View Single Post
  #7  
Old 08-02-2015, 02:22 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

A couple more glitches in #npc create are causing problems.

spawngroupid and npc_type_id aren't being set in the spawn struct when they're created in the database, so the values for those in the Mob class are zeroes.

Fixes with these three new lines:

zone/npc.cpp:
Quote:
@@ -1076,6 +1076,9 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char *zone, uint32 zone_version,
return false;
}
uint32 spawngroupid = results.LastInsertedID();

+ spawn->SetSp2(spawngroupid);
+ spawn->SetNPCTypeID(npc_type_id);

query = StringFormat("INSERT INTO spawn2 (zone, version, x, y, z, respawntime, heading, spawngroupID) "
"VALUES('%s', %u, %f, %f, %f, %i, %f, %i)",
zone/mob.h
Quote:
@@ -431,6 +431,7 @@ public:
((static_cast<float>(cur_mana) / max_mana) * 100); }
virtual int32 CalcMaxMana();
uint32 GetNPCTypeID() const { return npctype_id; }
+ void SetNPCTypeID(uint32 npctypeid) { npctype_id = npctypeid; }
inline const glm::vec4& GetPosition() const { return m_Position; }
inline const float GetX() const { return m_Position.x; }
inline const float GetY() const { return m_Position.y; }
Reply With Quote