mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-15 00:22:27 +00:00
More hate changes
This commit is contained in:
parent
21ce6efc73
commit
73fe229e25
@ -2400,7 +2400,8 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mob::AddToHateList(Mob* other, int32 hate, int32 damage, bool iYellForHelp, bool bFrenzy, bool iBuffTic) {
|
void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, bool iYellForHelp /*= true*/, bool bFrenzy /*= false*/, bool iBuffTic /*= false*/)
|
||||||
|
{
|
||||||
|
|
||||||
assert(other != nullptr);
|
assert(other != nullptr);
|
||||||
|
|
||||||
|
|||||||
@ -6008,7 +6008,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillUseTypes attack_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::AddToHateList(Mob* other, int32 hate, int32 damage, bool iYellForHelp, bool bFrenzy, bool iBuffTic)
|
void Bot::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, bool iYellForHelp /*= true*/, bool bFrenzy /*= false*/, bool iBuffTic /*= false*/)
|
||||||
{
|
{
|
||||||
Mob::AddToHateList(other, hate, damage, iYellForHelp, bFrenzy, iBuffTic);
|
Mob::AddToHateList(other, hate, damage, iYellForHelp, bFrenzy, iBuffTic);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -208,7 +208,7 @@ public:
|
|||||||
bool DoFinishedSpellGroupTarget(uint16 spell_id, Mob* spellTarget, uint16 slot, bool &stopLogic);
|
bool DoFinishedSpellGroupTarget(uint16 spell_id, Mob* spellTarget, uint16 slot, bool &stopLogic);
|
||||||
void SendBotArcheryWearChange(uint8 material_slot, uint32 material, uint32 color);
|
void SendBotArcheryWearChange(uint8 material_slot, uint32 material, uint32 color);
|
||||||
void Camp(bool databaseSave = true);
|
void Camp(bool databaseSave = true);
|
||||||
virtual void AddToHateList(Mob* other, int32 hate = 0, int32 damage = 0, bool iYellForHelp = true, bool bFrenzy = false, bool iBuffTic = false);
|
virtual void AddToHateList(Mob* other, uint32 hate = 0, int32 damage = 0, bool iYellForHelp = true, bool bFrenzy = false, bool iBuffTic = false);
|
||||||
virtual void SetTarget(Mob* mob);
|
virtual void SetTarget(Mob* mob);
|
||||||
virtual void Zone();
|
virtual void Zone();
|
||||||
std::vector<AISpells_Struct> GetBotSpells() { return AIspells; }
|
std::vector<AISpells_Struct> GetBotSpells() { return AIspells; }
|
||||||
|
|||||||
@ -8656,8 +8656,8 @@ void command_aggrozone(Client *c, const Seperator *sep) {
|
|||||||
if (!m)
|
if (!m)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int hate = atoi(sep->arg[1]); //should default to 0 if we don't enter anything
|
uint32 hate = atoi(sep->arg[1]); //should default to 0 if we don't enter anything
|
||||||
entity_list.AggroZone(m,hate);
|
entity_list.AggroZone(m, hate);
|
||||||
c->Message(0, "Train to you! Last chance to go invulnerable...");
|
c->Message(0, "Train to you! Last chance to go invulnerable...");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2914,7 +2914,7 @@ void EntityList::ClearZoneFeignAggro(Client *targ)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityList::AggroZone(Mob *who, int hate)
|
void EntityList::AggroZone(Mob *who, uint32 hate)
|
||||||
{
|
{
|
||||||
auto it = npc_list.begin();
|
auto it = npc_list.begin();
|
||||||
while (it != npc_list.end()) {
|
while (it != npc_list.end()) {
|
||||||
|
|||||||
@ -355,7 +355,7 @@ public:
|
|||||||
void ClearAggro(Mob* targ);
|
void ClearAggro(Mob* targ);
|
||||||
void ClearFeignAggro(Mob* targ);
|
void ClearFeignAggro(Mob* targ);
|
||||||
void ClearZoneFeignAggro(Client* targ);
|
void ClearZoneFeignAggro(Client* targ);
|
||||||
void AggroZone(Mob* who, int hate = 0);
|
void AggroZone(Mob* who, uint32 hate = 0);
|
||||||
|
|
||||||
bool Fighting(Mob* targ);
|
bool Fighting(Mob* targ);
|
||||||
void RemoveFromHateLists(Mob* mob, bool settoone = false);
|
void RemoveFromHateLists(Mob* mob, bool settoone = false);
|
||||||
|
|||||||
@ -158,8 +158,11 @@ Mob* HateList::GetClosestEntOnHateList(Mob *hater)
|
|||||||
return close_entity;
|
return close_entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HateList::AddEntToHateList(Mob *in_entity, int32 in_hate, int32 in_damage, bool in_is_entity_frenzy, bool iAddIfNotExist)
|
#include <iostream>
|
||||||
|
void HateList::AddEntToHateList(Mob *in_entity, uint32 in_hate, int32 in_damage, bool in_is_entity_frenzy, bool iAddIfNotExist)
|
||||||
{
|
{
|
||||||
|
std::cout << "AddEntToHateList name: " << owner->GetCleanName() << " in_hate " << in_hate << " in_damage " << in_damage << std::endl;
|
||||||
|
|
||||||
if (!in_entity) {
|
if (!in_entity) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ struct ExtraAttackOptions;
|
|||||||
|
|
||||||
struct struct_HateList {
|
struct struct_HateList {
|
||||||
Mob *entity_on_hatelist;
|
Mob *entity_on_hatelist;
|
||||||
uint32 hatelist_damage;
|
int32 hatelist_damage;
|
||||||
uint32 stored_hate_amount;
|
uint32 stored_hate_amount;
|
||||||
bool is_entity_frenzy;
|
bool is_entity_frenzy;
|
||||||
};
|
};
|
||||||
@ -44,7 +44,7 @@ class HateList
|
|||||||
Mob *GetEntWithMostHateInRange(Mob *center);
|
Mob *GetEntWithMostHateInRange(Mob *center);
|
||||||
Mob* GetEntWithMostHateOnList();
|
Mob* GetEntWithMostHateOnList();
|
||||||
|
|
||||||
bool IsEntOnHateList(Mob *);
|
bool IsEntOnHateList(Mob *mob);
|
||||||
bool IsHateListEmpty();
|
bool IsHateListEmpty();
|
||||||
bool RemoveEntFromHateList(Mob *ent);
|
bool RemoveEntFromHateList(Mob *ent);
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ class HateList
|
|||||||
|
|
||||||
uint32 GetEntHateAmount(Mob *in_entity, bool damage = false);
|
uint32 GetEntHateAmount(Mob *in_entity, bool damage = false);
|
||||||
|
|
||||||
void AddEntToHateList(Mob *in_entity, int32 in_hate = 0, int32 in_damage = 0, bool in_is_frenzied = false, bool add_to_hate_list_if_not_exist = true);
|
void AddEntToHateList(Mob *in_entity, uint32 in_hate = 0, int32 in_damage = 0, bool in_is_frenzied = false, bool add_to_hate_list_if_not_exist = true);
|
||||||
void DoFactionHits(int32 npc_faction_level_id);
|
void DoFactionHits(int32 npc_faction_level_id);
|
||||||
void IsEntityInFrenzyMode();
|
void IsEntityInFrenzyMode();
|
||||||
void PrintHateListToClient(Client *c);
|
void PrintHateListToClient(Client *c);
|
||||||
|
|||||||
@ -452,7 +452,7 @@ public:
|
|||||||
static uint32 GetLevelCon(uint8 mylevel, uint8 iOtherLevel);
|
static uint32 GetLevelCon(uint8 mylevel, uint8 iOtherLevel);
|
||||||
inline uint32 GetLevelCon(uint8 iOtherLevel) const {
|
inline uint32 GetLevelCon(uint8 iOtherLevel) const {
|
||||||
return this ? GetLevelCon(GetLevel(), iOtherLevel) : CON_GREEN; }
|
return this ? GetLevelCon(GetLevel(), iOtherLevel) : CON_GREEN; }
|
||||||
virtual void AddToHateList(Mob* other, int32 hate = 0, int32 damage = 0, bool iYellForHelp = true,
|
virtual void AddToHateList(Mob* other, uint32 hate = 0, int32 damage = 0, bool iYellForHelp = true,
|
||||||
bool bFrenzy = false, bool iBuffTic = false);
|
bool bFrenzy = false, bool iBuffTic = false);
|
||||||
bool RemoveFromHateList(Mob* mob);
|
bool RemoveFromHateList(Mob* mob);
|
||||||
void SetHateAmountOnEnt(Mob* other, int32 hate = 0, int32 damage = 0) { hate_list.SetHateAmountOnEnt(other,hate,damage);}
|
void SetHateAmountOnEnt(Mob* other, int32 hate = 0, int32 damage = 0) { hate_list.SetHateAmountOnEnt(other,hate,damage);}
|
||||||
|
|||||||
@ -106,7 +106,7 @@ void Mob::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage,
|
|||||||
if(who->GetInvul() || who->GetSpecialAbility(IMMUNE_MELEE) || who->GetSpecialAbility(IMMUNE_MELEE_EXCEPT_BANE))
|
if(who->GetInvul() || who->GetSpecialAbility(IMMUNE_MELEE) || who->GetSpecialAbility(IMMUNE_MELEE_EXCEPT_BANE))
|
||||||
return; //-5?
|
return; //-5?
|
||||||
|
|
||||||
int32 hate = max_damage;
|
uint32 hate = max_damage;
|
||||||
if(hate_override > -1)
|
if(hate_override > -1)
|
||||||
hate = hate_override;
|
hate = hate_override;
|
||||||
|
|
||||||
@ -583,7 +583,7 @@ void Mob::RogueBackstab(Mob* other, bool min_damage, int ReuseTime)
|
|||||||
int32 ndamage = 0;
|
int32 ndamage = 0;
|
||||||
int32 max_hit = 0;
|
int32 max_hit = 0;
|
||||||
int32 min_hit = 0;
|
int32 min_hit = 0;
|
||||||
int32 hate = 0;
|
uint32 hate = 0;
|
||||||
int32 primaryweapondamage = 0;
|
int32 primaryweapondamage = 0;
|
||||||
int32 backstab_dmg = 0;
|
int32 backstab_dmg = 0;
|
||||||
|
|
||||||
@ -889,7 +889,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
|||||||
if (HeadShot_Dmg)
|
if (HeadShot_Dmg)
|
||||||
HeadShot = true;
|
HeadShot = true;
|
||||||
|
|
||||||
int32 hate = 0;
|
uint32 hate = 0;
|
||||||
int32 TotalDmg = 0;
|
int32 TotalDmg = 0;
|
||||||
int16 WDmg = 0;
|
int16 WDmg = 0;
|
||||||
int16 ADmg = 0;
|
int16 ADmg = 0;
|
||||||
@ -2354,7 +2354,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
|
|||||||
skillinuse = SkillOffense;
|
skillinuse = SkillOffense;
|
||||||
|
|
||||||
int damage = 0;
|
int damage = 0;
|
||||||
int32 hate = 0;
|
uint32 hate = 0;
|
||||||
int Hand = MainPrimary;
|
int Hand = MainPrimary;
|
||||||
if (hate == 0 && weapon_damage > 1) hate = weapon_damage;
|
if (hate == 0 && weapon_damage > 1) hate = weapon_damage;
|
||||||
|
|
||||||
|
|||||||
@ -3728,7 +3728,7 @@ void Mob::DoBuffTic(uint16 spell_id, int slot, uint32 ticsremaining, uint8 caste
|
|||||||
case SE_AddHateOverTimePct:
|
case SE_AddHateOverTimePct:
|
||||||
{
|
{
|
||||||
if (IsNPC()){
|
if (IsNPC()){
|
||||||
int32 new_hate = CastToNPC()->GetHateAmount(caster) * (100 + spell.base[i]) / 100;
|
uint32 new_hate = CastToNPC()->GetHateAmount(caster) * (100 + spell.base[i]) / 100;
|
||||||
if (new_hate <= 0)
|
if (new_hate <= 0)
|
||||||
new_hate = 1;
|
new_hate = 1;
|
||||||
|
|
||||||
|
|||||||
@ -3656,7 +3656,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r
|
|||||||
spelltar->AddToHateList(this, aggro);
|
spelltar->AddToHateList(this, aggro);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
int32 newhate = spelltar->GetHateAmount(this) + aggro;
|
uint32 newhate = spelltar->GetHateAmount(this) + aggro;
|
||||||
if (newhate < 1) {
|
if (newhate < 1) {
|
||||||
spelltar->SetHateAmountOnEnt(this,1);
|
spelltar->SetHateAmountOnEnt(this,1);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user