mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
Depop and cleanup existing node npc's when command executed again. Also remove string from "name" and leave metadata in "lastname" otherwise it is visually too busy
This commit is contained in:
parent
0d094754db
commit
dc87b8e78b
@ -2044,6 +2044,16 @@ void command_grid(Client *c, const Seperator *sep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Depop any node npc's already spawned
|
||||||
|
*/
|
||||||
|
auto &mob_list = entity_list.GetMobList();
|
||||||
|
for (auto itr = mob_list.begin(); itr != mob_list.end(); ++itr) {
|
||||||
|
Mob *mob = itr->second;
|
||||||
|
if (mob->IsNPC() && mob->GetRace() == 2254)
|
||||||
|
mob->Depop();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Spawn grid nodes
|
* Spawn grid nodes
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -989,7 +989,7 @@ NPC * NPC::SpawnGridNodeNPC(std::string name, const glm::vec4 &position, uint32
|
|||||||
auto npc_type = new NPCType;
|
auto npc_type = new NPCType;
|
||||||
memset(npc_type, 0, sizeof(NPCType));
|
memset(npc_type, 0, sizeof(NPCType));
|
||||||
|
|
||||||
sprintf(npc_type->name, "(%s)_%u", name.c_str(), grid_number);
|
sprintf(npc_type->name, "%u_%u", grid_id, grid_number);
|
||||||
sprintf(npc_type->lastname, "Number: %u Grid: %u Pause: %u", grid_number, grid_id, pause);
|
sprintf(npc_type->lastname, "Number: %u Grid: %u Pause: %u", grid_number, grid_id, pause);
|
||||||
|
|
||||||
npc_type->cur_hp = 4000000;
|
npc_type->cur_hp = 4000000;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user