Merge pull request #371 from r-o-b-o-t-o/feat/send-update-world-state

Add Player::SendUpdateWorldState()
This commit is contained in:
Rochet2
2021-06-12 12:24:43 +03:00
committed by GitHub
2 changed files with 17 additions and 0 deletions

View File

@@ -728,6 +728,7 @@ ElunaRegister<Player> PlayerMethods[] =
{ "SendTabardVendorActivate", &LuaPlayer::SendTabardVendorActivate },
{ "SendSpiritResurrect", &LuaPlayer::SendSpiritResurrect },
{ "SendTaxiMenu", &LuaPlayer::SendTaxiMenu },
{ "SendUpdateWorldState", &LuaPlayer::SendUpdateWorldState },
{ "RewardQuest", &LuaPlayer::RewardQuest },
{ "SendAuctionMenu", &LuaPlayer::SendAuctionMenu },
{ "SendShowMailBox", &LuaPlayer::SendShowMailBox },

View File

@@ -1400,6 +1400,7 @@ namespace LuaPlayer
/**
* Returns the database textID of the [WorldObject]'s gossip header text for the [Player]
*
* @param WorldObject object
* @return uint32 textId : key to npc_text database table
*/
int GetGossipTextId(lua_State* L, Player* player)
@@ -2389,6 +2390,21 @@ namespace LuaPlayer
return 0;
}
/**
* Sends an update for the world state to the [Player]
*
* @param uint32 field
* @param uint32 value
*/
int SendUpdateWorldState(lua_State* L, Player* player)
{
uint32 field = Eluna::CHECKVAL<uint32>(L, 2);
uint32 value = Eluna::CHECKVAL<uint32>(L, 3);
player->SendUpdateWorldState(field, value);
return 0;
}
/**
* Forces the [Player] to log out
*