mirror of
https://github.com/EQEmu/Server.git
synced 2026-02-25 05:12:25 +00:00
Updated mod_functions and mod_functions_base with new hooks and descriptions
This commit is contained in:
parent
567c17cc9e
commit
851c842529
File diff suppressed because it is too large
Load Diff
@ -13,6 +13,8 @@
|
||||
#include "client.h"
|
||||
#include "worldserver.h"
|
||||
#include "QuestParserCollection.h"
|
||||
#include "event_codes.h"
|
||||
#include "embparser.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
@ -21,8 +23,6 @@ extern Zone* zone;
|
||||
|
||||
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
|
||||
@ -34,14 +34,31 @@ void NPC::mod_prespawn(Spawn2 *sp) { return; }
|
||||
|
||||
//Base damage from NPC::Attack
|
||||
int NPC::mod_npc_damage(int damage, SkillType skillinuse, int hand, const Item_Struct* weapon, Mob* other) { return(damage); }
|
||||
|
||||
//Mob c has been given credit for a kill. This is called after the regular EVENT_KILLED_MERIT event.
|
||||
void NPC::mod_npc_killed_merit(Mob* c) { return; }
|
||||
|
||||
//Mob oos has been given credit for a kill. This is called after the regular EVENT_DEATH event.
|
||||
void NPC::mod_npc_killed(Mob* oos) { return; }
|
||||
|
||||
//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); }
|
||||
int Client::mod_client_damage(int damage, SkillType skillinuse, int hand, const ItemInst* weapon, Mob* other) { return(damage); }
|
||||
|
||||
//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
|
||||
//message is char[4096], don't screw it up. Return true for normal behavior, false to return immediately.
|
||||
// Channels:
|
||||
// 0 - Guild Chat
|
||||
// 2 - Group Chat
|
||||
// 3 - Shout
|
||||
// 4 - Auction
|
||||
// 5 - Out of Character
|
||||
// 6 - Broadcast
|
||||
// 7 - Tell
|
||||
// 8 - Say
|
||||
// 11 - GMSay
|
||||
// 15 - Raid Chat
|
||||
// 20 - UCS Relay for UF client and later
|
||||
// 22 - Emotes for UF and later
|
||||
bool Client::mod_client_message(char* message, uint8 chan_num) { return(true); }
|
||||
|
||||
//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.
|
||||
@ -59,8 +76,14 @@ 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); }
|
||||
|
||||
//Haste cap override
|
||||
int Client::mod_client_haste_cap(int cap) { return(cap); }
|
||||
|
||||
//This is called when a client cons a mob
|
||||
void Client::mod_consider(Mob* tmob, Consider_Struct* con) { return; }
|
||||
bool Client::mod_saylink(const std::string&, bool silentsaylink) { return(true); }
|
||||
|
||||
//Return true to continue with normal behavior, false returns in the parent function
|
||||
bool Client::mod_saylink(const std::string& response, 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); }
|
||||
@ -71,7 +94,7 @@ float Client::mod_tradeskill_chance(float chance, DBTradeskillRecipe_Struct *spe
|
||||
//Chance to skillup rolled against a random 0-99 where higher is better.
|
||||
float Client::mod_tradeskill_skillup(float chance_stage2) { return(chance_stage2); }
|
||||
|
||||
//Item Tribute value override -- Need to pass the item, duh.
|
||||
//Tribute value override
|
||||
int32 Client::mod_tribute_item_value(int32 pts, const ItemInst* item) { return(pts); }
|
||||
|
||||
//Death reporting
|
||||
@ -79,20 +102,37 @@ 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
|
||||
//Calculated xp before consider modifier, called whenever a client gets XP for killing a mob.
|
||||
int32 Client::mod_client_xp(int32 in_xp, NPC *npc) { return(in_xp); }
|
||||
|
||||
//Client XP formula. Changes here will cause clients to change level after gaining or losing xp.
|
||||
//Either modify this before your server goes live, or be prepared to write a quest script that fixes levels.
|
||||
//To adjust how much XP is given per kill, use mod_client_xp
|
||||
uint32 Client::mod_client_xp_for_level(uint32 xp, uint16 check_level) { return(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); }
|
||||
|
||||
//Final riposte chance
|
||||
float Mob::mod_riposte_chance(float ripostechance, Mob* attacker) { return(ripostechance); }
|
||||
|
||||
//Final block chance
|
||||
float Mob::mod_block_chance(float blockchance, Mob* attacker) { return(blockchance); }
|
||||
|
||||
//Final parry chance
|
||||
float Mob::mod_parry_chance(float parrychance, Mob* attacker) { return(parrychance); }
|
||||
|
||||
//Final dodge chance
|
||||
float Mob::mod_dodge_chance(float dodgechance, Mob* attacker) { return(dodgechance); }
|
||||
|
||||
//Monk AC Bonus weight cap. Defined in Combat:MonkACBonusWeight
|
||||
//Usually 15, a monk under this weight threshold gets an AC bonus
|
||||
float Mob::mod_monk_weight(float monkweight, Mob* attacker) { return(monkweight); }
|
||||
|
||||
//Mitigation rating is compared to incoming attack rating. Higher is better.
|
||||
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); }
|
||||
|
||||
@ -123,6 +163,7 @@ int32 Mob::mod_archery_damage(int32 TotalDmg, bool hasbonus, const ItemInst* Ran
|
||||
//Thrown weapon damage after all other calcs
|
||||
uint16 Mob::mod_throwing_damage(uint16 MaxDmg) { return(MaxDmg); }
|
||||
|
||||
//Spell cast time in milliseconds - will not sync with client cast time bar, but does work.
|
||||
int32 Mob::mod_cast_time(int32 cast_time) { return(cast_time); }
|
||||
|
||||
//res - Default buff duration formula
|
||||
@ -137,4 +178,14 @@ int Mob::mod_buff_duration(int res, Mob* caster, Mob* target, uint16 spell_id) {
|
||||
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); }
|
||||
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) {
|
||||
int final = resist_chance + level_mod + resist_modifier + target_resist;
|
||||
return(final);
|
||||
}
|
||||
|
||||
//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; }
|
||||
|
||||
//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; }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user