diff --git a/changelog.txt b/changelog.txt index 8ece10e19..bd650a214 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,21 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 10/11/2013 == Bad_Captain: Fixed merc crash issue by updating special_abilities & vwMercNpcTypes (Sorvani). +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 +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 + +== 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 7b10f8d5d..883a5d9f4 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 668002e54..27dfb4ef2 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/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/world/client.cpp b/world/client.cpp index 1b142b693..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)); @@ -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; } } } 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/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") 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/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; } 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..710bf62cf 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -1818,7 +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 { - SpellOnTarget(spell_id, spell_target, false, true, resist_adjust, false); + 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() @@ -2257,7 +2263,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); @@ -3478,7 +3484,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; } @@ -3497,7 +3504,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); diff --git a/zone/zonedb.h b/zone/zonedb.h index 33c96acfd..60ed0e65e 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,