From 0dbd0478c0d92437962a3ab1c33e231a9860595d Mon Sep 17 00:00:00 2001 From: KimLS Date: Wed, 12 Jun 2013 12:11:56 -0700 Subject: [PATCH 1/7] Merge of hatebourne's stuff --- changelog.txt | 9 +++++++++ zone/bot.cpp | 2 +- zone/client_mods.cpp | 2 +- zone/common.h | 2 +- zone/merc.cpp | 2 +- zone/mob.cpp | 2 +- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/changelog.txt b/changelog.txt index 546be96d3..ec834d7f6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,14 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 06/12/2013 == +KLS: Merge Hateborne's hp cap stuff +KLS: We haven't updated changelog in a while but there's been: + -Some string stuff + -A lot of fixes to things like caps. + -More work on custom mod stuff (including examples) + -Fix for login not bailing out if it cant connect to a db + -Quite a few warning changes. + == 05/05/2013 == Tabasco: Added EVENT_ITEM_TICK for interactive item quest scripts. (See https://github.com/josheb/quests_dc/blob/master/items/12204.pl) Added simple account flags. Would this work better as an additional qglobal category? diff --git a/zone/bot.cpp b/zone/bot.cpp index c88ad72b7..239674927 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -11043,7 +11043,7 @@ int32 Bot::CalcMaxHP() { bot_hp += GroupLeadershipAAHealthEnhancement(); - bot_hp += bot_hp * (spellbonuses.MaxHPChange + itembonuses.MaxHPChange) / 10000; + bot_hp += bot_hp * ((spellbonuses.MaxHPChange + itembonuses.MaxHPChange) / 10000.0f); max_hp = bot_hp; if (cur_hp > max_hp) diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index eaab0ba81..b05b30e77 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -250,7 +250,7 @@ int32 Client::CalcMaxHP() { max_hp += GroupLeadershipAAHealthEnhancement(); - max_hp += max_hp * (spellbonuses.MaxHPChange + itembonuses.MaxHPChange) / 10000; + max_hp += max_hp * ((spellbonuses.MaxHPChange + itembonuses.MaxHPChange) / 10000.0f); if (cur_hp > max_hp) cur_hp = max_hp; diff --git a/zone/common.h b/zone/common.h index ddc17118f..f7716c927 100644 --- a/zone/common.h +++ b/zone/common.h @@ -283,7 +283,7 @@ struct StatBonuses { int16 HundredHands; //extra haste, stacks with all other haste i int8 MeleeLifetap; //i int16 HealRate; // Spell effect that influences effectiveness of heals - int16 MaxHPChange; // Spell Effect + int32 MaxHPChange; // Spell Effect int16 SkillDmgTaken[HIGHEST_SKILL+2]; // All Skills + -1 int32 HealAmt; // Item Effect int32 SpellDmg; // Item Effect diff --git a/zone/merc.cpp b/zone/merc.cpp index 0e652ff5a..0e262f735 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -918,7 +918,7 @@ int32 Merc::CalcMaxHP() { max_hp += GroupLeadershipAAHealthEnhancement(); - max_hp += max_hp * (spellbonuses.MaxHPChange + itembonuses.MaxHPChange) / 10000; + max_hp += max_hp * ((spellbonuses.MaxHPChange + itembonuses.MaxHPChange) / 10000.0f); if (cur_hp > max_hp) cur_hp = max_hp; diff --git a/zone/mob.cpp b/zone/mob.cpp index 33560ed55..f5073f860 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -615,7 +615,7 @@ int32 Mob::CalcMaxMana() { int32 Mob::CalcMaxHP() { max_hp = (base_hp + itembonuses.HP + spellbonuses.HP); - max_hp += max_hp * (aabonuses.MaxHPChange + spellbonuses.MaxHPChange + itembonuses.MaxHPChange) / 10000; + max_hp += max_hp * ((aabonuses.MaxHPChange + spellbonuses.MaxHPChange + itembonuses.MaxHPChange) / 10000.0f); return max_hp; } From 28eb80e27f8b548e5978b2f95b7b45249f3a0ee6 Mon Sep 17 00:00:00 2001 From: Uleat Date: Wed, 12 Jun 2013 22:04:07 -0400 Subject: [PATCH 2/7] Added changelog message for predated commit (Bot procs and AE buff casting) --- changelog.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/changelog.txt b/changelog.txt index ec834d7f6..de3743f64 100644 --- a/changelog.txt +++ b/changelog.txt @@ -9,6 +9,14 @@ KLS: We haven't updated changelog in a while but there's been: -Fix for login not bailing out if it cant connect to a db -Quite a few warning changes. +== 05/09/2013 == +Uleat: (Updated: 06/12/2013) Fixed a few observed bot issues and an beneficial AE casting bug: + Added missing Bot primary weapon proc call (secondary and ranged already exist) + Added Bard Bot instrumentation bonuses + Added checks to avoid AE Buff casting on enemy mobs + Fixed a few typos in 'Vah Shir'-related code + (Please post any discrepancies as bugs) + == 05/05/2013 == Tabasco: Added EVENT_ITEM_TICK for interactive item quest scripts. (See https://github.com/josheb/quests_dc/blob/master/items/12204.pl) Added simple account flags. Would this work better as an additional qglobal category? From 179063c86372e637a9fb267c515f1d27ff506043 Mon Sep 17 00:00:00 2001 From: Hateborne Date: Thu, 13 Jun 2013 17:59:24 -0400 Subject: [PATCH 3/7] spell.max convert int16 to int32 Converting the spell.max field to int32 to handle larger numbers in the PercentalHeal field. --- common/spdat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/spdat.h b/common/spdat.h index 7e3cd71a4..3a3ce6501 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -625,7 +625,7 @@ struct SPDat_Spell_Struct /* 019 */ uint16 mana; // Mana Used /* 020 */ int base[EFFECT_COUNT]; //various purposes /* 032 */ int base2[EFFECT_COUNT]; //various purposes -/* 044 */ int16 max[EFFECT_COUNT]; +/* 044 */ int32 max[EFFECT_COUNT]; /* 056 */ //uint16 icon; // Spell icon /* 057 */ //uint16 memicon; // Icon on membarthing /* 058 */ int32 components[4]; // reagents From 91b01c2fcc9ee3592d78de67e681e1ff2ca08275 Mon Sep 17 00:00:00 2001 From: KimLS Date: Sat, 15 Jun 2013 13:08:32 -0700 Subject: [PATCH 4/7] Image fix for OP_CastSpell exploit. --- changelog.txt | 3 +++ zone/client_packet.cpp | 37 +++++++------------------------------ 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/changelog.txt b/changelog.txt index de3743f64..73b908466 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 06/15/2013 == +KLS: (image) Potentially could bypass some spell checks by passing a specially crafted spell slot. This has been addressed. + == 06/12/2013 == KLS: Merge Hateborne's hp cap stuff KLS: We haven't updated changelog in a while but there's been: diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 133f5caa6..dbfe3d0c1 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -4577,7 +4577,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) LogFile->write(EQEMuLog::Debug, "cs_unknown2: 16 %p %u %u", &castspell->cs_unknown, *(uint16*) castspell->cs_unknown, *(uint16*) castspell->cs_unknown+sizeof(uint16) ); LogFile->write(EQEMuLog::Debug, "cs_unknown2: 16 %p %i %i", &castspell->cs_unknown, *(uint16*) castspell->cs_unknown, *(uint16*) castspell->cs_unknown+sizeof(uint16) ); #endif -LogFile->write(EQEMuLog::Debug, "OP CastSpell: slot=%d, spell=%d, target=%d, inv=%lx", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot); + LogFile->write(EQEMuLog::Debug, "OP CastSpell: slot=%d, spell=%d, target=%d, inv=%lx", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot); if ((castspell->slot == USE_ITEM_SPELL_SLOT) || (castspell->slot == POTION_BELT_SPELL_SLOT)) // this means item { @@ -4690,47 +4690,24 @@ LogFile->write(EQEMuLog::Debug, "OP CastSpell: slot=%d, spell=%d, target=%d, inv else spell_to_cast = SPELL_HARM_TOUCH2; p_timers.Start(pTimerHarmTouch, HarmTouchReuseTime); - } - - //handle disciplines, OLD, they keep changing this - if(castspell->slot == DISCIPLINE_SPELL_SLOT) { + } else if(castspell->slot == DISCIPLINE_SPELL_SLOT) { if(!UseDiscipline(castspell->spell_id, castspell->target_id)) { printf("Unknown ability being used by %s, spell being cast is: %i\n",GetName(),castspell->spell_id); InterruptSpell(castspell->spell_id); } return; - } - - if(castspell->slot < MAX_PP_MEMSPELL) - { + } else if(castspell->slot < MAX_PP_MEMSPELL) { spell_to_cast = m_pp.mem_spells[castspell->slot]; if(spell_to_cast != castspell->spell_id) { InterruptSpell(castspell->spell_id); //CHEATER!!! return; } + } else { + //If we get to here this slot should be invalid invalid + InterruptSpell(castspell->spell_id); + return; } - /* - these are coming through with slot 8 now... - else if(castspell->slot == 9) //discipline, LoH, HT, etc - { - if(GetClass() == PALADIN && castspell->spell_id == SPELL_LAY_ON_HANDS) - { - spell_to_cast = SPELL_LAY_ON_HANDS; - p_timers.Start(pTimerLayHands, LayOnHandsReuseTime); - CastSpell(spell_to_cast, castspell->target_id, castspell->slot); - } - else if(GetClass() == SHADOWKNIGHT - && (castspell->spell_id == SPELL_HARM_TOUCH || castspell->spell_id == SPELL_HARM_TOUCH2)) - { - if(GetLevel() < 40) - spell_to_cast = SPELL_HARM_TOUCH; - else - spell_to_cast = SPELL_HARM_TOUCH2; - p_timers.Start(pTimerHarmTouch, HarmTouchReuseTime); - } - else*/ - //try disciplines CastSpell(spell_to_cast, castspell->target_id, castspell->slot); } From d03e8d05ec0ef999a20e7f00c80d2cd60a7b55ab Mon Sep 17 00:00:00 2001 From: SecretsOTheP Date: Sun, 16 Jun 2013 13:04:48 -0700 Subject: [PATCH 5/7] --- common/patches/RoF.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/patches/RoF.cpp b/common/patches/RoF.cpp index da19e8d91..03893086c 100644 --- a/common/patches/RoF.cpp +++ b/common/patches/RoF.cpp @@ -4992,7 +4992,11 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint ibs.Magic = item->Magic; ibs.CastTime_ = item->CastTime_; ibs.ReqLevel = item->ReqLevel; + if(item->ReqLevel > 100) + ibs.ReqLevel = 100; ibs.RecLevel = item->RecLevel; + if(item->RecLevel > 100) + ibs.RecLevel = 100; ibs.RecSkill = item->RecSkill; ibs.BardType = item->BardType; ibs.BardValue = item->BardValue; From 68261e0308cab4aacf6340a3f877a6250e59445e Mon Sep 17 00:00:00 2001 From: SecretsOTheP Date: Sun, 16 Jun 2013 13:07:48 -0700 Subject: [PATCH 6/7] Fixed an issue with RoF items that have Rec/Req above 100. Forgot commit message/changelog.txt. --- changelog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/changelog.txt b/changelog.txt index 73b908466..efac3956a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 06/16/2013 == +Secrets: Fixed an issue with RoF items and Req/Rec level above 100 appearing yellow. Recommended to enable the #iteminfo command for items that have a req/rec above 100 to display proper information regarding the info. + == 06/15/2013 == KLS: (image) Potentially could bypass some spell checks by passing a specially crafted spell slot. This has been addressed. From e811e3975b3e6f5f1c3274a501b6f964925281fb Mon Sep 17 00:00:00 2001 From: KimLS Date: Sun, 16 Jun 2013 21:04:36 -0700 Subject: [PATCH 7/7] Mod functions should respect perl being turned off. --- zone/mod_functions.cpp | 3 +++ zone/mod_functions_base.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/zone/mod_functions.cpp b/zone/mod_functions.cpp index bf559d733..bf42e388e 100644 --- a/zone/mod_functions.cpp +++ b/zone/mod_functions.cpp @@ -186,6 +186,9 @@ int Mob::mod_spell_resist(int resist_chance, int level_mod, int resist_modifier, //Spell is cast by this on spelltar, called from spellontarget after the event_cast_on NPC event void Mob::mod_spell_cast(uint16 spell_id, Mob* spelltar, bool reflect, bool use_resist_adjust, int16 resist_adjust, bool isproc) { return; } +#ifdef EMBPERL //This is called right before regular event processing (the switch block) //It is intended to be used for exporting new variables to new or existing events. void PerlembParser::mod_quest_event(QuestEventID event, uint32 objid, const char * data, NPC* npcmob, ItemInst* iteminst, Mob* mob, uint32 extradata, bool global, std::string packagename) { return; } +#endif + diff --git a/zone/mod_functions_base.cpp b/zone/mod_functions_base.cpp index bf559d733..db8e45c3f 100644 --- a/zone/mod_functions_base.cpp +++ b/zone/mod_functions_base.cpp @@ -186,6 +186,8 @@ int Mob::mod_spell_resist(int resist_chance, int level_mod, int resist_modifier, //Spell is cast by this on spelltar, called from spellontarget after the event_cast_on NPC event void Mob::mod_spell_cast(uint16 spell_id, Mob* spelltar, bool reflect, bool use_resist_adjust, int16 resist_adjust, bool isproc) { return; } +#ifdef EMBPERL //This is called right before regular event processing (the switch block) //It is intended to be used for exporting new variables to new or existing events. void PerlembParser::mod_quest_event(QuestEventID event, uint32 objid, const char * data, NPC* npcmob, ItemInst* iteminst, Mob* mob, uint32 extradata, bool global, std::string packagename) { return; } +#endif