mirror of
https://github.com/mangosfour/server.git
synced 2025-12-25 13:37:02 +00:00
[11852] Add support for db scripts assigned to gossip menus
This commit is contained in:
parent
83e85416f4
commit
4c82458874
13 changed files with 76 additions and 48 deletions
|
|
@ -13122,7 +13122,7 @@ void Player::SendPreparedGossip(WorldObject *pSource)
|
|||
uint32 textId = GetGossipTextId(pSource);
|
||||
|
||||
if (uint32 menuId = PlayerTalkClass->GetGossipMenu().GetMenuId())
|
||||
textId = GetGossipTextId(menuId);
|
||||
textId = GetGossipTextId(menuId, pSource);
|
||||
|
||||
PlayerTalkClass->SendGossipMenu(textId, pSource->GetObjectGuid());
|
||||
}
|
||||
|
|
@ -13271,7 +13271,7 @@ uint32 Player::GetGossipTextId(WorldObject *pSource)
|
|||
return DEFAULT_GOSSIP_MESSAGE;
|
||||
}
|
||||
|
||||
uint32 Player::GetGossipTextId(uint32 menuId)
|
||||
uint32 Player::GetGossipTextId(uint32 menuId, WorldObject* pSource)
|
||||
{
|
||||
uint32 textId = DEFAULT_GOSSIP_MESSAGE;
|
||||
|
||||
|
|
@ -13285,6 +13285,10 @@ uint32 Player::GetGossipTextId(uint32 menuId)
|
|||
if (sObjectMgr.IsPlayerMeetToCondition(this, itr->second.cond_1) && sObjectMgr.IsPlayerMeetToCondition(this, itr->second.cond_2))
|
||||
{
|
||||
textId = itr->second.text_id;
|
||||
|
||||
// Start related script
|
||||
if (itr->second.script_id)
|
||||
GetMap()->ScriptsStart(sGossipScripts, itr->second.script_id, this, pSource);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue