public CreatureSpawn CreateCreatureSpawn(object[] data) { long guid = long.Parse(data[0].ToString()); long id = long.Parse(data[1].ToString()); int map = int.Parse(data[2].ToString()); int modelid = int.Parse(data[8].ToString()); float pos_x = float.Parse(data[3].ToString()); float pos_y = float.Parse(data[4].ToString()); float pos_z = float.Parse(data[5].ToString()); float orientation = float.Parse(data[6].ToString()); CreatureSpawn cs = new CreatureSpawn(guid, id, map, modelid, pos_x, pos_y, pos_z, orientation, 0, 0); return cs; }
public CreatureSpawn CreateCreatureSpawn(object[] data) { long guid = long.Parse(data[0].ToString()); long id = long.Parse(data[1].ToString()); int map = int.Parse(data[2].ToString()); int modelid = int.Parse(data[8].ToString()); float pos_x = float.Parse(data[3].ToString()); float pos_y = float.Parse(data[4].ToString()); float pos_z = float.Parse(data[5].ToString()); float orientation = float.Parse(data[6].ToString()); CreatureSpawn cs = new CreatureSpawn(guid, id, map, modelid, pos_x, pos_y, pos_z, orientation, 0, 0); return(cs); }
public string GetCreatureSpawnInsertQuery(CreatureSpawn cs) { StringBuilder sb = new StringBuilder(); sb.Append("INSERT INTO `creature_spawns` (`id`, `entry`, `map`, `displayid`, `position_x`, `position_y`, `position_z`, `orientation`) VALUES ("); string[] placeholder = GetSQLSpawnPlaceholder(); for (int i = 0; i < placeholder.Length; i++) { sb.Append(placeholder[i]); if (i + 1 < placeholder.Length) { sb.Append(","); } } sb.Append(");"); return sb.ToString(); }
public string GetCreatureSpawnInsertQuery(CreatureSpawn cs) { StringBuilder sb = new StringBuilder(); sb.Append("INSERT INTO `creature` (`guid`, `id`, `map`, `modelid`, `position_x`, `position_y`, `position_z`, `orientation`, `curhealth`, `curmana`) VALUES ("); string[] placeholder = GetSQLSpawnPlaceholder(); for (int i = 0; i < placeholder.Length; i++) { sb.Append(placeholder[i]); if (i + 1 < placeholder.Length) { sb.Append(", "); } } sb.Append(");"); return(sb.ToString()); }
public object[] GetSQLSpawnValues(CreatureSpawn cs) { return new object[] { cs.guid, cs.id, cs.map, cs.modelid, cs.pos_x, cs.pos_y, cs.pos_z, cs.orientation }; }
public object[] GetSQLSpawnValues(CreatureSpawn cs) { return(new object[] { cs.guid, cs.id, cs.map, cs.modelid, cs.pos_x, cs.pos_y, cs.pos_z, cs.orientation, cs.curHealth, cs.curMana }); }
private void testInsertCreatureSpawn() { CreatureSpawn spawn = new CreatureSpawn(2000000, 40627, 999, 32106, 999.5f, 999.6f, 999.7f, 999.8f, 599, 599); try { MessageBox.Show("Inserted " + con.AddCreatureSpawn(core, spawn) + " row(s)!"); } catch (MySqlException ex) { MessageBox.Show("Insert Creature Spawn failed(guid="+spawn.guid+"): " + ex.Message); } }