mirror of
https://github.com/mangosfour/server.git
synced 2025-12-20 16:37:04 +00:00
Various Cleanups (bindings/universal/)
This commit is contained in:
parent
c334cd5ea4
commit
ed3220dbf2
6 changed files with 100 additions and 99 deletions
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
//uint8 loglevel = 0;
|
//uint8 loglevel = 0;
|
||||||
int nrscripts;
|
int nrscripts;
|
||||||
Script *m_scripts[MAX_SCRIPTS];
|
Script* m_scripts[MAX_SCRIPTS];
|
||||||
|
|
||||||
// -- Scripts to be added --
|
// -- Scripts to be added --
|
||||||
extern void AddSC_default();
|
extern void AddSC_default();
|
||||||
|
|
@ -36,8 +36,9 @@ extern void AddSC_default();
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
void ScriptsFree()
|
void ScriptsFree()
|
||||||
{ // Free resources before library unload
|
{
|
||||||
for(int i = 0; i < nrscripts; ++i)
|
// Free resources before library unload
|
||||||
|
for (int i = 0; i < nrscripts; ++i)
|
||||||
delete m_scripts[i];
|
delete m_scripts[i];
|
||||||
|
|
||||||
nrscripts = 0;
|
nrscripts = 0;
|
||||||
|
|
@ -47,7 +48,7 @@ MANGOS_DLL_EXPORT
|
||||||
void ScriptsInit()
|
void ScriptsInit()
|
||||||
{
|
{
|
||||||
nrscripts = GetScriptNames().size();
|
nrscripts = GetScriptNames().size();
|
||||||
for(int i = 0; i < MAX_SCRIPTS; ++i)
|
for (int i = 0; i < MAX_SCRIPTS; ++i)
|
||||||
m_scripts[i]=NULL;
|
m_scripts[i]=NULL;
|
||||||
|
|
||||||
// -- Inicialize the Scripts to be Added --
|
// -- Inicialize the Scripts to be Added --
|
||||||
|
|
@ -69,9 +70,9 @@ void Script::registerSelf()
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool GossipHello ( Player * player, Creature *_Creature )
|
bool GossipHello(Player* player, Creature* _Creature)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[_Creature->GetScriptId()];
|
Script* tmpscript = m_scripts[_Creature->GetScriptId()];
|
||||||
if (!tmpscript || !tmpscript->pGossipHello)
|
if (!tmpscript || !tmpscript->pGossipHello)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -81,9 +82,9 @@ bool GossipHello ( Player * player, Creature *_Creature )
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool GOGossipHello(Player *pPlayer, GameObject *pGo)
|
bool GOGossipHello(Player* pPlayer, GameObject* pGo)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[pGo->GetGOInfo()->ScriptId];
|
Script* tmpscript = m_scripts[pGo->GetGOInfo()->ScriptId];
|
||||||
if (!tmpscript || !tmpscript->pGOGossipHello)
|
if (!tmpscript || !tmpscript->pGOGossipHello)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -93,11 +94,11 @@ bool GOGossipHello(Player *pPlayer, GameObject *pGo)
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool GossipSelect( Player *player, Creature *_Creature,uint32 sender, uint32 action )
|
bool GossipSelect(Player* player, Creature* _Creature,uint32 sender, uint32 action)
|
||||||
{
|
{
|
||||||
debug_log("DEBUG: Gossip selection, sender: %d, action: %d",sender, action);
|
debug_log("DEBUG: Gossip selection, sender: %d, action: %d",sender, action);
|
||||||
|
|
||||||
Script *tmpscript = m_scripts[_Creature->GetScriptId()];
|
Script* tmpscript = m_scripts[_Creature->GetScriptId()];
|
||||||
if (!tmpscript || !tmpscript->pGossipSelect)
|
if (!tmpscript || !tmpscript->pGossipSelect)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -107,11 +108,11 @@ bool GossipSelect( Player *player, Creature *_Creature,uint32 sender, uint32 act
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool GOGossipSelect(Player *pPlayer, GameObject *pGo, uint32 sender, uint32 action)
|
bool GOGossipSelect(Player* pPlayer, GameObject* pGo, uint32 sender, uint32 action)
|
||||||
{
|
{
|
||||||
debug_log("DEBUG: GO Gossip selection, sender: %u, action: %u", sender, action);
|
debug_log("DEBUG: GO Gossip selection, sender: %u, action: %u", sender, action);
|
||||||
|
|
||||||
Script *tmpscript = m_scripts[pGo->GetGOInfo()->ScriptId];
|
Script* tmpscript = m_scripts[pGo->GetGOInfo()->ScriptId];
|
||||||
if (!tmpscript || !tmpscript->pGOGossipSelect)
|
if (!tmpscript || !tmpscript->pGOGossipSelect)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -121,11 +122,11 @@ bool GOGossipSelect(Player *pPlayer, GameObject *pGo, uint32 sender, uint32 acti
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool GossipSelectWithCode( Player *player, Creature *_Creature, uint32 sender, uint32 action, const char* sCode )
|
bool GossipSelectWithCode(Player* player, Creature* _Creature, uint32 sender, uint32 action, const char* sCode)
|
||||||
{
|
{
|
||||||
debug_log("DEBUG: Gossip selection, sender: %d, action: %d",sender, action);
|
debug_log("DEBUG: Gossip selection, sender: %d, action: %d",sender, action);
|
||||||
|
|
||||||
Script *tmpscript = m_scripts[_Creature->GetScriptId()];
|
Script* tmpscript = m_scripts[_Creature->GetScriptId()];
|
||||||
if (!tmpscript || !tmpscript->pGossipSelectWithCode)
|
if (!tmpscript || !tmpscript->pGossipSelectWithCode)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -135,11 +136,11 @@ bool GossipSelectWithCode( Player *player, Creature *_Creature, uint32 sender, u
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool GOGossipSelectWithCode(Player *pPlayer, GameObject *pGo, uint32 sender, uint32 action, const char* sCode)
|
bool GOGossipSelectWithCode(Player* pPlayer, GameObject* pGo, uint32 sender, uint32 action, const char* sCode)
|
||||||
{
|
{
|
||||||
debug_log("DEBUG: GO Gossip selection, sender: %u, action: %u", sender, action);
|
debug_log("DEBUG: GO Gossip selection, sender: %u, action: %u", sender, action);
|
||||||
|
|
||||||
Script *tmpscript = m_scripts[pGo->GetGOInfo()->ScriptId];
|
Script* tmpscript = m_scripts[pGo->GetGOInfo()->ScriptId];
|
||||||
if (!tmpscript || !tmpscript->pGOGossipSelectWithCode)
|
if (!tmpscript || !tmpscript->pGOGossipSelectWithCode)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -149,9 +150,9 @@ bool GOGossipSelectWithCode(Player *pPlayer, GameObject *pGo, uint32 sender, uin
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool QuestAccept( Player *player, Creature *_Creature, Quest *_Quest )
|
bool QuestAccept(Player* player, Creature* _Creature, Quest* _Quest)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[_Creature->GetScriptId()];
|
Script* tmpscript = m_scripts[_Creature->GetScriptId()];
|
||||||
if (!tmpscript || !tmpscript->pQuestAccept)
|
if (!tmpscript || !tmpscript->pQuestAccept)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -161,9 +162,9 @@ bool QuestAccept( Player *player, Creature *_Creature, Quest *_Quest )
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool QuestSelect( Player *player, Creature *_Creature, Quest *_Quest )
|
bool QuestSelect(Player* player, Creature* _Creature, Quest* _Quest)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[_Creature->GetScriptId()];
|
Script* tmpscript = m_scripts[_Creature->GetScriptId()];
|
||||||
if (!tmpscript || !tmpscript->pQuestSelect)
|
if (!tmpscript || !tmpscript->pQuestSelect)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -173,9 +174,9 @@ bool QuestSelect( Player *player, Creature *_Creature, Quest *_Quest )
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool QuestComplete( Player *player, Creature *_Creature, Quest *_Quest )
|
bool QuestComplete(Player* player, Creature* _Creature, Quest* _Quest)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[_Creature->GetScriptId()];
|
Script* tmpscript = m_scripts[_Creature->GetScriptId()];
|
||||||
if (!tmpscript || !tmpscript->pQuestComplete)
|
if (!tmpscript || !tmpscript->pQuestComplete)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -185,9 +186,9 @@ bool QuestComplete( Player *player, Creature *_Creature, Quest *_Quest )
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool ChooseReward( Player *player, Creature *_Creature, Quest *_Quest, uint32 opt )
|
bool ChooseReward(Player* player, Creature* _Creature, Quest* _Quest, uint32 opt)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[_Creature->GetScriptId()];
|
Script* tmpscript = m_scripts[_Creature->GetScriptId()];
|
||||||
if (!tmpscript || !tmpscript->pChooseReward)
|
if (!tmpscript || !tmpscript->pChooseReward)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -197,9 +198,9 @@ bool ChooseReward( Player *player, Creature *_Creature, Quest *_Quest, uint32 op
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
uint32 NPCDialogStatus( Player *player, Creature *_Creature )
|
uint32 NPCDialogStatus(Player* player, Creature* _Creature)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[_Creature->GetScriptId()];
|
Script* tmpscript = m_scripts[_Creature->GetScriptId()];
|
||||||
if (!tmpscript || !tmpscript->pNPCDialogStatus)
|
if (!tmpscript || !tmpscript->pNPCDialogStatus)
|
||||||
return 100;
|
return 100;
|
||||||
|
|
||||||
|
|
@ -209,9 +210,9 @@ uint32 NPCDialogStatus( Player *player, Creature *_Creature )
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
uint32 GODialogStatus( Player *player, GameObject *_GO )
|
uint32 GODialogStatus(Player* player, GameObject* _GO)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId];
|
Script* tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId];
|
||||||
if (!tmpscript || !tmpscript->pGODialogStatus)
|
if (!tmpscript || !tmpscript->pGODialogStatus)
|
||||||
return 100;
|
return 100;
|
||||||
|
|
||||||
|
|
@ -221,9 +222,9 @@ uint32 GODialogStatus( Player *player, GameObject *_GO )
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool ItemHello( Player *player, Item *_Item, Quest *_Quest )
|
bool ItemHello(Player* player, Item* _Item, Quest* _Quest)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[_Item->GetProto()->ScriptId];
|
Script* tmpscript = m_scripts[_Item->GetProto()->ScriptId];
|
||||||
if (!tmpscript || !tmpscript->pItemHello)
|
if (!tmpscript || !tmpscript->pItemHello)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -233,9 +234,9 @@ bool ItemHello( Player *player, Item *_Item, Quest *_Quest )
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool ItemQuestAccept( Player *player, Item *_Item, Quest *_Quest )
|
bool ItemQuestAccept(Player* player, Item* _Item, Quest* _Quest)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[_Item->GetProto()->ScriptId];
|
Script* tmpscript = m_scripts[_Item->GetProto()->ScriptId];
|
||||||
if (!tmpscript || !tmpscript->pItemQuestAccept)
|
if (!tmpscript || !tmpscript->pItemQuestAccept)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -245,9 +246,9 @@ bool ItemQuestAccept( Player *player, Item *_Item, Quest *_Quest )
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool GOHello( Player *player, GameObject *_GO )
|
bool GOHello(Player* player, GameObject* _GO)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId];
|
Script* tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId];
|
||||||
if (!tmpscript || !tmpscript->pGOHello)
|
if (!tmpscript || !tmpscript->pGOHello)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -257,9 +258,9 @@ bool GOHello( Player *player, GameObject *_GO )
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool GOQuestAccept( Player *player, GameObject *_GO, Quest *_Quest )
|
bool GOQuestAccept(Player* player, GameObject* _GO, Quest* _Quest)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId];
|
Script* tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId];
|
||||||
if (!tmpscript || !tmpscript->pGOQuestAccept)
|
if (!tmpscript || !tmpscript->pGOQuestAccept)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -269,9 +270,9 @@ bool GOQuestAccept( Player *player, GameObject *_GO, Quest *_Quest )
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool GOChooseReward( Player *player, GameObject *_GO, Quest *_Quest, uint32 opt )
|
bool GOChooseReward(Player* player, GameObject* _GO, Quest* _Quest, uint32 opt)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId];
|
Script* tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId];
|
||||||
if (!tmpscript || !tmpscript->pGOChooseReward)
|
if (!tmpscript || !tmpscript->pGOChooseReward)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -280,9 +281,9 @@ bool GOChooseReward( Player *player, GameObject *_GO, Quest *_Quest, uint32 opt
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool AreaTrigger(Player *player, AreaTriggerEntry const* atEntry)
|
bool AreaTrigger(Player* player, AreaTriggerEntry const* atEntry)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[GetAreaTriggerScriptId(atEntry->id)];
|
Script* tmpscript = m_scripts[GetAreaTriggerScriptId(atEntry->id)];
|
||||||
if (!tmpscript || !tmpscript->pAreaTrigger)
|
if (!tmpscript || !tmpscript->pAreaTrigger)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -292,7 +293,7 @@ bool AreaTrigger(Player *player, AreaTriggerEntry const* atEntry)
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool ProcessEventId(uint32 eventId, Object* source, Object* target, bool isStart)
|
bool ProcessEventId(uint32 eventId, Object* source, Object* target, bool isStart)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[GetEventIdScriptId(eventId)];
|
Script* tmpscript = m_scripts[GetEventIdScriptId(eventId)];
|
||||||
if (!tmpscript || !tmpscript->pProcessEventId)
|
if (!tmpscript || !tmpscript->pProcessEventId)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -301,9 +302,9 @@ bool ProcessEventId(uint32 eventId, Object* source, Object* target, bool isStart
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool ItemUse( Player *player, Item* _Item, SpellCastTargets const& targets)
|
bool ItemUse(Player* player, Item* _Item, SpellCastTargets const& targets)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[_Item->GetProto()->ScriptId];
|
Script* tmpscript = m_scripts[_Item->GetProto()->ScriptId];
|
||||||
if (!tmpscript || !tmpscript->pItemUse)
|
if (!tmpscript || !tmpscript->pItemUse)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -311,9 +312,9 @@ bool ItemUse( Player *player, Item* _Item, SpellCastTargets const& targets)
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
CreatureAI* GetAI(Creature *_Creature )
|
CreatureAI* GetAI(Creature* _Creature)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[_Creature->GetScriptId()];
|
Script* tmpscript = m_scripts[_Creature->GetScriptId()];
|
||||||
if (!tmpscript || !tmpscript->GetAI)
|
if (!tmpscript || !tmpscript->GetAI)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
@ -321,12 +322,12 @@ CreatureAI* GetAI(Creature *_Creature )
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
InstanceData* CreateInstanceData(Map *map)
|
InstanceData* CreateInstanceData(Map* map)
|
||||||
{
|
{
|
||||||
if (!map->IsDungeon())
|
if (!map->IsDungeon())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
Script *tmpscript = m_scripts[((InstanceMap*)map)->GetScriptId()];
|
Script* tmpscript = m_scripts[((InstanceMap*)map)->GetScriptId()];
|
||||||
if (!tmpscript || !tmpscript->GetInstanceData)
|
if (!tmpscript || !tmpscript->GetInstanceData)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
@ -334,9 +335,9 @@ InstanceData* CreateInstanceData(Map *map)
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool EffectDummyGameObj(Unit *caster, uint32 spellId, SpellEffectIndex effIndex, GameObject *gameObjTarget )
|
bool EffectDummyGameObj(Unit* caster, uint32 spellId, SpellEffectIndex effIndex, GameObject* gameObjTarget)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[gameObjTarget->GetGOInfo()->ScriptId];
|
Script* tmpscript = m_scripts[gameObjTarget->GetGOInfo()->ScriptId];
|
||||||
if (!tmpscript || !tmpscript->pEffectDummyGameObj)
|
if (!tmpscript || !tmpscript->pEffectDummyGameObj)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -344,9 +345,9 @@ bool EffectDummyGameObj(Unit *caster, uint32 spellId, SpellEffectIndex effIndex,
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool EffectDummyCreature(Unit *caster, uint32 spellId, SpellEffectIndex effIndex, Creature *crTarget )
|
bool EffectDummyCreature(Unit* caster, uint32 spellId, SpellEffectIndex effIndex, Creature* crTarget)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[crTarget->GetScriptId()];
|
Script* tmpscript = m_scripts[crTarget->GetScriptId()];
|
||||||
if (!tmpscript || !tmpscript->pEffectDummyCreature)
|
if (!tmpscript || !tmpscript->pEffectDummyCreature)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -354,9 +355,9 @@ bool EffectDummyCreature(Unit *caster, uint32 spellId, SpellEffectIndex effIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool EffectDummyItem(Unit *caster, uint32 spellId, SpellEffectIndex effIndex, Item *itemTarget )
|
bool EffectDummyItem(Unit* caster, uint32 spellId, SpellEffectIndex effIndex, Item* itemTarget)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[itemTarget->GetProto()->ScriptId];
|
Script* tmpscript = m_scripts[itemTarget->GetProto()->ScriptId];
|
||||||
if (!tmpscript || !tmpscript->pEffectDummyItem)
|
if (!tmpscript || !tmpscript->pEffectDummyItem)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -366,7 +367,7 @@ bool EffectDummyItem(Unit *caster, uint32 spellId, SpellEffectIndex effIndex, It
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool EffectAuraDummy(const Aura* pAura, bool apply)
|
bool EffectAuraDummy(const Aura* pAura, bool apply)
|
||||||
{
|
{
|
||||||
Script *tmpscript = m_scripts[((Creature*)pAura->GetTarget())->GetScriptId()];
|
Script* tmpscript = m_scripts[((Creature*)pAura->GetTarget())->GetScriptId()];
|
||||||
if (!tmpscript || !tmpscript->pEffectAuraDummy)
|
if (!tmpscript || !tmpscript->pEffectAuraDummy)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,32 +50,32 @@ struct Script
|
||||||
std::string Name;
|
std::string Name;
|
||||||
|
|
||||||
// -- Quest/gossip Methods to be scripted --
|
// -- Quest/gossip Methods to be scripted --
|
||||||
bool (*pGossipHello )(Player *player, Creature *_Creature);
|
bool (*pGossipHello)(Player* player, Creature* _Creature);
|
||||||
bool (*pGOGossipHello )(Player *player, GameObject *_GO);
|
bool (*pGOGossipHello)(Player* player, GameObject* _GO);
|
||||||
bool (*pQuestAccept )(Player *player, Creature *_Creature, Quest const*_Quest );
|
bool (*pQuestAccept)(Player* player, Creature* _Creature, Quest const* _Quest);
|
||||||
bool (*pGossipSelect )(Player *player, Creature *_Creature, uint32 sender, uint32 action );
|
bool (*pGossipSelect)(Player* player, Creature* _Creature, uint32 sender, uint32 action);
|
||||||
bool (*pGOGossipSelect )(Player *player, GameObject *_GO, uint32 sender, uint32 action );
|
bool (*pGOGossipSelect)(Player* player, GameObject* _GO, uint32 sender, uint32 action);
|
||||||
bool (*pGossipSelectWithCode)(Player *player, Creature *_Creature, uint32 sender, uint32 action, const char* sCode );
|
bool (*pGossipSelectWithCode)(Player* player, Creature* _Creature, uint32 sender, uint32 action, const char* sCode);
|
||||||
bool (*pGOGossipSelectWithCode)(Player *player, GameObject *_GO, uint32 sender, uint32 action, const char* sCode );
|
bool (*pGOGossipSelectWithCode)(Player* player, GameObject* _GO, uint32 sender, uint32 action, const char* sCode);
|
||||||
bool (*pQuestSelect )(Player *player, Creature *_Creature, Quest const*_Quest );
|
bool (*pQuestSelect)(Player* player, Creature* _Creature, Quest const* _Quest);
|
||||||
bool (*pQuestComplete )(Player *player, Creature *_Creature, Quest const*_Quest );
|
bool (*pQuestComplete)(Player* player, Creature* _Creature, Quest const* _Quest);
|
||||||
uint32 (*pNPCDialogStatus )(Player *player, Creature *_Creature );
|
uint32(*pNPCDialogStatus)(Player* player, Creature* _Creature);
|
||||||
uint32 (*pGODialogStatus )(Player *player, GameObject * _GO );
|
uint32(*pGODialogStatus)(Player* player, GameObject* _GO);
|
||||||
bool (*pChooseReward )(Player *player, Creature *_Creature, Quest const*_Quest, uint32 opt );
|
bool (*pChooseReward)(Player* player, Creature* _Creature, Quest const* _Quest, uint32 opt);
|
||||||
bool (*pItemHello )(Player *player, Item *_Item, Quest const*_Quest );
|
bool (*pItemHello)(Player* player, Item* _Item, Quest const* _Quest);
|
||||||
bool (*pGOHello )(Player *player, GameObject *_GO );
|
bool (*pGOHello)(Player* player, GameObject* _GO);
|
||||||
bool (*pAreaTrigger )(Player *player, AreaTriggerEntry const* at);
|
bool (*pAreaTrigger)(Player* player, AreaTriggerEntry const* at);
|
||||||
bool (*pProcessEventId )(uint32 eventId, Object* source, Object* target, bool isStart);
|
bool (*pProcessEventId)(uint32 eventId, Object* source, Object* target, bool isStart);
|
||||||
bool (*pItemQuestAccept )(Player *player, Item *_Item, Quest const*_Quest );
|
bool (*pItemQuestAccept)(Player* player, Item* _Item, Quest const* _Quest);
|
||||||
bool (*pGOQuestAccept )(Player *player, GameObject *_GO, Quest const*_Quest );
|
bool (*pGOQuestAccept)(Player* player, GameObject* _GO, Quest const* _Quest);
|
||||||
bool (*pGOChooseReward )(Player *player, GameObject *_GO, Quest const*_Quest, uint32 opt );
|
bool (*pGOChooseReward)(Player* player, GameObject* _GO, Quest const* _Quest, uint32 opt);
|
||||||
bool (*pItemUse )(Player *player, Item* _Item, SpellCastTargets const& targets);
|
bool (*pItemUse)(Player* player, Item* _Item, SpellCastTargets const& targets);
|
||||||
bool (*pEffectDummyGameObj )(Unit*, uint32, SpellEffectIndex, GameObject* );
|
bool (*pEffectDummyGameObj)(Unit*, uint32, SpellEffectIndex, GameObject*);
|
||||||
bool (*pEffectDummyCreature )(Unit*, uint32, SpellEffectIndex, Creature* );
|
bool (*pEffectDummyCreature)(Unit*, uint32, SpellEffectIndex, Creature*);
|
||||||
bool (*pEffectDummyItem )(Unit*, uint32, SpellEffectIndex, Item* );
|
bool (*pEffectDummyItem)(Unit*, uint32, SpellEffectIndex, Item*);
|
||||||
bool (*pEffectAuraDummy )(const Aura*, bool);
|
bool (*pEffectAuraDummy)(const Aura*, bool);
|
||||||
|
|
||||||
CreatureAI* (*GetAI)(Creature *_Creature);
|
CreatureAI* (*GetAI)(Creature* _Creature);
|
||||||
InstanceData* (*GetInstanceData)(Map*);
|
InstanceData* (*GetInstanceData)(Map*);
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
|
|
||||||
|
|
@ -116,7 +116,7 @@ struct MANGOS_DLL_DECL ScriptedAI : public CreatureAI
|
||||||
m_creature->CastSpell(victim,spelId,true);
|
m_creature->CastSpell(victim,spelId,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoCastSpell(Unit* who,SpellEntry *spellInfo)
|
void DoCastSpell(Unit* who,SpellEntry* spellInfo)
|
||||||
{
|
{
|
||||||
m_creature->CastSpell(who,spellInfo,true);
|
m_creature->CastSpell(who,spellInfo,true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,79 +23,79 @@ bool GossipHello_default(Player* /*player*/, Creature* /*_Creature*/)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GossipSelect_default(Player* /*player*/, Creature* /*_Creature*/, uint32 /*sender*/, uint32 /*action*/ )
|
bool GossipSelect_default(Player* /*player*/, Creature* /*_Creature*/, uint32 /*sender*/, uint32 /*action*/)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GossipSelectWithCode_default( Player* /*player*/, Creature* /*_Creature*/, uint32 /*sender*/, uint32 /*action*/, const char* /*sCode*/ )
|
bool GossipSelectWithCode_default(Player* /*player*/, Creature* /*_Creature*/, uint32 /*sender*/, uint32 /*action*/, const char* /*sCode*/)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QuestAccept_default(Player* /*player*/, Creature* /*_Creature*/, Quest const* /*_Quest*/ )
|
bool QuestAccept_default(Player* /*player*/, Creature* /*_Creature*/, Quest const* /*_Quest*/)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QuestSelect_default(Player* /*player*/, Creature* /*_Creature*/, Quest const* /*_Quest*/ )
|
bool QuestSelect_default(Player* /*player*/, Creature* /*_Creature*/, Quest const* /*_Quest*/)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QuestComplete_default(Player* /*player*/, Creature* /*_Creature*/, Quest const* /*_Quest*/ )
|
bool QuestComplete_default(Player* /*player*/, Creature* /*_Creature*/, Quest const* /*_Quest*/)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChooseReward_default(Player* /*player*/, Creature* /*_Creature*/, Quest const* /*_Quest*/, uint32 /*opt*/ )
|
bool ChooseReward_default(Player* /*player*/, Creature* /*_Creature*/, Quest const* /*_Quest*/, uint32 /*opt*/)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 NPCDialogStatus_default(Player* /*player*/, Creature* /*_Creature*/ )
|
uint32 NPCDialogStatus_default(Player* /*player*/, Creature* /*_Creature*/)
|
||||||
{
|
{
|
||||||
return 128;
|
return 128;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 GODialogStatus_default(Player* /*player*/, GameObject* /*_Creature*/ )
|
uint32 GODialogStatus_default(Player* /*player*/, GameObject* /*_Creature*/)
|
||||||
{
|
{
|
||||||
return 128;
|
return 128;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ItemHello_default(Player* /*player*/, Item* /*_Item*/, Quest const* /*_Quest*/ )
|
bool ItemHello_default(Player* /*player*/, Item* /*_Item*/, Quest const* /*_Quest*/)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ItemQuestAccept_default(Player* /*player*/, Item* /*_Item*/, Quest const* /*_Quest*/ )
|
bool ItemQuestAccept_default(Player* /*player*/, Item* /*_Item*/, Quest const* /*_Quest*/)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GOHello_default(Player* /*player*/, GameObject* /*_GO*/ )
|
bool GOHello_default(Player* /*player*/, GameObject* /*_GO*/)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GOQuestAccept_default(Player* /*player*/, GameObject* /*_GO*/, Quest const* /*_Quest*/ )
|
bool GOQuestAccept_default(Player* /*player*/, GameObject* /*_GO*/, Quest const* /*_Quest*/)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GOChooseReward_default(Player* /*player*/, GameObject* /*_GO*/, Quest const* /*_Quest*/, uint32 /*opt*/ )
|
bool GOChooseReward_default(Player* /*player*/, GameObject* /*_GO*/, Quest const* /*_Quest*/, uint32 /*opt*/)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AreaTrigger_default(Player* /*player*/, AreaTriggerEntry const* /*atEntry*/ )
|
bool AreaTrigger_default(Player* /*player*/, AreaTriggerEntry const* /*atEntry*/)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddSC_default()
|
void AddSC_default()
|
||||||
{
|
{
|
||||||
Script *newscript;
|
Script* newscript;
|
||||||
|
|
||||||
newscript = new Script;
|
newscript = new Script;
|
||||||
newscript->Name="default";
|
newscript->Name="default";
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
#include "../../../game/Player.h"
|
#include "../../../game/Player.h"
|
||||||
|
|
||||||
uint32 GetSkillLevel(Player *player,uint32 trskill)
|
uint32 GetSkillLevel(Player* player,uint32 trskill)
|
||||||
{
|
{
|
||||||
// Returns the level of some tradetrskill known by player
|
// Returns the level of some tradetrskill known by player
|
||||||
// Need to add missing spells
|
// Need to add missing spells
|
||||||
|
|
@ -32,7 +32,7 @@ uint32 GetSkillLevel(Player *player,uint32 trskill)
|
||||||
uint32 spell_master = 0;
|
uint32 spell_master = 0;
|
||||||
uint32 spell_grand_master = 0;
|
uint32 spell_grand_master = 0;
|
||||||
|
|
||||||
switch(trskill)
|
switch (trskill)
|
||||||
{
|
{
|
||||||
case TRADESKILL_ALCHEMY:
|
case TRADESKILL_ALCHEMY:
|
||||||
spell_apprentice = 2259;
|
spell_apprentice = 2259;
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@
|
||||||
|
|
||||||
#define DEFAULT_GOSSIP_MESSAGE 0xffffff
|
#define DEFAULT_GOSSIP_MESSAGE 0xffffff
|
||||||
|
|
||||||
extern uint32 GetSkillLevel(Player *player,uint32 skill);
|
extern uint32 GetSkillLevel(Player* player,uint32 skill);
|
||||||
|
|
||||||
// Defined functions to use with player.
|
// Defined functions to use with player.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
BOOL APIENTRY DllMain( HANDLE /*hModule*/, DWORD /*ul_reason_for_call*/, LPVOID /*lpReserved*/)
|
BOOL APIENTRY DllMain(HANDLE /*hModule*/, DWORD /*ul_reason_for_call*/, LPVOID /*lpReserved*/)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue