From 5970b0ee41fd7ab432f3e3bf780e73015407d828 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Sun, 23 Nov 2014 20:19:54 -0500 Subject: [PATCH 1/6] Fix for numhits counter being decreased 2x for Outgoing Hit Success from client melee attacks. --- zone/attack.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index da812e724..a04ed9985 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1362,11 +1362,8 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b MeleeLifeTap(damage); - if (damage > 0){ - CheckNumHitsRemaining(NUMHIT_OutgoingHitSuccess); - if (HasSkillProcSuccess() && other && other->GetHP() > 0) - TrySkillProc(other, skillinuse, 0, true, Hand); - } + if (damage > 0 && HasSkillProcSuccess() && other && other->GetHP() > 0) + TrySkillProc(other, skillinuse, 0, true, Hand); CommonBreakInvisible(); From 3266ed98e68f3b5bd5b5e5a9cff98dbe9d153f5b Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Sun, 23 Nov 2014 20:48:07 -0500 Subject: [PATCH 2/6] Fix for target type 39 GroupNoPets. Should no longer take hold on a pet if your targeting it when casting spell. --- zone/spells.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zone/spells.cpp b/zone/spells.cpp index 06c28adaa..0757e4510 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -1670,6 +1670,12 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce } else { spell_target = this; } + + if (spell_target && spell_target->IsPet() && spells[spell_id].targettype == ST_GroupNoPets){ + Message_StringID(13,NO_CAST_ON_PET); + return false; + } + CastAction = GroupSpell; break; } From ce4c6b0c8a175806b2c53880a0b6134e28eeab0e Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Sun, 23 Nov 2014 20:52:24 -0500 Subject: [PATCH 3/6] string --- zone/string_ids.h | 1 + 1 file changed, 1 insertion(+) diff --git a/zone/string_ids.h b/zone/string_ids.h index 57711a40d..5375c2d7d 100644 --- a/zone/string_ids.h +++ b/zone/string_ids.h @@ -264,6 +264,7 @@ #define TRADESKILL_MISSING_COMPONENTS 3456 //Sorry, but you don't have everything you need for this recipe in your general inventory. #define TRADESKILL_LEARN_RECIPE 3457 //You have learned the recipe %1! #define EXPEDITION_MIN_REMAIN 3551 //You only have %1 minutes remaining before this expedition comes to an end. +#define NO_CAST_ON_PET 4045 //You cannot cast this spell on your pet. #define REWIND_WAIT 4059 //You must wait a bit longer before using the rewind command again. #define CORPSEDRAG_LIMIT 4061 //You are already dragging as much as you can! #define CORPSEDRAG_ALREADY 4062 //You are already dragging %1. From 5c0fbac7b0361ce251cf575da185966893353b3f Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Sun, 23 Nov 2014 21:41:05 -0500 Subject: [PATCH 4/6] Removal of 2x numhits outgoing hit success call from special attack. --- zone/special_attacks.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 963bf51a8..3625c9180 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -2128,8 +2128,6 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes if (HasDied()) return; - CheckNumHitsRemaining(NUMHIT_OutgoingHitSuccess); - if(aabonuses.SpecialAttackKBProc[0] && aabonuses.SpecialAttackKBProc[1] == skillinuse){ int kb_chance = 25; kb_chance += kb_chance*(100-aabonuses.SpecialAttackKBProc[0])/100; From 3ca282abfa81c519f26528fc2212a09ad4bc754d Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Sun, 23 Nov 2014 22:06:15 -0500 Subject: [PATCH 5/6] Fix for numhits counter not working where buffslot was 0 in some situations. --- zone/mob.cpp | 4 ++-- zone/mob.h | 2 +- zone/spell_effects.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/zone/mob.cpp b/zone/mob.cpp index a7d141b30..6c451f907 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -3059,7 +3059,7 @@ void Mob::TriggerOnCast(uint32 focus_spell, uint32 spell_id, bool aa_trigger) if(IsValidSpell(trigger_spell_id) && GetTarget()){ SpellFinished(trigger_spell_id, GetTarget(),10, 0, -1, spells[trigger_spell_id].ResistDiff); - CheckNumHitsRemaining(NUMHIT_MatchingSpells,0, focus_spell); + CheckNumHitsRemaining(NUMHIT_MatchingSpells,-1, focus_spell); } } } @@ -3396,7 +3396,7 @@ void Mob::TrySympatheticProc(Mob *target, uint32 spell_id) SpellFinished(focus_trigger, target, 10, 0, -1, spells[focus_trigger].ResistDiff); } - CheckNumHitsRemaining(NUMHIT_MatchingSpells, 0, focus_spell); + CheckNumHitsRemaining(NUMHIT_MatchingSpells, -1, focus_spell); } } diff --git a/zone/mob.h b/zone/mob.h index a4dd2d665..525cbb2e8 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -275,7 +275,7 @@ public: int16 GetBuffSlotFromType(uint16 type); uint16 GetSpellIDFromSlot(uint8 slot); int CountDispellableBuffs(); - void CheckNumHitsRemaining(uint8 type, uint32 buff_slot=0, uint16 spell_id=SPELL_UNKNOWN); + void CheckNumHitsRemaining(uint8 type, uint32 buff_slot=-1, uint16 spell_id=SPELL_UNKNOWN); bool HasNumhits() const { return has_numhits; } inline void Numhits(bool val) { has_numhits = val; } bool HasMGB() const { return has_MGB; } diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 447d34efd..35d93127a 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -5586,8 +5586,8 @@ void Mob::CheckNumHitsRemaining(uint8 type, uint32 buff_slot, uint16 spell_id) } } } - } else if (type == 7) { - if (buff_slot > 0) { + } else if (type == NUMHIT_MatchingSpells) { + if (buff_slot >= 0) { if (--buffs[buff_slot].numhits == 0) { CastOnNumHitFade(buffs[buff_slot].spellid); if (!TryFadeEffect(buff_slot)) From f4d024fd478da28af51e01fb1e11c701ca766250 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Sun, 23 Nov 2014 23:44:14 -0500 Subject: [PATCH 6/6] Swarm pets will no longer assist owners if special ability '34' IMMUNE_AGGRO is set. --- zone/entity.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index ed5b99219..a17bf9317 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -3652,7 +3652,8 @@ void EntityList::AddTempPetsToHateList(Mob *owner, Mob* other, bool bFrenzy) NPC* n = it->second; if (n->GetSwarmInfo()) { if (n->GetSwarmInfo()->owner_id == owner->GetID()) { - n->CastToNPC()->hate_list.Add(other, 0, 0, bFrenzy); + if (!n->GetSpecialAbility(IMMUNE_AGGRO)) + n->hate_list.Add(other, 0, 0, bFrenzy); } } ++it;