Browse Source

NPCs aggro on unfriendly spell casted on them

Fix #89 -- need further review on how much hate should be added by the spell
Image 4 years ago
parent
commit
c1c6fc8d2d
1 changed files with 4 additions and 0 deletions
  1. 4 0
      EQ2/source/WorldServer/SpellProcess.cpp

+ 4 - 0
EQ2/source/WorldServer/SpellProcess.cpp

@@ -1306,6 +1306,10 @@ bool SpellProcess::CastProcessedSpell(LuaSpell* spell, bool passive){
 			if (client && client->IsZoning())
 				continue;
 
+			// TODO: Establish actual hate per spell
+			if (!spell->spell->GetSpellData()->friendly_spell && target->IsNPC())
+				((NPC*)target)->AddHate((Entity*)spell->caster, 50);
+
 			if(spell->spell->GetSpellData()->success_message.length() > 0){
 				if(client){
 					string success_message = spell->spell->GetSpellData()->success_message;