diff --git a/zone/client.h b/zone/client.h index 3be422a2b..1da5b1551 100644 --- a/zone/client.h +++ b/zone/client.h @@ -1125,7 +1125,7 @@ public: int16 mod_pet_power(int16 act_power, uint16 spell_id); float mod_tradeskill_chance(float chance, DBTradeskillRecipe_Struct *spec); float mod_tradeskill_skillup(float chance_stage2); - int32 mod_tribute_item_value(int32 pts); + int32 mod_tribute_item_value(int32 pts, const ItemInst* item); void mod_client_death_npc(Mob* killerMob); void mod_client_death_duel(Mob* killerMob); void mod_client_death_env(); diff --git a/zone/mod_functions.cpp b/zone/mod_functions.cpp index a6088ee02..6d6d6cbbb 100644 --- a/zone/mod_functions.cpp +++ b/zone/mod_functions.cpp @@ -314,7 +314,7 @@ float Client::mod_tradeskill_skillup(float chance_stage2) { } //Tribute value override -int32 Client::mod_tribute_item_value(int32 pts) { +int32 Client::mod_tribute_item_value(int32 pts, const ItemInst* item) { return(0); } diff --git a/zone/mod_functions_base.cpp b/zone/mod_functions_base.cpp index af228ed9e..94750a184 100644 --- a/zone/mod_functions_base.cpp +++ b/zone/mod_functions_base.cpp @@ -23,33 +23,71 @@ extern WorldServer worldserver; using namespace std; +//All functions that modify a value are passed the value as it was computed by default formulas and bonuses. In most cases this should be the final value that will be used. + +//These are called when a zone boots or is repopped void Zone::mod_init() { return; } void Zone::mod_repop() { return; } +//Pre-spawn hook called from the NPC object to be spawned void NPC::mod_prespawn(Spawn2 *sp) { return; } -int NPC::mod_npc_damage(int damage, SkillType skillinuse, int hand, ItemInst* weapon, Mob* other) { return(damage); } + +//Base damage from NPC::Attack +int NPC::mod_npc_damage(int damage, SkillType skillinuse, int hand, const Item_Struct* weapon, Mob* other) { return(damage); } void NPC::mod_npc_killed_merit(Mob* c) { return; } void NPC::mod_npc_killed(Mob* oos) { return; } -int Client::mod_client_damage(int damage, SkillType skillinuse, int hand, ItemInst* weapon, Mob* other) { return(damage); } +//Base damage from Client::Attack - can cover myriad skill types +int Client::mod_client_damage(int damage, SkillType skillinuse, int hand, const ItemInst* weapon, Mob* other) { return(final); } + +//message is char[4096], don't screw it up. bool Client::mod_client_message(char* message, uint8 chan_num) { return(true); } //Potentially dangerous string handling here + +//Skillup override. When this is called the regular skillup check has failed. Return false to proceed with default behavior. +//This will NOT allow a client to increase skill past a cap. bool Client::mod_can_increase_skill(SkillType skillid, Mob* against_who) { return(false); } + +//chance of general skill increase, rolled against 0-99 where higher chance is better. int16 Client::mod_increase_skill_chance(int16 chance, Mob* against_who) { return(chance); } + +//Max percent of health you can bind wound starting with default value for class, item, and AA bonuses int Client::mod_bindwound_percent(int max_percent, Mob* bindmob) { return(max_percent); } + +//Final bind HP value after bonuses int Client::mod_bindwound_hp(int bindhps, Mob* bindmob) { return(bindhps); } + +//Client haste as calculated by default formulas - In percent from 0-100 int Client::mod_client_haste(int h) { return(h); } + void Client::mod_consider(Mob* tmob, Consider_Struct* con) { return; } bool Client::mod_saylink(const std::string&, bool silentsaylink) { return(true); } + +//Client pet power as calculated by default formulas and bonuses int16 Client::mod_pet_power(int16 act_power, uint16 spell_id) { return(act_power); } + +//Chance to combine rolled against a random 0-99 where higher is better. float Client::mod_tradeskill_chance(float chance, DBTradeskillRecipe_Struct *spec) { return(chance); } + +//Chance to skillup rolled against a random 0-99 where higher is better. float Client::mod_tradeskill_skillup(float chance_stage2) { return(chance_stage2); } -int32 Client::mod_tribute_item_value(int32 pts) { return(pts); } + +//Item Tribute value override -- Need to pass the item, duh. +int32 Client::mod_tribute_item_value(int32 pts, const ItemInst* item) { return(pts); } + +//Death reporting void Client::mod_client_death_npc(Mob* killerMob) { return; } void Client::mod_client_death_duel(Mob* killerMob) { return; } void Client::mod_client_death_env() { return; } +//Calculated xp before consider modifier +int32 Client::mod_client_xp(int32 in_xp, NPC *npc) { return(in_xp); } + +//effect_vallue - Spell effect value as calculated by default formulas. You will want to ignore effects that don't lend themselves to scaling - pet ID's, gate coords, etc. int Mob::mod_effect_value(int effect_value, uint16 spell_id, int effect_type, Mob* caster) { return(effect_value); } + +//chancetohit - 0 to 100 percent - set over 1000 for a guaranteed hit float Mob::mod_hit_chance(float chancetohit, SkillType skillinuse, Mob* attacker) { return(chancetohit); } + float Mob::mod_riposte_chance(float ripostechance, Mob* attacker) { return(ripostechance); } float Mob::mod_block_chance(float blockchance, Mob* attacker) { return(blockchance); } float Mob::mod_parry_chance(float parrychance, Mob* attacker) { return(parrychance); } @@ -57,16 +95,46 @@ float Mob::mod_dodge_chance(float dodgechance, Mob* attacker) { return(dodgechan float Mob::mod_monk_weight(float monkweight, Mob* attacker) { return(monkweight); } float Mob::mod_mitigation_rating(float mitigation_rating, Mob* attacker) { return(mitigation_rating); } float Mob::mod_attack_rating(float attack_rating, Mob* defender) { return(attack_rating); } + +//Kick damage after all other bonuses are applied int32 Mob::mod_kick_damage(int32 dmg) { return(dmg); } + +//Slam and bash damage after all other bonuses are applied int32 Mob::mod_bash_damage(int32 dmg) { return(dmg); } + +//Frenzy damage after all other bonuses are applied int32 Mob::mod_frenzy_damage(int32 dmg) { return(dmg); } + +//Special attack damage after all other bonuses are applied. int32 Mob::mod_monk_special_damage(int32 ndamage, SkillType skill_type) { return(ndamage); } + +//ndamage - Backstab damage as calculated by default formulas int32 Mob::mod_backstab_damage(int32 ndamage) { return(ndamage); } + +//Chance for 50+ archery bonus damage if Combat:UseArcheryBonusRoll is true. Base is Combat:ArcheryBonusChance int Mob::mod_archery_bonus_chance(int bonuschance, const ItemInst* RangeWeapon) { return(bonuschance); } -uint32 Mob::mod_archery_bonus_damage(uint32 MaxDmg) { return(MaxDmg); } -int32 Mob::mod_archery_damage(int32 TotalDmg, bool hasbonus) { return(TotalDmg); } + +//Archery bonus damage +uint32 Mob::mod_archery_bonus_damage(uint32 MaxDmg, const ItemInst* RangeWeapon) { return(MaxDmg); } + +//Final archery damage including bonus if it was applied. +int32 Mob::mod_archery_damage(int32 TotalDmg, bool hasbonus, const ItemInst* RangeWeapon) { return(TotalDmg); } + +//Thrown weapon damage after all other calcs uint16 Mob::mod_throwing_damage(uint16 MaxDmg) { return(MaxDmg); } + int32 Mob::mod_cast_time(int32 cast_time) { return(cast_time); } + +//res - Default buff duration formula int Mob::mod_buff_duration(int res, Mob* caster, Mob* target, uint16 spell_id) { return(res); } + +//Spell stack override - If this returns anything < 2, it will ignore all other stacking rules. +// See spells.cpp: Mob::CheckStackConflict +// 0 - No conflict +// 1 - Overwrite, spellid1 is replaced by spellid2 +// -1 - Blocked, spellid2 will not land +// 2 - Default stacking behavior int Mob::mod_spell_stack(uint16 spellid1, int caster_level1, Mob* caster1, uint16 spellid2, int caster_level2, Mob* caster2) { return(2); } + +//Sum of various resists rolled against a value of 200. int Mob::mod_spell_resist(int resist_chance, int level_mod, int resist_modifier, int target_resist, uint8 resist_type, uint16 spell_id, Mob* caster) { return(resist_chance + level_mod + resist_modifier + target_resist); } diff --git a/zone/tribute.cpp b/zone/tribute.cpp index 9d864a72d..b536ecdf9 100644 --- a/zone/tribute.cpp +++ b/zone/tribute.cpp @@ -252,7 +252,7 @@ int32 Client::TributeItem(uint32 slot, uint32 quantity) { //figure out what its worth int32 pts = inst->GetItem()->Favor; - pts = mod_tribute_item_value(pts); + pts = mod_tribute_item_value(pts, m_inv[slot]); if(pts < 1) { Message(13, "This item is worthless for favor.");