MANGOS_DLL_EXPORT CreatureAI* GetAI(Creature *_Creature ) { Script *tmpscript = GetScriptByName(_Creature->GetCreatureInfo()->ScriptName); if(!tmpscript || !tmpscript->GetAI) return NULL; return tmpscript->GetAI(_Creature); }
AIScriptPlayer * AIScriptManager :: AddActiveScript(const char *name) { AIScriptDef *def = GetScriptByName(name); if(def == NULL) return NULL; aiAct.push_back(AIScriptPlayer()); aiAct.back().Initialize(def); return &aiAct.back(); }
MANGOS_DLL_EXPORT bool ReceiveEmote ( Player *player, Creature *_Creature, uint32 emote ) { Script *tmpscript = NULL; tmpscript = GetScriptByName(_Creature->GetCreatureInfo()->ScriptName); if(!tmpscript || !tmpscript->pReceiveEmote) return false; return tmpscript->pReceiveEmote(player,_Creature, emote); }
MANGOS_DLL_EXPORT bool ItemUse( Player *player, Item* _Item, SpellCastTargets const& targets) { Script *tmpscript = NULL; tmpscript = GetScriptByName(_Item->GetProto()->ScriptName); if(!tmpscript || !tmpscript->pItemUse) return false; return tmpscript->pItemUse(player,_Item,targets); }
MANGOS_DLL_EXPORT bool QuestAccept( Player *player, Creature *_Creature, Quest *_Quest ) { Script *tmpscript = NULL; tmpscript = GetScriptByName(_Creature->GetCreatureInfo()->ScriptName); if(!tmpscript || !tmpscript->pQuestAccept) return false; player->PlayerTalkClass->ClearMenus(); return tmpscript->pQuestAccept(player,_Creature,_Quest); }
MANGOS_DLL_EXPORT bool GossipSelectWithCode( Player *player, Creature *_Creature, uint32 sender, uint32 action, char* sCode ) { Script *tmpscript = NULL; tmpscript = GetScriptByName(_Creature->GetCreatureInfo()->ScriptName); if(!tmpscript || !tmpscript->pGossipSelectWithCode) return false; player->PlayerTalkClass->ClearMenus(); return tmpscript->pGossipSelectWithCode(player,_Creature,sender,action,sCode); }
MANGOS_DLL_EXPORT bool GossipHello ( Player * player, Creature *_Creature ) { Script *tmpscript = NULL; tmpscript = GetScriptByName(_Creature->GetCreatureInfo()->ScriptName); if(!tmpscript || !tmpscript->pGossipHello) return false; player->PlayerTalkClass->ClearMenus(); return tmpscript->pGossipHello(player,_Creature); }
MANGOS_DLL_EXPORT bool GOChooseReward( Player *player, GameObject *_GO, Quest *_Quest, uint32 opt ) { Script *tmpscript = NULL; tmpscript = GetScriptByName(_GO->GetGOInfo()->ScriptName); if(!tmpscript || !tmpscript->pGOChooseReward) return false; player->PlayerTalkClass->ClearMenus(); return tmpscript->pGOChooseReward(player,_GO,_Quest,opt); }
MANGOS_DLL_EXPORT bool GOHello( Player *player, GameObject *_GO ) { Script *tmpscript = NULL; tmpscript = GetScriptByName(_GO->GetGOInfo()->ScriptName); if(!tmpscript || !tmpscript->pGOHello) return false; player->PlayerTalkClass->ClearMenus(); return tmpscript->pGOHello(player,_GO); }
MANGOS_DLL_EXPORT bool ItemQuestAccept( Player *player, Item *_Item, Quest *_Quest ) { Script *tmpscript = NULL; tmpscript = GetScriptByName(_Item->GetProto()->ScriptName); if(!tmpscript || !tmpscript->pItemQuestAccept) return false; player->PlayerTalkClass->ClearMenus(); return tmpscript->pItemQuestAccept(player,_Item,_Quest); }
MANGOS_DLL_EXPORT uint32 NPCDialogStatus( Player *player, Creature *_Creature ) { Script *tmpscript = NULL; tmpscript = GetScriptByName(_Creature->GetCreatureInfo()->ScriptName); if(!tmpscript || !tmpscript->pNPCDialogStatus) return 100; player->PlayerTalkClass->ClearMenus(); return tmpscript->pNPCDialogStatus(player,_Creature); }
MANGOS_DLL_EXPORT bool ChooseReward( Player *player, Creature *_Creature, Quest *_Quest, uint32 opt ) { Script *tmpscript = NULL; tmpscript = GetScriptByName(_Creature->GetCreatureInfo()->ScriptName); if(!tmpscript || !tmpscript->pChooseReward) return false; player->PlayerTalkClass->ClearMenus(); return tmpscript->pChooseReward(player,_Creature,_Quest,opt); }
MANGOS_DLL_EXPORT uint32 GODialogStatus( Player *player, GameObject *_GO ) { Script *tmpscript = NULL; tmpscript = GetScriptByName(_GO->GetGOInfo()->ScriptName); if(!tmpscript || !tmpscript->pGODialogStatus) return 100; player->PlayerTalkClass->ClearMenus(); return tmpscript->pGODialogStatus(player,_GO); }
MANGOS_DLL_EXPORT bool GossipSelect( Player *player, Creature *_Creature,uint32 sender, uint32 action ) { Script *tmpscript = NULL; printf("action: %d\n",action); tmpscript = GetScriptByName(_Creature->GetCreatureInfo()->ScriptName); if(!tmpscript || !tmpscript->pGossipSelect) return false; player->PlayerTalkClass->ClearMenus(); return tmpscript->pGossipSelect(player,_Creature,sender,action); }