Jump to content

Help with Deathbringer's Will


amxxL

Recommended Posts

he wants to fix trinket

you need to handle spells http://www.wowhead.com/spell=71519 and http://www.wowhead.com/spell=71562

which are applied on item equip.

Proc spells should be cast depending on player class, here they are

http://www.wowhead.com/spell=71484

http://www.wowhead.com/spell=71561

http://www.wowhead.com/spell=71491

http://www.wowhead.com/spell=71559

http://www.wowhead.com/spell=71485

http://www.wowhead.com/spell=71556

http://www.wowhead.com/spell=71492

http://www.wowhead.com/spell=71560

For cooldowns and and class patterns check wowpedia. As a template for your code you can use some darkmoon trinket proc, that is already in the core

Link to comment
Share on other sites

  • 1 month later...

Sorry for double post but i need help. please look at this code:

case 71562: // Deathbringer's Will Heroic
{
if (GetTypeId() != TYPEID_PLAYER)
	return SPELL_AURA_PROC_FAILED;

std::vector<uint32> RandomSpells;

switch (getClass())
{
case CLASS_WARRIOR:
case CLASS_PALADIN:
case CLASS_DEATH_KNIGHT:
	RandomSpells.push_back(71561);
	RandomSpells.push_back(71559);
	RandomSpells.push_back(71560);
	break;
case CLASS_SHAMAN:
case CLASS_ROGUE:
	RandomSpells.push_back(71558);
	RandomSpells.push_back(71556);
	RandomSpells.push_back(71560);
	break;
case CLASS_DRUID:
	RandomSpells.push_back(71561);
	RandomSpells.push_back(71556);
	RandomSpells.push_back(71558);
	break;
case CLASS_HUNTER:
	RandomSpells.push_back(71558);
	RandomSpells.push_back(71559);
	RandomSpells.push_back(71556);
	break;
default:
	return SPELL_AURA_PROC_FAILED;
}

if (RandomSpells.empty())
	return SPELL_AURA_PROC_FAILED;

uint8 rand_spell = irand(0, (RandomSpells.size() - 1));
CastSpell(target, RandomSpells[rand_spell], true, castItem, triggeredByAura);
return SPELL_AURA_PROC_OK;
break;
}

this code works but not correctly. how i can add cooldown for that spell?

Link to comment
Share on other sites

Something like this?

case 71519: // Deathbringer's Will Normal
{
if (GetTypeId() != TYPEID_PLAYER)
	return SPELL_AURA_PROC_FAILED;

switch (getClass())
{
	case CLASS_PALADIN:
	case CLASS_DEATH_KNIGHT:
	{
		uint32 RandomSpell[] = {71484, 71491, 71492};
		triggered_spell_id = RandomSpell[urand(0, countof(RandomSpell) - 1)];
		break;
	}
	case CLASS_ROGUE:
	case CLASS_DRUID:
	case CLASS_SHAMAN:
	{
		uint32 RandomSpell[] = {71485, 71486, 71492};
		triggered_spell_id = RandomSpell[urand(0, countof(RandomSpell) - 1)];
		break;
	}
	case CLASS_WARRIOR:
	{
		uint32 RandomSpell[] = {71484, 71491, 71492};
		triggered_spell_id = RandomSpell[urand(0, countof(RandomSpell) - 1)];
		break;
	}
	case CLASS_HUNTER:
	{
		uint32 RandomSpell[] = {71485, 71486, 71491};
		triggered_spell_id = RandomSpell[urand(0, countof(RandomSpell) - 1)];
		break;
	}
	default:
		return SPELL_AURA_PROC_FAILED;
}

target = this;
break;
}
case 71562: // Deathbringer's Will Heroic
{
if (GetTypeId() != TYPEID_PLAYER)
	return SPELL_AURA_PROC_FAILED;

switch (getClass())
{
	case CLASS_PALADIN:
	case CLASS_DEATH_KNIGHT:
	{
		uint32 RandomSpell[] = {71561, 71560, 71559};
		triggered_spell_id = RandomSpell[urand(0, countof(RandomSpell) - 1)];
		break;
	}
	case CLASS_ROGUE:
	case CLASS_DRUID:
	case CLASS_SHAMAN:
	{
		uint32 RandomSpell[] = {71560, 71558, 71556};
		triggered_spell_id = RandomSpell[urand(0, countof(RandomSpell) - 1)];
		break;
	}
	case CLASS_WARRIOR:
	{
		uint32 RandomSpell[] = {71561, 71560, 71559};
		triggered_spell_id = RandomSpell[urand(0, countof(RandomSpell) - 1)];
		break;
	}
	case CLASS_HUNTER:
	{
		uint32 RandomSpell[] = {71558, 71557, 71559};
		triggered_spell_id = RandomSpell[urand(0, countof(RandomSpell) - 1)];
		break;
	}
	default:
		return SPELL_AURA_PROC_FAILED;
}

target = this;
break;
}

This code works but the problem with cooldowns did not disappear How i can fix cooldowns?

I try add cooldown to spell_proc_event table but it's doesn't work for me.

Link to comment
Share on other sites

  • 2 weeks later...

I fixed it. There's the code:

// Deathbringer's Will Normal
case 71519:
// Deathbringer's Will Heroic
case 71562:
{
if (((Player*)this)->HasSpellCooldown(dummySpell->Id))
	return SPELL_AURA_PROC_FAILED;

switch (getClass())
{
	case CLASS_WARRIOR:
	case CLASS_PALADIN:
	case CLASS_DEATH_KNIGHT:
	{
		uint32 proc_spells[] = {71491, 71492, 71484, 71559, 71560, 71561};
		triggered_spell_id = (dummySpell->Id) == 71519 ? proc_spells[urand(0, 2)] : proc_spells[urand(3, 5)];
		break;
	}
	case CLASS_ROGUE:
	case CLASS_SHAMAN:
	{
		uint32 proc_spells[] = {71485, 71486, 71492, 71556, 71558, 71560};
		triggered_spell_id = (dummySpell->Id) == 71519 ? proc_spells[urand(0, 2)] : proc_spells[urand(3, 5)];
		break;
	}
	case CLASS_HUNTER:
	{
		uint32 proc_spells[] = {71485, 71486, 71491, 71556, 71558, 71559};
		triggered_spell_id = (dummySpell->Id) == 71519 ? proc_spells[urand(0, 2)] : proc_spells[urand(3, 5)];
		break;
	}
	case CLASS_DRUID:
	{
		uint32 proc_spells[] = {71485, 71492, 71484, 71556, 71560, 71561};
		triggered_spell_id = (dummySpell->Id) == 71519 ? proc_spells[urand(0, 2)] : proc_spells[urand(3, 5)];
		break;
	}
	default:
		return SPELL_AURA_PROC_FAILED;
}

target = this;
((Player*)this)->AddSpellCooldown(dummySpell->Id, 0, time(NULL) + cooldown);

break;
}

if someone need it add this code to UnitAuraProcHandler.cpp this function:

SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const * procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use