From 88b9f96b9196ea3da7b36fec500b0e452a3df5b2 Mon Sep 17 00:00:00 2001 From: JJ Date: Sat, 6 Apr 2013 08:23:09 -0400 Subject: [PATCH] Attempting manual merge for Nature's Bounty --- changelog.txt | 3 +++ common/spdat.h | 2 +- .../sql/git/required/2013_04_04_NaturesBounty.sql | 12 ++++++++++++ zone/StringIDs.h | 1 + zone/bonuses.cpp | 15 ++++++++++++++- zone/client.h | 2 +- zone/common.h | 1 + zone/forage.cpp | 10 ++++++++-- zone/spell_effects.cpp | 1 + 9 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 utils/sql/git/required/2013_04_04_NaturesBounty.sql diff --git a/changelog.txt b/changelog.txt index 8df9c1c34..c37ee7211 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 04/04/2013 == +demonstar55: Implemented SE_ForageAdditionalItems as a bonus +required SQL: 2013_04_04_NaturesBounty.sql == 04/03/2013 == demonstar55: Overloaded Mob::Say_StringID with the option to provide a message type diff --git a/common/spdat.h b/common/spdat.h index a814ad9ba..45a7cc552 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -457,7 +457,7 @@ typedef enum { #define SE_ReduceReuseTimer 310 // implemented #define SE_CombatSkills 311 // implemented #define SE_Sanctuary 312 // *not implemented -#define SE_ForageAdditionalItems 313 // *not implemented[AA] - chance to forage additional items +#define SE_ForageAdditionalItems 313 // implemented[AA] - chance to forage additional items #define SE_Invisibility2 314 // implemented - fixed duration invisible #define SE_InvisVsUndead2 315 // implemented - fixed duration ITU //#define SE_Unknown316 316 // not used diff --git a/utils/sql/git/required/2013_04_04_NaturesBounty.sql b/utils/sql/git/required/2013_04_04_NaturesBounty.sql new file mode 100644 index 000000000..fd6a904d1 --- /dev/null +++ b/utils/sql/git/required/2013_04_04_NaturesBounty.sql @@ -0,0 +1,12 @@ +-- Nature's Bounty +INSERT INTO `altadv_vars` (`skill_id`, `name`, `cost`, `max_level`, `hotkey_sid`, `hotkey_sid2`, `title_sid`, `desc_sid`, `type`, `spellid`, `prereq_skill`, `prereq_minpoints`, `spell_type`, `spell_refresh`, `classes`, `berserker`, `class_type`, `cost_inc`, `aa_expansion`, `special_category`, `sof_type`, `sof_cost_inc`, `sof_max_level`, `sof_next_skill`, `clientver`, `account_time_required`, `sof_current_level`, `sof_next_id`, `level_inc`) VALUES ('1230', 'Nature''s Bounty', '1', '3', '4294967295', '4294967295', '1230', '1230', '7', '0', '0', '0', '0', '0', '80', '0', '51', '1', '8', '4294967295', '3', '0', '6', '1230', '1', '0', '0', '5000', '2'); +INSERT INTO `aa_effects` (`id`, `aaid`, `slot`, `effectid`, `base1`, `base2`) VALUES ('2368', '1230', '1', '313', '15', '0'); +INSERT INTO `aa_effects` (`id`, `aaid`, `slot`, `effectid`, `base1`, `base2`) VALUES ('2369', '1231', '1', '313', '20', '0'); +INSERT INTO `aa_effects` (`id`, `aaid`, `slot`, `effectid`, `base1`, `base2`) VALUES ('2370', '1232', '1', '313', '25', '0'); + +-- Survivalist +INSERT INTO `altadv_vars` (`skill_id`, `name`, `cost`, `max_level`, `hotkey_sid`, `hotkey_sid2`, `title_sid`, `desc_sid`, `type`, `spellid`, `prereq_skill`, `prereq_minpoints`, `spell_type`, `spell_refresh`, `classes`, `berserker`, `class_type`, `cost_inc`, `aa_expansion`, `special_category`, `sof_type`, `sof_cost_inc`, `sof_max_level`, `sof_next_skill`, `clientver`, `account_time_required`, `sof_current_level`, `sof_next_id`, `level_inc`) VALUES ('5000', 'Survivalist', '2', '3', '4294967295', '4294967295', '5000', '5000', '7', '4294967295', '1230', '3', '0', '0', '80', '0', '71', '0', '12', '4294967295', '3', '0', '6', '1230', '1', '0', '3', '0', '2'); +INSERT INTO `aa_effects` (`id`, `aaid`, `slot`, `effectid`, `base1`, `base2`) VALUES ('2371', '5000', '1', '313', '50', '0'); +INSERT INTO `aa_effects` (`id`, `aaid`, `slot`, `effectid`, `base1`, `base2`) VALUES ('2372', '5001', '1', '313', '75', '0'); +INSERT INTO `aa_effects` (`id`, `aaid`, `slot`, `effectid`, `base1`, `base2`) VALUES ('2373', '5002', '1', '313', '100', '0'); + diff --git a/zone/StringIDs.h b/zone/StringIDs.h index 6c44203b1..03d2b6769 100644 --- a/zone/StringIDs.h +++ b/zone/StringIDs.h @@ -238,6 +238,7 @@ #define DISCIPLINE_REUSE_MSG2 5808 //You can use the ability %1 again in %2 minute(s) %3 seconds. #define FAILED_TAUNT 5811 //You have failed to taunt your target. #define AA_NO_TARGET 5825 //You must first select a target for this ability! +#define FORAGE_MASTERY 6012 //Your forage mastery has enabled you to find something else! #define GUILD_BANK_CANNOT_DEPOSIT 6097 // Cannot deposit this item. Containers must be empty, and only one of each LORE and no NO TRADE or TEMPORARY items may be deposited. #define GUILD_BANK_FULL 6098 // There is no more room in the Guild Bank. #define GUILD_BANK_TRANSFERRED 6100 // '%1' transferred to Guild Bank from Deposits. diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index e92096cb9..d0c716cb0 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -835,6 +835,9 @@ void Client::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon) case SE_ConsumeProjectile: newbon->ConsumeProjectile += base1; break; + case SE_ForageAdditionalItems: + newbon->ForageAdditionalItems += base1; + break; case SE_ArcheryDamageModifier: newbon->ArcheryDamageModifier += base1; break; @@ -2192,6 +2195,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne newbon->ConsumeProjectile += effect_value; break; + case SE_ForageAdditionalItems: + newbon->ForageAdditionalItems += effect_value; + break; + case SE_ArcheryDamageModifier: newbon->ArcheryDamageModifier += effect_value; break; @@ -3331,6 +3338,12 @@ void Mob::NegateSpellsBonuses(uint16 spell_id) itembonuses.ConsumeProjectile = effect_value; break; + case SE_ForageAdditionalItems: + spellbonuses.ForageAdditionalItems = effect_value; + aabonuses.ForageAdditionalItems = effect_value; + itembonuses.ForageAdditionalItems = effect_value; + break; + case SE_ArcheryDamageModifier: spellbonuses.ArcheryDamageModifier = effect_value; aabonuses.ArcheryDamageModifier = effect_value; @@ -3473,4 +3486,4 @@ void Mob::NegateSpellsBonuses(uint16 spell_id) } } } -} \ No newline at end of file +} diff --git a/zone/client.h b/zone/client.h index e4ff410aa..2d7aa2ac7 100644 --- a/zone/client.h +++ b/zone/client.h @@ -810,7 +810,7 @@ public: void LogSQL(const char *fmt, ...); bool CanFish(); void GoFish(); - void ForageItem(); + void ForageItem(bool guarantee = false); //Calculate vendor price modifier based on CHA: (reverse==selling) float CalcPriceMod(Mob* other = 0, bool reverse = false); void ResetTrade(); diff --git a/zone/common.h b/zone/common.h index 665627742..df0853309 100644 --- a/zone/common.h +++ b/zone/common.h @@ -345,6 +345,7 @@ struct StatBonuses { bool FrontalBackstabMinDmg; // Allow frontal backstabs for min damage uint8 FrontalBackstabChance; // Chance to backstab from the front for full damage uint8 ConsumeProjectile; // Chance to not consume arrow. + uint8 ForageAdditionalItems; // Chance to forage another item. uint16 ArcheryDamageModifier; // Increase Archery Damage by percent bool SecondaryDmgInc; // Allow off hand weapon to recieve damage bonus. uint16 GiveDoubleAttack; // Allow classes to double attack with a specified chance. diff --git a/zone/forage.cpp b/zone/forage.cpp index 4ffd969d6..388d0c119 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -400,7 +400,7 @@ void Client::GoFish() } } -void Client::ForageItem() { +void Client::ForageItem(bool guarantee) { int skill_level = GetSkill(FORAGE); @@ -417,7 +417,7 @@ void Client::ForageItem() { }; // these may need to be fine tuned, I am just guessing here - if (MakeRandomInt(0,199) < skill_level) { + if (guarantee || MakeRandomInt(0,199) < skill_level) { uint32 foragedfood = 0; uint32 stringid = FORAGE_NOEAT; @@ -476,6 +476,12 @@ void Client::ForageItem() { } parse->EventPlayer(EVENT_FORAGE_SUCCESS, this, "", inst != NULL ? inst->GetItem()->ID : 0); + + int ChanceSecondForage = aabonuses.ForageAdditionalItems + itembonuses.ForageAdditionalItems + spellbonuses.ForageAdditionalItems; + if(!guarantee && MakeRandomInt(0,99) < ChanceSecondForage) { + this->Message_StringID(MT_Skills, FORAGE_MASTERY); + this->ForageItem(true); + } } else { Message_StringID(MT_Skills, FORAGE_FAILED); diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 0f6c0519f..fa64de858 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -2715,6 +2715,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) case SE_SecondaryDmgInc: case SE_ArcheryDamageModifier: case SE_ConsumeProjectile: + case SE_ForageAdditionalItems: case SE_FrontalBackstabChance: case SE_FrontalBackstabMinDmg: case SE_TripleBackstab: