Add support for virtual zonepoints

This commit is contained in:
Akkadius
2020-08-16 00:06:20 -05:00
parent 9d0f7781b4
commit f78828216d
14 changed files with 387 additions and 59 deletions
+38
View File
@@ -1118,6 +1118,44 @@ void NPC::SpawnGridNodeNPC(const glm::vec4 &position, int32 grid_number, int32 z
entity_list.AddNPC(npc);
}
void NPC::SpawnZonePointNodeNPC(std::string name, const glm::vec4 &position)
{
auto npc_type = new NPCType;
memset(npc_type, 0, sizeof(NPCType));
char node_name[64];
strn0cpy(node_name, name.c_str(), 64);
strcpy(npc_type->name, entity_list.MakeNameUnique(node_name));
npc_type->current_hp = 4000000;
npc_type->max_hp = 4000000;
npc_type->race = 2254;
npc_type->gender = 2;
npc_type->class_ = 9;
npc_type->deity = 1;
npc_type->level = 200;
npc_type->npc_id = 0;
npc_type->loottable_id = 0;
npc_type->texture = 1;
npc_type->light = 1;
npc_type->size = 5;
npc_type->runspeed = 0;
npc_type->merchanttype = 1;
npc_type->bodytype = 1;
npc_type->show_name = true;
npc_type->findable = true;
auto node_position = glm::vec4(position.x, position.y, position.z, position.w);
auto npc = new NPC(npc_type, nullptr, node_position, GravityBehavior::Flying);
npc->name[strlen(npc->name)-3] = (char) NULL;
npc->GiveNPCTypeData(npc_type);
entity_list.AddNPC(npc);
}
NPC * NPC::SpawnNodeNPC(std::string name, std::string last_name, const glm::vec4 &position) {
auto npc_type = new NPCType;
memset(npc_type, 0, sizeof(NPCType));