EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   Implemented StringID ALREADY_INVIS (https://www.eqemulator.org/forums/showthread.php?t=28691)

demonstar55 06-26-2009 06:38 AM

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)

steve 06-26-2009 07:36 AM

You can stack Uinvis and Invis on Live... but you need to be using one of the group forms of the spells. They nerfed using single target casts. Invis overwrites Uinvis and vice versa.

So if I wanted to get both Uinvis and Invis, I would cast my Group version of the spell first, then the other person casts the group or single target version of the other spell. This is the common method used for collecting the crystallos base in Hills of Shade (where there's both undead and regular mobs that see through (u)invis).

demonstar55 06-26-2009 07:15 PM

This shouldn't prevent you from having invis, ivu and iva at the same time if that's what you are saying

cavedude 08-08-2009 10:07 PM

Committed in Rev 903.


All times are GMT -4. The time now is 11:17 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.