mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[9413] Use SpellEffectIndex in EffectDummy* script calls.
Scripts used this script calls will need update...
This commit is contained in:
parent
dd2f02699e
commit
79a54286fd
3 changed files with 88 additions and 75 deletions
|
|
@ -35,7 +35,7 @@ extern void AddSC_default();
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
void ScriptsFree()
|
void ScriptsFree()
|
||||||
{ // Free resources before library unload
|
{ // Free resources before library unload
|
||||||
for(int i=0;i<nrscripts;i++)
|
for(int i = 0; i < nrscripts; ++i)
|
||||||
delete m_scripts[i];
|
delete m_scripts[i];
|
||||||
|
|
||||||
nrscripts = 0;
|
nrscripts = 0;
|
||||||
|
|
@ -45,10 +45,8 @@ 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 --
|
||||||
AddSC_default();
|
AddSC_default();
|
||||||
|
|
@ -64,17 +62,19 @@ char const* ScriptsVersion()
|
||||||
|
|
||||||
void Script::registerSelf()
|
void Script::registerSelf()
|
||||||
{
|
{
|
||||||
int id = GetScriptId(Name.c_str());
|
if (int id = GetScriptId(Name.c_str()))
|
||||||
if(id != 0) m_scripts[id] = this;
|
m_scripts[id] = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
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) return false;
|
if (!tmpscript || !tmpscript->pGossipHello)
|
||||||
|
return false;
|
||||||
|
|
||||||
player->PlayerTalkClass->ClearMenus();
|
player->PlayerTalkClass->ClearMenus();
|
||||||
|
|
||||||
return tmpscript->pGossipHello(player,_Creature);
|
return tmpscript->pGossipHello(player,_Creature);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -84,9 +84,11 @@ bool GossipSelect( Player *player, Creature *_Creature,uint32 sender, uint32 act
|
||||||
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) return false;
|
if (!tmpscript || !tmpscript->pGossipSelect)
|
||||||
|
return false;
|
||||||
|
|
||||||
player->PlayerTalkClass->ClearMenus();
|
player->PlayerTalkClass->ClearMenus();
|
||||||
|
|
||||||
return tmpscript->pGossipSelect(player,_Creature,sender,action);
|
return tmpscript->pGossipSelect(player,_Creature,sender,action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,9 +98,11 @@ bool GossipSelectWithCode( Player *player, Creature *_Creature, uint32 sender, u
|
||||||
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) return false;
|
if (!tmpscript || !tmpscript->pGossipSelectWithCode)
|
||||||
|
return false;
|
||||||
|
|
||||||
player->PlayerTalkClass->ClearMenus();
|
player->PlayerTalkClass->ClearMenus();
|
||||||
|
|
||||||
return tmpscript->pGossipSelectWithCode(player,_Creature,sender,action,sCode);
|
return tmpscript->pGossipSelectWithCode(player,_Creature,sender,action,sCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -106,9 +110,11 @@ 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) return false;
|
if (!tmpscript || !tmpscript->pQuestAccept)
|
||||||
|
return false;
|
||||||
|
|
||||||
player->PlayerTalkClass->ClearMenus();
|
player->PlayerTalkClass->ClearMenus();
|
||||||
|
|
||||||
return tmpscript->pQuestAccept(player,_Creature,_Quest);
|
return tmpscript->pQuestAccept(player,_Creature,_Quest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -116,9 +122,11 @@ 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) return false;
|
if (!tmpscript || !tmpscript->pQuestSelect)
|
||||||
|
return false;
|
||||||
|
|
||||||
player->PlayerTalkClass->ClearMenus();
|
player->PlayerTalkClass->ClearMenus();
|
||||||
|
|
||||||
return tmpscript->pQuestSelect(player,_Creature,_Quest);
|
return tmpscript->pQuestSelect(player,_Creature,_Quest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -126,9 +134,11 @@ 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) return false;
|
if (!tmpscript || !tmpscript->pQuestComplete)
|
||||||
|
return false;
|
||||||
|
|
||||||
player->PlayerTalkClass->ClearMenus();
|
player->PlayerTalkClass->ClearMenus();
|
||||||
|
|
||||||
return tmpscript->pQuestComplete(player,_Creature,_Quest);
|
return tmpscript->pQuestComplete(player,_Creature,_Quest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -136,9 +146,11 @@ 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) return false;
|
if (!tmpscript || !tmpscript->pChooseReward)
|
||||||
|
return false;
|
||||||
|
|
||||||
player->PlayerTalkClass->ClearMenus();
|
player->PlayerTalkClass->ClearMenus();
|
||||||
|
|
||||||
return tmpscript->pChooseReward(player,_Creature,_Quest,opt);
|
return tmpscript->pChooseReward(player,_Creature,_Quest,opt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -146,79 +158,80 @@ 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) return 100;
|
if (!tmpscript || !tmpscript->pNPCDialogStatus)
|
||||||
|
return 100;
|
||||||
|
|
||||||
player->PlayerTalkClass->ClearMenus();
|
player->PlayerTalkClass->ClearMenus();
|
||||||
|
|
||||||
return tmpscript->pNPCDialogStatus(player,_Creature);
|
return tmpscript->pNPCDialogStatus(player,_Creature);
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
uint32 GODialogStatus( Player *player, GameObject *_GO )
|
uint32 GODialogStatus( Player *player, GameObject *_GO )
|
||||||
{
|
{
|
||||||
Script *tmpscript = NULL;
|
Script *tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId];
|
||||||
|
if (!tmpscript || !tmpscript->pGODialogStatus)
|
||||||
tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId];
|
return 100;
|
||||||
if(!tmpscript || !tmpscript->pGODialogStatus) return 100;
|
|
||||||
|
|
||||||
player->PlayerTalkClass->ClearMenus();
|
player->PlayerTalkClass->ClearMenus();
|
||||||
|
|
||||||
return tmpscript->pGODialogStatus(player,_GO);
|
return tmpscript->pGODialogStatus(player,_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 = NULL;
|
Script *tmpscript = m_scripts[_Item->GetProto()->ScriptId];
|
||||||
|
if (!tmpscript || !tmpscript->pItemHello)
|
||||||
tmpscript = m_scripts[_Item->GetProto()->ScriptId];
|
return false;
|
||||||
if(!tmpscript || !tmpscript->pItemHello) return false;
|
|
||||||
|
|
||||||
player->PlayerTalkClass->ClearMenus();
|
player->PlayerTalkClass->ClearMenus();
|
||||||
|
|
||||||
return tmpscript->pItemHello(player,_Item,_Quest);
|
return tmpscript->pItemHello(player,_Item,_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 = NULL;
|
Script *tmpscript = m_scripts[_Item->GetProto()->ScriptId];
|
||||||
|
if (!tmpscript || !tmpscript->pItemQuestAccept)
|
||||||
tmpscript = m_scripts[_Item->GetProto()->ScriptId];
|
return false;
|
||||||
if(!tmpscript || !tmpscript->pItemQuestAccept) return false;
|
|
||||||
|
|
||||||
player->PlayerTalkClass->ClearMenus();
|
player->PlayerTalkClass->ClearMenus();
|
||||||
|
|
||||||
return tmpscript->pItemQuestAccept(player,_Item,_Quest);
|
return tmpscript->pItemQuestAccept(player,_Item,_Quest);
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool GOHello( Player *player, GameObject *_GO )
|
bool GOHello( Player *player, GameObject *_GO )
|
||||||
{
|
{
|
||||||
Script *tmpscript = NULL;
|
Script *tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId];
|
||||||
|
if (!tmpscript || !tmpscript->pGOHello)
|
||||||
tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId];
|
return false;
|
||||||
if(!tmpscript || !tmpscript->pGOHello) return false;
|
|
||||||
|
|
||||||
player->PlayerTalkClass->ClearMenus();
|
player->PlayerTalkClass->ClearMenus();
|
||||||
|
|
||||||
return tmpscript->pGOHello(player,_GO);
|
return tmpscript->pGOHello(player,_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 = NULL;
|
Script *tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId];
|
||||||
|
if (!tmpscript || !tmpscript->pGOQuestAccept)
|
||||||
tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId];
|
return false;
|
||||||
if(!tmpscript || !tmpscript->pGOQuestAccept) return false;
|
|
||||||
|
|
||||||
player->PlayerTalkClass->ClearMenus();
|
player->PlayerTalkClass->ClearMenus();
|
||||||
|
|
||||||
return tmpscript->pGOQuestAccept(player,_GO,_Quest);
|
return tmpscript->pGOQuestAccept(player,_GO,_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 = NULL;
|
Script *tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId];
|
||||||
|
if (!tmpscript || !tmpscript->pGOChooseReward)
|
||||||
tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId];
|
return false;
|
||||||
if(!tmpscript || !tmpscript->pGOChooseReward) return false;
|
|
||||||
|
|
||||||
player->PlayerTalkClass->ClearMenus();
|
player->PlayerTalkClass->ClearMenus();
|
||||||
return tmpscript->pGOChooseReward(player,_GO,_Quest,opt);
|
return tmpscript->pGOChooseReward(player,_GO,_Quest,opt);
|
||||||
|
|
@ -227,10 +240,9 @@ bool GOChooseReward( Player *player, GameObject *_GO, Quest *_Quest, uint32 opt
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool AreaTrigger ( Player *player, AreaTriggerEntry* atEntry )
|
bool AreaTrigger ( Player *player, AreaTriggerEntry* atEntry )
|
||||||
{
|
{
|
||||||
Script *tmpscript = NULL;
|
Script *tmpscript = m_scripts[GetAreaTriggerScriptId(atEntry->id)];
|
||||||
|
if (!tmpscript || !tmpscript->pAreaTrigger)
|
||||||
tmpscript = m_scripts[GetAreaTriggerScriptId(atEntry->id)];
|
return false;
|
||||||
if(!tmpscript || !tmpscript->pAreaTrigger) return false;
|
|
||||||
|
|
||||||
return tmpscript->pAreaTrigger(player, atEntry);
|
return tmpscript->pAreaTrigger(player, atEntry);
|
||||||
}
|
}
|
||||||
|
|
@ -238,10 +250,9 @@ bool AreaTrigger ( Player *player, AreaTriggerEntry* atEntry )
|
||||||
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 = NULL;
|
Script *tmpscript = m_scripts[_Item->GetProto()->ScriptId];
|
||||||
|
if (!tmpscript || !tmpscript->pItemUse)
|
||||||
tmpscript = m_scripts[_Item->GetProto()->ScriptId];
|
return false;
|
||||||
if(!tmpscript || !tmpscript->pItemUse) return false;
|
|
||||||
|
|
||||||
return tmpscript->pItemUse(player,_Item,targets);
|
return tmpscript->pItemUse(player,_Item,targets);
|
||||||
}
|
}
|
||||||
|
|
@ -250,7 +261,8 @@ 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) return NULL;
|
if (!tmpscript || !tmpscript->GetAI)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
return tmpscript->GetAI(_Creature);
|
return tmpscript->GetAI(_Creature);
|
||||||
}
|
}
|
||||||
|
|
@ -258,52 +270,55 @@ CreatureAI* GetAI(Creature *_Creature )
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
InstanceData* CreateInstanceData(Map *map)
|
InstanceData* CreateInstanceData(Map *map)
|
||||||
{
|
{
|
||||||
if(!map->IsDungeon()) return NULL;
|
if (!map->IsDungeon())
|
||||||
|
return NULL;
|
||||||
|
|
||||||
Script *tmpscript = m_scripts[((InstanceMap*)map)->GetScriptId()];
|
Script *tmpscript = m_scripts[((InstanceMap*)map)->GetScriptId()];
|
||||||
if(!tmpscript || !tmpscript->GetInstanceData) return NULL;
|
if (!tmpscript || !tmpscript->GetInstanceData)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
return tmpscript->GetInstanceData(map);
|
return tmpscript->GetInstanceData(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool EffectDummyGameObj(Unit *caster, uint32 spellId, uint32 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)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!tmpscript || !tmpscript->pEffectDummyGameObj) return false;
|
return tmpscript->pEffectDummyGameObj(caster, spellId, effIndex, gameObjTarget);
|
||||||
|
|
||||||
return tmpscript->pEffectDummyGameObj(caster, spellId,effIndex,gameObjTarget);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool EffectDummyCreature(Unit *caster, uint32 spellId, uint32 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)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!tmpscript || !tmpscript->pEffectDummyCreature) return false;
|
return tmpscript->pEffectDummyCreature(caster, spellId, effIndex, crTarget);
|
||||||
|
|
||||||
return tmpscript->pEffectDummyCreature(caster, spellId,effIndex,crTarget);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MANGOS_DLL_EXPORT
|
MANGOS_DLL_EXPORT
|
||||||
bool EffectDummyItem(Unit *caster, uint32 spellId, uint32 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)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!tmpscript || !tmpscript->pEffectDummyItem) return false;
|
return tmpscript->pEffectDummyItem(caster, spellId, effIndex, itemTarget);
|
||||||
|
|
||||||
return tmpscript->pEffectDummyItem(caster, spellId,effIndex,itemTarget);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptedAI::UpdateAI(const uint32)
|
void ScriptedAI::UpdateAI(const uint32)
|
||||||
{
|
{
|
||||||
//Check if we have a current target
|
//Check if we have a current target
|
||||||
if( m_creature->isAlive() && m_creature->SelectHostileTarget() && m_creature->getVictim())
|
if (m_creature->isAlive() && m_creature->SelectHostileTarget() && m_creature->getVictim())
|
||||||
{
|
{
|
||||||
//If we are within range melee the target
|
//If we are within range melee the target
|
||||||
if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
|
if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
|
||||||
{
|
{
|
||||||
if( m_creature->isAttackReady() )
|
if (m_creature->isAttackReady())
|
||||||
{
|
{
|
||||||
m_creature->AttackerStateUpdate(m_creature->getVictim());
|
m_creature->AttackerStateUpdate(m_creature->getVictim());
|
||||||
m_creature->resetAttackTimer();
|
m_creature->resetAttackTimer();
|
||||||
|
|
@ -315,26 +330,24 @@ void ScriptedAI::UpdateAI(const uint32)
|
||||||
void ScriptedAI::EnterEvadeMode()
|
void ScriptedAI::EnterEvadeMode()
|
||||||
{
|
{
|
||||||
m_creature->CombatStop(true);
|
m_creature->CombatStop(true);
|
||||||
if( m_creature->isAlive() )
|
if (m_creature->isAlive())
|
||||||
DoGoHome();
|
DoGoHome();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptedAI::DoStartAttack(Unit* victim)
|
void ScriptedAI::DoStartAttack(Unit* victim)
|
||||||
{
|
{
|
||||||
if( m_creature->Attack(victim, true) )
|
if (m_creature->Attack(victim, true))
|
||||||
m_creature->GetMotionMaster()->MoveChase(victim);
|
m_creature->GetMotionMaster()->MoveChase(victim);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptedAI::DoStopAttack()
|
void ScriptedAI::DoStopAttack()
|
||||||
{
|
{
|
||||||
if( m_creature->getVictim() != NULL )
|
if (m_creature->getVictim() != NULL)
|
||||||
{
|
|
||||||
m_creature->AttackStop();
|
m_creature->AttackStop();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptedAI::DoGoHome()
|
void ScriptedAI::DoGoHome()
|
||||||
{
|
{
|
||||||
if( !m_creature->getVictim() && m_creature->isAlive() )
|
if (!m_creature->getVictim() && m_creature->isAlive())
|
||||||
m_creature->GetMotionMaster()->MoveTargetedHome();
|
m_creature->GetMotionMaster()->MoveTargetedHome();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,9 +64,9 @@ struct Script
|
||||||
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, uint32, GameObject* );
|
bool (*pEffectDummyGameObj )(Unit*, uint32, SpellEffectIndex, GameObject* );
|
||||||
bool (*pEffectDummyCreature )(Unit*, uint32, uint32, Creature* );
|
bool (*pEffectDummyCreature )(Unit*, uint32, SpellEffectIndex, Creature* );
|
||||||
bool (*pEffectDummyItem )(Unit*, uint32, uint32, Item* );
|
bool (*pEffectDummyItem )(Unit*, uint32, SpellEffectIndex, Item* );
|
||||||
|
|
||||||
CreatureAI* (*GetAI)(Creature *_Creature);
|
CreatureAI* (*GetAI)(Creature *_Creature);
|
||||||
InstanceData* (*GetInstanceData)(Map*);
|
InstanceData* (*GetInstanceData)(Map*);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9412"
|
#define REVISION_NR "9413"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue