mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
*Update eventAI to SD2 979. Author: nofantasy.
--HG-- branch : trunk
This commit is contained in:
@@ -40,6 +40,7 @@ enum ChatType
|
||||
CHAT_TYPE_BOSS_EMOTE = 3,
|
||||
CHAT_TYPE_WHISPER = 4,
|
||||
CHAT_TYPE_BOSS_WHISPER = 5,
|
||||
CHAT_TYPE_ZONE_YELL = 6
|
||||
};
|
||||
|
||||
#define TEXT_SOURCE_RANGE -1000000 //the amount of entries each text source has available
|
||||
@@ -2239,6 +2240,9 @@ void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target)
|
||||
pSource->MonsterWhisper(textEntry, target->GetGUID(), true);
|
||||
else error_log("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry);
|
||||
}break;
|
||||
case CHAT_TYPE_ZONE_YELL:
|
||||
pSource->MonsterYellToZone(textEntry, (*i).second.Language, target ? target->GetGUID() : 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2473,14 +2477,13 @@ bool ReceiveEmote( Player *player, Creature *_Creature, uint32 emote )
|
||||
}
|
||||
|
||||
TRINITY_DLL_EXPORT
|
||||
InstanceData* CreateInstanceData(Map *map)
|
||||
bool EffectDummyCreature(Unit *caster, uint32 spellId, uint32 effIndex, Creature *crTarget )
|
||||
{
|
||||
if (!map->IsDungeon()) return NULL;
|
||||
Script *tmpscript = m_scripts[crTarget->GetScriptId()];
|
||||
|
||||
Script *tmpscript = m_scripts[((InstanceMap*)map)->GetScriptId()];
|
||||
if (!tmpscript || !tmpscript->GetInstanceData) return NULL;
|
||||
if (!tmpscript || !tmpscript->pEffectDummyCreature) return false;
|
||||
|
||||
return tmpscript->GetInstanceData(map);
|
||||
return tmpscript->pEffectDummyCreature(caster, spellId,effIndex,crTarget);
|
||||
}
|
||||
|
||||
TRINITY_DLL_EXPORT
|
||||
@@ -2493,15 +2496,6 @@ bool EffectDummyGameObj(Unit *caster, uint32 spellId, uint32 effIndex, GameObjec
|
||||
return tmpscript->pEffectDummyGameObj(caster, spellId,effIndex,gameObjTarget);
|
||||
}
|
||||
|
||||
TRINITY_DLL_EXPORT
|
||||
bool EffectDummyCreature(Unit *caster, uint32 spellId, uint32 effIndex, Creature *crTarget )
|
||||
{
|
||||
Script *tmpscript = m_scripts[crTarget->GetScriptId()];
|
||||
|
||||
if (!tmpscript || !tmpscript->pEffectDummyCreature) return false;
|
||||
|
||||
return tmpscript->pEffectDummyCreature(caster, spellId,effIndex,crTarget);
|
||||
}
|
||||
|
||||
TRINITY_DLL_EXPORT
|
||||
bool EffectDummyItem(Unit *caster, uint32 spellId, uint32 effIndex, Item *itemTarget )
|
||||
@@ -2512,3 +2506,15 @@ bool EffectDummyItem(Unit *caster, uint32 spellId, uint32 effIndex, Item *itemTa
|
||||
|
||||
return tmpscript->pEffectDummyItem(caster, spellId,effIndex,itemTarget);
|
||||
}
|
||||
|
||||
TRINITY_DLL_EXPORT
|
||||
InstanceData* CreateInstanceData(Map *map)
|
||||
{
|
||||
if (!map->IsDungeon()) return NULL;
|
||||
|
||||
Script *tmpscript = m_scripts[((InstanceMap*)map)->GetScriptId()];
|
||||
if (!tmpscript || !tmpscript->GetInstanceData) return NULL;
|
||||
|
||||
return tmpscript->GetInstanceData(map);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,10 +32,11 @@ struct Script
|
||||
{
|
||||
Script() :
|
||||
pGossipHello(NULL), pQuestAccept(NULL), pGossipSelect(NULL), pGossipSelectWithCode(NULL),
|
||||
pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pGODialogStatus(NULL), pChooseReward(NULL),
|
||||
pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), pItemQuestAccept(NULL), pGOQuestAccept(NULL),
|
||||
pGOChooseReward(NULL), pReceiveEmote(NULL), pItemUse(NULL), pEffectDummyGameObj(NULL), pEffectDummyCreature(NULL),
|
||||
pEffectDummyItem(NULL), GetAI(NULL)
|
||||
pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pGODialogStatus(NULL),
|
||||
pChooseReward(NULL), pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), pItemQuestAccept(NULL),
|
||||
pGOQuestAccept(NULL), pGOChooseReward(NULL),pReceiveEmote(NULL),pItemUse(NULL),
|
||||
pEffectDummyCreature(NULL), pEffectDummyGameObj(NULL), pEffectDummyItem(NULL),
|
||||
GetAI(NULL), GetInstanceData(NULL)
|
||||
{}
|
||||
|
||||
std::string Name;
|
||||
@@ -60,8 +61,8 @@ struct Script
|
||||
bool (*pGOChooseReward )(Player*, GameObject*, Quest const*, uint32 );
|
||||
bool (*pReceiveEmote )(Player*, Creature*, uint32 );
|
||||
bool (*pItemUse )(Player*, Item*, SpellCastTargets const& );
|
||||
bool (*pEffectDummyGameObj )(Unit*, uint32, uint32, GameObject* );
|
||||
bool (*pEffectDummyCreature )(Unit*, uint32, uint32, Creature* );
|
||||
bool (*pEffectDummyGameObj )(Unit*, uint32, uint32, GameObject* );
|
||||
bool (*pEffectDummyItem )(Unit*, uint32, uint32, Item* );
|
||||
|
||||
CreatureAI* (*GetAI)(Creature*);
|
||||
|
||||
@@ -933,10 +933,17 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
break;
|
||||
case ACTION_T_KILLED_MONSTER:
|
||||
{
|
||||
Unit* target = GetTargetByType(param2, pActionInvoker);
|
||||
//first attempt player who tapped creature
|
||||
if (Player* pPlayer = m_creature->GetLootRecipient())
|
||||
pPlayer->RewardPlayerAndGroupAtEvent(param1,m_creature);
|
||||
else
|
||||
{
|
||||
//if not available, use pActionInvoker
|
||||
Unit* pTarget = GetTargetByType(param2, pActionInvoker);
|
||||
|
||||
if (target && target->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)target)->KilledMonster(param1, m_creature->GetGUID());
|
||||
if (Player* pPlayer = pTarget->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
pPlayer->RewardPlayerAndGroupAtEvent(param1,m_creature);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ACTION_T_SET_INST_DATA:
|
||||
|
||||
Reference in New Issue
Block a user