Implemented SE_Sanctuary - Places caster at bottom hate list,

effect fades if caster cast spell on targets other than self.
This commit is contained in:
KayenEQ
2014-07-02 08:42:18 -04:00
parent bd86e70766
commit ee6d7ae6ba
6 changed files with 53 additions and 2 deletions
+8
View File
@@ -2856,6 +2856,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne
newbon->PetMeleeMitigation += effect_value;
break;
case SE_Sanctuary:
newbon->Sanctuary = true;
break;
//Special custom cases for loading effects on to NPC from 'npc_spels_effects' table
if (IsAISpellEffect) {
@@ -4330,6 +4334,10 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
itembonuses.FinishingBlowLvl[1] = effect_value;
break;
case SE_Sanctuary:
spellbonuses.Sanctuary = effect_value;
break;
}
}
}
+1
View File
@@ -372,6 +372,7 @@ struct StatBonuses {
int16 DStacker[1]; // For buff stack blocking 0=Exists 1=Effect_value
bool BerserkSPA; // berserk effect
int16 Metabolism; // Food/drink consumption rates.
bool Sanctuary; // Sanctuary effect, lowers place on hate list until cast on others.
// AAs
int8 Packrat; //weight reduction for items, 1 point = 10%
+36
View File
@@ -2732,6 +2732,22 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
break;
}
case SE_Sanctuary:
{
std::list<NPC*> npc_list;
entity_list.GetNPCList(npc_list);
for(std::list<NPC*>::iterator itr = npc_list.begin(); itr != npc_list.end(); ++itr) {
NPC* npc = *itr;
if (npc && npc->CheckAggro(this))
npc->SetHate(caster, 1);
}
break;
}
// Handled Elsewhere
case SE_ImmuneFleeing:
case SE_NegateSpellEffect:
@@ -2960,6 +2976,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
case SE_Berserk:
case SE_Vampirism:
case SE_Metabolism:
case SE_FinishingBlow:
case SE_FinishingBlowLvl:
case SE_Assassinate:
case SE_AssassinateLevel:
{
break;
}
@@ -3604,6 +3624,22 @@ void Mob::DoBuffTic(uint16 spell_id, int slot, uint32 ticsremaining, uint8 caste
break;
}
case SE_Sanctuary:
{
std::list<NPC*> npc_list;
entity_list.GetNPCList(npc_list);
for(std::list<NPC*>::iterator itr = npc_list.begin(); itr != npc_list.end(); ++itr) {
NPC* npc = *itr;
if (npc && npc->CheckAggro(this))
npc->SetHate(caster, 1);
}
break;
}
default:
{
// do we need to do anyting here?
+3
View File
@@ -183,6 +183,9 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot,
CastToNPC()->AI_Event_SpellCastFinished(false, casting_spell_slot);
return(false);
}
//It appears that the Sanctuary effect is removed by a check on the client side (keep this however for redundancy)
if (spellbonuses.Sanctuary && (spells[spell_id].targettype != ST_Self && GetTarget() != this) || IsDetrimentalSpell(spell_id))
BuffFadeByEffect(SE_Sanctuary);
if(IsClient()){
int chance = CastToClient()->GetFocusEffect(focusFcMute, spell_id);