View Single Post
  #1  
Old 06-26-2009, 06:38 AM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default Implemented StringID ALREADY_INVIS

Well, a little nuisance I decided to give a crack at fixing. Basically before if you were invisible and someone tried to invis you again, it would cause you to become uninvised

Code:
Index: EQEmuServer/zone/spells.cpp
===================================================================
--- EQEmuServer/zone/spells.cpp	(revision 713)
+++ EQEmuServer/zone/spells.cpp	(working copy)
@@ -2859,6 +2859,38 @@
 		return(false);
 	}
 
+	// Prevent double invising, which made you uninvised
+	// Not sure if all 3 should be stacking
+	if(IsEffectInSpell(spell_id, SE_Invisibility))
+	{
+		if(spelltar->invisible)
+		{
+			spelltar->Message_StringID(MT_Shout, ALREADY_INVIS, GetCleanName());
+			safe_delete(action_packet);
+			return false;
+		}
+	}
+
+	if(IsEffectInSpell(spell_id, SE_InvisVsUndead))
+	{
+		if(spelltar->invisible_undead)
+		{
+			spelltar->Message_StringID(MT_Shout, ALREADY_INVIS, GetCleanName());
+			safe_delete(action_packet);
+			return false;
+		}
+	}
+
+	if(IsEffectInSpell(spell_id, SE_InvisVsAnimals))
+	{
+		if(spelltar->invisible_animals)
+		{
+			spelltar->Message_StringID(MT_Shout, ALREADY_INVIS, GetCleanName());
+			safe_delete(action_packet);
+			return false;
+		}
+	}
+
 	if(!(IsClient() && CastToClient()->GetGM()) && !IsHarmonySpell(spell_id))	// GMs can cast on anything
 	{
 		// Beneficial spells check
did not test IVA or IVU but the logic is the same, so if there is a problem, it's not my fault!

only "problem" I've come across is bard song invis spams you if you're already invis (singing just the song w/o another invis on causes no problems)
Reply With Quote