From 563a39c2d904a08942148ec9425cd6727acd2eb0 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Thu, 13 Nov 2014 21:45:19 -0500 Subject: [PATCH] Spell field defined that determines if must be sneaking to use this ability. This is handled by client under normal conditions, however if you force cast this effect in situations like 'procs' you can cause zone crashes, therefore a failsafe check is added in 'SpellOnTarget' --- changelog.txt | 2 +- common/shareddb.cpp | 1 + common/spdat.h | 2 +- zone/spells.cpp | 7 ++++++- zone/string_ids.h | 1 + 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index d72b4ca23..52e445090 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,6 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- -== 11/13/2014 == +== 11/14/2014 == Kayen: Implemented target type (44) 'Beams' (which projects an AE infront of caster with a specified length and width). Kayen: Implemented target type (32) AE Target HateList Kayen: Implemented target type (36) Area Client Only diff --git a/common/shareddb.cpp b/common/shareddb.cpp index c679cd19c..1f30a3481 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1564,6 +1564,7 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { sp[tempid].NimbusEffect = atoi(row[193]); sp[tempid].directional_start = static_cast(atoi(row[194])); sp[tempid].directional_end = static_cast(atoi(row[195])); + sp[tempid].sneak = atoi(row[196]) != 0; sp[tempid].not_extendable = atoi(row[197]) != 0; sp[tempid].suspendable = atoi(row[200]) != 0; sp[tempid].viral_range = atoi(row[201]); diff --git a/common/spdat.h b/common/spdat.h index da2e4486c..410269813 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -722,7 +722,7 @@ struct SPDat_Spell_Struct /* 193 */ int NimbusEffect; /* 194 */ float directional_start; //Cone Start Angle: /* 195 */ float directional_end; // Cone End Angle: -/* 196 */ +/* 196 */ bool sneak; // effect can only be used if sneaking (rogue 'Daggerfall' ect) /* 197 */ bool not_extendable; /* 198- 199 */ /* 200 */ bool suspendable; // buff is suspended in suspended buff zones diff --git a/zone/spells.cpp b/zone/spells.cpp index 5b8bfef39..6c6119831 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -3262,6 +3262,11 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if(spelltar->IsClient() && spelltar->CastToClient()->IsHoveringForRespawn()) return false; + if (spells[spell_id].sneak && IsClient() && !CastToClient()->sneaking){ + Message_StringID(13, SNEAK_RESTRICT); + return false;//Fail Safe, this can cause a zone crash certain situations if you try to apply sneak effects when not sneaking. + } + if(IsDetrimentalSpell(spell_id) && !IsAttackAllowed(spelltar) && !IsResurrectionEffects(spell_id)) { if(!IsClient() || !CastToClient()->GetGM()) { Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); @@ -4711,7 +4716,7 @@ void NPC::Stun(int duration) { void NPC::UnStun() { Mob::UnStun(); - SetRunAnimSpeed(this->GetRunspeed()); + SetRunAnimSpeed(static_cast(GetRunspeed())); SendPosition(); } diff --git a/zone/string_ids.h b/zone/string_ids.h index 41e0960b0..a12b8640e 100644 --- a/zone/string_ids.h +++ b/zone/string_ids.h @@ -338,6 +338,7 @@ #define STRIKETHROUGH_STRING 9078 //You strike through your opponent's defenses! #define SPELL_REFLECT 9082 //%1's spell has been reflected by %2. #define NEW_SPELLS_AVAIL 9149 //You have new spells available to you. Check the merchants near your guild master. +#define SNEAK_RESTRICT 9240 //You can not use this ability because you have not been hidden for long enough. #define PET_NOW_FOCUSING 9254 //Focusing on one target, Master. #define PET_NOT_FOCUSING 9263 //No longer focusing on one target, Master. #define PET_NOT_CASTING 9264 //Not casting spells, Master.