From cbe0e94ca7770ae79ff90617c3836971746dff7b Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Thu, 27 Mar 2014 23:23:15 -0400 Subject: [PATCH] Implemented SE_NegateIfCombat --- common/spdat.h | 2 +- zone/attack.cpp | 6 ++++++ zone/bonuses.cpp | 3 +++ zone/bot.cpp | 6 ++++++ zone/common.h | 1 + zone/special_attacks.cpp | 9 +++++++++ zone/spells.cpp | 3 +++ 7 files changed, 29 insertions(+), 1 deletion(-) diff --git a/common/spdat.h b/common/spdat.h index 49f990537..99de59c83 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -241,7 +241,7 @@ typedef enum { #define SE_SummonCorpse 91 // implemented #define SE_InstantHate 92 // implemented - add hate #define SE_StopRain 93 // implemented - Wake of Karana -#define SE_NegateIfCombat 94 // *not implemented? - Works client side but there is comment todo in spell effects...Component of Spirit of Scale +#define SE_NegateIfCombat 94 // implemented #define SE_Sacrifice 95 // implemented #define SE_Silence 96 // implemented #define SE_ManaPool 97 // implemented diff --git a/zone/attack.cpp b/zone/attack.cpp index be099adc6..91ce521d5 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1371,6 +1371,9 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b invisible_animals = false; } + if (spellbonuses.NegateIfCombat) + BuffFadeByEffect(SE_NegateIfCombat); + if(hidden || improved_hidden){ hidden = false; improved_hidden = false; @@ -1983,6 +1986,9 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool invisible_animals = false; } + if (spellbonuses.NegateIfCombat) + BuffFadeByEffect(SE_NegateIfCombat); + if(hidden || improved_hidden) { EQApplicationPacket* outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct)); diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index c89424a3c..b6f341f56 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -2585,6 +2585,9 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne newbon->AbsorbMagicAtt[1] = buffslot; } break; + + case SE_NegateIfCombat: + newbon->NegateIfCombat = true; } } } diff --git a/zone/bot.cpp b/zone/bot.cpp index 425402b65..347dd0bc6 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -3237,6 +3237,9 @@ void Bot::BotRangedAttack(Mob* other) { invisible_animals = false; } + if (spellbonuses.NegateIfCombat) + BuffFadeByEffect(SE_NegateIfCombat); + if(hidden || improved_hidden){ hidden = false; improved_hidden = false; @@ -6640,6 +6643,9 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b safe_delete(outapp); } + if (spellbonuses.NegateIfCombat) + BuffFadeByEffect(SE_NegateIfCombat); + if(GetTarget()) TriggerDefensiveProcs(weapon, other, Hand, damage); diff --git a/zone/common.h b/zone/common.h index 581d11430..11b9f8919 100644 --- a/zone/common.h +++ b/zone/common.h @@ -344,6 +344,7 @@ struct StatBonuses { int16 FrenziedDevastation; // base1= AArank(used) base2= chance increase spell criticals + all DD spells 2x mana. uint16 AbsorbMagicAtt[2]; // 0 = magic rune value 1 = buff slot uint16 MeleeRune[2]; // 0 = rune value 1 = buff slot + bool NegateIfCombat; // Bool Drop buff if cast or melee // AAs int8 Packrat; //weight reduction for items, 1 point = 10% diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index d551962ea..8d95524fe 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -839,6 +839,9 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { invisible_animals = false; } + if (spellbonuses.NegateIfCombat) + BuffFadeByEffect(SE_NegateIfCombat); + if(hidden || improved_hidden){ hidden = false; improved_hidden = false; @@ -1085,6 +1088,9 @@ void NPC::RangedAttack(Mob* other) invisible_animals = false; } + if (spellbonuses.NegateIfCombat) + BuffFadeByEffect(SE_NegateIfCombat); + if(hidden || improved_hidden){ hidden = false; improved_hidden = false; @@ -1227,6 +1233,9 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 invisible_animals = false; } + if (spellbonuses.NegateIfCombat) + BuffFadeByEffect(SE_NegateIfCombat); + if(hidden || improved_hidden){ hidden = false; improved_hidden = false; diff --git a/zone/spells.cpp b/zone/spells.cpp index 86d21ea7a..2963172c5 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -211,6 +211,9 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, return(false); } + if (spellbonuses.NegateIfCombat) + BuffFadeByEffect(SE_NegateIfCombat); + if(IsClient() && GetTarget() && IsHarmonySpell(spell_id)) { for(int i = 0; i < EFFECT_COUNT; i++) {