Skip to content

Commit 0c30141

Browse files
authored
[Zone] Make zone controller less likely to be visible, immune to all forms of combat (#4750)
* [Zone] Make zone controller less likely to be visible, immune to all forms of combat * Exclude zone controller from scanning
1 parent d6a21be commit 0c30141

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

zone/entity.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2914,7 +2914,7 @@ void EntityList::ScanCloseMobs(Mob *scanning_mob)
29142914
return;
29152915
}
29162916

2917-
if (scanning_mob->GetID() <= 0) {
2917+
if (scanning_mob->GetID() <= 0 || scanning_mob->IsZoneController()) {
29182918
return;
29192919
}
29202920

@@ -2933,7 +2933,7 @@ void EntityList::ScanCloseMobs(Mob *scanning_mob)
29332933
for (auto &e : mob_list) {
29342934
auto mob = e.second;
29352935

2936-
if (mob && mob->GetID() <= 0) {
2936+
if (mob && (mob->GetID() <= 0 || mob->IsZoneController())) {
29372937
continue;
29382938
}
29392939

zone/mob.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -1453,6 +1453,10 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
14531453
ns->spawn.flymode = 0;
14541454
}
14551455

1456+
if (IsZoneController()) {
1457+
ns->spawn.invis = 255; // gm invis
1458+
}
1459+
14561460
if (RuleB(Character, AllowCrossClassTrainers) && ForWho) {
14571461
if (ns->spawn.class_ >= Class::WarriorGM && ns->spawn.class_ <= Class::BerserkerGM) {
14581462
int trainer_class = Class::WarriorGM + (ForWho->GetClass() - 1);
@@ -8347,7 +8351,7 @@ int Mob::DispatchZoneControllerEvent(
83478351
RuleB(Zone, UseZoneController) &&
83488352
(
83498353
!IsNPC() ||
8350-
(IsNPC() && GetNPCTypeID() != ZONE_CONTROLLER_NPC_ID)
8354+
(IsNPC() && !IsZoneController())
83518355
)
83528356
) {
83538357
auto controller = entity_list.GetNPCByNPCTypeID(ZONE_CONTROLLER_NPC_ID);

zone/mob.h

+1
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,7 @@ class Mob : public Entity {
671671
((static_cast<float>(current_mana) / max_mana) * 100); }
672672
virtual int64 CalcMaxMana();
673673
uint32 GetNPCTypeID() const { return npctype_id; }
674+
inline bool IsZoneController() const { return npctype_id == ZONE_CONTROLLER_NPC_ID; }
674675
void SetNPCTypeID(uint32 npctypeid) { npctype_id = npctypeid; }
675676
inline const glm::vec4& GetPosition() const { return m_Position; }
676677
inline void SetPosition(const float x, const float y, const float z) { m_Position.x = x; m_Position.y = y; m_Position.z = z; }

zone/npc.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -941,13 +941,14 @@ bool NPC::SpawnZoneController()
941941

942942
npc_type->findable = 0;
943943
npc_type->trackable = 0;
944+
npc_type->untargetable = 1;
944945

945-
strcpy(npc_type->special_abilities, "12,1^13,1^14,1^15,1^16,1^17,1^19,1^22,1^24,1^25,1^28,1^31,1^35,1^39,1^42,1");
946+
strcpy(npc_type->special_abilities, "1,1,3000,50^12,1^14,1^16,1^18,1^19,1^20,1^21,1^22,1^23,1^24,1^25,1^26,1^32,1^33,1^35,1^46,1^47,1^48,1^49,1^50,1^52,1^53,1^54,1^55,1^56,1^57,1");
946947

947948
glm::vec4 point;
948-
point.x = 3000;
949-
point.y = 1000;
950-
point.z = 500;
949+
point.x = 30000;
950+
point.y = 10000;
951+
point.z = -10000;
951952

952953
auto npc = new NPC(npc_type, nullptr, point, GravityBehavior::Flying);
953954
npc->GiveNPCTypeData(npc_type);

0 commit comments

Comments
 (0)