This commit is contained in:
1 parent
dcc4d29276
commit
a3b16c040b
122 files changed
+6029
-5246
No files matched your search
@@ -795,24 +795,29 @@ void SmartAI::SetEvadeDisabled(bool disable)
|
||||
mEvadeDisabled = disable;
|
||||
}
|
||||
|
||||
void SmartAI::sGossipHello(Player* player)
|
||||
bool SmartAI::GossipHello(Player* player)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_HELLO, player);
|
||||
return false;
|
||||
}
|
||||
|
||||
void SmartAI::sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId)
|
||||
bool SmartAI::GossipSelect(Player* player, uint32 menuId, uint32 gossipListId)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_SELECT, player, menuId, gossipListId);
|
||||
return false;
|
||||
}
|
||||
|
||||
void SmartAI::sGossipSelectCode(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/, const char* /*code*/) { }
|
||||
bool SmartAI::GossipSelectCode(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/, const char* /*code*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void SmartAI::sQuestAccept(Player* player, Quest const* quest)
|
||||
void SmartAI::QuestAccept(Player* player, Quest const* quest)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_ACCEPTED_QUEST, player, quest->GetQuestId());
|
||||
}
|
||||
|
||||
void SmartAI::sQuestReward(Player* player, Quest const* quest, uint32 opt)
|
||||
void SmartAI::QuestReward(Player* player, Quest const* quest, uint32 opt)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_REWARD_QUEST, player, quest->GetQuestId(), opt);
|
||||
}
|
||||
@@ -902,7 +907,7 @@ void SmartAI::SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker)
|
||||
GetScript()->SetScript9(e, entry);
|
||||
}
|
||||
|
||||
void SmartAI::sOnGameEvent(bool start, uint16 eventId)
|
||||
void SmartAI::OnGameEvent(bool start, uint16 eventId)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, nullptr, eventId);
|
||||
}
|
||||
@@ -951,10 +956,10 @@ void SmartGameObjectAI::UpdateAI(uint32 diff)
|
||||
|
||||
void SmartGameObjectAI::InitializeAI()
|
||||
{
|
||||
GetScript()->OnInitialize(go);
|
||||
GetScript()->OnInitialize(me);
|
||||
|
||||
// do not call respawn event if go is not spawned
|
||||
if (go->isSpawned())
|
||||
if (me->isSpawned())
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_RESPAWN);
|
||||
//Reset();
|
||||
}
|
||||
@@ -971,41 +976,39 @@ void SmartGameObjectAI::Reset()
|
||||
bool SmartGameObjectAI::GossipHello(Player* player, bool reportUse)
|
||||
{
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartGameObjectAI::GossipHello");
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_HELLO, player, uint32(reportUse), 0, false, nullptr, go);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_HELLO, player, uint32(reportUse), 0, false, nullptr, me);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Called when a player selects a gossip item in the gameobject's gossip menu.
|
||||
bool SmartGameObjectAI::GossipSelect(Player* player, uint32 sender, uint32 action)
|
||||
bool SmartGameObjectAI::GossipSelect(Player* player, uint32 menuId, uint32 gossipListId)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_SELECT, player, sender, action, false, nullptr, go);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_SELECT, player, menuId, gossipListId, false, nullptr, me);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Called when a player selects a gossip with a code in the gameobject's gossip menu.
|
||||
bool SmartGameObjectAI::GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/)
|
||||
bool SmartGameObjectAI::GossipSelectCode(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/, const char* /*code*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Called when a player accepts a quest from the gameobject.
|
||||
bool SmartGameObjectAI::QuestAccept(Player* player, Quest const* quest)
|
||||
void SmartGameObjectAI::QuestAccept(Player* player, Quest const* quest)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_ACCEPTED_QUEST, player, quest->GetQuestId(), 0, false, nullptr, go);
|
||||
return false;
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_ACCEPTED_QUEST, player, quest->GetQuestId(), 0, false, nullptr, me);
|
||||
}
|
||||
|
||||
// Called when a player selects a quest reward.
|
||||
bool SmartGameObjectAI::QuestReward(Player* player, Quest const* quest, uint32 opt)
|
||||
void SmartGameObjectAI::QuestReward(Player* player, Quest const* quest, uint32 opt)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_REWARD_QUEST, player, quest->GetQuestId(), opt, false, nullptr, go);
|
||||
return false;
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_REWARD_QUEST, player, quest->GetQuestId(), opt, false, nullptr, me);
|
||||
}
|
||||
|
||||
// Called when the gameobject is destroyed (destructible buildings only).
|
||||
void SmartGameObjectAI::Destroyed(Player* player, uint32 eventId)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DEATH, player, eventId, 0, false, nullptr, go);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DEATH, player, eventId, 0, false, nullptr, me);
|
||||
}
|
||||
|
||||
void SmartGameObjectAI::SetData(uint32 id, uint32 value)
|
||||
@@ -1025,9 +1028,9 @@ void SmartGameObjectAI::OnGameEvent(bool start, uint16 eventId)
|
||||
GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, nullptr, eventId);
|
||||
}
|
||||
|
||||
void SmartGameObjectAI::OnStateChanged(uint32 state, Unit* unit)
|
||||
void SmartGameObjectAI::OnLootStateChanged(uint32 state, Unit* unit)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_GO_STATE_CHANGED, unit, state);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_GO_LOOT_STATE_CHANGED, unit, state);
|
||||
}
|
||||
|
||||
void SmartGameObjectAI::EventInform(uint32 eventId)
|
||||
|
||||
Reference in new issue
Block a user