mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
[Experience] Add exp mod to npc types to let a server op change the exp modifier (#1252)
* Add exp mod to npc types to let a server op change the exp modifier a npc gives (useful for custom content) * Updated version.h
This commit is contained in:
parent
65704274cb
commit
bf3593a60d
@ -34,7 +34,7 @@
|
||||
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||
*/
|
||||
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9159
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9160
|
||||
|
||||
#ifdef BOTS
|
||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9027
|
||||
|
||||
@ -413,6 +413,7 @@
|
||||
9157|2020_09_02_pet_taunting.sql|SHOW COLUMNS from `character_pet_info` LIKE 'taunting'|empty|
|
||||
9158|2020_12_09_underworld.sql|SHOW COLUMNS from `zone` LIKE 'underworld_teleport_index'|empty|
|
||||
9159|2020_12_22_expedition_system.sql|SELECT * FROM db_version WHERE version >= 9159|empty|
|
||||
9160|2021_02_14_npc_exp_mod.sql|SHOW COLUMNS from `npc_types` LIKE 'exp_mod'|empty|
|
||||
|
||||
# Upgrade conditions:
|
||||
# This won't be needed after this system is implemented, but it is used database that are not
|
||||
|
||||
1
utils/sql/git/required/2021_02_14_npc_exp_mod.sql
Normal file
1
utils/sql/git/required/2021_02_14_npc_exp_mod.sql
Normal file
@ -0,0 +1 @@
|
||||
ALTER TABLE `npc_types` ADD COLUMN `exp_mod` INT NOT NULL DEFAULT '100' AFTER `always_aggro`;
|
||||
10
zone/exp.cpp
10
zone/exp.cpp
@ -215,7 +215,15 @@ uint32 Client::GetExperienceForKill(Mob *against)
|
||||
|
||||
if (against && against->IsNPC()) {
|
||||
uint32 level = (uint32)against->GetLevel();
|
||||
return EXP_FORMULA;
|
||||
uint32 ret = EXP_FORMULA;
|
||||
|
||||
auto mod = against->GetKillExpMod();
|
||||
if(mod >= 0) {
|
||||
ret *= mod;
|
||||
ret /= 100;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@ -695,6 +695,7 @@ public:
|
||||
bool PlotPositionOnArcInFrontOfTarget(Mob *target, float &x_dest, float &y_dest, float &z_dest, float distance, float min_deg = 5.0f, float max_deg = 150.0f);
|
||||
bool PlotPositionOnArcBehindTarget(Mob *target, float &x_dest, float &y_dest, float &z_dest, float distance);
|
||||
bool PlotPositionBehindMeFacingTarget(Mob *target, float &x_dest, float &y_dest, float &z_dest, float min_dist = 1.0f, float max_dist = 5.0f);
|
||||
virtual int GetKillExpMod() const { return 100; }
|
||||
|
||||
// aura functions
|
||||
void MakeAura(uint16 spell_id);
|
||||
|
||||
@ -422,10 +422,12 @@ public:
|
||||
void SetCombatEvent(bool b) { combat_event = b; }
|
||||
|
||||
/* Only allows players that killed corpse to loot */
|
||||
const bool HasPrivateCorpse() const { return NPCTypedata->private_corpse; }
|
||||
const bool HasPrivateCorpse() const { return NPCTypedata_ours ? NPCTypedata_ours->private_corpse : NPCTypedata->private_corpse; }
|
||||
|
||||
virtual const bool IsUnderwaterOnly() const { return NPCTypedata->underwater; }
|
||||
const char* GetRawNPCTypeName() const { return NPCTypedata->name; }
|
||||
virtual const bool IsUnderwaterOnly() const { return NPCTypedata_ours ? NPCTypedata_ours->underwater : NPCTypedata->underwater; }
|
||||
const char* GetRawNPCTypeName() const { return NPCTypedata_ours ? NPCTypedata_ours->name : NPCTypedata->name; }
|
||||
|
||||
virtual int GetKillExpMod() const { return NPCTypedata_ours ? NPCTypedata_ours->exp_mod : NPCTypedata->exp_mod; }
|
||||
|
||||
void ChangeLastName(const char* in_lastname);
|
||||
void ClearLastName();
|
||||
|
||||
@ -2525,7 +2525,8 @@ const NPCType *ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
|
||||
"npc_types.stuck_behavior, "
|
||||
"npc_types.model, "
|
||||
"npc_types.flymode, "
|
||||
"npc_types.always_aggro "
|
||||
"npc_types.always_aggro, "
|
||||
"npc_types.exp_mod "
|
||||
"FROM npc_types %s",
|
||||
where_condition.c_str()
|
||||
);
|
||||
@ -2728,6 +2729,7 @@ const NPCType *ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
|
||||
temp_npctype_data->use_model = atoi(row[110]);
|
||||
temp_npctype_data->flymode = atoi(row[111]);
|
||||
temp_npctype_data->always_aggro = atoi(row[112]);
|
||||
temp_npctype_data->exp_mod = atoi(row[113]);
|
||||
|
||||
temp_npctype_data->skip_auto_scale = false; // hardcoded here for now
|
||||
|
||||
|
||||
@ -148,6 +148,7 @@ struct NPCType
|
||||
uint16 use_model;
|
||||
int8 flymode;
|
||||
bool always_aggro;
|
||||
int exp_mod;
|
||||
};
|
||||
|
||||
namespace player_lootitem {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user