switch(uiAction)
{
case 0:
if(Player->HasItemCount(race_token, 1))
{
Player->DestroyItemCount(race_token, 1, true, false);
Player->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '128' WHERE guid = %u", Player->GetGUID());
Player->GetSession()->SendNotification("You need to relog, to change your race!");
Player->PlayerTalkClass->SendCloseGossip();
}
else
{
Player->GetSession()->SendNotification("You need atleast one race change token!");
Player->PlayerTalkClass->SendCloseGossip();
}
break;
case 1:
if(Player->HasItemCount(faction_token, 1))
{
Player->DestroyItemCount(faction_token, 1, true, false);
Player->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '64' WHERE guid = %u", Player->GetGUID());
Player->GetSession()->SendNotification("You need to relog, to change your faction!");
Player->PlayerTalkClass->SendCloseGossip();
}
else
{
Player->GetSession()->SendNotification("You need atleast one faction change token!");
Player->PlayerTalkClass->SendCloseGossip();
}
break;
}
return true;
}