From 9a19a00bdc515e35d390903525db2911a50852f7 Mon Sep 17 00:00:00 2001 From: Michael Cook Date: Tue, 8 Oct 2013 17:24:07 -0400 Subject: [PATCH 1/8] Added IsBuffSpell(spell_id). This will return true if the spell would end up having a duration, which will mean it would end up in one of the many buff windows on the client. This just makes sure the spell has a buffduration or buffdurationformula, which means the calculation will return a duration Replaced all instances of CalcBuffDuration being used to determine if a spell was a buff with IsBuffSpell Removed Mob::HasBuffIcon since it does the same thing IsBuffSpell does in a more convoluted way and had a rather missing leading name Fixed issues that arose from the 10/03/2013 changes --- changelog.txt | 6 ++++++ common/spdat.cpp | 7 +++++++ common/spdat.h | 1 + zone/bot.cpp | 2 +- zone/mob.cpp | 9 --------- zone/mob.h | 1 - zone/spell_effects.cpp | 4 ++-- zone/spells.cpp | 4 ++-- 8 files changed, 19 insertions(+), 15 deletions(-) diff --git a/changelog.txt b/changelog.txt index e8511f6b6..5cd454b9f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,11 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 10/08/2013 == +demonstar55: Added IsBuffSpell(spell_id) that will return true if the spell has a duration, so would end up in effects/song/discs etc windows on the client +demonstar55: Replaced instances of using CalcBuffDuration to determine if a spell was a buff with IsBuffSpell +demonstar55: Removed Mob::HasBuffIcon since it was doing what IsBuffSpell does in a more convoluted way with a rather misleading name +demonstar55: Fixed issues that arose from the 10/03/2013 change + == 10/05/2013 == Sorvani: fixed issue with stackable items being created with 0 charges cause by fix to SummonItems diff --git a/common/spdat.cpp b/common/spdat.cpp index 4cf4ab1a6..7f413dfe1 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -987,6 +987,13 @@ bool IsSelfConversionSpell(uint16 spell_id) { return false; } +// returns true for both detrimental and beneficial buffs +bool IsBuffSpell(uint16 spell_id) { + if(IsValidSpell(spell_id) && (spells[spell_id].buffduration || spells[spell_id].buffdurationformula)) + return true; + return false; +} + uint32 GetMorphTrigger(uint32 spell_id) { for(int i = 0; i < EFFECT_COUNT; ++i) diff --git a/common/spdat.h b/common/spdat.h index 5d317f693..df2e9b558 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -792,6 +792,7 @@ bool IsGroupHealOverTimeSpell(uint16 spell_id); bool IsDebuffSpell(uint16 spell_id); bool IsResistDebuffSpell(uint16 spell_id); bool IsSelfConversionSpell(uint16 spell_id); +bool IsBuffSpell(uint16 spell_id); uint32 GetMorphTrigger(uint32 spell_id); uint32 GetPartialMeleeRuneReduction(uint32 spell_id); uint32 GetPartialMagicRuneReduction(uint32 spell_id); diff --git a/zone/bot.cpp b/zone/bot.cpp index 83ccc0979..5512903e0 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -9329,7 +9329,7 @@ int32 Bot::GetActSpellCasttime(uint16 spell_id, int32 casttime) { || botclass == PALADIN || botclass == BEASTLORD )) cast_reducer += (GetLevel()-50)*3; - if((casttime >= 4000) && BeneficialSpell(spell_id) && ((CalcBuffDuration(this,this,spell_id)-1) > 0)) { + if((casttime >= 4000) && BeneficialSpell(spell_id) && IsBuffSpell(spell_id)) { switch (GetAA(aaSpellCastingDeftness)) { case 1: cast_reducer += 5; diff --git a/zone/mob.cpp b/zone/mob.cpp index 2b978eb03..501271e2a 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -3033,15 +3033,6 @@ void Mob::SetDeltas(float dx, float dy, float dz, float dh) { delta_heading = static_cast(dh); } - -bool Mob::HasBuffIcon(Mob *caster, Mob *target, uint16 spell_id) -{ - if((caster->CalcBuffDuration(caster, target, spell_id)-1) > 0) - return true; - else - return false; -} - void Mob::SetEntityVariable(const char *id, const char *m_var) { std::string n_m_var = m_var; diff --git a/zone/mob.h b/zone/mob.h index 8404c3804..dfcae9d2a 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -241,7 +241,6 @@ public: int16 GetBuffSlotFromType(uint16 type); uint16 GetSpellIDFromSlot(uint8 slot); int CountDispellableBuffs(); - bool HasBuffIcon(Mob* caster, Mob* target, uint16 spell_id); bool CheckHitsRemaining(uint32 buff_slot, bool when_spell_done=false, bool negate=false,uint16 type=0, uint16 spell_id=0, bool use_skill=false,uint16 skill=0); void SpreadVirus(uint16 spell_id, uint16 casterID); diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 435795d0c..b43046649 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -82,7 +82,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if(c_override) { int durat = CalcBuffDuration(caster, this, spell_id, caster_level); - if((durat-1) > 0) + if(durat > 0) { buffslot = AddBuff(caster, spell_id, durat, caster_level); if(buffslot == -1) // stacking failure @@ -95,7 +95,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) } else { - if((CalcBuffDuration(caster,this,spell_id)-1) > 0){ + if(IsBuffSpell(spell_id)){ if(IsEffectInSpell(spell_id, SE_BindSight)) { if(caster) diff --git a/zone/spells.cpp b/zone/spells.cpp index f40f96912..5be8a19f0 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -2257,7 +2257,7 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { { if(IsClient()) { - if(HasBuffIcon(caster, this, spell_id) == false) + if(!IsBuffSpell(spell_id)) { CastToClient()->SetKnockBackExemption(true); @@ -3497,7 +3497,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { if(spelltar->IsClient()) { - if(HasBuffIcon(this, spelltar, spell_id) == false) + if(!IsBuffSpell(spell_id)) { spelltar->CastToClient()->SetKnockBackExemption(true); From 3a95f81196935016741c56412ccb24224d88766f Mon Sep 17 00:00:00 2001 From: Michael Cook Date: Wed, 9 Oct 2013 02:00:49 -0400 Subject: [PATCH 2/8] Fixed more instances of AA timers being eaten Every time I touch zone/AA.cpp to fix timers it gets uglier. This should fix the bug reported here: http://www.peqtgc.com/phpBB3/viewtopic.php?f=17&t=14125 It should also fix AAs not being reset when it when you have no buff slots free (confirmed on live) --- changelog.txt | 3 +++ zone/AA.cpp | 14 +++++++++----- zone/spells.cpp | 7 +++++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/changelog.txt b/changelog.txt index 5cd454b9f..67ecfe9a8 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 10/09/2013 == +demonstar55: Fixed some more instances of the AA timer being eaten + == 10/08/2013 == demonstar55: Added IsBuffSpell(spell_id) that will return true if the spell has a duration, so would end up in effects/song/discs etc windows on the client demonstar55: Replaced instances of using CalcBuffDuration to determine if a spell was a buff with IsBuffSpell diff --git a/zone/AA.cpp b/zone/AA.cpp index 24c17b939..71af74de0 100644 --- a/zone/AA.cpp +++ b/zone/AA.cpp @@ -262,7 +262,6 @@ void Client::ActivateAA(aaID activate){ } SetMana(GetMana() - caa->mana_cost); } - HandleAAAction(aaid); if(caa->reuse_time > 0) { uint32 timer_base = CalcAAReuseTimer(caa); @@ -273,6 +272,7 @@ void Client::ActivateAA(aaID activate){ p_timers.Start(AATimerID + pTimerAAStart, timer_base); SendAATimer(AATimerID, 0, 0); } + HandleAAAction(aaid); } //cast the spell, if we have one @@ -531,10 +531,14 @@ void Client::HandleAAAction(aaID activate) { } //cast the spell, if we have one - if(spell_id > 0 && spell_id < SPDAT_RECORDS) { - //I dont know when we need to mem and when we do not, if ever... - //MemorizeSpell(8, spell_id, 3); - CastSpell(spell_id, target_id); + if(IsValidSpell(spell_id)) { + int aatid = GetAATimerID(activate); + if(!CastSpell(spell_id, target_id , 10, -1, -1, 0, -1, pTimerAAStart + aatid , CalcAAReuseTimer(caa), 1)) { + SendAATimer(aatid, 0, 0xFFFFFF); + Message_StringID(15,ABILITY_FAILED); + p_timers.Clear(&database, pTimerAAStart + aatid); + return; + } } //handle the duration timer if we have one. diff --git a/zone/spells.cpp b/zone/spells.cpp index 5be8a19f0..02ae8db0d 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -1818,7 +1818,9 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if (isproc) { SpellOnTarget(spell_id, spell_target, false, true, resist_adjust, true); } else { - SpellOnTarget(spell_id, spell_target, false, true, resist_adjust, false); + if(!SpellOnTarget(spell_id, spell_target, false, true, resist_adjust, false)) + if(casting_spell_type == 1) // AA failed to cast, InterruptSpell to reset timer + InterruptSpell(); } if(IsPlayerIllusionSpell(spell_id) && IsClient() @@ -3478,7 +3480,8 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // if SpellEffect returned false there's a problem applying the // spell. It's most likely a buff that can't stack. mlog(SPELLS__CASTING_ERR, "Spell %d could not apply its effects %s -> %s\n", spell_id, GetName(), spelltar->GetName()); - Message_StringID(MT_Shout, SPELL_NO_HOLD); + if(casting_spell_type != 1) // AA is handled differently + Message_StringID(MT_Shout, SPELL_NO_HOLD); safe_delete(action_packet); return false; } From 7ee417ab05a3513b8dab28b64bc37cc66676f419 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Wed, 9 Oct 2013 00:46:43 +0400 Subject: [PATCH 3/8] Simplify conditional linking with libdl --- eqlaunch/CMakeLists.txt | 4 +--- loginserver/CMakeLists.txt | 4 +--- queryserv/CMakeLists.txt | 4 +--- shared_memory/CMakeLists.txt | 4 +--- tests/CMakeLists.txt | 2 +- ucs/CMakeLists.txt | 5 +---- world/CMakeLists.txt | 5 +---- zone/CMakeLists.txt | 4 +--- 8 files changed, 8 insertions(+), 24 deletions(-) diff --git a/eqlaunch/CMakeLists.txt b/eqlaunch/CMakeLists.txt index 5c9ad6a60..0f0114c88 100644 --- a/eqlaunch/CMakeLists.txt +++ b/eqlaunch/CMakeLists.txt @@ -27,9 +27,7 @@ IF(MINGW) ENDIF(MINGW) IF(UNIX) - IF(NOT FREEBSD) - TARGET_LINK_LIBRARIES(eqlaunch "dl") - ENDIF(NOT FREEBSD) + TARGET_LINK_LIBRARIES(eqlaunch "${CMAKE_DL_LIBS}") TARGET_LINK_LIBRARIES(eqlaunch "z") TARGET_LINK_LIBRARIES(eqlaunch "m") TARGET_LINK_LIBRARIES(eqlaunch "rt") diff --git a/loginserver/CMakeLists.txt b/loginserver/CMakeLists.txt index 7a4272a70..ba96b1f61 100644 --- a/loginserver/CMakeLists.txt +++ b/loginserver/CMakeLists.txt @@ -55,9 +55,7 @@ IF(MINGW) ENDIF(MINGW) IF(UNIX) - IF(NOT FREEBSD) - TARGET_LINK_LIBRARIES(loginserver "dl") - ENDIF(NOT FREEBSD) + TARGET_LINK_LIBRARIES(loginserver "${CMAKE_DL_LIBS}") TARGET_LINK_LIBRARIES(loginserver "z") TARGET_LINK_LIBRARIES(loginserver "m") TARGET_LINK_LIBRARIES(loginserver "rt") diff --git a/queryserv/CMakeLists.txt b/queryserv/CMakeLists.txt index 8b8196b12..a8480ca94 100644 --- a/queryserv/CMakeLists.txt +++ b/queryserv/CMakeLists.txt @@ -33,9 +33,7 @@ IF(MINGW) ENDIF(MINGW) IF(UNIX) - IF(NOT FREEBSD) - TARGET_LINK_LIBRARIES(queryserv "dl") - ENDIF(NOT FREEBSD) + TARGET_LINK_LIBRARIES(queryserv "${CMAKE_DL_LIBS}") TARGET_LINK_LIBRARIES(queryserv "z") TARGET_LINK_LIBRARIES(queryserv "m") TARGET_LINK_LIBRARIES(queryserv "rt") diff --git a/shared_memory/CMakeLists.txt b/shared_memory/CMakeLists.txt index 76c8b75bd..da4e6d609 100644 --- a/shared_memory/CMakeLists.txt +++ b/shared_memory/CMakeLists.txt @@ -33,9 +33,7 @@ IF(MINGW) ENDIF(MINGW) IF(UNIX) - IF(NOT FREEBSD) - TARGET_LINK_LIBRARIES(shared_memory "dl") - ENDIF(NOT FREEBSD) + TARGET_LINK_LIBRARIES(shared_memory "${CMAKE_DL_LIBS}") TARGET_LINK_LIBRARIES(shared_memory "z") TARGET_LINK_LIBRARIES(shared_memory "m") TARGET_LINK_LIBRARIES(shared_memory "rt") diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 649285b8b..2cffeae88 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -27,7 +27,7 @@ IF(MINGW) ENDIF(MINGW) IF(UNIX) - TARGET_LINK_LIBRARIES(tests "dl") + TARGET_LINK_LIBRARIES(tests "${CMAKE_DL_LIBS}") TARGET_LINK_LIBRARIES(tests "z") TARGET_LINK_LIBRARIES(tests "m") TARGET_LINK_LIBRARIES(tests "rt") diff --git a/ucs/CMakeLists.txt b/ucs/CMakeLists.txt index 6603470f6..27a8a072d 100644 --- a/ucs/CMakeLists.txt +++ b/ucs/CMakeLists.txt @@ -35,10 +35,7 @@ IF(MINGW) ENDIF(MINGW) IF(UNIX) - - IF(NOT FREEBSD) - TARGET_LINK_LIBRARIES(ucs "dl") - ENDIF(NOT FREEBSD) + TARGET_LINK_LIBRARIES(ucs "${CMAKE_DL_LIBS}") TARGET_LINK_LIBRARIES(ucs "z") TARGET_LINK_LIBRARIES(ucs "m") TARGET_LINK_LIBRARIES(ucs "rt") diff --git a/world/CMakeLists.txt b/world/CMakeLists.txt index a14505485..2decbf4c9 100644 --- a/world/CMakeLists.txt +++ b/world/CMakeLists.txt @@ -81,10 +81,7 @@ IF(MINGW) ENDIF(MINGW) IF(UNIX) - - IF(NOT FREEBSD) - TARGET_LINK_LIBRARIES(world "dl") - ENDIF(NOT FREEBSD) + TARGET_LINK_LIBRARIES(world "${CMAKE_DL_LIBS}") TARGET_LINK_LIBRARIES(world "z") TARGET_LINK_LIBRARIES(world "m") TARGET_LINK_LIBRARIES(world "rt") diff --git a/zone/CMakeLists.txt b/zone/CMakeLists.txt index 3cf5b0cf2..9e45b698a 100644 --- a/zone/CMakeLists.txt +++ b/zone/CMakeLists.txt @@ -223,9 +223,7 @@ IF(MINGW) ENDIF(MINGW) IF(UNIX) - IF(NOT FREEBSD) - TARGET_LINK_LIBRARIES(zone "dl") - ENDIF(NOT FREEBSD) + TARGET_LINK_LIBRARIES(zone "${CMAKE_DL_LIBS}") TARGET_LINK_LIBRARIES(zone "z") TARGET_LINK_LIBRARIES(zone "m") TARGET_LINK_LIBRARIES(zone "rt") From 6154cfce99695b52a3bca7e0f07c9e3df93daed8 Mon Sep 17 00:00:00 2001 From: SecretsOTheP Date: Thu, 10 Oct 2013 05:15:38 -0700 Subject: [PATCH 4/8] Fixed zone shutdown (or #reloadqst) reinitalization of Perl. This should allow for Perl 5.14 and later to work on Windows under the new quest system. --- changelog.txt | 3 +++ zone/embperl.cpp | 51 ++++++++++++++++++++++++++---------------------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/changelog.txt b/changelog.txt index 67ecfe9a8..899ab7015 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 10/10/2013 == +Secrets: Fixed zone shutdown (or #reloadqst) reinitalization of Perl. This should allow for Perl 5.14 and later to work on Windows under the new quest system. + == 10/09/2013 == demonstar55: Fixed some more instances of the AA timer being eaten diff --git a/zone/embperl.cpp b/zone/embperl.cpp index 7bd4db2b5..9f05d8711 100644 --- a/zone/embperl.cpp +++ b/zone/embperl.cpp @@ -43,6 +43,17 @@ EXTERN_C XS(boot_PerlPacket); XS(XS_EQEmuIO_PRINT); #endif //EMBPERL_IO_CAPTURE +const char *argv_eqemu[] = { "", +#ifdef EMBPERL_IO_CAPTURE + "-w", "-W", +#endif + "-e", "0;", nullptr }; + +#ifdef EMBPERL_IO_CAPTURE + int argc = 5; +#else + int argc = 3; +#endif //so embedded scripts can use xs extensions (ala 'use socket;') EXTERN_C void boot_DynaLoader(pTHX_ CV* cv); EXTERN_C void xs_init(pTHX) @@ -85,38 +96,25 @@ EXTERN_C void xs_init(pTHX) Embperl::Embperl() { + char **argv = (char **)argv_eqemu; + char **env = { nullptr }; in_use = true; //in case one of these files generates an event - - //setup perl... - my_perl = perl_alloc(); - if(!my_perl) - throw "Failed to init Perl (perl_alloc)"; + PERL_SYS_INIT3(&argc, &argv, &env); DoInit(); } void Embperl::DoInit() { - const char *argv_eqemu[] = { "", -#ifdef EMBPERL_IO_CAPTURE - "-w", "-W", -#endif - "-e", "0;", nullptr }; - - int argc = 3; -#ifdef EMBPERL_IO_CAPTURE - argc = 5; -#endif - char **argv = (char **)argv_eqemu; char **env = { nullptr }; - + my_perl = perl_alloc(); + //setup perl... + if(!my_perl) + throw "Failed to init Perl (perl_alloc)"; + PERL_SET_CONTEXT(my_perl); + PERL_SET_INTERP(my_perl); PL_perl_destruct_level = 1; - perl_construct(my_perl); - - PERL_SYS_INIT3(&argc, &argv, &env); - - perl_parse(my_perl, xs_init, argc, argv, env); - + perl_parse(my_perl, xs_init, argc, argv, nullptr); perl_run(my_perl); //a little routine we use a lot. @@ -213,12 +211,19 @@ Embperl::~Embperl() ,FALSE); #endif perl_free(my_perl); + PERL_SYS_TERM(); + my_perl = NULL; } void Embperl::Reinit() { in_use = true; + PERL_SET_CONTEXT(my_perl); + PERL_SET_INTERP(my_perl); PL_perl_destruct_level = 1; perl_destruct(my_perl); + perl_free(my_perl); + my_perl = NULL; + //Now reinit... DoInit(); in_use = false; } From 8327f22f6f82e5e9d145201ab9d560e3af5f41f2 Mon Sep 17 00:00:00 2001 From: JJ Date: Thu, 10 Oct 2013 22:38:23 -0400 Subject: [PATCH 5/8] Revert change to EnterWorldPacket introduced on 22 April 2013 to fix inability to enter Tutorial or Go Home from character select screen. --- changelog.txt | 1 + world/client.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 899ab7015..6bd5f2387 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 10/10/2013 == Secrets: Fixed zone shutdown (or #reloadqst) reinitalization of Perl. This should allow for Perl 5.14 and later to work on Windows under the new quest system. +JJ: Revert change to EnterWorldPacket introduced on 22 April 2013 to fix inability to enter Tutorial or Go Home from character select screen. == 10/09/2013 == demonstar55: Fixed some more instances of the AA timer being eaten diff --git a/world/client.cpp b/world/client.cpp index 1b142b693..57c60c072 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -723,7 +723,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { if(cs->gohome[x] == 1) { home_enabled = true; - return true; + break; } } } @@ -755,7 +755,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { if(cs->tutorial[x] == 1) { tutorial_enabled = true; - return true; + break; } } } From da401acdb2a32bf2b3c89cff4daecb6ff0a8971b Mon Sep 17 00:00:00 2001 From: Michael Cook Date: Thu, 10 Oct 2013 23:17:02 -0400 Subject: [PATCH 6/8] Fix mana and timer being used on single target buffs failing Single target buffs shouldn't have their mana consumed or their reuse timers set if they fail the Mob::SpellOnTarget call in Mob::SpellFinished. Ex. Night's Dark Terror not taking hold (no free slots) or Target running out of range. Debuffs do not get this nice behavior. --- changelog.txt | 1 + zone/spells.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 899ab7015..059396ab6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 10/10/2013 == Secrets: Fixed zone shutdown (or #reloadqst) reinitalization of Perl. This should allow for Perl 5.14 and later to work on Windows under the new quest system. +demonstar55: Beneficial single target buffs shouldn't have their mana/timers set if they fail to cast after the Mob::SpellOnTarget call in Mob::SpellFinished == 10/09/2013 == demonstar55: Fixed some more instances of the AA timer being eaten diff --git a/zone/spells.cpp b/zone/spells.cpp index 02ae8db0d..710bf62cf 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -1818,9 +1818,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if (isproc) { SpellOnTarget(spell_id, spell_target, false, true, resist_adjust, true); } else { - if(!SpellOnTarget(spell_id, spell_target, false, true, resist_adjust, false)) - if(casting_spell_type == 1) // AA failed to cast, InterruptSpell to reset timer + if(!SpellOnTarget(spell_id, spell_target, false, true, resist_adjust, false)) { + if(IsBuffSpell(spell_id) && IsBeneficialSpell(spell_id)) { + // Prevent mana usage/timers being set for beneficial buffs InterruptSpell(); + return false; + } + } } if(IsPlayerIllusionSpell(spell_id) && IsClient() From 2019379a42dfbc03dc00c8611adccc85730d0c4e Mon Sep 17 00:00:00 2001 From: Michael Cook Date: Fri, 11 Oct 2013 00:00:21 -0400 Subject: [PATCH 7/8] bool* foo = false should probably be an error, GCC 4.8+ at least warns about it, clang I think fails on it. --- zone/zonedb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/zonedb.h b/zone/zonedb.h index 76f528e29..d3d096fcf 100644 --- a/zone/zonedb.h +++ b/zone/zonedb.h @@ -217,7 +217,7 @@ public: bool GetAccountInfoForLogin(uint32 account_id, int16* admin = 0, char* account_name = 0, uint32* lsaccountid = 0, uint8* gmspeed = 0, bool* revoked = 0, bool* gmhideme = 0); bool GetAccountInfoForLogin_result(MYSQL_RES* result, int16* admin = 0, char* account_name = 0, - uint32* lsaccountid = 0, uint8* gmspeed = 0, bool* revoked = 0, bool* gmhideme = false, + uint32* lsaccountid = 0, uint8* gmspeed = 0, bool* revoked = 0, bool* gmhideme = nullptr, uint32* account_creation = 0); bool GetCharacterInfoForLogin_result(MYSQL_RES* result, uint32* character_id = 0, char* current_zone = 0, PlayerProfile_Struct* pp = 0, Inventory* inv = 0, ExtendedProfile_Struct *ext = 0, uint32* pplen = 0, From 549dfc978172d063f590a905017907e22e91bf94 Mon Sep 17 00:00:00 2001 From: JJ Date: Fri, 11 Oct 2013 22:40:49 -0400 Subject: [PATCH 8/8] Allow use of Go Home button when Tutorial still selected in RoF. --- changelog.txt | 3 +++ world/client.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 650af03bd..c84aa1924 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 10/11/2013 == +JJ: (demonstar55) Allow use of Go Home button when Tutorial still selected in RoF. + == 10/10/2013 == Secrets: Fixed zone shutdown (or #reloadqst) reinitalization of Perl. This should allow for Perl 5.14 and later to work on Windows under the new quest system. demonstar55: Beneficial single target buffs shouldn't have their mana/timers set if they fail to cast after the Mob::SpellOnTarget call in Mob::SpellFinished diff --git a/world/client.cpp b/world/client.cpp index 57c60c072..0fd211790 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -709,7 +709,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { return true; } - if(!pZoning && ew->return_home) + if(!pZoning && ew->return_home && !ew->tutorial) { CharacterSelect_Struct* cs = new CharacterSelect_Struct; memset(cs, 0, sizeof(CharacterSelect_Struct));