mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
* Add faction logging category Probably should use this for more things * Add FactionAssociation struct This is simply just a struct that contains an array of faction ids and multiplier. This can hold a maximum of 10 entries (Seru hit is 8, so 2 extra) this can be raised if need be. * Add database changes and other data point changes This is all the database changes and loading changes Included is an optional SQL that will be used as a starting point, there is likely errors or typos, but we will fix those as they are discovered. * Add Client::RewardFaction function This just takes the faction ID and the magnitude of the primary faction hit and calculates the rest. The minimum change will be either 1 or -1. We stop processing after we see an ID of 0 and assume there will be no later entries. The primary faction ID will always receive a hit even if there is no faction association entries * Add users of RewardFaction to NPC death, tasks, and QuestRewards This will only use the new system if the magnitude is set, otherwise we will just use the old system still * Add quest system calls and lua QuestReward support * Add #factionassociation command This just calls RewardFaction, mostly useful for debugging
95 lines
3.2 KiB
C++
95 lines
3.2 KiB
C++
/* EQEMu: Everquest Server Emulator
|
|
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; version 2 of the License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
|
are required to give you total support for your newly bought product;
|
|
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
|
|
#ifndef HATELIST_H
|
|
#define HATELIST_H
|
|
|
|
class Client;
|
|
class Group;
|
|
class Mob;
|
|
class Raid;
|
|
struct ExtraAttackOptions;
|
|
|
|
struct struct_HateList {
|
|
Mob *entity_on_hatelist;
|
|
int64 hatelist_damage;
|
|
int64 stored_hate_amount;
|
|
bool is_entity_frenzy;
|
|
int8 oor_count; // count on how long we've been out of range
|
|
uint32 last_modified; // we need to remove this if it gets higher than 10 mins
|
|
};
|
|
|
|
class HateList {
|
|
public:
|
|
HateList();
|
|
~HateList();
|
|
|
|
Mob *GetClosestEntOnHateList(Mob *hater, bool skip_mezzed = false);
|
|
Mob *GetDamageTopOnHateList(Mob *hater); // didn't add 'skip_mezzed' due to calls being in ::Death()
|
|
Mob *GetEntWithMostHateOnList(Mob *center, Mob *skip = nullptr, bool skip_mezzed = false);
|
|
Mob *GetRandomEntOnHateList(bool skip_mezzed = false);
|
|
Mob *GetEntWithMostHateOnList(bool skip_mezzed = false);
|
|
Mob *GetEscapingEntOnHateList(); // returns first eligble entity
|
|
Mob *GetEscapingEntOnHateList(Mob *center, float range = 0.0f, bool first = false);
|
|
|
|
#ifdef BOTS
|
|
Bot* GetRandomBotOnHateList(bool skip_mezzed = false);
|
|
#endif
|
|
Client *GetRandomClientOnHateList(bool skip_mezzed = false);
|
|
NPC *GetRandomNPCOnHateList(bool skip_mezzed = false);
|
|
|
|
bool IsEntOnHateList(Mob *mob);
|
|
bool IsHateListEmpty();
|
|
bool RemoveEntFromHateList(Mob *ent);
|
|
|
|
int AreaRampage(Mob *caster, Mob *target, int count, ExtraAttackOptions *opts);
|
|
int GetSummonedPetCountOnHateList();
|
|
int GetHateRatio(Mob *top, Mob *other);
|
|
|
|
int64 GetEntHateAmount(Mob *ent, bool in_damage = false);
|
|
|
|
std::list<struct_HateList *> &GetHateList() { return list; }
|
|
std::list<struct_HateList *> GetHateListByDistance(int distance = 0);
|
|
|
|
void AddEntToHateList(
|
|
Mob *ent,
|
|
int64 in_hate = 0,
|
|
int64 in_damage = 0,
|
|
bool in_is_frenzied = false,
|
|
bool add_to_hate_list_if_not_exist = true
|
|
);
|
|
void DoFactionHits(int64 npc_faction_level_id, int32 faction_id, int32 faction_value);
|
|
void IsEntityInFrenzyMode();
|
|
void PrintHateListToClient(Client *c);
|
|
void SetHateAmountOnEnt(Mob *other, int64 in_hate, uint64 in_damage);
|
|
void SetHateOwner(Mob *new_hate_owner) { hate_owner = new_hate_owner; }
|
|
void SpellCast(Mob *caster, uint32 spell_id, float range, Mob *ae_center = nullptr);
|
|
void WipeHateList();
|
|
void RemoveStaleEntries(int time_ms, float dist);
|
|
|
|
|
|
protected:
|
|
struct_HateList *Find(Mob *ent);
|
|
private:
|
|
std::list<struct_HateList *> list;
|
|
Mob *hate_owner;
|
|
};
|
|
|
|
#endif
|
|
|