diff options
| author | raczman <none@none> | 2009-03-30 16:57:17 +0200 |
|---|---|---|
| committer | raczman <none@none> | 2009-03-30 16:57:17 +0200 |
| commit | 3f985645dbb8136986eeaf4c8cac6ba87c6e4b82 (patch) | |
| tree | 84f7bde584f7473e573b93638423501f441152de /src/bindings/scripts | |
| parent | 9d02feed4f2cdd41c5ec300e6582af8abe3b5fcd (diff) | |
Added GO gossip menu support. Kudos and cookies to arrai.
--HG--
branch : trunk
Diffstat (limited to 'src/bindings/scripts')
| -rw-r--r-- | src/bindings/scripts/ScriptMgr.cpp | 24 | ||||
| -rw-r--r-- | src/bindings/scripts/ScriptMgr.h | 2 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index 728bc435d81..0d7f47a4c84 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -2064,6 +2064,30 @@ bool GossipSelectWithCode( Player *player, Creature *_Creature, uint32 sender, u } TRINITY_DLL_EXPORT +bool GOSelect( Player *player, GameObject *_GO, uint32 sender, uint32 action ) +{ + debug_log("TSCR: Gossip selection, sender: %d, action: %d",sender, action); + + Script *tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId]; + if(!tmpscript || !tmpscript->pGOSelect) return false; + + player->PlayerTalkClass->ClearMenus(); + return tmpscript->pGOSelect(player,_GO,sender,action); +} + +TRINITY_DLL_EXPORT +bool GOSelectWithCode( Player *player, GameObject *_GO, uint32 sender, uint32 action, const char* sCode ) +{ + debug_log("TSCR: Gossip selection, sender: %d, action: %d",sender, action); + + Script *tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId]; + if(!tmpscript || !tmpscript->pGOSelectWithCode) return false; + + player->PlayerTalkClass->ClearMenus(); + return tmpscript->pGOSelectWithCode(player,_GO,sender,action,sCode); +} + +TRINITY_DLL_EXPORT bool QuestAccept( Player *player, Creature *_Creature, Quest const *_Quest ) { Script *tmpscript = m_scripts[_Creature->GetScriptId()]; diff --git a/src/bindings/scripts/ScriptMgr.h b/src/bindings/scripts/ScriptMgr.h index b3c25bfaffd..87a557779a2 100644 --- a/src/bindings/scripts/ScriptMgr.h +++ b/src/bindings/scripts/ScriptMgr.h @@ -44,6 +44,8 @@ struct Script bool (*pQuestAccept )(Player*, Creature*, Quest const* ); bool (*pGossipSelect )(Player*, Creature*, uint32 , uint32 ); bool (*pGossipSelectWithCode)(Player*, Creature*, uint32 , uint32 , const char* ); + bool (*pGOSelect )(Player*, GameObject*, uint32 , uint32 ); + bool (*pGOSelectWithCode )(Player*, GameObject*, uint32 , uint32 , const char* ); bool (*pQuestSelect )(Player*, Creature*, Quest const* ); bool (*pQuestComplete )(Player*, Creature*, Quest const* ); uint32 (*pNPCDialogStatus )(Player*, Creature* ); |
