/* Made by: aaddss A.K.A Deathsoul untested (in game) */ #include "ScriptPCH.h" class npc_tool : public CreatureScript { public: npc_tool() : CreatureScript("npc_tool"){} bool OnGossipHello(Player * pPlayer, Creature * pCreature) { pPlayer->ADD_GOSSIP_ITEM(4, " 种族修改 5个物品消耗", GOSSIP_SENDER_MAIN, 0); pPlayer->ADD_GOSSIP_ITEM(4, " 阵营修改 10个物品消耗", GOSSIP_SENDER_MAIN, 1); pPlayer->ADD_GOSSIP_ITEM(4, " 修改外貌 1个物品消耗", GOSSIP_SENDER_MAIN, 2); pPlayer->ADD_GOSSIP_ITEM(4, " 修改名字 1个物品消耗", GOSSIP_SENDER_MAIN, 3); pPlayer->PlayerTalkClass->SendGossipMenu(9425, pCreature->GetGUID()); return true; } bool OnGossipSelect(Player * Player, Creature * Creature, uint32 /*uiSender*/, uint32 uiAction) { if(!Player) return true; switch(uiAction) { case 0: if(Player->HasItemCount(12345, 5)) // 修改一下12345,修改成你需要设置消耗的物品ID { Player->DestroyItemCount(12345, 5, true, true); // 销毁该物品 Player->DestroyItemCount(12345, 5, true, false); // race change token (12345) you can change it Player->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE); CharacterDatabase.PExecute("UPDATe characters Set at_login = at_login | '128' Where guid = %u", Player->GetGUID()); Player->GetSession()->SendNotification("你需要重新登录,然后才能修改种族!"); Player->PlayerTalkClass->CloseGossip(); } else { Player->GetSession()->SendNotification("You need atleast 5 race change token!"); Player->PlayerTalkClass->CloseGossip(); } break; case 1: if(Player->HasItemCount(123, 10)) // 修改一下123,修改成你需要设置消耗的物品ID { Player->DestroyItemCount(123, 10, true, true); // race change token (123) you can change it Player->DestroyItemCount(123, 10, true, false); // race change token (123) you can change it Player->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION); CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '64' WHERE guid = %u", Player->GetGUID()); Player->GetSession()->SendNotification("你需要重新登录,然后才能修改阵营!"); Player->PlayerTalkClass->CloseGossip(); } else { Player->GetSession()->SendNotification("you need atleast 10 faction change token!"); Player->PlayerTalkClass->CloseGossip(); } break; case 2: if(Player->HasItemCount(152, 1)) //修改一下152,修改成你需要设置消耗的物品ID { Player->DestroyItemCount(152, 1, true, true); // customize change token (152) you can change it Player->DestroyItemCount(152, 1, true, false); // customize change token (152) you can change it Player->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE); CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '8' WHERE guid = %u", Player->GetGUID()); Player->GetSession()->SendNotification("你需要重新登录,然后才能修改角色外貌!"); Player->PlayerTalkClass->CloseGossip(); } else { Player->GetSession()->SendNotification("you need atleast 1 customize change token!"); Player->PlayerTalkClass->CloseGossip(); } break; case 3: if(Player->HasItemCount(152, 1)) // 修改一下152,修改成你需要设置消耗的物品ID { Player->DestroyItemCount(1552, 1, true, true); // name change token (1552) you can change it Player->DestroyItemCount(1552, 1, true, false); // name change token (1552) you can change it Player->SetAtLoginFlag(AT_LOGIN_RENAME); CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '8' WHERE guid = %u", Player->GetGUID()); Player->GetSession()->SendNotification("you need to relog, to change your name!"); Player->PlayerTalkClass->CloseGossip(); } else { Player->GetSession()->SendNotification("you need atleast 1 name change token!"); Player->PlayerTalkClass->CloseGossip(); } break; } return true; } }; void AddSc_npc_tool() { new npc_tool(); }