Index: src/game/Chat.cpp =================================================================== --- src/game/Chat.cpp (revision 2788) +++ src/game/Chat.cpp (working copy) @@ -194,7 +194,12 @@ { "rage", 'm', NULL, "Rage Points", NULL, UNIT_FIELD_POWER2, UNIT_FIELD_MAXPOWER2, 1 }, { "energy", 'm', NULL, "Energy Points", NULL, UNIT_FIELD_POWER4, UNIT_FIELD_MAXPOWER4, 1 }, { "level", 'm', &ChatHandler::HandleModifyLevelCommand,"Level", NULL, 0, 0, 0 }, - { "armor", 'm', NULL, "Armor", NULL, UNIT_FIELD_STAT1, 0, 1 }, + { "strength", 'm', NULL, "Strength", NULL, UNIT_FIELD_STAT0, 0, 1 }, + { "agility", 'm', NULL, "Agility", NULL, UNIT_FIELD_STAT1, 0, 1 }, + { "stamina", 'm', NULL, "Stamina", NULL, UNIT_FIELD_STAT2, 0, 1 }, + { "intellect", 'm', NULL, "Intellect", NULL, UNIT_FIELD_STAT3, 0, 1 }, + { "spirit", 'm', NULL, "Spirit", NULL, UNIT_FIELD_STAT4, 0, 1 }, + { "armor", 'm', NULL, "Armor", NULL, UNIT_FIELD_RESISTANCES, 0, 1 }, { "holy", 'm', NULL, "Holy Resistance", NULL, UNIT_FIELD_RESISTANCES_01, 0, 1 }, { "fire", 'm', NULL, "Fire Resistance", NULL, UNIT_FIELD_RESISTANCES_02, 0, 1 }, { "nature", 'm', NULL, "Nature Resistance", NULL, UNIT_FIELD_RESISTANCES_03, 0, 1 }, @@ -212,7 +217,6 @@ { "dynamicflags",'m',NULL, "Dynamic Flags", NULL, UNIT_DYNAMIC_FLAGS, 0, 1 }, { "talentpoints",'m',NULL, "Talent Points", NULL, PLAYER_CHARACTER_POINTS1, 0, 1 }, { "loyalty", 'm', NULL, "Loyalty", NULL, UNIT_FIELD_POWER5, UNIT_FIELD_MAXPOWER5, 1 }, - { "spirit", 'm', NULL, "Spirit", NULL, UNIT_FIELD_STAT0, 0, 1 }, { "boundingraidius",'m',NULL, "Bounding Radius", NULL, UNIT_FIELD_BOUNDINGRADIUS, 0, 2 }, { "combatreach",'m',NULL, "Combat Reach", NULL, UNIT_FIELD_COMBATREACH, 0, 2 }, { "emotestate",'m', NULL, "NPC Emote State", NULL, UNIT_NPC_EMOTESTATE, 0, 1 }, Index: src/game/Level3.cpp =================================================================== --- src/game/Level3.cpp (revision 2788) +++ src/game/Level3.cpp (working copy) @@ -494,34 +494,61 @@ bool ChatHandler::HandleNpcInfoCommand(const char *args, WorldSession *m_session) { char msg[512]; - uint32 guid = GUID_LOPART(m_session->GetPlayer()->GetSelection()); - Creature *crt = getSelectedCreature(m_session); - if(!crt) return false; - if(crt->GetCreatureName()) - BlueSystemMessage(m_session, "Showing creature info for %s", crt->GetCreatureName()->Name); - snprintf(msg,512,"GUID: %d\nFaction: %d\nNPCFlags: %d\nDisplayID: %d", (int)guid, (int)crt->GetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE), (int)crt->GetUInt32Value(UNIT_NPC_FLAGS), (int)crt->GetUInt32Value(UNIT_FIELD_DISPLAYID)); - SystemMessage(m_session, msg); - if(crt->m_faction) - GreenSystemMessage(m_session, "Combat Support: 0x%.3X", crt->m_faction->FriendlyMask); - GreenSystemMessage(m_session, "Base Health: %d", crt->GetUInt32Value(UNIT_FIELD_BASE_HEALTH)); - GreenSystemMessage(m_session, "Base Armor: %d", crt->GetUInt32Value(UNIT_FIELD_STAT1)*2); - GreenSystemMessage(m_session, "Base Mana: %d", crt->GetUInt32Value(UNIT_FIELD_MAXPOWER1)); - GreenSystemMessage(m_session, "Base Holy: %d", crt->GetUInt32Value(UNIT_FIELD_RESISTANCES_01)); - GreenSystemMessage(m_session, "Base Fire: %d", crt->GetUInt32Value(UNIT_FIELD_RESISTANCES_02)); - GreenSystemMessage(m_session, "Base Nature: %d", crt->GetUInt32Value(UNIT_FIELD_RESISTANCES_03)); - GreenSystemMessage(m_session, "Base Frost: %d", crt->GetUInt32Value(UNIT_FIELD_RESISTANCES_04)); - GreenSystemMessage(m_session, "Base Shadow: %d", crt->GetUInt32Value(UNIT_FIELD_RESISTANCES_05)); - GreenSystemMessage(m_session, "Base Arcane: %d", crt->GetUInt32Value(UNIT_FIELD_RESISTANCES_06)); - GreenSystemMessage(m_session, "Damage min/max: %f/%f", crt->GetFloatValue(UNIT_FIELD_MINDAMAGE),crt->GetFloatValue(UNIT_FIELD_MAXDAMAGE)); - - ColorSystemMessage(m_session, MSG_COLOR_RED, "Entry ID: %d", crt->GetUInt32Value(OBJECT_FIELD_ENTRY)); - ColorSystemMessage(m_session, MSG_COLOR_RED, "SQL Entry ID: %d", crt->GetSQL_id()); - // show byte - std::stringstream sstext; - uint32 theBytes = crt->GetUInt32Value(UNIT_FIELD_BYTES_0); - sstext << "UNIT_FIELD_BYTES_0 are " << uint16((uint8)theBytes & 0xFF) << " " << uint16((uint8)(theBytes >> 8) & 0xFF) << " "; - sstext << uint16((uint8)(theBytes >> 16) & 0xFF) << " " << uint16((uint8)(theBytes >> 24) & 0xFF) << '\0'; - BlueSystemMessage(m_session, sstext.str().c_str()); + Player* target = objmgr.GetPlayer((uint32)m_session->GetPlayer()->GetSelection()); + if(!target) + { + uint32 guid = GUID_LOPART(m_session->GetPlayer()->GetSelection()); + Creature *crt = getSelectedCreature(m_session); + if(!crt) return false; + if(crt->GetCreatureName()) + BlueSystemMessage(m_session, "Showing creature info for %s", crt->GetCreatureName()->Name); + snprintf(msg,512,"GUID: %d\nFaction: %d\nNPCFlags: %d\nDisplayID: %d (Native: %d)", (int)guid, (int)crt->GetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE), (int)crt->GetUInt32Value(UNIT_NPC_FLAGS), (int)crt->GetUInt32Value(UNIT_FIELD_DISPLAYID), crt->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID)); + SystemMessage(m_session, msg); + if(crt->m_faction) + GreenSystemMessage(m_session, "Combat Support: 0x%.3X", crt->m_faction->FriendlyMask); + GreenSystemMessage(m_session, "Base Health: %d", crt->GetUInt32Value(UNIT_FIELD_BASE_HEALTH)); + GreenSystemMessage(m_session, "Base Mana: %d", crt->GetUInt32Value(UNIT_FIELD_MAXPOWER1)); + GreenSystemMessage(m_session, "Base Armor: %d", crt->GetUInt32Value(UNIT_FIELD_RESISTANCES)); + GreenSystemMessage(m_session, "Resistances (Holy/Fire/Nature/Frost/Shadow/Arcane): %d/%d/%d/%d/%d/%d", crt->GetUInt32Value(UNIT_FIELD_RESISTANCES_01), crt->GetUInt32Value(UNIT_FIELD_RESISTANCES_02), crt->GetUInt32Value(UNIT_FIELD_RESISTANCES_03), crt->GetUInt32Value(UNIT_FIELD_RESISTANCES_04), crt->GetUInt32Value(UNIT_FIELD_RESISTANCES_05), crt->GetUInt32Value(UNIT_FIELD_RESISTANCES_06)); + GreenSystemMessage(m_session, "Damage min/max: %f/%f", crt->GetFloatValue(UNIT_FIELD_MINDAMAGE),crt->GetFloatValue(UNIT_FIELD_MAXDAMAGE)); + + ColorSystemMessage(m_session, MSG_COLOR_RED, "Entry ID: %d", crt->GetUInt32Value(OBJECT_FIELD_ENTRY)); + ColorSystemMessage(m_session, MSG_COLOR_RED, "SQL Entry ID: %d", crt->GetSQL_id()); + // show byte + std::stringstream sstext; + uint32 theBytes = crt->GetUInt32Value(UNIT_FIELD_BYTES_0); + sstext << "UNIT_FIELD_BYTES_0 are " << uint16((uint8)theBytes & 0xFF) << " " << uint16((uint8)(theBytes >> 8) & 0xFF) << " "; + sstext << uint16((uint8)(theBytes >> 16) & 0xFF) << " " << uint16((uint8)(theBytes >> 24) & 0xFF) << '\0'; + BlueSystemMessage(m_session, sstext.str().c_str()); + } + else + { + BlueSystemMessage(m_session, "Showing player info for %s", target->GetName()); + snprintf(msg,512,"GUID: %d\nFaction: %d\nFlags: %d\nDisplayID: %d (Native: %d)", target->GetGUIDLow(), (int)target->GetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE), (int)target->GetUInt32Value(UNIT_FIELD_FLAGS), (int)target->GetUInt32Value(UNIT_FIELD_DISPLAYID), target->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID)); + SystemMessage(m_session, msg); + GreenSystemMessage(m_session, "Base Health: %d", target->GetUInt32Value(UNIT_FIELD_MAXHEALTH)); + GreenSystemMessage(m_session, "Base Mana/Rage/Energy: %d/%d/%d", target->GetUInt32Value(UNIT_FIELD_MAXPOWER1), target->GetUInt32Value(UNIT_FIELD_MAXPOWER2), target->GetUInt32Value(UNIT_FIELD_MAXPOWER4)); + GreenSystemMessage(m_session, "Base Strength: %d", target->GetUInt32Value(UNIT_FIELD_STAT0)); + GreenSystemMessage(m_session, "Base Agility: %d", target->GetUInt32Value(UNIT_FIELD_STAT1)); + GreenSystemMessage(m_session, "Base Stamina: %d", target->GetUInt32Value(UNIT_FIELD_STAT2)); + GreenSystemMessage(m_session, "Base Intellect: %d", target->GetUInt32Value(UNIT_FIELD_STAT3)); + GreenSystemMessage(m_session, "Base Spirit: %d", target->GetUInt32Value(UNIT_FIELD_STAT4)); + GreenSystemMessage(m_session, "Base Armor: %d", target->GetUInt32Value(UNIT_FIELD_RESISTANCES)); + GreenSystemMessage(m_session, "Resistances (Holy/Fire/Nature/Frost/Shadow/Arcane): %d/%d/%d/%d/%d/%d", target->GetUInt32Value(UNIT_FIELD_RESISTANCES_01), target->GetUInt32Value(UNIT_FIELD_RESISTANCES_02), target->GetUInt32Value(UNIT_FIELD_RESISTANCES_03), target->GetUInt32Value(UNIT_FIELD_RESISTANCES_04), target->GetUInt32Value(UNIT_FIELD_RESISTANCES_05), target->GetUInt32Value(UNIT_FIELD_RESISTANCES_06)); + GreenSystemMessage(m_session, "Damage min/max: %f/%f", target->GetFloatValue(UNIT_FIELD_MINDAMAGE),target->GetFloatValue(UNIT_FIELD_MAXDAMAGE)); + GreenSystemMessage(m_session, "Size/Scale: %f", target->GetFloatValue(OBJECT_FIELD_SCALE_X)); + GreenSystemMessage(m_session, "Player Experience: %d/%d (%d Rested)", target->GetUInt32Value(PLAYER_XP), target->GetUInt32Value(PLAYER_NEXT_LEVEL_XP), target->GetUInt32Value(PLAYER_REST_STATE_EXPERIENCE)); + GreenSystemMessage(m_session, "Player Coinage: %d", target->GetUInt32Value(PLAYER_FIELD_COINAGE)); + GreenSystemMessage(m_session, "Movement Speed: %f", target->m_runSpeed); + GreenSystemMessage(m_session, "Bounding Radius: %f", target->GetFloatValue(UNIT_FIELD_BOUNDINGRADIUS)); + GreenSystemMessage(m_session, "Combat Reach: %f", target->GetFloatValue(UNIT_FIELD_COMBATREACH)); + // show byte + std::stringstream sstext; + uint32 theBytes = target->GetUInt32Value(UNIT_FIELD_BYTES_0); + sstext << "UNIT_FIELD_BYTES_0 are " << uint16((uint8)theBytes & 0xFF) << " " << uint16((uint8)(theBytes >> 8) & 0xFF) << " "; + sstext << uint16((uint8)(theBytes >> 16) & 0xFF) << " " << uint16((uint8)(theBytes >> 24) & 0xFF) << '\0'; + BlueSystemMessage(m_session, sstext.str().c_str()); + } return true; }