Looking at the beneficial casting code (forgive me if i'm wrong) it looks like nobody would be able to land this 'buff' on an npc unless they're a GM.
From testing i am experiencing the following:
GM:
Harmony - Lands, no aggro. When cast a second time, you can see the buff wear off.
Calm - Aggros 100% of the time.
Normal Player:
Harmony - Does not land. Reports 'Your spell did not take hold'. No aggro.
Calm - Aggros 100% of the time.
I can't seem to find the code for calm. So I'll put that on the back burner for now. But looking at the beneficial code in spells.cpp (line 222
I can see that there doesn't seem to be a check for harmony beneficial buff spells on NPCs. Now i'm not at home right now so I can't check this but I am guessing we need to add a check in here to fix this.
Quote:
if(!(IsClient() && CastToClient()->GetGM())) // GMs can cast on anything
{
// Beneficial spells check
if(IsBeneficialSpell(spell_id))
{
if
(
IsClient() && //let NPCs do beneficial spells on anybody if they want, should be the job of the AI, not the spell code to prevent this from going wrong
spelltar != this &&
(
!IsBeneficialAllowed(spelltar) ||
(
IsGroupOnlySpell(spell_id) &&
!(
(entity_list.GetGroupByMob(this) &&
entity_list.GetGroupByMob(this)->IsGroupMember(spelltar)) ||
(spelltar == GetPet()) //should be able to cast grp spells on self and pet despite grped status.
)
)
)
)
{
mlog(SPELLS__CASTING_ERR, "Beneficial spell %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar));
Message_StringID(MT_Shout, SPELL_NO_HOLD);
safe_delete(action_packet);
return false;
}
}
else if ( !IsAttackAllowed(spelltar) ) // Detrimental spells - PVP check
{
mlog(SPELLS__CASTING_ERR, "Detrimental spell %d can't take hold %s -> %s", spell_id, GetName(), spelltar->GetName());
spelltar->Message_StringID(MT_Shout, YOU_ARE_PROTECTED, GetCleanName());
safe_delete(action_packet);
return false;
}
}
|
Anyone got any ideas on this?
Then I am assuming once this is done we make changes to ApplySpellBonuses in bonuses.cpp to add an additional check for SE_Calm?