mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
[Cleanup] Remove Unused Mod Hooks (#2856)
- Removes old `mod_` hooks that have gone unused for years in favor of Lua mods.
This commit is contained in:
parent
0f49fbcfcd
commit
85f7b10f90
@ -97,7 +97,6 @@ SET(zone_sources
|
||||
mob_appearance.cpp
|
||||
mob_movement_manager.cpp
|
||||
mob_info.cpp
|
||||
mod_functions.cpp
|
||||
npc.cpp
|
||||
npc_ai.cpp
|
||||
npc_scale_manager.cpp
|
||||
|
||||
11
zone/aa.cpp
11
zone/aa.cpp
@ -59,7 +59,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u
|
||||
if (IsOfClientBot()) {
|
||||
act_power = GetFocusEffect(focusPetPower, spell_id);
|
||||
if (IsClient()) {
|
||||
act_power = CastToClient()->mod_pet_power(act_power, spell_id);
|
||||
act_power = CastToClient()->GetFocusEffect(focusPetPower, spell_id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -302,15 +302,6 @@ void Mob::WakeTheDead(uint16 spell_id, Corpse *corpse_to_use, Mob *target, uint3
|
||||
return;
|
||||
}
|
||||
|
||||
/* TODO: Does WTD use pet focus?
|
||||
int act_power = 0;
|
||||
|
||||
if (IsClient()) {
|
||||
act_power = CastToClient()->GetFocusEffect(focusPetPower, spell_id);
|
||||
act_power = CastToClient()->mod_pet_power(act_power, spell_id);
|
||||
}
|
||||
*/
|
||||
|
||||
SwarmPet_Struct pet;
|
||||
pet.count = 1;
|
||||
pet.duration = 1;
|
||||
|
||||
@ -520,7 +520,7 @@ bool Mob::CheckWillAggro(Mob *mob) {
|
||||
) {
|
||||
if(CheckLosFN(mob)) {
|
||||
LogAggro("Check aggro for [{}] target [{}]", GetName(), mob->GetName());
|
||||
return mod_will_aggro(mob, this);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (
|
||||
@ -548,7 +548,7 @@ bool Mob::CheckWillAggro(Mob *mob) {
|
||||
) {
|
||||
if(CheckLosFN(mob)) {
|
||||
LogAggro("Check aggro for [{}] target [{}]", GetName(), mob->GetName());
|
||||
return mod_will_aggro(mob, this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1824,8 +1824,6 @@ bool Client::Death(Mob* killerMob, int64 damage, uint16 spell, EQ::skills::Skill
|
||||
parse->EventNPC(EVENT_SLAY, killerMob->CastToNPC(), this, "", 0);
|
||||
}
|
||||
|
||||
mod_client_death_npc(killerMob);
|
||||
|
||||
auto emote_id = killerMob->GetEmoteID();
|
||||
if (emote_id) {
|
||||
killerMob->CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::KilledPC, emoteid);
|
||||
@ -1855,9 +1853,6 @@ bool Client::Death(Mob* killerMob, int64 damage, uint16 spell, EQ::skills::Skill
|
||||
killerMob->CastToClient()->SetDueling(false);
|
||||
killerMob->CastToClient()->SetDuelTarget(0);
|
||||
entity_list.DuelMessage(killerMob, this, false);
|
||||
|
||||
mod_client_death_duel(killerMob);
|
||||
|
||||
}
|
||||
else {
|
||||
//otherwise, we just died, end the duel.
|
||||
@ -2260,8 +2255,6 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
||||
otherlevel = otherlevel ? otherlevel : 1;
|
||||
mylevel = mylevel ? mylevel : 1;
|
||||
|
||||
//damage = mod_npc_damage(damage, skillinuse, Hand, weapon, other);
|
||||
|
||||
my_hit.base_damage = GetBaseDamage() + eleBane;
|
||||
my_hit.min_damage = GetMinDamage();
|
||||
int32 hate = my_hit.base_damage + my_hit.min_damage;
|
||||
@ -2545,7 +2538,6 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
Raid *kr = entity_list.GetRaidByClient(give_exp_client);
|
||||
|
||||
int64 finalxp = give_exp_client->GetExperienceForKill(this);
|
||||
finalxp = give_exp_client->mod_client_xp(finalxp, this);
|
||||
|
||||
// handle task credit on behalf of the killer
|
||||
if (RuleB(TaskSystem, EnableTaskSystem)) {
|
||||
@ -2577,8 +2569,6 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
if (RuleB(NPC, EnableMeritBasedFaction))
|
||||
c->SetFactionLevel(c->CharacterID(), GetNPCFactionID(), c->GetBaseClass(), c->GetBaseRace(), c->GetDeity());
|
||||
|
||||
mod_npc_killed_merit(kr->members[i].member);
|
||||
|
||||
PlayerCount++;
|
||||
}
|
||||
}
|
||||
@ -2629,8 +2619,6 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
if (RuleB(NPC, EnableMeritBasedFaction))
|
||||
c->SetFactionLevel(c->CharacterID(), GetNPCFactionID(), c->GetBaseClass(), c->GetBaseRace(), c->GetDeity());
|
||||
|
||||
mod_npc_killed_merit(c);
|
||||
|
||||
PlayerCount++;
|
||||
}
|
||||
}
|
||||
@ -2680,8 +2668,6 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
give_exp_client->SetFactionLevel(give_exp_client->CharacterID(), GetNPCFactionID(), give_exp_client->GetBaseClass(),
|
||||
give_exp_client->GetBaseRace(), give_exp_client->GetDeity());
|
||||
|
||||
mod_npc_killed_merit(give_exp_client);
|
||||
|
||||
// QueryServ Logging - Solo
|
||||
if (RuleB(QueryServ, PlayerLogNPCKills)) {
|
||||
auto pack = new ServerPacket(ServerOP_QSPlayerLogNPCKills,
|
||||
@ -2817,8 +2803,6 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
|
||||
// Parse quests even if we're killed by an NPC
|
||||
if (oos) {
|
||||
mod_npc_killed(oos);
|
||||
|
||||
if (IsNPC()) {
|
||||
auto emote_id = GetEmoteID();
|
||||
if (emote_id) {
|
||||
|
||||
@ -922,9 +922,6 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
//Return true to proceed, false to return
|
||||
if(!mod_client_message(message, chan_num)) { return; }
|
||||
|
||||
// Garble the message based on drunkness
|
||||
if (m_pp.intoxication > 0 && !(RuleB(Chat, ServerWideOOC) && chan_num == ChatChannel_OOC) && !GetGM()) {
|
||||
GarbleMessage(message, (int)(m_pp.intoxication / 3));
|
||||
@ -2544,10 +2541,7 @@ bool Client::CheckIncreaseSkill(EQ::skills::SkillType skillid, Mob *against_who,
|
||||
against_who->IsClient() ||
|
||||
GetLevelCon(against_who->GetLevel()) == CON_GRAY
|
||||
) {
|
||||
//false by default
|
||||
if (!mod_can_increase_skill(skillid, against_who)) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2564,7 +2558,6 @@ bool Client::CheckIncreaseSkill(EQ::skills::SkillType skillid, Mob *against_who,
|
||||
// This result is increased by the existing SkillUpModifier rule
|
||||
double working_chance = (((RuleI(Character, SkillUpMaximumChancePercentage) - RuleI(Character, SkillUpMinimumChancePercentage) + chancemodi) * (pow(0.99, skillval))) + RuleI(Character, SkillUpMinimumChancePercentage));
|
||||
Chance = (working_chance * RuleI(Character, SkillUpModifier) / 100);
|
||||
Chance = mod_increase_skill_chance(Chance, against_who);
|
||||
}
|
||||
|
||||
if(zone->random.Real(0, 99) < Chance)
|
||||
@ -2961,8 +2954,6 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail)
|
||||
max_percent = 70 + maxHPBonus;
|
||||
}
|
||||
|
||||
max_percent = mod_bindwound_percent(max_percent, bindmob);
|
||||
|
||||
int64 max_hp = bindmob->GetMaxHP() * max_percent / 100;
|
||||
|
||||
// send bindmob new hp's
|
||||
@ -2983,8 +2974,6 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail)
|
||||
|
||||
bindhps += bindhps * bindBonus / 100;
|
||||
|
||||
bindhps = mod_bindwound_hp(bindhps, bindmob);
|
||||
|
||||
// if the bind takes them above the max bindable
|
||||
// cap it at that value. Dont know if live does it this way
|
||||
// but it makes sense to me.
|
||||
@ -3026,8 +3015,6 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail)
|
||||
if (max_percent > 100)
|
||||
max_percent = 100;
|
||||
|
||||
max_percent = mod_bindwound_percent(max_percent, bindmob);
|
||||
|
||||
int max_hp = (bindmob->GetMaxHP() * max_percent) / 100;
|
||||
if (max_hp > bindmob->GetMaxHP())
|
||||
max_hp = bindmob->GetMaxHP();
|
||||
@ -3048,8 +3035,6 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail)
|
||||
if (bindhps < 3)
|
||||
bindhps = 3;
|
||||
|
||||
bindhps = mod_bindwound_hp(bindhps, bindmob);
|
||||
|
||||
bindhps += bindmob->GetHP();
|
||||
if (bindhps > max_hp)
|
||||
bindhps = max_hp;
|
||||
@ -8387,8 +8372,6 @@ void Client::Consume(const EQ::ItemData *item, uint8 type, int16 slot, bool auto
|
||||
return;
|
||||
|
||||
if (type == EQ::item::ItemTypeFood) {
|
||||
increase = mod_food_value(item, increase);
|
||||
|
||||
if (increase < 0)
|
||||
return;
|
||||
|
||||
@ -8404,8 +8387,6 @@ void Client::Consume(const EQ::ItemData *item, uint8 type, int16 slot, bool auto
|
||||
LogFood("Eating from slot: [{}]", (int)slot);
|
||||
|
||||
} else {
|
||||
increase = mod_drink_value(item, increase);
|
||||
|
||||
if (increase < 0)
|
||||
return;
|
||||
|
||||
|
||||
@ -1598,28 +1598,6 @@ public:
|
||||
void Consume(const EQ::ItemData *item, uint8 type, int16 slot, bool auto_consume);
|
||||
void PlayMP3(const char* fname);
|
||||
void ExpeditionSay(const char *str, int ExpID);
|
||||
int mod_client_damage(int64 damage, EQ::skills::SkillType skillinuse, int hand, const EQ::ItemInstance* weapon, Mob* other);
|
||||
bool mod_client_message(char* message, uint8 chan_num);
|
||||
bool mod_can_increase_skill(EQ::skills::SkillType skillid, Mob* against_who);
|
||||
double mod_increase_skill_chance(double chance, Mob* against_who);
|
||||
int mod_bindwound_percent(int max_percent, Mob* bindmob);
|
||||
int mod_bindwound_hp(int bindhps, Mob* bindmob);
|
||||
int mod_client_haste(int h);
|
||||
void mod_consider(Mob* tmob, Consider_Struct* con);
|
||||
bool mod_saylink(const std::string&, bool silentsaylink);
|
||||
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, const EQ::ItemInstance* item);
|
||||
void mod_client_death_npc(Mob* killerMob);
|
||||
void mod_client_death_duel(Mob* killerMob);
|
||||
void mod_client_death_env();
|
||||
int64 mod_client_xp(int64 in_exp, NPC *npc);
|
||||
uint32 mod_client_xp_for_level(uint32 xp, uint16 check_level);
|
||||
int mod_client_haste_cap(int cap);
|
||||
int mod_consume(EQ::ItemData *item, EQ::item::ItemType type, int change);
|
||||
int mod_food_value(const EQ::ItemData *item, int change);
|
||||
int mod_drink_value(const EQ::ItemData *item, int change);
|
||||
|
||||
inline int32 GetEnvironmentDamageModifier() const { return environment_damage_modifier; }
|
||||
void SetEnvironmentDamageModifier(int32 val) { environment_damage_modifier = val; }
|
||||
|
||||
@ -1047,7 +1047,6 @@ int Client::CalcHaste()
|
||||
else { // 1-50
|
||||
cap = level + 25;
|
||||
}
|
||||
cap = mod_client_haste_cap(cap);
|
||||
if (h > cap) {
|
||||
h = cap;
|
||||
}
|
||||
@ -1064,7 +1063,6 @@ int Client::CalcHaste()
|
||||
h += spellbonuses.hastetype3 > 10 ? 10 : spellbonuses.hastetype3;
|
||||
}
|
||||
h += ExtraHaste; //GM granted haste.
|
||||
h = mod_client_haste(h);
|
||||
Haste = 100 + h;
|
||||
return Haste;
|
||||
}
|
||||
|
||||
@ -5115,8 +5115,6 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app)
|
||||
con->faction = FACTION_DUBIOUSLY;
|
||||
}
|
||||
|
||||
mod_consider(t, con);
|
||||
|
||||
QueuePacket(outapp);
|
||||
// only wanted to check raid target once
|
||||
// and need con to still be around so, do it here!
|
||||
@ -6204,7 +6202,6 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app)
|
||||
}
|
||||
|
||||
if (GetHP() <= 0) {
|
||||
mod_client_death_env();
|
||||
Death(0, 32000, SPELL_UNKNOWN, EQ::skills::SkillHandtoHand);
|
||||
}
|
||||
SendHPUpdate();
|
||||
@ -8736,10 +8733,6 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app)
|
||||
}
|
||||
|
||||
if (!response.empty()) {
|
||||
if (!mod_saylink(response, silentsaylink)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ChannelMessageReceived(ChatChannel_Say, 0, 100, response.c_str(), nullptr, true);
|
||||
|
||||
if (!silentsaylink) {
|
||||
|
||||
@ -1066,8 +1066,6 @@ uint32 Client::GetEXPForLevel(uint16 check_level)
|
||||
finalxp = uint64(finalxp * classmod);
|
||||
}
|
||||
|
||||
finalxp = mod_client_xp_for_level(finalxp, check_level);
|
||||
|
||||
return finalxp;
|
||||
}
|
||||
|
||||
|
||||
39
zone/mob.h
39
zone/mob.h
@ -1323,45 +1323,6 @@ public:
|
||||
inline uint32 GetEmoteID() { return emoteid; }
|
||||
|
||||
bool HasSpellEffect(int effect_id);
|
||||
int mod_effect_value(int effect_value, uint16 spell_id, int effect_type, Mob *caster, uint16 caster_id);
|
||||
float mod_hit_chance(float chancetohit, EQ::skills::SkillType skillinuse, Mob *attacker);
|
||||
float mod_riposte_chance(float ripostchance, Mob *attacker);
|
||||
float mod_block_chance(float blockchance, Mob *attacker);
|
||||
float mod_parry_chance(float parrychance, Mob *attacker);
|
||||
float mod_dodge_chance(float dodgechance, Mob *attacker);
|
||||
float mod_monk_weight(float monkweight, Mob *attacker);
|
||||
float mod_mitigation_rating(float mitigation_rating, Mob *attacker);
|
||||
float mod_attack_rating(float attack_rating, Mob *defender);
|
||||
int64 mod_kick_damage(int64 dmg);
|
||||
int64 mod_bash_damage(int64 dmg);
|
||||
int64 mod_frenzy_damage(int64 dmg);
|
||||
int64 mod_monk_special_damage(int64 ndamage, EQ::skills::SkillType skill_type);
|
||||
int64 mod_backstab_damage(int64 ndamage);
|
||||
int64 mod_archery_bonus_chance(int bonuschance, const EQ::ItemInstance *RangeWeapon);
|
||||
uint64 mod_archery_bonus_damage(uint64 MaxDmg, const EQ::ItemInstance *RangeWeapon);
|
||||
int64 mod_archery_damage(int64 TotalDmg, bool hasbonus, const EQ::ItemInstance *RangeWeapon);
|
||||
uint64 mod_throwing_damage(uint64 MaxDmg);
|
||||
int32 mod_cast_time(int32 cast_time);
|
||||
int mod_buff_duration(int res, Mob *caster, Mob *target, uint16 spell_id);
|
||||
int mod_spell_stack(uint16 spellid1, int caster_level1, Mob *caster1, uint16 spellid2, int caster_level2, Mob *caster2);
|
||||
int mod_spell_resist(
|
||||
int resist_chance,
|
||||
int level_mod,
|
||||
int resist_modifier,
|
||||
int target_resist,
|
||||
uint8 resist_type,
|
||||
uint16 spell_id,
|
||||
Mob *caster
|
||||
);
|
||||
void mod_spell_cast(
|
||||
uint16 spell_id,
|
||||
Mob *spelltar,
|
||||
bool reflect,
|
||||
bool use_resist_adjust,
|
||||
int16 resist_adjust,
|
||||
bool isproc
|
||||
);
|
||||
bool mod_will_aggro(Mob *attacker, Mob *on);
|
||||
|
||||
//Command #Tune functions
|
||||
void TuneGetStats(Mob* defender, Mob *attacker);
|
||||
|
||||
@ -1,188 +0,0 @@
|
||||
#include "client.h"
|
||||
#include "entity.h"
|
||||
#include "mob.h"
|
||||
#include "npc.h"
|
||||
#include "worldserver.h"
|
||||
#include "zone.h"
|
||||
|
||||
class Spawn2;
|
||||
struct Consider_Struct;
|
||||
struct DBTradeskillRecipe_Struct;
|
||||
|
||||
namespace EQ
|
||||
{
|
||||
class ItemInstance;
|
||||
}
|
||||
|
||||
extern EntityList entity_list;
|
||||
extern Zone* zone;
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
//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; }
|
||||
|
||||
//Base damage from NPC::Attack
|
||||
int NPC::mod_npc_damage(int64 damage, EQ::skills::SkillType skillinuse, int hand, const EQ::ItemData* 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(int64 damage, EQ::skills::SkillType skillinuse, int hand, const EQ::ItemInstance* weapon, Mob* other) { return(damage); }
|
||||
|
||||
//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.
|
||||
bool Client::mod_can_increase_skill(EQ::skills::SkillType skillid, Mob* against_who) { return(false); }
|
||||
|
||||
//chance of general skill increase, rolled against 0-99 where higher chance is better.
|
||||
double Client::mod_increase_skill_chance(double 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); }
|
||||
|
||||
//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; }
|
||||
|
||||
//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); }
|
||||
|
||||
//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); }
|
||||
|
||||
//Tribute value override
|
||||
int32 Client::mod_tribute_item_value(int32 pts, const EQ::ItemInstance* 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, called whenever a client gets XP for killing a mob.
|
||||
int64 Client::mod_client_xp(int64 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); }
|
||||
|
||||
//Food and drink values as computed by consume requests. Return < 0 to abort the request.
|
||||
int Client::mod_food_value(const EQ::ItemData *item, int change) { return(change); }
|
||||
int Client::mod_drink_value(const EQ::ItemData *item, int change) { return(change); }
|
||||
|
||||
//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, uint16 caster_id) { return(effect_value); }
|
||||
|
||||
//chancetohit - 0 to 100 percent - set over 1000 for a guaranteed hit
|
||||
float Mob::mod_hit_chance(float chancetohit, EQ::skills::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); }
|
||||
|
||||
//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); }
|
||||
|
||||
//Kick damage after all other bonuses are applied
|
||||
int64 Mob::mod_kick_damage(int64 dmg) { return(dmg); }
|
||||
|
||||
//Slam and bash damage after all other bonuses are applied
|
||||
int64 Mob::mod_bash_damage(int64 dmg) { return(dmg); }
|
||||
|
||||
//Frenzy damage after all other bonuses are applied
|
||||
int64 Mob::mod_frenzy_damage(int64 dmg) { return(dmg); }
|
||||
|
||||
//Special attack damage after all other bonuses are applied.
|
||||
int64 Mob::mod_monk_special_damage(int64 ndamage, EQ::skills::SkillType skill_type) { return(ndamage); }
|
||||
|
||||
//ndamage - Backstab damage as calculated by default formulas
|
||||
int64 Mob::mod_backstab_damage(int64 ndamage) { return(ndamage); }
|
||||
|
||||
//Chance for 50+ archery bonus damage if Combat:UseArcheryBonusRoll is true.
|
||||
int64 Mob::mod_archery_bonus_chance(int bonuschance, const EQ::ItemInstance* RangeWeapon) { return(bonuschance); }
|
||||
|
||||
//Archery bonus damage
|
||||
uint64 Mob::mod_archery_bonus_damage(uint64 MaxDmg, const EQ::ItemInstance* RangeWeapon) { return(MaxDmg); }
|
||||
|
||||
//Final archery damage including bonus if it was applied.
|
||||
int64 Mob::mod_archery_damage(int64 TotalDmg, bool hasbonus, const EQ::ItemInstance* RangeWeapon) { return(TotalDmg); }
|
||||
|
||||
//Thrown weapon damage after all other calcs
|
||||
uint64 Mob::mod_throwing_damage(uint64 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
|
||||
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);
|
||||
}
|
||||
|
||||
//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; }
|
||||
|
||||
//At this point all applicable aggro checks have succeeded. Attacker should aggro unless we return false.
|
||||
bool Mob::mod_will_aggro(Mob *attacker, Mob *on) { return(true); }
|
||||
@ -1,187 +0,0 @@
|
||||
#include "../common/debug.h"
|
||||
#include "../common/timer.h"
|
||||
#include <cmath>
|
||||
#include <stdlib.h>
|
||||
#include "spawn2.h"
|
||||
#include "entity.h"
|
||||
#include "masterentity.h"
|
||||
#include "zone.h"
|
||||
#include "spawngroup.h"
|
||||
#include "zonedb.h"
|
||||
#include "../common/zone_store.h"
|
||||
#include "npc.h"
|
||||
#include "mob.h"
|
||||
#include "client.h"
|
||||
#include "worldserver.h"
|
||||
#include "quest_parser_collection.h"
|
||||
#include "event_codes.h"
|
||||
#include "embparser.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
extern EntityList entity_list;
|
||||
extern Zone* zone;
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
//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; }
|
||||
|
||||
//Base damage from NPC::Attack
|
||||
int NPC::mod_npc_damage(int64 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(int64 damage, SkillType skillinuse, int hand, const ItemInst* weapon, Mob* other) { return(damage); }
|
||||
|
||||
//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.
|
||||
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); }
|
||||
|
||||
//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; }
|
||||
|
||||
//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); }
|
||||
|
||||
//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); }
|
||||
|
||||
//Tribute value override
|
||||
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, called whenever a client gets XP for killing a mob.
|
||||
int64 Client::mod_client_xp(int64 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); }
|
||||
|
||||
//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); }
|
||||
|
||||
//Kick damage after all other bonuses are applied
|
||||
int64 Mob::mod_kick_damage(int64 dmg) { return(dmg); }
|
||||
|
||||
//Slam and bash damage after all other bonuses are applied
|
||||
int64 Mob::mod_bash_damage(int64 dmg) { return(dmg); }
|
||||
|
||||
//Frenzy damage after all other bonuses are applied
|
||||
int64 Mob::mod_frenzy_damage(int64 dmg) { return(dmg); }
|
||||
|
||||
//Special attack damage after all other bonuses are applied.
|
||||
int64 Mob::mod_monk_special_damage(int64 ndamage, EQ::skills::SkillType skill_type) { return(ndamage); }
|
||||
|
||||
//ndamage - Backstab damage as calculated by default formulas
|
||||
int64 Mob::mod_backstab_damage(int64 ndamage) { return(ndamage); }
|
||||
|
||||
//Chance for 50+ archery bonus damage if Combat:UseArcheryBonusRoll is true.
|
||||
int64 Mob::mod_archery_bonus_chance(int bonuschance, const ItemInst* RangeWeapon) { return(bonuschance); }
|
||||
|
||||
//Archery bonus damage
|
||||
uint64 Mob::mod_archery_bonus_damage(uint64 MaxDmg, const ItemInst* RangeWeapon) { return(MaxDmg); }
|
||||
|
||||
//Final archery damage including bonus if it was applied.
|
||||
int64 Mob::mod_archery_damage(int64 TotalDmg, bool hasbonus, const ItemInst* RangeWeapon) { return(TotalDmg); }
|
||||
|
||||
//Thrown weapon damage after all other calcs
|
||||
uint64 Mob::mod_throwing_damage(uint64 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
|
||||
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) {
|
||||
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; }
|
||||
@ -477,10 +477,6 @@ public:
|
||||
|
||||
uint32 GetSpawnKillCount();
|
||||
int GetScore();
|
||||
void mod_prespawn(Spawn2 *sp);
|
||||
int mod_npc_damage(int64 damage, EQ::skills::SkillType skillinuse, int hand, const EQ::ItemData* weapon, Mob* other);
|
||||
void mod_npc_killed_merit(Mob* c);
|
||||
void mod_npc_killed(Mob* oos);
|
||||
void AISpellsList(Client *c);
|
||||
uint16 GetInnateProcSpellID() const { return innate_proc_spell_id; }
|
||||
|
||||
|
||||
@ -194,7 +194,6 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
|
||||
if (petpower == -1) {
|
||||
if (IsClient()) {
|
||||
act_power = CastToClient()->GetFocusEffect(focusPetPower, spell_id);//Client only
|
||||
act_power = CastToClient()->mod_pet_power(act_power, spell_id);
|
||||
}
|
||||
else if (IsBot())
|
||||
act_power = CastToBot()->GetFocusEffect(focusPetPower, spell_id);
|
||||
|
||||
@ -260,8 +260,6 @@ bool Spawn2::Process() {
|
||||
|
||||
NPC *npc = new NPC(tmp, this, glm::vec4(x, y, z, heading), GravityBehavior::Water);
|
||||
|
||||
npc->mod_prespawn(this);
|
||||
|
||||
npcthis = npc;
|
||||
npc->AddLootTable();
|
||||
if (npc->DropsGlobalLoot()) {
|
||||
|
||||
@ -332,8 +332,6 @@ void Client::OPCombatAbility(const CombatAbility_Struct *ca_atk)
|
||||
int32 max_dmg = GetBaseSkillDamage(EQ::skills::SkillFrenzy, GetTarget());
|
||||
DoAnim(anim1HWeapon, 0, false);
|
||||
|
||||
max_dmg = mod_frenzy_damage(max_dmg);
|
||||
|
||||
if (GetClass() == BERSERKER) {
|
||||
int chance = GetLevel() * 2 + GetSkill(EQ::skills::SkillFrenzy);
|
||||
if (zone->random.Roll0(450) < chance)
|
||||
@ -528,9 +526,6 @@ int Mob::MonkSpecialAttack(Mob *other, uint8 unchecked_type)
|
||||
if (max_dmg > 0)
|
||||
ht = max_dmg;
|
||||
|
||||
// This can potentially stack with changes to kick damage
|
||||
ht = ndamage = mod_monk_special_damage(ndamage, skill_type);
|
||||
|
||||
DoSpecialAttackDamage(other, skill_type, max_dmg, min_dmg, ht, reuse);
|
||||
|
||||
return reuse;
|
||||
|
||||
@ -3428,8 +3428,6 @@ int64 Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level
|
||||
}
|
||||
}
|
||||
|
||||
effect_value = mod_effect_value(effect_value, spell_id, spells[spell_id].effect_id[effect_id], caster, caster_id);
|
||||
|
||||
return effect_value;
|
||||
}
|
||||
|
||||
|
||||
@ -478,8 +478,6 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
|
||||
return(true);
|
||||
}
|
||||
|
||||
cast_time = mod_cast_time(cast_time);
|
||||
|
||||
// ok we know it has a cast time so we can start the timer now
|
||||
spellend_timer.Start(cast_time);
|
||||
|
||||
@ -2819,9 +2817,6 @@ int Mob::CalcBuffDuration(Mob *caster, Mob *target, uint16 spell_id, int32 caste
|
||||
res = 10000; // ~16h override
|
||||
}
|
||||
|
||||
|
||||
res = mod_buff_duration(res, caster, target, spell_id);
|
||||
|
||||
LogSpells("Spell [{}]: Casting level [{}], formula [{}], base_duration [{}]: result [{}]",
|
||||
spell_id, castlevel, formula, duration, res);
|
||||
|
||||
@ -2946,9 +2941,6 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2,
|
||||
}
|
||||
}
|
||||
|
||||
int modval = mod_spell_stack(spellid1, caster_level1, caster1, spellid2, caster_level2, caster2);
|
||||
if(modval < 2) { return(modval); }
|
||||
|
||||
/*
|
||||
One of these is a bard song and one isn't and they're both beneficial so they should stack.
|
||||
*/
|
||||
@ -3697,8 +3689,6 @@ bool Mob::SpellOnTarget(
|
||||
}
|
||||
}
|
||||
|
||||
mod_spell_cast(spell_id, spelltar, reflect_effectiveness, use_resist_adjust, resist_adjust, isproc);
|
||||
|
||||
if (!DoCastingChecksOnTarget(false, spell_id, spelltar)) {
|
||||
safe_delete(action_packet);
|
||||
return false;
|
||||
@ -5067,8 +5057,6 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
||||
resist_chance += resist_modifier;
|
||||
resist_chance += target_resist;
|
||||
|
||||
resist_chance = mod_spell_resist(resist_chance, level_mod, resist_modifier, target_resist, resist_type, spell_id, caster);
|
||||
|
||||
//Do our min and max resist checks.
|
||||
if(resist_chance > spells[spell_id].max_resist && spells[spell_id].max_resist != 0)
|
||||
{
|
||||
|
||||
@ -1110,8 +1110,6 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
|
||||
|
||||
const EQ::ItemData* item = nullptr;
|
||||
|
||||
chance = mod_tradeskill_chance(chance, spec);
|
||||
|
||||
if (((spec->tradeskill==75) || GetGM() || (chance > res)) || zone->random.Roll(aa_chance)) {
|
||||
|
||||
success_modifier = 1;
|
||||
@ -1248,8 +1246,6 @@ void Client::CheckIncreaseTradeskill(int16 bonusstat, int16 stat_modifier, float
|
||||
}
|
||||
}
|
||||
|
||||
chance_stage2 = mod_tradeskill_skillup(chance_stage2);
|
||||
|
||||
if (chance_stage2 > zone->random.Real(0, 99)) {
|
||||
//Only if stage1 and stage2 succeeded you get a skillup.
|
||||
SetSkill(tradeskill, current_raw_skill + 1);
|
||||
|
||||
@ -247,8 +247,6 @@ int32 Client::TributeItem(uint32 slot, uint32 quantity) {
|
||||
//figure out what its worth
|
||||
int32 pts = inst->GetItem()->Favor;
|
||||
|
||||
pts = mod_tribute_item_value(pts, m_inv[slot]);
|
||||
|
||||
if(pts < 1) {
|
||||
Message(Chat::Red, "This item is worthless for favor.");
|
||||
return(0);
|
||||
|
||||
@ -1218,9 +1218,6 @@ bool Zone::Init(bool is_static) {
|
||||
LoadGrids();
|
||||
LoadTickItems();
|
||||
|
||||
//MODDING HOOK FOR ZONE INIT
|
||||
mod_init();
|
||||
|
||||
// logging origination information
|
||||
LogSys.origination_info.zone_short_name = zone->short_name;
|
||||
LogSys.origination_info.zone_long_name = zone->long_name;
|
||||
@ -1927,9 +1924,6 @@ void Zone::Repop()
|
||||
initgrids_timer.Start();
|
||||
|
||||
entity_list.UpdateAllTraps(true, true);
|
||||
|
||||
//MODDING HOOK FOR REPOP
|
||||
mod_repop();
|
||||
}
|
||||
|
||||
void Zone::GetTimeSync()
|
||||
|
||||
@ -395,11 +395,6 @@ public:
|
||||
|
||||
double GetMaxMovementUpdateRange() const { return max_movement_update_range; }
|
||||
|
||||
/**
|
||||
* Modding hooks
|
||||
*/
|
||||
void mod_init();
|
||||
void mod_repop();
|
||||
void SetIsHotzone(bool is_hotzone);
|
||||
|
||||
private:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user