diff --git a/zone/command.cpp b/zone/command.cpp index 7499edd6b..1dfab5bb0 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -1800,10 +1800,11 @@ void command_gassign(Client *c, const Seperator *sep) { if (sep->IsNumber(1) && c->GetTarget() && c->GetTarget()->IsNPC()) { + auto npcBind = c->GetTarget()->CastToNPC()->m_SpawnPoint; database.AssignGrid( c, - (c->GetTarget()->CastToNPC()->org_x), - (c->GetTarget()->CastToNPC()->org_y), + npcBind.m_X, + npcBind.m_Y, atoi(sep->arg[1]) ); } diff --git a/zone/npc.cpp b/zone/npc.cpp index eae42b670..147d275f9 100644 --- a/zone/npc.cpp +++ b/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), sendhpupdate_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.. 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; merchant_open = GetClass() == MERCHANT; adventure_template_id = d->adventure_template; - org_x = x; - org_y = y; - org_z = z; flymode = iflymode; guard_x = -1; //just some value we might be able to recongize as "unset" 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_min_delay = 1000; roambox_delay = 1000; - org_heading = heading; p_depop = false; loottable_id = d->loottable_id; @@ -1853,7 +1850,7 @@ void NPC::PetOnSpawn(NewSpawn_Struct* ns) { swarmOwner = entity_list.GetMobID(GetSwarmOwner()); } - + if (swarmOwner != nullptr) { if(swarmOwner->IsClient()) @@ -1873,7 +1870,7 @@ void NPC::PetOnSpawn(NewSpawn_Struct* ns) 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->SetTempPetCount(swarmOwner->GetTempPetCount() + 1); - + //Not recommended if using above (However, this will work better on older clients). if (RuleB(Pets, UnTargetableSwarmPet)) { @@ -1881,7 +1878,7 @@ void NPC::PetOnSpawn(NewSpawn_Struct* ns) if(!IsCharmed() && swarmOwner->IsClient()) sprintf(ns->spawn.lastName, "%s's Pet", swarmOwner->GetName()); } - } + } else if(GetOwnerID()) { ns->spawn.is_pet = 1; @@ -2430,7 +2427,7 @@ void NPC::DepopSwarmPets() Mob* owner = entity_list.GetMobID(GetSwarmInfo()->owner_id); if (owner) owner->SetTempPetCount(owner->GetTempPetCount() - 1); - + Depop(); return; } @@ -2448,4 +2445,4 @@ void NPC::DepopSwarmPets() } } } -} \ No newline at end of file +} diff --git a/zone/npc.h b/zone/npc.h index 71e6596ad..1770219ba 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -67,10 +67,10 @@ struct AISpells_Struct { }; struct AISpellsEffects_Struct { - uint16 spelleffectid; - int32 base; - int32 limit; - int32 max; + uint16 spelleffectid; + int32 base; + int32 limit; + int32 max; }; struct AISpellsVar_Struct { @@ -86,7 +86,7 @@ struct AISpellsVar_Struct { uint32 idle_no_sp_recast_min; uint32 idle_no_sp_recast_max; uint8 idle_beneficial_chance; -}; +}; class AA_SwarmPetInfo; @@ -163,7 +163,7 @@ public: FACTION_VALUE CheckNPCFactionAlly(int32 other_faction); 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 GetPetState(SpellBuff_Struct *buffs, uint32 *items, char *name); @@ -211,10 +211,10 @@ public: uint32 GetSp2() const { return spawn_group; } uint32 GetSpawnPointID() const; - float GetSpawnPointX() const { return org_x; } - float GetSpawnPointY() const { return org_y; } - float GetSpawnPointZ() const { return org_z; } - float GetSpawnPointH() const { return org_heading; } + float GetSpawnPointX() const { return m_SpawnPoint.m_X; } + float GetSpawnPointY() const { return m_SpawnPoint.m_Y; } + float GetSpawnPointZ() const { return m_SpawnPoint.m_Z; } + float GetSpawnPointH() const { return m_SpawnPoint.m_Heading; } float GetGuardPointX() const { return guard_x; } float GetGuardPointY() const { return guard_y; } 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); } - float org_x, org_y, org_z, org_heading; + xyz_heading m_SpawnPoint; uint32 GetMaxDMG() const {return max_dmg;} uint32 GetMinDMG() const {return min_dmg;} @@ -385,7 +385,7 @@ public: inline void SetHealScale(float amt) { healscale = amt; } inline float GetHealScale() { return healscale; } - + inline void SetSpellFocusDMG(int32 NewSpellFocusDMG) {SpellFocusDMG = NewSpellFocusDMG;} inline int32 GetSpellFocusDMG() const { return SpellFocusDMG;} @@ -443,7 +443,7 @@ protected: virtual bool AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes); virtual bool AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0); AISpellsVar_Struct AISpellVar; - + uint32 npc_spells_effects_id; std::vector AIspellsEffects; bool HasAISpellEffects; @@ -510,7 +510,7 @@ protected: //mercenary stuff std::list mercTypeList; std::list mercDataList; - + bool raid_target; uint8 probability;