Complete revision of SE_SkillProc, SE_LimitToSkill,

SE_SkillProcSuccess (now implemented correctly)
to function more accurately and efficiently, AA supported.
This may need to be updated in the future, if more live
spells readily become avialable to test with.
This commit is contained in:
KayenEQ
2014-07-06 18:58:16 -04:00
parent 3a4e72e3e7
commit 0e438942e4
13 changed files with 415 additions and 186 deletions
+74 -1
View File
@@ -637,7 +637,7 @@ void Client::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon)
continue;
_log(AA__BONUSES, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName());
uint8 focus = IsFocusEffect(0, 0, true,effect);
if (focus)
{
@@ -1333,6 +1333,41 @@ void Client::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon)
newbon->IllusionPersistence = true;
break;
case SE_LimitToSkill:{
if (base1 <= HIGHEST_SKILL)
newbon->LimitToSkill[base1] = true;
break;
}
case SE_SkillProc:{
for(int e = 0; e < MAX_SKILL_PROCS; e++)
{
if(newbon->SkillProc[e] && newbon->SkillProc[e] == aaid)
break; //Do not use the same aa id more than once.
else if(!newbon->SkillProc[e]){
newbon->SkillProc[e] = aaid;
break;
}
}
break;
}
case SE_SkillProcSuccess:{
for(int e = 0; e < MAX_SKILL_PROCS; e++)
{
if(newbon->SkillProcSuccess[e] && newbon->SkillProcSuccess[e] == aaid)
break; //Do not use the same spell id more than once.
else if(!newbon->SkillProcSuccess[e]){
newbon->SkillProcSuccess[e] = aaid;
break;
}
}
break;
}
}
}
}
@@ -2884,6 +2919,44 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne
newbon->IllusionPersistence = true;
break;
case SE_LimitToSkill:{
if (effect_value <= HIGHEST_SKILL){
newbon->LimitToSkill[effect_value] = true;
Shout("BONUS Set Limit = %i", effect_value);
}
break;
}
case SE_SkillProc:{
for(int e = 0; e < MAX_SKILL_PROCS; e++)
{
if(newbon->SkillProc[e] && newbon->SkillProc[e] == spell_id)
break; //Do not use the same spell id more than once.
else if(!newbon->SkillProc[e]){
newbon->SkillProc[e] = spell_id;
break;
}
}
break;
}
case SE_SkillProcSuccess:{
for(int e = 0; e < MAX_SKILL_PROCS; e++)
{
if(newbon->SkillProcSuccess[e] && newbon->SkillProcSuccess[e] == spell_id)
break; //Do not use the same spell id more than once.
else if(!newbon->SkillProcSuccess[e]){
newbon->SkillProcSuccess[e] = spell_id;
break;
}
}
break;
}
//Special custom cases for loading effects on to NPC from 'npc_spels_effects' table
if (IsAISpellEffect) {