Jump to content

Recommended Posts

Posted

Hello everyone, i want to fix Deathbringer's Will but i don't know where is it in source code.

Someone please tell me where is it. Thanks for helping.

(I bad speak english)

Posted

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

  • 1 month later...
Posted

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?

Posted

no reason use dynamic filled vector. You can define in each case { uint32 spells[3] = {...}; triggered_spell = spells[irand(0, 2)]; break; } /*end case*/ }; break;

not remember exactly variable name for triggered spell. And you don't must without strong reason do cast spell call instead allow do cast by normal way work code.

Posted

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.

Posted

Hmm, by default cooldown set to triggered spell, so for one from randomly selected.

Not nice but working sollution maybe set cooldown manually for _all_ spells from array for caster.

This will prevent cast alt. spell at next triggering.

  • 2 weeks later...
Posted

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)

×
×
  • 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