public void unpack(WoWpacket pkt, int entry) { if ((entry & 0x80000000) != 0) { m_entry = entry & 0x7fffffff; m_valid = false; m_name = "?"; WoWgame.self().showDebug("Creature " + m_entry + " not found"); return; } m_entry = entry; m_name = pkt.getString(); pkt.getString(); pkt.getString(); pkt.getString(); m_description = pkt.getString(); m_iconName = pkt.getString(); m_flags = pkt.getInt(); m_type = pkt.getInt(); // more to decode WoWwdbc db = WoWwdbc.cached("resource:/dbc/CreatureType.dbc"); if (db != null) { int idx = db.getRecord(0, m_type); m_typeName = db.getString(1, idx); } WoWgame.self() .showDebug( "Creature " + m_entry + " is " + m_name + (m_description.length() == 0 ? "" : " : ") + m_description); m_valid = true; }
public InfoCreature(WoWpacket pkt) { super(0); pkt.reset(); unpack(pkt, pkt.getInt()); }