Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-26-2009, 06:38 AM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,165
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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:57 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3