Example #1
0
void HookMgr::HandleContinentCreateHook(MapMgr * pMapMgr)
{
	HookList::iterator itr = mContinentCreateHooks.begin();
	for(; itr != mContinentCreateHooks.end(); itr++)
	{
		ContinentCreateHook * pHook = (ContinentCreateHook*)(*itr);
		if(pMapMgr->GetMapId() == pHook->mapId || pHook->mapId == ALL_MAPS)
			pHook->function(pMapMgr);
	}
}
Example #2
0
void HookMgr::HandlePostSpellCastHook(Player * pPlayer, SpellEntry * pSpell, Unit * pTarget)
{
	HookList::iterator itr = mPostSpellCastHooks.begin();
	for(; itr != mPostSpellCastHooks.end(); itr++)
	{
		PostSpellCastHook * pHook = (PostSpellCastHook*)(*itr);
		if(pPlayer->GetMapId() == pHook->mapId || pHook->mapId == ALL_MAPS)
			pHook->function(pPlayer, pSpell, pTarget);
	}
}
Example #3
0
void HookMgr::HandleHonorableKillHook(Player * pPlayer, Player * pKilled)
{
	HookList::iterator itr = mHonorableKillHooks.begin();
	for(; itr != mHonorableKillHooks.end(); itr++)
	{
		HonorableKillHook * pHook = (HonorableKillHook*)(*itr);
		if(pPlayer->GetMapId() == pHook->mapId || pHook->mapId == ALL_MAPS)
			pHook->function(pPlayer, pKilled);
	}
}
Example #4
0
void HookMgr::HandleKillPlayerHook(Player * pPlayer, Player * pVictim)
{
	HookList::iterator itr = mKillPlayerHooks.begin();
	for(; itr != mKillPlayerHooks.end(); itr++)
	{
		KillPlayerHook * pHook = (KillPlayerHook*)(*itr);
		if(pPlayer->GetMapId() == pHook->mapId || pHook->mapId == ALL_MAPS)
			pHook->function(pPlayer, pVictim);
	}
}
Example #5
0
void HookMgr::HandleEnterWorldHook(Player * pPlayer)
{
	HookList::iterator itr = mEnterWorldHooks.begin();
	for(; itr != mEnterWorldHooks.end(); itr++)
	{
		EnterWorldHook * pHook = (EnterWorldHook*)(*itr);
		if(pPlayer->GetMapId() == pHook->mapId || pHook->mapId == ALL_MAPS)
			pHook->function(pPlayer);
	}
}
Example #6
0
void HookMgr::HandleQuestFinishHook(Player * pPlayer, Quest * pQuest)
{
	HookList::iterator itr = mQuestFinishHooks.begin();
	for(; itr != mQuestFinishHooks.end(); itr++)
	{
		QuestFinishHook * pHook = (QuestFinishHook*)(*itr);
		if(pPlayer->GetMapId() == pHook->mapId || pHook->mapId == ALL_MAPS)
			pHook->function(pPlayer, pQuest);
	}
}
Example #7
0
void HookMgr::HandleArenaFinishHook(Player * pPlayer, uint32 type, ArenaTeam * pTeam, bool rated, bool victory)
{
	HookList::iterator itr = mArenaFinishHooks.begin();
	for(; itr != mArenaFinishHooks.end(); itr++)
	{
		ArenaFinishHook * pHook = (ArenaFinishHook*)(*itr);
		if(pPlayer->GetMapId() == pHook->mapId || pHook->mapId == ALL_MAPS)
			pHook->function(pPlayer, type, pTeam, rated, victory);
	}
}
Example #8
0
bool HookMgr::HandleRepopHook(Player * pPlayer)
{
	bool pResult = true;
	HookList::iterator itr = mRepopHooks.begin();
	for(; itr != mRepopHooks.end(); itr++)
	{
		RepopHook * pHook = (RepopHook*)(*itr);
		if(pPlayer->GetMapId() == pHook->mapId || pHook->mapId == ALL_MAPS)
			pResult = pHook->function(pPlayer);
	}
	return pResult;
}
Example #9
0
bool HookMgr::HandleCastSpellHook(Player * pPlayer, SpellEntry * pSpell)
{
	bool pResult = true;
	HookList::iterator itr = mCastSpellHooks.begin();
	for(; itr != mCastSpellHooks.end(); itr++)
	{
		CastSpellHook * pHook = (CastSpellHook*)(*itr);
		if(pPlayer->GetMapId() == pHook->mapId || pHook->mapId == ALL_MAPS)
			pResult = pHook->function(pPlayer, pSpell);
	}

	return pResult;
}
Example #10
0
void Engine::DoHook(HookList& hooklist) {
    if (!_recurseStop) {
        try {
            _recurseStop = true;
            hooklist.flush(); // handle any pending insertions/deletions

            for (HookList::iterator i = hooklist.begin(); i != hooklist.end(); i++) {
                script.ExecObject(*i);
            }
        } catch (...) {
            _recurseStop = false;
            throw;
        }
        _recurseStop = false;
    }
}
Example #11
0
void HookMgr::RegisterHook(ArenaFinishHook * pHook)
{
	mArenaFinishHooks.push_back((void*)pHook);
}
Example #12
0
void HookMgr::RegisterHook(ContinentCreateHook * pHook)
{
	mContinentCreateHooks.push_back((void*)pHook);
}
Example #13
0
void HookMgr::RegisterHook(PostSpellCastHook * pHook)
{
	mPostSpellCastHooks.push_back((void*)pHook);
}
Example #14
0
void HookMgr::RegisterHook(KillPlayerHook * pHook)
{
	mKillPlayerHooks.push_back((void*)pHook);
}
Example #15
0
void HookMgr::RegisterHook(CastSpellHook * pHook)
{
	mCastSpellHooks.push_back((void*)pHook);
}
Example #16
0
void HookMgr::RegisterHook(RepopHook * pHook)
{
	mRepopHooks.push_back((void*)pHook);
}
Example #17
0
void HookMgr::RegisterHook(DeathHook * pHook)
{
	mDeathHooks.push_back((void*)pHook);
}
Example #18
0
void HookMgr::RegisterHook(HonorableKillHook * pHook)
{
	mHonorableKillHooks.push_back((void*)pHook);
}
Example #19
0
void HookMgr::RegisterHook(QuestFinishHook * pHook)
{
	mQuestFinishHooks.push_back((void*)pHook);
}
Example #20
0
void HookMgr::RegisterHook(FirstEnterWorldHook * pHook)
{
	mFirstEnterWorldHooks.push_back((void*)pHook);
}