Implemented SE_AlterNPCLevel

This commit is contained in:
KayenEQ 2014-06-13 14:51:26 -04:00
parent 216113e14b
commit 5137b84ba8
7 changed files with 35 additions and 3 deletions

View File

@ -3,7 +3,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50)
== 06/13/2014 ==
Kayen: For table 'npc_spell_effects_entries' setting se_max for damage shield effects (59) will now determine the DS Type (ie burning)
Setting se_max to 1 for SkillDamageTaken effects (127) will allow for stackable mitigation/weakness same as quest function ModSkillDmgTaken.
Kayen: Implemented SE_AlterNPCLevel (not currently used on live). Will +/- to NPC level. When fade will revert back to original level.
== 06/8/2014 ==
KLS: Changed lua API: eq.get_globals(client, npc) has been removed. Use eq.get_globals(npc, client) instead.

View File

@ -254,7 +254,7 @@ typedef enum {
#define SE_Translocate 104 // implemented
#define SE_AntiGate 105 // implemented - Translocational Anchor
#define SE_SummonBSTPet 106 // implemented
//#define SE_AlterNPCLevel 107 // not used
#define SE_AlterNPCLevel 107 // implemented - not used on live
#define SE_Familiar 108 // implemented
#define SE_SummonItemIntoBag 109 // implemented - summons stuff into container
//#define SE_IncreaseArchery 110 // not used
@ -606,6 +606,7 @@ typedef enum {
//#define SE_AddHateOverTimePct 456 // not used
//#define SE_ResourceTap 457 // not used
//#define SE_FactionModPct 458 // not used
//#define SE_DamageModifier2 459 // *not implemented - Modifies melee damage by skill type
// LAST

View File

@ -2641,6 +2641,26 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne
newbon->Screech = effect_value;
break;
case SE_AlterNPCLevel:
if (IsNPC()){
if (!newbon->AlterNPCLevel
|| ((effect_value < 0) && (newbon->AlterNPCLevel > effect_value))
|| ((effect_value > 0) && (newbon->AlterNPCLevel < effect_value))) {
int16 tmp_lv = GetOrigLevel() + effect_value;
if (tmp_lv < 1)
tmp_lv = 1;
else if (tmp_lv > 255)
tmp_lv = 255;
if ((GetLevel() != tmp_lv)){
newbon->AlterNPCLevel = effect_value;
SetLevel(tmp_lv);
}
}
}
break;
//Special custom cases for loading effects on to NPC from 'npc_spels_effects' table
if (IsAISpellEffect) {

View File

@ -347,6 +347,7 @@ struct StatBonuses {
uint16 MeleeRune[2]; // 0 = rune value 1 = buff slot
bool NegateIfCombat; // Bool Drop buff if cast or melee
int8 Screech; // -1 = Will be blocked if another Screech is +(1)
int16 AlterNPCLevel; // amount of lvls +/-
// AAs
int8 Packrat; //weight reduction for items, 1 point = 10%

View File

@ -146,6 +146,7 @@ Mob::Mob(const char* in_name,
orig_bodytype = in_bodytype;
deity = in_deity;
level = in_level;
orig_level = in_level;
npctype_id = in_npctype_id;
size = in_size;
base_size = size;
@ -3415,7 +3416,7 @@ int32 Mob::GetVulnerability(Mob* caster, uint32 spell_id, uint32 ticsremaining)
int16 Mob::GetSkillDmgTaken(const SkillUseTypes skill_used)
{
int skilldmg_mod = 0;
// All skill dmg mod + Skill specific
skilldmg_mod += itembonuses.SkillDmgTaken[HIGHEST_SKILL+1] + spellbonuses.SkillDmgTaken[HIGHEST_SKILL+1] +
itembonuses.SkillDmgTaken[skill_used] + spellbonuses.SkillDmgTaken[skill_used];

View File

@ -318,6 +318,7 @@ public:
inline uint32 GetArmorTint(uint8 i) const { return armor_tint[(i < _MaterialCount) ? i : 0]; }
inline uint8 GetClass() const { return class_; }
inline uint8 GetLevel() const { return level; }
inline uint8 GetOrigLevel() const { return orig_level; }
inline const char* GetName() const { return name; }
inline const char* GetOrigName() const { return orig_name; }
inline const char* GetLastName() const { return lastname; }
@ -960,6 +961,7 @@ protected:
bodyType orig_bodytype;
uint16 deity;
uint8 level;
uint8 orig_level;
uint32 npctype_id;
float x_pos;
float y_pos;

View File

@ -3833,6 +3833,13 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
break;
}
case SE_AlterNPCLevel:
{
if (IsNPC())
SetLevel(GetOrigLevel());
break;
}
case SE_MovementSpeed:
{
if(IsClient())