mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-20 13:21:28 +00:00
org_x, org_y, org_z, and org_heading converted to xyz_heading as m_SpawnPoint
This commit is contained in:
parent
82cc830297
commit
6ffd7203ff
@ -1800,10 +1800,11 @@ void command_gassign(Client *c, const Seperator *sep)
|
|||||||
{
|
{
|
||||||
if (sep->IsNumber(1) && c->GetTarget() && c->GetTarget()->IsNPC())
|
if (sep->IsNumber(1) && c->GetTarget() && c->GetTarget()->IsNPC())
|
||||||
{
|
{
|
||||||
|
auto npcBind = c->GetTarget()->CastToNPC()->m_SpawnPoint;
|
||||||
database.AssignGrid(
|
database.AssignGrid(
|
||||||
c,
|
c,
|
||||||
(c->GetTarget()->CastToNPC()->org_x),
|
npcBind.m_X,
|
||||||
(c->GetTarget()->CastToNPC()->org_y),
|
npcBind.m_Y,
|
||||||
atoi(sep->arg[1])
|
atoi(sep->arg[1])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
17
zone/npc.cpp
17
zone/npc.cpp
@ -113,7 +113,8 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, float x, float y, float z, float
|
|||||||
qglobal_purge_timer(30000),
|
qglobal_purge_timer(30000),
|
||||||
sendhpupdate_timer(1000),
|
sendhpupdate_timer(1000),
|
||||||
enraged_timer(1000),
|
enraged_timer(1000),
|
||||||
taunt_timer(TauntReuseTime * 1000)
|
taunt_timer(TauntReuseTime * 1000),
|
||||||
|
m_SpawnPoint(x,y,z,heading)
|
||||||
{
|
{
|
||||||
//What is the point of this, since the names get mangled..
|
//What is the point of this, since the names get mangled..
|
||||||
Mob* mob = entity_list.GetMob(name);
|
Mob* mob = entity_list.GetMob(name);
|
||||||
@ -203,9 +204,6 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, float x, float y, float z, float
|
|||||||
MerchantType = d->merchanttype;
|
MerchantType = d->merchanttype;
|
||||||
merchant_open = GetClass() == MERCHANT;
|
merchant_open = GetClass() == MERCHANT;
|
||||||
adventure_template_id = d->adventure_template;
|
adventure_template_id = d->adventure_template;
|
||||||
org_x = x;
|
|
||||||
org_y = y;
|
|
||||||
org_z = z;
|
|
||||||
flymode = iflymode;
|
flymode = iflymode;
|
||||||
guard_x = -1; //just some value we might be able to recongize as "unset"
|
guard_x = -1; //just some value we might be able to recongize as "unset"
|
||||||
guard_y = -1;
|
guard_y = -1;
|
||||||
@ -221,7 +219,6 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, float x, float y, float z, float
|
|||||||
roambox_movingto_y = -2;
|
roambox_movingto_y = -2;
|
||||||
roambox_min_delay = 1000;
|
roambox_min_delay = 1000;
|
||||||
roambox_delay = 1000;
|
roambox_delay = 1000;
|
||||||
org_heading = heading;
|
|
||||||
p_depop = false;
|
p_depop = false;
|
||||||
loottable_id = d->loottable_id;
|
loottable_id = d->loottable_id;
|
||||||
|
|
||||||
@ -1853,7 +1850,7 @@ void NPC::PetOnSpawn(NewSpawn_Struct* ns)
|
|||||||
{
|
{
|
||||||
swarmOwner = entity_list.GetMobID(GetSwarmOwner());
|
swarmOwner = entity_list.GetMobID(GetSwarmOwner());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (swarmOwner != nullptr)
|
if (swarmOwner != nullptr)
|
||||||
{
|
{
|
||||||
if(swarmOwner->IsClient())
|
if(swarmOwner->IsClient())
|
||||||
@ -1873,7 +1870,7 @@ void NPC::PetOnSpawn(NewSpawn_Struct* ns)
|
|||||||
SetTempPet(true); //Simple mob flag for checking if temp pet
|
SetTempPet(true); //Simple mob flag for checking if temp pet
|
||||||
swarmOwner->SetTempPetsActive(true); //Necessary fail safe flag set if mob ever had a swarm pet to ensure they are removed.
|
swarmOwner->SetTempPetsActive(true); //Necessary fail safe flag set if mob ever had a swarm pet to ensure they are removed.
|
||||||
swarmOwner->SetTempPetCount(swarmOwner->GetTempPetCount() + 1);
|
swarmOwner->SetTempPetCount(swarmOwner->GetTempPetCount() + 1);
|
||||||
|
|
||||||
//Not recommended if using above (However, this will work better on older clients).
|
//Not recommended if using above (However, this will work better on older clients).
|
||||||
if (RuleB(Pets, UnTargetableSwarmPet))
|
if (RuleB(Pets, UnTargetableSwarmPet))
|
||||||
{
|
{
|
||||||
@ -1881,7 +1878,7 @@ void NPC::PetOnSpawn(NewSpawn_Struct* ns)
|
|||||||
if(!IsCharmed() && swarmOwner->IsClient())
|
if(!IsCharmed() && swarmOwner->IsClient())
|
||||||
sprintf(ns->spawn.lastName, "%s's Pet", swarmOwner->GetName());
|
sprintf(ns->spawn.lastName, "%s's Pet", swarmOwner->GetName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(GetOwnerID())
|
else if(GetOwnerID())
|
||||||
{
|
{
|
||||||
ns->spawn.is_pet = 1;
|
ns->spawn.is_pet = 1;
|
||||||
@ -2430,7 +2427,7 @@ void NPC::DepopSwarmPets()
|
|||||||
Mob* owner = entity_list.GetMobID(GetSwarmInfo()->owner_id);
|
Mob* owner = entity_list.GetMobID(GetSwarmInfo()->owner_id);
|
||||||
if (owner)
|
if (owner)
|
||||||
owner->SetTempPetCount(owner->GetTempPetCount() - 1);
|
owner->SetTempPetCount(owner->GetTempPetCount() - 1);
|
||||||
|
|
||||||
Depop();
|
Depop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2448,4 +2445,4 @@ void NPC::DepopSwarmPets()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
28
zone/npc.h
28
zone/npc.h
@ -67,10 +67,10 @@ struct AISpells_Struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct AISpellsEffects_Struct {
|
struct AISpellsEffects_Struct {
|
||||||
uint16 spelleffectid;
|
uint16 spelleffectid;
|
||||||
int32 base;
|
int32 base;
|
||||||
int32 limit;
|
int32 limit;
|
||||||
int32 max;
|
int32 max;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AISpellsVar_Struct {
|
struct AISpellsVar_Struct {
|
||||||
@ -86,7 +86,7 @@ struct AISpellsVar_Struct {
|
|||||||
uint32 idle_no_sp_recast_min;
|
uint32 idle_no_sp_recast_min;
|
||||||
uint32 idle_no_sp_recast_max;
|
uint32 idle_no_sp_recast_max;
|
||||||
uint8 idle_beneficial_chance;
|
uint8 idle_beneficial_chance;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class AA_SwarmPetInfo;
|
class AA_SwarmPetInfo;
|
||||||
@ -163,7 +163,7 @@ public:
|
|||||||
FACTION_VALUE CheckNPCFactionAlly(int32 other_faction);
|
FACTION_VALUE CheckNPCFactionAlly(int32 other_faction);
|
||||||
virtual FACTION_VALUE GetReverseFactionCon(Mob* iOther);
|
virtual FACTION_VALUE GetReverseFactionCon(Mob* iOther);
|
||||||
|
|
||||||
void GoToBind(uint8 bindnum = 0) { GMMove(org_x, org_y, org_z, org_heading); }
|
void GoToBind(uint8 bindnum = 0) { GMMove(m_SpawnPoint.m_X, m_SpawnPoint.m_Y, m_SpawnPoint.m_Z, m_SpawnPoint.m_Heading); }
|
||||||
void Gate();
|
void Gate();
|
||||||
|
|
||||||
void GetPetState(SpellBuff_Struct *buffs, uint32 *items, char *name);
|
void GetPetState(SpellBuff_Struct *buffs, uint32 *items, char *name);
|
||||||
@ -211,10 +211,10 @@ public:
|
|||||||
uint32 GetSp2() const { return spawn_group; }
|
uint32 GetSp2() const { return spawn_group; }
|
||||||
uint32 GetSpawnPointID() const;
|
uint32 GetSpawnPointID() const;
|
||||||
|
|
||||||
float GetSpawnPointX() const { return org_x; }
|
float GetSpawnPointX() const { return m_SpawnPoint.m_X; }
|
||||||
float GetSpawnPointY() const { return org_y; }
|
float GetSpawnPointY() const { return m_SpawnPoint.m_Y; }
|
||||||
float GetSpawnPointZ() const { return org_z; }
|
float GetSpawnPointZ() const { return m_SpawnPoint.m_Z; }
|
||||||
float GetSpawnPointH() const { return org_heading; }
|
float GetSpawnPointH() const { return m_SpawnPoint.m_Heading; }
|
||||||
float GetGuardPointX() const { return guard_x; }
|
float GetGuardPointX() const { return guard_x; }
|
||||||
float GetGuardPointY() const { return guard_y; }
|
float GetGuardPointY() const { return guard_y; }
|
||||||
float GetGuardPointZ() const { return guard_z; }
|
float GetGuardPointZ() const { return guard_z; }
|
||||||
@ -255,7 +255,7 @@ public:
|
|||||||
|
|
||||||
void SetNPCFactionID(int32 in) { npc_faction_id = in; database.GetFactionIdsForNPC(npc_faction_id, &faction_list, &primary_faction); }
|
void SetNPCFactionID(int32 in) { npc_faction_id = in; database.GetFactionIdsForNPC(npc_faction_id, &faction_list, &primary_faction); }
|
||||||
|
|
||||||
float org_x, org_y, org_z, org_heading;
|
xyz_heading m_SpawnPoint;
|
||||||
|
|
||||||
uint32 GetMaxDMG() const {return max_dmg;}
|
uint32 GetMaxDMG() const {return max_dmg;}
|
||||||
uint32 GetMinDMG() const {return min_dmg;}
|
uint32 GetMinDMG() const {return min_dmg;}
|
||||||
@ -385,7 +385,7 @@ public:
|
|||||||
|
|
||||||
inline void SetHealScale(float amt) { healscale = amt; }
|
inline void SetHealScale(float amt) { healscale = amt; }
|
||||||
inline float GetHealScale() { return healscale; }
|
inline float GetHealScale() { return healscale; }
|
||||||
|
|
||||||
inline void SetSpellFocusDMG(int32 NewSpellFocusDMG) {SpellFocusDMG = NewSpellFocusDMG;}
|
inline void SetSpellFocusDMG(int32 NewSpellFocusDMG) {SpellFocusDMG = NewSpellFocusDMG;}
|
||||||
inline int32 GetSpellFocusDMG() const { return SpellFocusDMG;}
|
inline int32 GetSpellFocusDMG() const { return SpellFocusDMG;}
|
||||||
|
|
||||||
@ -443,7 +443,7 @@ protected:
|
|||||||
virtual bool AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes);
|
virtual bool AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes);
|
||||||
virtual bool AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0);
|
virtual bool AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0);
|
||||||
AISpellsVar_Struct AISpellVar;
|
AISpellsVar_Struct AISpellVar;
|
||||||
|
|
||||||
uint32 npc_spells_effects_id;
|
uint32 npc_spells_effects_id;
|
||||||
std::vector<AISpellsEffects_Struct> AIspellsEffects;
|
std::vector<AISpellsEffects_Struct> AIspellsEffects;
|
||||||
bool HasAISpellEffects;
|
bool HasAISpellEffects;
|
||||||
@ -510,7 +510,7 @@ protected:
|
|||||||
//mercenary stuff
|
//mercenary stuff
|
||||||
std::list<MercType> mercTypeList;
|
std::list<MercType> mercTypeList;
|
||||||
std::list<MercData> mercDataList;
|
std::list<MercData> mercDataList;
|
||||||
|
|
||||||
bool raid_target;
|
bool raid_target;
|
||||||
uint8 probability;
|
uint8 probability;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user