[SD2][915] Call Reset() after AI ctor; AT 522 script fix
This commit is contained in:
parent
606b1f0dc6
commit
f42a7b1fae
@ -342,6 +342,9 @@ class CreatureAI
|
|||||||
*/
|
*/
|
||||||
virtual void ReceiveAIEvent(AIEventType /*eventType*/, Creature* /*pSender*/, Unit* /*pInvoker*/, uint32 /*miscValue*/) {}
|
virtual void ReceiveAIEvent(AIEventType /*eventType*/, Creature* /*pSender*/, Unit* /*pInvoker*/, uint32 /*miscValue*/) {}
|
||||||
|
|
||||||
|
// Reset should be defined here, as it is called from out the AI ctor now
|
||||||
|
virtual void Reset() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void HandleMovementOnAttackStart(Unit* victim);
|
void HandleMovementOnAttackStart(Unit* victim);
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ struct ScriptedAI : public CreatureAI
|
|||||||
* Called by default on creature evade and respawn
|
* Called by default on creature evade and respawn
|
||||||
* In most scripts also called in the constructor of the AI
|
* In most scripts also called in the constructor of the AI
|
||||||
*/
|
*/
|
||||||
virtual void Reset() = 0;
|
//virtual void Reset() = 0; // is defined in CreatureAI
|
||||||
|
|
||||||
/// Called at creature EnterCombat with an enemy
|
/// Called at creature EnterCombat with an enemy
|
||||||
/**
|
/**
|
||||||
|
@ -546,16 +546,12 @@ struct at_twiggy_flathead : public AreaTriggerScript
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CreatureAI* pTwiggyAI = pCreature->AI()) //TODO how the data transfer unit->object (GO, AT) may be implemented? CreatureAI::GetData()? or &miscValue in SendAIEvent?
|
if (CreatureAI* pTwiggyAI = pCreature->AI())
|
||||||
{
|
{
|
||||||
pTwiggyAI->SendAIEvent(AI_EVENT_CUSTOM_A, pPlayer, pCreature); //TODO check the state here and return true/false (other possible AT uses are blocked now!)
|
pTwiggyAI->SendAIEvent(AI_EVENT_CUSTOM_A, pPlayer, pCreature);
|
||||||
//if (pTwiggyAI->CanStartEvent(pPlayer))
|
|
||||||
//{
|
|
||||||
// return false; // ok to let mangos process further
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return false; //this will let the trigger pop up several times until the quest is complete, but who cares
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -514,7 +514,11 @@ CreatureAI* SD2::GetCreatureAI(Creature* pCreature)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return pTempScript->ToCreatureScript()->GetAI(pCreature);
|
CreatureAI* ai = pTempScript->ToCreatureScript()->GetAI(pCreature);
|
||||||
|
if (ai)
|
||||||
|
ai->Reset();
|
||||||
|
|
||||||
|
return ai;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SD2::ItemUse(Player* pPlayer, Item* pItem, SpellCastTargets const& targets)
|
bool SD2::ItemUse(Player* pPlayer, Item* pItem, SpellCastTargets const& targets)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user