mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7115] Sort spells by spellfamily cases for speedup most common (check fail) case.
This commit is contained in:
parent
9e590f7ceb
commit
e188a0a505
2 changed files with 439 additions and 418 deletions
|
|
@ -4600,40 +4600,38 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
// TODO: we must implement hunter pet summon at login there (spell 6962)
|
||||
|
||||
// by spell id
|
||||
switch(m_spellInfo->Id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
switch(m_spellInfo->SpellFamilyName)
|
||||
{
|
||||
case SPELLFAMILY_GENERIC:
|
||||
{
|
||||
switch(m_spellInfo->Id)
|
||||
{
|
||||
// PX-238 Winter Wondervolt TRAP
|
||||
case 26275:
|
||||
{
|
||||
if( unitTarget->HasAura(26272,0)
|
||||
|| unitTarget->HasAura(26157,0)
|
||||
|| unitTarget->HasAura(26273,0)
|
||||
|| unitTarget->HasAura(26274,0))
|
||||
if (unitTarget->HasAura(26272,0) ||
|
||||
unitTarget->HasAura(26157,0) ||
|
||||
unitTarget->HasAura(26273,0) ||
|
||||
unitTarget->HasAura(26274,0))
|
||||
return;
|
||||
|
||||
uint32 iTmpSpellId;
|
||||
|
||||
switch(urand(0,3))
|
||||
{
|
||||
case 0:
|
||||
iTmpSpellId = 26272;
|
||||
break;
|
||||
case 1:
|
||||
iTmpSpellId = 26157;
|
||||
break;
|
||||
case 2:
|
||||
iTmpSpellId = 26273;
|
||||
break;
|
||||
case 3:
|
||||
iTmpSpellId = 26274;
|
||||
break;
|
||||
case 0: iTmpSpellId = 26272; break;
|
||||
case 1: iTmpSpellId = 26157; break;
|
||||
case 2: iTmpSpellId = 26273; break;
|
||||
case 3: iTmpSpellId = 26274; break;
|
||||
}
|
||||
|
||||
unitTarget->CastSpell(unitTarget, iTmpSpellId, true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Bending Shinbone
|
||||
case 8856:
|
||||
{
|
||||
|
|
@ -4650,61 +4648,6 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
m_caster->CastSpell(m_caster,spell_id,true,NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
// Healthstone creating spells
|
||||
case 6201:
|
||||
case 6202:
|
||||
case 5699:
|
||||
case 11729:
|
||||
case 11730:
|
||||
case 27230:
|
||||
case 47871:
|
||||
case 47878:
|
||||
{
|
||||
uint32 itemtype;
|
||||
uint32 rank = 0;
|
||||
Unit::AuraList const& mDummyAuras = unitTarget->GetAurasByType(SPELL_AURA_DUMMY);
|
||||
for(Unit::AuraList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
|
||||
{
|
||||
if((*i)->GetId() == 18692)
|
||||
{
|
||||
rank = 1;
|
||||
break;
|
||||
}
|
||||
else if((*i)->GetId() == 18693)
|
||||
{
|
||||
rank = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static uint32 const itypes[8][3] = {
|
||||
{ 5512,19004,19005}, // Minor Healthstone
|
||||
{ 5511,19006,19007}, // Lesser Healthstone
|
||||
{ 5509,19008,19009}, // Healthstone
|
||||
{ 5510,19010,19011}, // Greater Healthstone
|
||||
{ 9421,19012,19013}, // Major Healthstone
|
||||
{22103,22104,22105}, // Master Healthstone
|
||||
{36889,36890,36891}, // Demonic Healthstone
|
||||
{36892,36893,36894} // Fel Healthstone
|
||||
};
|
||||
|
||||
switch(m_spellInfo->Id)
|
||||
{
|
||||
case 6201: itemtype=itypes[0][rank];break; // Minor Healthstone
|
||||
case 6202: itemtype=itypes[1][rank];break; // Lesser Healthstone
|
||||
case 5699: itemtype=itypes[2][rank];break; // Healthstone
|
||||
case 11729: itemtype=itypes[3][rank];break; // Greater Healthstone
|
||||
case 11730: itemtype=itypes[4][rank];break; // Major Healthstone
|
||||
case 27230: itemtype=itypes[5][rank];break; // Master Healthstone
|
||||
case 47871: itemtype=itypes[6][rank];break; // Demonic Healthstone
|
||||
case 47878: itemtype=itypes[7][rank];break; // Fel Healthstone
|
||||
default:
|
||||
return;
|
||||
}
|
||||
DoCreateItem( effIndex, itemtype );
|
||||
return;
|
||||
}
|
||||
// Brittle Armor - need remove one 24575 Brittle Armor aura
|
||||
case 24590:
|
||||
unitTarget->RemoveSingleSpellAurasFromStack(24575);
|
||||
|
|
@ -4744,7 +4687,6 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
unitTarget->CastSpell(unitTarget,spellid,false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Shadow Flame (All script effects, not just end ones to prevent player from dodging the last triggered spell)
|
||||
case 22539:
|
||||
case 22972:
|
||||
|
|
@ -4771,8 +4713,6 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
m_caster->CastSpell(unitTarget, 22682, true);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
// Summon Black Qiraji Battle Tank
|
||||
case 26656:
|
||||
{
|
||||
|
|
@ -4797,59 +4737,18 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
unitTarget->HandleEmoteCommand(EMOTE_STATE_DANCE);
|
||||
break;
|
||||
}
|
||||
|
||||
// Dreaming Glory
|
||||
case 28698:
|
||||
{
|
||||
if(!unitTarget)
|
||||
return;
|
||||
unitTarget->CastSpell(unitTarget, 28694, true);
|
||||
break;
|
||||
}
|
||||
|
||||
// Netherbloom
|
||||
case 28702:
|
||||
{
|
||||
if(!unitTarget)
|
||||
return;
|
||||
// 25% chance of casting a random buff
|
||||
if(roll_chance_i(75))
|
||||
return;
|
||||
|
||||
// triggered spells are 28703 to 28707
|
||||
// Note: some sources say, that there was the possibility of
|
||||
// receiving a debuff. However, this seems to be removed by a patch.
|
||||
const uint32 spellid = 28703;
|
||||
|
||||
// don't overwrite an existing aura
|
||||
for(uint8 i=0; i<5; i++)
|
||||
if(unitTarget->HasAura(spellid+i, 0))
|
||||
return;
|
||||
unitTarget->CastSpell(unitTarget, spellid+urand(0, 4), true);
|
||||
break;
|
||||
}
|
||||
|
||||
// Nightmare Vine
|
||||
case 28720:
|
||||
{
|
||||
if(!unitTarget)
|
||||
return;
|
||||
// 25% chance of casting Nightmare Pollen
|
||||
if(roll_chance_i(75))
|
||||
return;
|
||||
unitTarget->CastSpell(unitTarget, 28721, true);
|
||||
break;
|
||||
}
|
||||
|
||||
// Mirren's Drinking Hat
|
||||
case 29830:
|
||||
{
|
||||
uint32 item = 0;
|
||||
switch ( urand(1,6) )
|
||||
{
|
||||
case 1: case 2: case 3: item = 23584; break;// Loch Modan Lager
|
||||
case 4: case 5: item = 23585; break;// Stouthammer Lite
|
||||
case 6: item = 23586; break;// Aerie Peak Pale Ale
|
||||
case 1:case 2:case 3:
|
||||
item = 23584;break; // Loch Modan Lager
|
||||
case 4:case 5:
|
||||
item = 23585;break; // Stouthammer Lite
|
||||
case 6:
|
||||
item = 23586;break; // Aerie Peak Pale Ale
|
||||
}
|
||||
if (item)
|
||||
DoCreateItem(effIndex,item);
|
||||
|
|
@ -4881,7 +4780,8 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
}
|
||||
break;
|
||||
}
|
||||
case 41126: // Flame Crash
|
||||
// Flame Crash
|
||||
case 41126:
|
||||
{
|
||||
if(!unitTarget)
|
||||
return;
|
||||
|
|
@ -4889,7 +4789,8 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
unitTarget->CastSpell(unitTarget, 41131, true);
|
||||
break;
|
||||
}
|
||||
case 44876: // Force Cast - Portal Effect: Sunwell Isle
|
||||
// Force Cast - Portal Effect: Sunwell Isle
|
||||
case 44876:
|
||||
{
|
||||
if(!unitTarget)
|
||||
return;
|
||||
|
|
@ -4897,7 +4798,6 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
unitTarget->CastSpell(unitTarget, 44870, true);
|
||||
break;
|
||||
}
|
||||
|
||||
// Goblin Weather Machine
|
||||
case 46203:
|
||||
{
|
||||
|
|
@ -4942,7 +4842,78 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
break;
|
||||
}
|
||||
}
|
||||
if( m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER )
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_WARLOCK:
|
||||
{
|
||||
switch(m_spellInfo->Id)
|
||||
{
|
||||
// Healthstone creating spells
|
||||
case 6201:
|
||||
case 6202:
|
||||
case 5699:
|
||||
case 11729:
|
||||
case 11730:
|
||||
case 27230:
|
||||
case 47871:
|
||||
case 47878:
|
||||
{
|
||||
uint32 itemtype;
|
||||
uint32 rank = 0;
|
||||
Unit::AuraList const& mDummyAuras = unitTarget->GetAurasByType(SPELL_AURA_DUMMY);
|
||||
for(Unit::AuraList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
|
||||
{
|
||||
if((*i)->GetId() == 18692)
|
||||
{
|
||||
rank = 1;
|
||||
break;
|
||||
}
|
||||
else if((*i)->GetId() == 18693)
|
||||
{
|
||||
rank = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static uint32 const itypes[8][3] = {
|
||||
{ 5512,19004,19005}, // Minor Healthstone
|
||||
{ 5511,19006,19007}, // Lesser Healthstone
|
||||
{ 5509,19008,19009}, // Healthstone
|
||||
{ 5510,19010,19011}, // Greater Healthstone
|
||||
{ 9421,19012,19013}, // Major Healthstone
|
||||
{22103,22104,22105}, // Master Healthstone
|
||||
{36889,36890,36891}, // Demonic Healthstone
|
||||
{36892,36893,36894} // Fel Healthstone
|
||||
};
|
||||
|
||||
switch(m_spellInfo->Id)
|
||||
{
|
||||
case 6201:
|
||||
itemtype=itypes[0][rank];break; // Minor Healthstone
|
||||
case 6202:
|
||||
itemtype=itypes[1][rank];break; // Lesser Healthstone
|
||||
case 5699:
|
||||
itemtype=itypes[2][rank];break; // Healthstone
|
||||
case 11729:
|
||||
itemtype=itypes[3][rank];break; // Greater Healthstone
|
||||
case 11730:
|
||||
itemtype=itypes[4][rank];break; // Major Healthstone
|
||||
case 27230:
|
||||
itemtype=itypes[5][rank];break; // Master Healthstone
|
||||
case 47871:
|
||||
itemtype=itypes[6][rank];break; // Demonic Healthstone
|
||||
case 47878:
|
||||
itemtype=itypes[7][rank];break; // Fel Healthstone
|
||||
default:
|
||||
return;
|
||||
}
|
||||
DoCreateItem( effIndex, itemtype );
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_HUNTER:
|
||||
{
|
||||
switch(m_spellInfo->Id)
|
||||
{
|
||||
|
|
@ -4993,8 +4964,9 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if( m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN )
|
||||
case SPELLFAMILY_PALADIN:
|
||||
{
|
||||
// Judgement
|
||||
if (m_spellInfo->SpellFamilyFlags & 0x0000000000800000LL)
|
||||
|
|
@ -5036,6 +5008,55 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
return;
|
||||
}
|
||||
}
|
||||
case SPELLFAMILY_POTION:
|
||||
{
|
||||
switch(m_spellInfo->Id)
|
||||
{
|
||||
// Dreaming Glory
|
||||
case 28698:
|
||||
{
|
||||
if(!unitTarget)
|
||||
return;
|
||||
unitTarget->CastSpell(unitTarget, 28694, true);
|
||||
break;
|
||||
}
|
||||
// Netherbloom
|
||||
case 28702:
|
||||
{
|
||||
if(!unitTarget)
|
||||
return;
|
||||
// 25% chance of casting a random buff
|
||||
if(roll_chance_i(75))
|
||||
return;
|
||||
|
||||
// triggered spells are 28703 to 28707
|
||||
// Note: some sources say, that there was the possibility of
|
||||
// receiving a debuff. However, this seems to be removed by a patch.
|
||||
const uint32 spellid = 28703;
|
||||
|
||||
// don't overwrite an existing aura
|
||||
for(uint8 i=0; i<5; i++)
|
||||
if(unitTarget->HasAura(spellid+i, 0))
|
||||
return;
|
||||
unitTarget->CastSpell(unitTarget, spellid+urand(0, 4), true);
|
||||
break;
|
||||
}
|
||||
|
||||
// Nightmare Vine
|
||||
case 28720:
|
||||
{
|
||||
if(!unitTarget)
|
||||
return;
|
||||
// 25% chance of casting Nightmare Pollen
|
||||
if(roll_chance_i(75))
|
||||
return;
|
||||
unitTarget->CastSpell(unitTarget, 28721, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// normal DB scripted effect
|
||||
if(!unitTarget)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7114"
|
||||
#define REVISION_NR "7115"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue