mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 16:41:29 +00:00
QuestManager::spawn2 converted to xyz_heading
This commit is contained in:
parent
0ad62461f0
commit
2e0cfa86bf
@ -218,11 +218,9 @@ XS(XS__spawn)
|
|||||||
int npc_type = (int)SvIV(ST(0));
|
int npc_type = (int)SvIV(ST(0));
|
||||||
int grid = (int)SvIV(ST(1));
|
int grid = (int)SvIV(ST(1));
|
||||||
int unused = (int)SvIV(ST(2));
|
int unused = (int)SvIV(ST(2));
|
||||||
float x = (float)SvNV(ST(3));
|
auto position = xyz_heading((float)SvNV(ST(3)), (float)SvNV(ST(4)), (float)SvNV(ST(5)), 0.0f);
|
||||||
float y = (float)SvNV(ST(4));
|
|
||||||
float z = (float)SvNV(ST(5));
|
|
||||||
|
|
||||||
Mob *r = quest_manager.spawn2(npc_type, grid, unused, x, y, z, 0);
|
Mob *r = quest_manager.spawn2(npc_type, grid, unused, position);
|
||||||
RETVAL = (r != nullptr) ? r->GetID() : 0;
|
RETVAL = (r != nullptr) ? r->GetID() : 0;
|
||||||
XSprePUSH; PUSHu((UV)RETVAL);
|
XSprePUSH; PUSHu((UV)RETVAL);
|
||||||
|
|
||||||
@ -242,12 +240,9 @@ XS(XS__spawn2)
|
|||||||
int npc_type = (int)SvIV(ST(0));
|
int npc_type = (int)SvIV(ST(0));
|
||||||
int grid = (int)SvIV(ST(1));
|
int grid = (int)SvIV(ST(1));
|
||||||
int unused = (int)SvIV(ST(2));
|
int unused = (int)SvIV(ST(2));
|
||||||
float x = (float)SvNV(ST(3));
|
auto position = xyz_heading((float)SvNV(ST(3)), (float)SvNV(ST(4)), (float)SvNV(ST(5)), (float)SvNV(ST(6)));
|
||||||
float y = (float)SvNV(ST(4));
|
|
||||||
float z = (float)SvNV(ST(5));
|
|
||||||
float heading = (float)SvNV(ST(6));
|
|
||||||
|
|
||||||
Mob *r = quest_manager.spawn2(npc_type, grid, unused, x, y, z, heading);
|
Mob *r = quest_manager.spawn2(npc_type, grid, unused, position);
|
||||||
RETVAL = (r != nullptr) ? r->GetID() : 0;
|
RETVAL = (r != nullptr) ? r->GetID() : 0;
|
||||||
XSprePUSH; PUSHu((UV)RETVAL);
|
XSprePUSH; PUSHu((UV)RETVAL);
|
||||||
|
|
||||||
|
|||||||
@ -251,8 +251,8 @@ void unregister_spell_event(int evt, int spell_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Lua_Mob lua_spawn2(int npc_type, int grid, int unused, double x, double y, double z, double heading) {
|
Lua_Mob lua_spawn2(int npc_type, int grid, int unused, double x, double y, double z, double heading) {
|
||||||
return Lua_Mob(quest_manager.spawn2(npc_type, grid, unused,
|
auto position = xyz_heading(x, y, z, heading);
|
||||||
static_cast<float>(x), static_cast<float>(y), static_cast<float>(z), static_cast<float>(heading)));
|
return Lua_Mob(quest_manager.spawn2(npc_type, grid, unused, position));
|
||||||
}
|
}
|
||||||
|
|
||||||
Lua_Mob lua_unique_spawn(int npc_type, int grid, int unused, double x, double y, double z, double heading = 0.0) {
|
Lua_Mob lua_unique_spawn(int npc_type, int grid, int unused, double x, double y, double z, double heading = 0.0) {
|
||||||
|
|||||||
@ -241,11 +241,11 @@ void QuestManager::write(const char *file, const char *str) {
|
|||||||
fclose (pFile);
|
fclose (pFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
Mob* QuestManager::spawn2(int npc_type, int grid, int unused, float x, float y, float z, float heading) {
|
Mob* QuestManager::spawn2(int npc_type, int grid, int unused, const xyz_heading& position) {
|
||||||
const NPCType* tmp = 0;
|
const NPCType* tmp = 0;
|
||||||
if (tmp = database.GetNPCType(npc_type))
|
if (tmp = database.GetNPCType(npc_type))
|
||||||
{
|
{
|
||||||
NPC* npc = new NPC(tmp, nullptr, xyz_heading(x, y, z, heading), FlyMode3);
|
NPC* npc = new NPC(tmp, nullptr, position, FlyMode3);
|
||||||
npc->AddLootTable();
|
npc->AddLootTable();
|
||||||
entity_list.AddNPC(npc,true,true);
|
entity_list.AddNPC(npc,true,true);
|
||||||
if(grid > 0)
|
if(grid > 0)
|
||||||
|
|||||||
@ -56,7 +56,7 @@ public:
|
|||||||
void me(const char *str);
|
void me(const char *str);
|
||||||
void summonitem(uint32 itemid, int16 charges = -1);
|
void summonitem(uint32 itemid, int16 charges = -1);
|
||||||
void write(const char *file, const char *str);
|
void write(const char *file, const char *str);
|
||||||
Mob* spawn2(int npc_type, int grid, int unused, float x, float y, float z, float heading);
|
Mob* spawn2(int npc_type, int grid, int unused, const xyz_heading& position);
|
||||||
Mob* unique_spawn(int npc_type, int grid, int unused, float x, float y, float z, float heading = 0);
|
Mob* unique_spawn(int npc_type, int grid, int unused, float x, float y, float z, float heading = 0);
|
||||||
Mob* spawn_from_spawn2(uint32 spawn2_id);
|
Mob* spawn_from_spawn2(uint32 spawn2_id);
|
||||||
void enable_spawn2(uint32 spawn2_id);
|
void enable_spawn2(uint32 spawn2_id);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user