From 5b85aa6550992963384f23c353a260b376253287 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Wed, 19 Nov 2014 00:39:42 -0500 Subject: [PATCH 1/5] Fix to allow discipline reuse timers to be set on client correclty and therefore have the client return the time remaining instead of the server. Hopefully may resolve some bugs reselated to discipline use. --- zone/client.h | 1 + zone/effects.cpp | 27 +++++++++++++++++---------- zone/spells.cpp | 4 ++++ 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/zone/client.h b/zone/client.h index fd797c1b7..de6d187b7 100644 --- a/zone/client.h +++ b/zone/client.h @@ -875,6 +875,7 @@ void SetConsumption(int32 in_hunger, int32 in_thirst); bool TrainDiscipline(uint32 itemid); void SendDisciplineUpdate(); bool UseDiscipline(uint32 spell_id, uint32 target); + void SendDisciplineTimer(uint32 timer_id, uint32 duration, uint16 spell_id = SPELL_UNKNOWN); bool CheckTitle(int titleset); void EnableTitle(int titleset); diff --git a/zone/effects.cpp b/zone/effects.cpp index 7506f99cf..118acb4a3 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -696,16 +696,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { return true; } - CastSpell(spell_id, target, DISCIPLINE_SPELL_SLOT, -1, -1, 0, -1, (uint32)DiscTimer, reduced_recast); - if(spells[spell_id].EndurTimerIndex < MAX_DISCIPLINE_TIMERS) - { - EQApplicationPacket *outapp = new EQApplicationPacket(OP_DisciplineTimer, sizeof(DisciplineTimer_Struct)); - DisciplineTimer_Struct *dts = (DisciplineTimer_Struct *)outapp->pBuffer; - dts->TimerID = spells[spell_id].EndurTimerIndex; - dts->Duration = reduced_recast; - QueuePacket(outapp); - safe_delete(outapp); - } + SendDisciplineTimer(spells[spell_id].EndurTimerIndex, reduced_recast); } else { @@ -714,6 +705,22 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { return(true); } +void Client::SendDisciplineTimer(uint32 timer_id, uint32 duration, uint16 spell_id) +{ + if (!timer_id && IsValidSpell(spell_id)) + timer_id = spells[spell_id].EndurTimerIndex; + + if(duration > 0 && timer_id && (timer_id < MAX_DISCIPLINE_TIMERS)) + { + EQApplicationPacket *outapp = new EQApplicationPacket(OP_DisciplineTimer, sizeof(DisciplineTimer_Struct)); + DisciplineTimer_Struct *dts = (DisciplineTimer_Struct *)outapp->pBuffer; + dts->TimerID = timer_id; + dts->Duration = duration; + QueuePacket(outapp); + safe_delete(outapp); + } +} + void EntityList::AETaunt(Client* taunter, float range) { if (range == 0) diff --git a/zone/spells.cpp b/zone/spells.cpp index 315fe8712..05000dc51 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -2256,6 +2256,10 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 } } + //Disc Timer needs to be sent before and after the spell packet. + if (IsClient() && spells[spell_id].IsDisciplineBuff && spells[spell_id].EndurTimerIndex) + CastToClient()->SendDisciplineTimer(casting_spell_timer, casting_spell_timer_duration); + if(IsNPC()) CastToNPC()->AI_Event_SpellCastFinished(true, slot); From ac463fe9aae4bcf5bd4d03964a2deb0780887fe0 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Thu, 20 Nov 2014 01:10:24 -0500 Subject: [PATCH 2/5] Fix RoF Raid opcodes --- utils/patches/patch_RoF.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/patches/patch_RoF.conf b/utils/patches/patch_RoF.conf index 97098946d..027eac161 100644 --- a/utils/patches/patch_RoF.conf +++ b/utils/patches/patch_RoF.conf @@ -514,8 +514,8 @@ OP_LFGAppearance=0x0000 OP_LFGResponse=0x0000 # Raid Opcodes -OP_RaidInvite=0x1bd1 -OP_RaidUpdate=0x548e +OP_RaidInvite=0x5fb2 +OP_RaidUpdate=0x1bd1 OP_RaidJoin=0x0000 # Button-push commands From 2330285b04fd80625b7593018dbdf3a2b37613e1 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Thu, 20 Nov 2014 05:05:15 -0500 Subject: [PATCH 3/5] revert --- zone/client.h | 1 - zone/effects.cpp | 27 ++++++++++----------------- zone/spells.cpp | 4 ---- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/zone/client.h b/zone/client.h index de6d187b7..fd797c1b7 100644 --- a/zone/client.h +++ b/zone/client.h @@ -875,7 +875,6 @@ void SetConsumption(int32 in_hunger, int32 in_thirst); bool TrainDiscipline(uint32 itemid); void SendDisciplineUpdate(); bool UseDiscipline(uint32 spell_id, uint32 target); - void SendDisciplineTimer(uint32 timer_id, uint32 duration, uint16 spell_id = SPELL_UNKNOWN); bool CheckTitle(int titleset); void EnableTitle(int titleset); diff --git a/zone/effects.cpp b/zone/effects.cpp index 118acb4a3..7506f99cf 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -696,7 +696,16 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { return true; } - SendDisciplineTimer(spells[spell_id].EndurTimerIndex, reduced_recast); + CastSpell(spell_id, target, DISCIPLINE_SPELL_SLOT, -1, -1, 0, -1, (uint32)DiscTimer, reduced_recast); + if(spells[spell_id].EndurTimerIndex < MAX_DISCIPLINE_TIMERS) + { + EQApplicationPacket *outapp = new EQApplicationPacket(OP_DisciplineTimer, sizeof(DisciplineTimer_Struct)); + DisciplineTimer_Struct *dts = (DisciplineTimer_Struct *)outapp->pBuffer; + dts->TimerID = spells[spell_id].EndurTimerIndex; + dts->Duration = reduced_recast; + QueuePacket(outapp); + safe_delete(outapp); + } } else { @@ -705,22 +714,6 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { return(true); } -void Client::SendDisciplineTimer(uint32 timer_id, uint32 duration, uint16 spell_id) -{ - if (!timer_id && IsValidSpell(spell_id)) - timer_id = spells[spell_id].EndurTimerIndex; - - if(duration > 0 && timer_id && (timer_id < MAX_DISCIPLINE_TIMERS)) - { - EQApplicationPacket *outapp = new EQApplicationPacket(OP_DisciplineTimer, sizeof(DisciplineTimer_Struct)); - DisciplineTimer_Struct *dts = (DisciplineTimer_Struct *)outapp->pBuffer; - dts->TimerID = timer_id; - dts->Duration = duration; - QueuePacket(outapp); - safe_delete(outapp); - } -} - void EntityList::AETaunt(Client* taunter, float range) { if (range == 0) diff --git a/zone/spells.cpp b/zone/spells.cpp index 05000dc51..315fe8712 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -2256,10 +2256,6 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 } } - //Disc Timer needs to be sent before and after the spell packet. - if (IsClient() && spells[spell_id].IsDisciplineBuff && spells[spell_id].EndurTimerIndex) - CastToClient()->SendDisciplineTimer(casting_spell_timer, casting_spell_timer_duration); - if(IsNPC()) CastToNPC()->AI_Event_SpellCastFinished(true, slot); From f1701aae9fe0781dcc246f11292764e8ed9c786c Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Thu, 20 Nov 2014 05:53:59 -0500 Subject: [PATCH 4/5] Fix to remove double CastSpell calls from use disc function. --- zone/client.h | 1 + zone/effects.cpp | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/zone/client.h b/zone/client.h index 4ffe6d57d..ad30e0e6f 100644 --- a/zone/client.h +++ b/zone/client.h @@ -874,6 +874,7 @@ void SetConsumption(int32 in_hunger, int32 in_thirst); void DropInst(const ItemInst* inst); bool TrainDiscipline(uint32 itemid); void SendDisciplineUpdate(); + void SendDisciplineTimer(uint32 timer_id, uint32 duration); bool UseDiscipline(uint32 spell_id, uint32 target); bool CheckTitle(int titleset); diff --git a/zone/effects.cpp b/zone/effects.cpp index 7506f99cf..0bface8b7 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -696,16 +696,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { return true; } - CastSpell(spell_id, target, DISCIPLINE_SPELL_SLOT, -1, -1, 0, -1, (uint32)DiscTimer, reduced_recast); - if(spells[spell_id].EndurTimerIndex < MAX_DISCIPLINE_TIMERS) - { - EQApplicationPacket *outapp = new EQApplicationPacket(OP_DisciplineTimer, sizeof(DisciplineTimer_Struct)); - DisciplineTimer_Struct *dts = (DisciplineTimer_Struct *)outapp->pBuffer; - dts->TimerID = spells[spell_id].EndurTimerIndex; - dts->Duration = reduced_recast; - QueuePacket(outapp); - safe_delete(outapp); - } + SendDisciplineTimer(spells[spell_id].EndurTimerIndex, reduced_recast); } else { @@ -714,6 +705,19 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { return(true); } +void Client::SendDisciplineTimer(uint32 timer_id, uint32 duration) +{ + if (timer_id < MAX_DISCIPLINE_TIMERS) + { + EQApplicationPacket *outapp = new EQApplicationPacket(OP_DisciplineTimer, sizeof(DisciplineTimer_Struct)); + DisciplineTimer_Struct *dts = (DisciplineTimer_Struct *)outapp->pBuffer; + dts->TimerID = timer_id; + dts->Duration = duration; + QueuePacket(outapp); + safe_delete(outapp); + } +} + void EntityList::AETaunt(Client* taunter, float range) { if (range == 0) From 357368697676417998d0e50dbbb41ca8af5f1d2d Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 21 Nov 2014 22:50:08 -0500 Subject: [PATCH 5/5] Fix issue with PendingTranslocateData --- zone/client.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index f09d24039..e012c7364 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -3868,11 +3868,11 @@ void Client::SendOPTranslocateConfirm(Mob *Caster, uint16 SpellID) { PendingTranslocateData.heading = m_pp.binds[0].heading; } else { - ts->ZoneID = database.GetZoneID(Spell.teleport_zone); + PendingTranslocateData.zone_id = ts->ZoneID = database.GetZoneID(Spell.teleport_zone); PendingTranslocateData.instance_id = 0; - ts->y = Spell.base[0]; - ts->x = Spell.base[1]; - ts->z = Spell.base[2]; + PendingTranslocateData.y = ts->y = Spell.base[0]; + PendingTranslocateData.x = ts->x = Spell.base[1]; + PendingTranslocateData.z = ts->z = Spell.base[2]; PendingTranslocateData.heading = 0.0; }