From 2c69dd7c9336fe026d48d24b12e9eaf18a18888a Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Fri, 4 Apr 2014 22:03:32 -0400 Subject: [PATCH] Implemented proper functionality of SE_Screech If you have a buff with SE_Screech with value of 1 it will block any other buff with SE_Screen that has a value of -1, giving you an immunity message. Example: 1383 Screech and 2785 Screech Immunity --- common/spdat.h | 2 +- zone/StringIDs.h | 1 + zone/bonuses.cpp | 6 ++++++ zone/common.h | 1 + zone/spells.cpp | 10 +++++++++- 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/common/spdat.h b/common/spdat.h index fcbb02aaf..c7452426d 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -270,7 +270,7 @@ typedef enum { #define SE_HealRate 120 // implemented - reduces healing by a % #define SE_ReverseDS 121 // implemented //#define SE_ReduceSkill 122 // not used -#define SE_Screech 123 // implemented? Spell Blocker(can only have one buff with this effect at one time) +#define SE_Screech 123 // implemented Spell Blocker(If have buff with value +1 will block any effect with -1) #define SE_ImprovedDamage 124 // implemented #define SE_ImprovedHeal 125 // implemented #define SE_SpellResistReduction 126 // implemented diff --git a/zone/StringIDs.h b/zone/StringIDs.h index 95227ae07..05bbffdec 100644 --- a/zone/StringIDs.h +++ b/zone/StringIDs.h @@ -334,6 +334,7 @@ #define ALREADY_CASTING 12442 //You are already casting a spell! #define SENSE_CORPSE_NOT_NAME 12446 //You don't sense any corpses of that name. #define SENSE_CORPSE_NONE 12447 //You don't sense any corpses. +#define SCREECH_BUFF_BLOCK 12448 //Your immunity buff protected you from the spell %1! #define NOT_HOLDING_ITEM 12452 //You are not holding an item! #define SENSE_UNDEAD 12471 //You sense undead in this direction. #define SENSE_ANIMAL 12472 //You sense an animal in this direction. diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index b6f341f56..56f8b9f5f 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -2588,6 +2588,12 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne case SE_NegateIfCombat: newbon->NegateIfCombat = true; + break; + + case SE_Screech: + newbon->Screech = effect_value; + break; + } } } diff --git a/zone/common.h b/zone/common.h index ee87bd164..d720f3d43 100644 --- a/zone/common.h +++ b/zone/common.h @@ -346,6 +346,7 @@ struct StatBonuses { 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 + int8 Screech; // -1 = Will be blocked if another Screech is +(1) // AAs int8 Packrat; //weight reduction for items, 1 point = 10% diff --git a/zone/spells.cpp b/zone/spells.cpp index e00ece3c0..43a0d2b19 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -2613,6 +2613,14 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { effect1 = sp1.effectid[i]; effect2 = sp2.effectid[i]; + + if (spellbonuses.Screech == 1) { + if (effect2 == SE_Screech && sp2.base[i] == -1) { + Message_StringID(MT_SpellFailure, SCREECH_BUFF_BLOCK, sp2.name); + return -1; + } + } + if(effect2 == SE_StackingCommand_Overwrite) { overwrite_effect = sp2.base[i]; @@ -2657,7 +2665,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, mlog(SPELLS__STACKING, "%s (%d) blocks effect %d on slot %d below %d, but we do not have that effect on that slot. Ignored.", sp1.name, spellid1, blocked_effect, blocked_slot, blocked_below_value); } - } + } } } else { mlog(SPELLS__STACKING, "%s (%d) and %s (%d) appear to be in the same line, skipping Stacking Overwrite/Blocking checks",