This commit is contained in:
1 parent
dcc4d29276
commit
a3b16c040b
122 files changed
+6029
-5246
No files matched your search
@@ -29,9 +29,9 @@
|
||||
class TC_GAME_API GameObjectAI
|
||||
{
|
||||
protected:
|
||||
GameObject* const go;
|
||||
GameObject* const me;
|
||||
public:
|
||||
explicit GameObjectAI(GameObject* g) : go(g) { }
|
||||
explicit GameObjectAI(GameObject* g) : me(g) { }
|
||||
virtual ~GameObjectAI() { }
|
||||
|
||||
virtual void UpdateAI(uint32 /*diff*/) { }
|
||||
@@ -47,19 +47,35 @@ class TC_GAME_API GameObjectAI
|
||||
|
||||
static int32 Permissible(GameObject const* /*go*/) { return PERMIT_BASE_NO; }
|
||||
|
||||
// Called when a player opens a gossip dialog with the gameobject.
|
||||
virtual bool GossipHello(Player* /*player*/, bool /*reportUse*/) { return false; }
|
||||
virtual bool GossipSelect(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/) { return false; }
|
||||
virtual bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, char const* /*code*/) { return false; }
|
||||
virtual bool QuestAccept(Player* /*player*/, Quest const* /*quest*/) { return false; }
|
||||
virtual bool QuestReward(Player* /*player*/, Quest const* /*quest*/, uint32 /*opt*/) { return false; }
|
||||
|
||||
// Called when a player selects a gossip item in the gameobject's gossip menu.
|
||||
virtual bool GossipSelect(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/) { return false; }
|
||||
|
||||
// Called when a player selects a gossip with a code in the gameobject's gossip menu.
|
||||
virtual bool GossipSelectCode(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/, char const* /*code*/) { return false; }
|
||||
|
||||
// Called when a player accepts a quest from the gameobject.
|
||||
virtual void QuestAccept(Player* /*player*/, Quest const* /*quest*/) { }
|
||||
|
||||
// Called when a player completes a quest and is rewarded, opt is the selected item's index or 0
|
||||
virtual void QuestReward(Player* /*player*/, Quest const* /*quest*/, uint32 /*opt*/) { }
|
||||
|
||||
// Called when the dialog status between a player and the gameobject is requested.
|
||||
virtual uint32 GetDialogStatus(Player* /*player*/) { return DIALOG_STATUS_SCRIPTED_NO_STATUS; }
|
||||
|
||||
virtual void Destroyed(Player* /*player*/, uint32 /*eventId*/) { }
|
||||
virtual void Damaged(Player* /*player*/, uint32 /*eventId*/) { }
|
||||
|
||||
virtual uint32 GetData(uint32 /*id*/) const { return 0; }
|
||||
virtual void SetData64(uint32 /*id*/, uint64 /*value*/) { }
|
||||
virtual uint64 GetData64(uint32 /*id*/) const { return 0; }
|
||||
virtual void SetData(uint32 /*id*/, uint32 /*value*/) { }
|
||||
|
||||
virtual void OnGameEvent(bool /*start*/, uint16 /*eventId*/) { }
|
||||
virtual void OnStateChanged(uint32 /*state*/, Unit* /*unit*/) { }
|
||||
virtual void OnLootStateChanged(uint32 /*state*/, Unit* /*unit*/) { }
|
||||
virtual void OnStateChanged(uint32 /*state*/) { }
|
||||
virtual void EventInform(uint32 /*eventId*/) { }
|
||||
virtual void SpellHit(Unit* /*unit*/, const SpellInfo* /*spellInfo*/) { }
|
||||
};
|
||||
|
||||
@@ -297,13 +297,26 @@ class TC_GAME_API UnitAI
|
||||
static AISpellInfoType* AISpellInfo;
|
||||
static void FillAISpellInfo();
|
||||
|
||||
virtual void sGossipHello(Player* /*player*/) { }
|
||||
virtual void sGossipSelect(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/) { }
|
||||
virtual void sGossipSelectCode(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/, char const* /*code*/) { }
|
||||
virtual void sQuestAccept(Player* /*player*/, Quest const* /*quest*/) { }
|
||||
virtual void sQuestSelect(Player* /*player*/, Quest const* /*quest*/) { }
|
||||
virtual void sQuestReward(Player* /*player*/, Quest const* /*quest*/, uint32 /*opt*/) { }
|
||||
virtual void sOnGameEvent(bool /*start*/, uint16 /*eventId*/) { }
|
||||
// Called when a player opens a gossip dialog with the creature.
|
||||
virtual bool GossipHello(Player* /*player*/) { return false; }
|
||||
|
||||
// Called when a player selects a gossip item in the creature's gossip menu.
|
||||
virtual bool GossipSelect(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/) { return false; }
|
||||
|
||||
// Called when a player selects a gossip with a code in the creature's gossip menu.
|
||||
virtual bool GossipSelectCode(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/, char const* /*code*/) { return false; }
|
||||
|
||||
// Called when a player accepts a quest from the creature.
|
||||
virtual void QuestAccept(Player* /*player*/, Quest const* /*quest*/) { }
|
||||
|
||||
// Called when a player completes a quest and is rewarded, opt is the selected item's index or 0
|
||||
virtual void QuestReward(Player* /*player*/, Quest const* /*quest*/, uint32 /*opt*/) { }
|
||||
|
||||
// Called when a game event starts or ends
|
||||
virtual void OnGameEvent(bool /*start*/, uint16 /*eventId*/) { }
|
||||
|
||||
// Called when the dialog status between a player and the creature is requested.
|
||||
virtual uint32 GetDialogStatus(Player* /*player*/) { return DIALOG_STATUS_SCRIPTED_NO_STATUS; }
|
||||
|
||||
private:
|
||||
UnitAI(UnitAI const& right) = delete;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -178,13 +178,12 @@ class TC_GAME_API SmartAI : public CreatureAI
|
||||
|
||||
void SetInvincibilityHpLevel(uint32 level) { mInvincibilityHpLevel = level; }
|
||||
|
||||
void sGossipHello(Player* player) override;
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override;
|
||||
void sGossipSelectCode(Player* player, uint32 menuId, uint32 gossipListId, const char* code) override;
|
||||
void sQuestAccept(Player* player, Quest const* quest) override;
|
||||
//void sQuestSelect(Player* player, Quest const* quest) override;
|
||||
void sQuestReward(Player* player, Quest const* quest, uint32 opt) override;
|
||||
void sOnGameEvent(bool start, uint16 eventId) override;
|
||||
bool GossipHello(Player* player) override;
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override;
|
||||
bool GossipSelectCode(Player* player, uint32 menuId, uint32 gossipListId, const char* code) override;
|
||||
void QuestAccept(Player* player, Quest const* quest) override;
|
||||
void QuestReward(Player* player, Quest const* quest, uint32 opt) override;
|
||||
void OnGameEvent(bool start, uint16 eventId) override;
|
||||
|
||||
uint32 mEscortQuestID;
|
||||
|
||||
@@ -256,15 +255,15 @@ class TC_GAME_API SmartGameObjectAI : public GameObjectAI
|
||||
static int32 Permissible(GameObject const* /*go*/) { return PERMIT_BASE_NO; }
|
||||
|
||||
bool GossipHello(Player* player, bool reportUse) override;
|
||||
bool GossipSelect(Player* player, uint32 sender, uint32 action) override;
|
||||
bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/) override;
|
||||
bool QuestAccept(Player* player, Quest const* quest) override;
|
||||
bool QuestReward(Player* player, Quest const* quest, uint32 opt) override;
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override;
|
||||
bool GossipSelectCode(Player* player, uint32 menuId, uint32 gossipListId, const char* code) override;
|
||||
void QuestAccept(Player* player, Quest const* quest) override;
|
||||
void QuestReward(Player* player, Quest const* quest, uint32 opt) override;
|
||||
void Destroyed(Player* player, uint32 eventId) override;
|
||||
void SetData(uint32 id, uint32 value) override;
|
||||
void SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker);
|
||||
void OnGameEvent(bool start, uint16 eventId) override;
|
||||
void OnStateChanged(uint32 state, Unit* unit) override;
|
||||
void OnLootStateChanged(uint32 state, Unit* unit) override;
|
||||
void EventInform(uint32 eventId) override;
|
||||
void SpellHit(Unit* unit, const SpellInfo* spellInfo) override;
|
||||
|
||||
|
||||
@@ -2736,16 +2736,16 @@ void SmartScript::InstallTemplate(SmartScriptHolder const& e)
|
||||
if (!go)
|
||||
return;
|
||||
//store hostage as id1
|
||||
AddEvent(SMART_EVENT_GO_STATE_CHANGED, 0, 2, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 1, 0, 0, 0, 0, 0, SMART_TARGET_CLOSEST_CREATURE, e.action.installTtemplate.param1, 10, 0, 0);
|
||||
AddEvent(SMART_EVENT_GO_LOOT_STATE_CHANGED, 0, GO_ACTIVATED, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 1, 0, 0, 0, 0, 0, SMART_TARGET_CLOSEST_CREATURE, e.action.installTtemplate.param1, 10, 0, 0);
|
||||
//store invoker as id2
|
||||
AddEvent(SMART_EVENT_GO_STATE_CHANGED, 0, 2, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 2, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0);
|
||||
AddEvent(SMART_EVENT_GO_LOOT_STATE_CHANGED, 0, GO_ACTIVATED, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 2, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0);
|
||||
//signal hostage
|
||||
AddEvent(SMART_EVENT_GO_STATE_CHANGED, 0, 2, 0, 0, 0, SMART_ACTION_SET_DATA, 0, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 1, 0, 0, 0);
|
||||
AddEvent(SMART_EVENT_GO_LOOT_STATE_CHANGED, 0, GO_ACTIVATED, 0, 0, 0, SMART_ACTION_SET_DATA, 0, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 1, 0, 0, 0);
|
||||
//when hostage raeched end point, give credit to invoker
|
||||
if (e.action.installTtemplate.param2)
|
||||
AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_CALL_KILLEDMONSTER, e.action.installTtemplate.param1, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 2, 0, 0, 0);
|
||||
else
|
||||
AddEvent(SMART_EVENT_GO_STATE_CHANGED, 0, 2, 0, 0, 0, SMART_ACTION_CALL_KILLEDMONSTER, e.action.installTtemplate.param1, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 2, 0, 0, 0);
|
||||
AddEvent(SMART_EVENT_GO_LOOT_STATE_CHANGED, 0, GO_ACTIVATED, 0, 0, 0, SMART_ACTION_CALL_KILLEDMONSTER, e.action.installTtemplate.param1, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 2, 0, 0, 0);
|
||||
break;
|
||||
}
|
||||
case SMARTAI_TEMPLATE_BASIC:
|
||||
@@ -3592,9 +3592,9 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
ProcessAction(e, nullptr, var0);
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_GO_STATE_CHANGED:
|
||||
case SMART_EVENT_GO_LOOT_STATE_CHANGED:
|
||||
{
|
||||
if (e.event.goStateChanged.state != var0)
|
||||
if (e.event.goLootStateChanged.lootState != var0)
|
||||
return;
|
||||
ProcessAction(e, unit, var0, var1);
|
||||
break;
|
||||
|
||||
@@ -811,7 +811,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
}
|
||||
break;
|
||||
case SMART_EVENT_LINK:
|
||||
case SMART_EVENT_GO_STATE_CHANGED:
|
||||
case SMART_EVENT_GO_LOOT_STATE_CHANGED:
|
||||
case SMART_EVENT_GO_EVENT_INFORM:
|
||||
case SMART_EVENT_TIMED_EVENT_TRIGGERED:
|
||||
case SMART_EVENT_INSTANCE_PLAYER_ENTER:
|
||||
|
||||
@@ -182,7 +182,7 @@ enum SMART_EVENT
|
||||
SMART_EVENT_IS_BEHIND_TARGET = 67, // cooldownMin, CooldownMax
|
||||
SMART_EVENT_GAME_EVENT_START = 68, // game_event.Entry
|
||||
SMART_EVENT_GAME_EVENT_END = 69, // game_event.Entry
|
||||
SMART_EVENT_GO_STATE_CHANGED = 70, // go state
|
||||
SMART_EVENT_GO_LOOT_STATE_CHANGED = 70, // go LootState
|
||||
SMART_EVENT_GO_EVENT_INFORM = 71, // eventId
|
||||
SMART_EVENT_ACTION_DONE = 72, // eventId (SharedDefines.EventId)
|
||||
SMART_EVENT_ON_SPELLCLICK = 73, // clicker (unit)
|
||||
@@ -405,8 +405,8 @@ struct SmartEvent
|
||||
|
||||
struct
|
||||
{
|
||||
uint32 state;
|
||||
} goStateChanged;
|
||||
uint32 lootState;
|
||||
} goLootStateChanged;
|
||||
|
||||
struct
|
||||
{
|
||||
@@ -588,7 +588,7 @@ enum SMART_ACTION
|
||||
SMART_ACTION_LOAD_EQUIPMENT = 124, // id
|
||||
SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT = 125, // id min range, id max range
|
||||
SMART_ACTION_REMOVE_ALL_GAMEOBJECTS = 126,
|
||||
SMART_ACTION_STOP_MOTION = 127, // stopMoving, movementExpired
|
||||
SMART_ACTION_STOP_MOTION = 127, // stopMoving, movementExpired
|
||||
SMART_ACTION_PLAY_ANIMKIT = 128, // id, type (0 = oneShot, 1 = aiAnim, 2 = meleeAnim, 3 = movementAnim)
|
||||
|
||||
SMART_ACTION_END = 129
|
||||
@@ -1464,7 +1464,7 @@ const uint32 SmartAIEventMask[SMART_EVENT_END][2] =
|
||||
{SMART_EVENT_IS_BEHIND_TARGET, SMART_SCRIPT_TYPE_MASK_CREATURE },
|
||||
{SMART_EVENT_GAME_EVENT_START, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT },
|
||||
{SMART_EVENT_GAME_EVENT_END, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT },
|
||||
{SMART_EVENT_GO_STATE_CHANGED, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT },
|
||||
{SMART_EVENT_GO_LOOT_STATE_CHANGED, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT },
|
||||
{SMART_EVENT_GO_EVENT_INFORM, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT },
|
||||
{SMART_EVENT_ACTION_DONE, SMART_SCRIPT_TYPE_MASK_CREATURE },
|
||||
{SMART_EVENT_ON_SPELLCLICK, SMART_SCRIPT_TYPE_MASK_CREATURE },
|
||||
|
||||
@@ -712,8 +712,6 @@ void Creature::Update(uint32 diff)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
sScriptMgr->OnCreatureUpdate(this, diff);
|
||||
}
|
||||
|
||||
void Creature::RegenerateMana()
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "UpdateFieldFlags.h"
|
||||
#include "World.h"
|
||||
#include "Transport.h"
|
||||
#include "GossipDef.h"
|
||||
|
||||
GameObject::GameObject() : WorldObject(false), MapObject(),
|
||||
m_model(nullptr), m_goValue(), m_AI(nullptr)
|
||||
@@ -721,7 +722,6 @@ void GameObject::Update(uint32 diff)
|
||||
break;
|
||||
}
|
||||
}
|
||||
sScriptMgr->OnGameObjectUpdate(this, diff);
|
||||
}
|
||||
|
||||
void GameObject::Refresh()
|
||||
@@ -1239,9 +1239,7 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
if (Player* playerUser = user->ToPlayer())
|
||||
{
|
||||
if (sScriptMgr->OnGossipHello(playerUser, this))
|
||||
return;
|
||||
|
||||
playerUser->PlayerTalkClass->ClearMenus();
|
||||
if (AI()->GossipHello(playerUser, false))
|
||||
return;
|
||||
}
|
||||
@@ -2068,7 +2066,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
|
||||
case GO_DESTRUCTIBLE_DAMAGED:
|
||||
{
|
||||
EventInform(m_goInfo->building.damagedEvent, eventInvoker);
|
||||
sScriptMgr->OnGameObjectDamaged(this, eventInvoker);
|
||||
AI()->Damaged(eventInvoker, m_goInfo->building.damageEvent);
|
||||
|
||||
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED);
|
||||
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED);
|
||||
@@ -2092,8 +2090,9 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
|
||||
}
|
||||
case GO_DESTRUCTIBLE_DESTROYED:
|
||||
{
|
||||
sScriptMgr->OnGameObjectDestroyed(this, eventInvoker);
|
||||
EventInform(m_goInfo->building.destroyedEvent, eventInvoker);
|
||||
AI()->Destroyed(eventInvoker, m_goInfo->building.destroyedEvent);
|
||||
|
||||
if (eventInvoker)
|
||||
if (Battleground* bg = eventInvoker->GetBattleground())
|
||||
bg->DestroyGate(eventInvoker, this);
|
||||
@@ -2146,8 +2145,7 @@ void GameObject::SetLootState(LootState state, Unit* unit)
|
||||
else
|
||||
m_lootStateUnitGUID.Clear();
|
||||
|
||||
AI()->OnStateChanged(state, unit);
|
||||
sScriptMgr->OnGameObjectLootStateChanged(this, state, unit);
|
||||
AI()->OnLootStateChanged(state, unit);
|
||||
|
||||
if (GetGoType() == GAMEOBJECT_TYPE_DOOR) // only set collision for doors on SetGoState
|
||||
return;
|
||||
@@ -2166,7 +2164,8 @@ void GameObject::SetLootState(LootState state, Unit* unit)
|
||||
void GameObject::SetGoState(GOState state)
|
||||
{
|
||||
SetByteValue(GAMEOBJECT_BYTES_1, 0, state);
|
||||
sScriptMgr->OnGameObjectStateChanged(this, state);
|
||||
if (AI())
|
||||
AI()->OnStateChanged(state);
|
||||
if (m_model && !IsTransport())
|
||||
{
|
||||
if (!IsInWorld())
|
||||
|
||||
@@ -14879,8 +14879,8 @@ void Player::AddQuestAndCheckCompletion(Quest const* quest, Object* questGiver)
|
||||
switch (questGiver->GetTypeId())
|
||||
{
|
||||
case TYPEID_UNIT:
|
||||
sScriptMgr->OnQuestAccept(this, questGiver->ToCreature(), quest);
|
||||
questGiver->ToCreature()->AI()->sQuestAccept(this, quest);
|
||||
PlayerTalkClass->ClearMenus();
|
||||
questGiver->ToCreature()->AI()->QuestAccept(this, quest);
|
||||
break;
|
||||
case TYPEID_ITEM:
|
||||
case TYPEID_CONTAINER:
|
||||
@@ -14905,7 +14905,7 @@ void Player::AddQuestAndCheckCompletion(Quest const* quest, Object* questGiver)
|
||||
break;
|
||||
}
|
||||
case TYPEID_GAMEOBJECT:
|
||||
sScriptMgr->OnQuestAccept(this, questGiver->ToGameObject(), quest);
|
||||
PlayerTalkClass->ClearMenus();
|
||||
questGiver->ToGameObject()->AI()->QuestAccept(this, quest);
|
||||
break;
|
||||
default:
|
||||
@@ -16021,11 +16021,12 @@ QuestGiverStatus Player::GetQuestDialogStatus(Object* questgiver)
|
||||
QuestRelationBounds qr;
|
||||
QuestRelationBounds qir;
|
||||
|
||||
PlayerTalkClass->ClearMenus();
|
||||
switch (questgiver->GetTypeId())
|
||||
{
|
||||
case TYPEID_GAMEOBJECT:
|
||||
{
|
||||
QuestGiverStatus questStatus = QuestGiverStatus(sScriptMgr->GetDialogStatus(this, questgiver->ToGameObject()));
|
||||
QuestGiverStatus questStatus = QuestGiverStatus(questgiver->ToGameObject()->AI()->GetDialogStatus(this));
|
||||
if (questStatus != DIALOG_STATUS_SCRIPTED_NO_STATUS)
|
||||
return questStatus;
|
||||
qr = sObjectMgr->GetGOQuestRelationBounds(questgiver->GetEntry());
|
||||
@@ -16034,7 +16035,7 @@ QuestGiverStatus Player::GetQuestDialogStatus(Object* questgiver)
|
||||
}
|
||||
case TYPEID_UNIT:
|
||||
{
|
||||
QuestGiverStatus questStatus = QuestGiverStatus(sScriptMgr->GetDialogStatus(this, questgiver->ToCreature()));
|
||||
QuestGiverStatus questStatus = QuestGiverStatus(questgiver->ToCreature()->AI()->GetDialogStatus(this));
|
||||
if (questStatus != DIALOG_STATUS_SCRIPTED_NO_STATUS)
|
||||
return questStatus;
|
||||
qr = sObjectMgr->GetCreatureQuestRelationBounds(questgiver->GetEntry());
|
||||
|
||||
@@ -1684,7 +1684,7 @@ class GameEventAIHookWorker
|
||||
{
|
||||
for (auto const& p : creatureMap)
|
||||
if (p.second->IsInWorld() && p.second->IsAIEnabled)
|
||||
p.second->AI()->sOnGameEvent(_activate, _eventId);
|
||||
p.second->AI()->OnGameEvent(_activate, _eventId);
|
||||
}
|
||||
|
||||
void Visit(std::unordered_map<ObjectGuid, GameObject*>& gameObjectMap)
|
||||
|
||||
@@ -147,14 +147,12 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket& recvData)
|
||||
{
|
||||
if (unit)
|
||||
{
|
||||
unit->AI()->sGossipSelectCode(_player, menuId, gossipListId, code.c_str());
|
||||
if (!sScriptMgr->OnGossipSelectCode(_player, unit, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId), code.c_str()))
|
||||
if (!unit->AI()->GossipSelectCode(_player, menuId, gossipListId, code.c_str()))
|
||||
_player->OnGossipSelect(unit, gossipListId, menuId);
|
||||
}
|
||||
else
|
||||
{
|
||||
go->AI()->GossipSelectCode(_player, menuId, gossipListId, code.c_str());
|
||||
if (!sScriptMgr->OnGossipSelectCode(_player, go, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId), code.c_str()))
|
||||
if (!go->AI()->GossipSelectCode(_player, menuId, gossipListId, code.c_str()))
|
||||
_player->OnGossipSelect(go, gossipListId, menuId);
|
||||
}
|
||||
}
|
||||
@@ -162,14 +160,12 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket& recvData)
|
||||
{
|
||||
if (unit)
|
||||
{
|
||||
unit->AI()->sGossipSelect(_player, menuId, gossipListId);
|
||||
if (!sScriptMgr->OnGossipSelect(_player, unit, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId)))
|
||||
if (!unit->AI()->GossipSelect(_player, menuId, gossipListId))
|
||||
_player->OnGossipSelect(unit, gossipListId, menuId);
|
||||
}
|
||||
else
|
||||
{
|
||||
go->AI()->GossipSelect(_player, menuId, gossipListId);
|
||||
if (!sScriptMgr->OnGossipSelect(_player, go, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId)))
|
||||
if (!go->AI()->GossipSelect(_player, menuId, gossipListId))
|
||||
_player->OnGossipSelect(go, gossipListId, menuId);
|
||||
}
|
||||
}
|
||||
@@ -618,19 +614,19 @@ void WorldSession::HandleResurrectResponseOpcode(WorldPacket& recvData)
|
||||
if (!GetPlayer()->IsResurrectRequestedBy(guid))
|
||||
return;
|
||||
|
||||
if (Player* ressPlayer = ObjectAccessor::GetPlayer(*GetPlayer(), guid))
|
||||
{
|
||||
if (InstanceScript* instance = ressPlayer->GetInstanceScript())
|
||||
{
|
||||
if ((instance->IsEncounterInProgress() && ressPlayer->GetMap()->IsRaid()))
|
||||
{
|
||||
if (!instance->GetCombatResurrectionCharges())
|
||||
return;
|
||||
else
|
||||
instance->UseCombatResurrection();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Player* ressPlayer = ObjectAccessor::GetPlayer(*GetPlayer(), guid))
|
||||
{
|
||||
if (InstanceScript* instance = ressPlayer->GetInstanceScript())
|
||||
{
|
||||
if ((instance->IsEncounterInProgress() && ressPlayer->GetMap()->IsRaid()))
|
||||
{
|
||||
if (!instance->GetCombatResurrectionCharges())
|
||||
return;
|
||||
else
|
||||
instance->UseCombatResurrection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GetPlayer()->ResurrectUsingRequestData();
|
||||
}
|
||||
|
||||
@@ -364,13 +364,13 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
|
||||
}
|
||||
}
|
||||
|
||||
if (!sScriptMgr->OnGossipHello(_player, unit))
|
||||
_player->PlayerTalkClass->ClearMenus();
|
||||
if (!unit->AI()->GossipHello(_player))
|
||||
{
|
||||
// _player->TalkedToCreature(unit->GetEntry(), unit->GetGUID());
|
||||
_player->PrepareGossipMenu(unit, unit->GetCreatureTemplate()->GossipMenuId, true);
|
||||
_player->SendPreparedGossip(unit);
|
||||
}
|
||||
unit->AI()->sGossipHello(_player);
|
||||
}
|
||||
|
||||
void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket& recvData)
|
||||
|
||||
@@ -89,13 +89,12 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket& recvData)
|
||||
// Stop the npc if moving
|
||||
creature->StopMoving();
|
||||
|
||||
if (sScriptMgr->OnGossipHello(_player, creature))
|
||||
_player->PlayerTalkClass->ClearMenus();
|
||||
if (creature->AI()->GossipHello(_player))
|
||||
return;
|
||||
|
||||
_player->PrepareGossipMenu(creature, creature->GetCreatureTemplate()->GossipMenuId, true);
|
||||
_player->SendPreparedGossip(creature);
|
||||
|
||||
creature->AI()->sGossipHello(_player);
|
||||
}
|
||||
|
||||
void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket& recvData)
|
||||
@@ -308,48 +307,42 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData)
|
||||
case TYPEID_UNIT:
|
||||
case TYPEID_PLAYER:
|
||||
{
|
||||
//For AutoSubmition was added plr case there as it almost same exclute AI script cases.
|
||||
Creature* creatureQGiver = object->ToCreature();
|
||||
if (!creatureQGiver || !sScriptMgr->OnQuestReward(_player, creatureQGiver, quest, reward))
|
||||
// Send next quest
|
||||
if (Quest const* nextQuest = _player->GetNextQuest(guid, quest))
|
||||
{
|
||||
// Send next quest
|
||||
if (Quest const* nextQuest = _player->GetNextQuest(guid, quest))
|
||||
// Only send the quest to the player if the conditions are met
|
||||
if (_player->CanTakeQuest(nextQuest, false))
|
||||
{
|
||||
// Only send the quest to the player if the conditions are met
|
||||
if (_player->CanTakeQuest(nextQuest, false))
|
||||
{
|
||||
if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true))
|
||||
_player->AddQuestAndCheckCompletion(nextQuest, object);
|
||||
if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true))
|
||||
_player->AddQuestAndCheckCompletion(nextQuest, object);
|
||||
|
||||
_player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true, false);
|
||||
}
|
||||
_player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true, false);
|
||||
}
|
||||
|
||||
if (creatureQGiver)
|
||||
creatureQGiver->AI()->sQuestReward(_player, quest, reward);
|
||||
}
|
||||
|
||||
_player->PlayerTalkClass->ClearMenus();
|
||||
if (Creature* creatureQGiver = object->ToCreature())
|
||||
creatureQGiver->AI()->QuestReward(_player, quest, reward);
|
||||
break;
|
||||
}
|
||||
case TYPEID_GAMEOBJECT:
|
||||
{
|
||||
GameObject* questGiver = object->ToGameObject();
|
||||
if (!sScriptMgr->OnQuestReward(_player, questGiver, quest, reward))
|
||||
// Send next quest
|
||||
if (Quest const* nextQuest = _player->GetNextQuest(guid, quest))
|
||||
{
|
||||
// Send next quest
|
||||
if (Quest const* nextQuest = _player->GetNextQuest(guid, quest))
|
||||
// Only send the quest to the player if the conditions are met
|
||||
if (_player->CanTakeQuest(nextQuest, false))
|
||||
{
|
||||
// Only send the quest to the player if the conditions are met
|
||||
if (_player->CanTakeQuest(nextQuest, false))
|
||||
{
|
||||
if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true))
|
||||
_player->AddQuestAndCheckCompletion(nextQuest, object);
|
||||
if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true))
|
||||
_player->AddQuestAndCheckCompletion(nextQuest, object);
|
||||
|
||||
_player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true, false);
|
||||
}
|
||||
_player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true, false);
|
||||
}
|
||||
|
||||
questGiver->AI()->QuestReward(_player, quest, reward);
|
||||
}
|
||||
|
||||
_player->PlayerTalkClass->ClearMenus();
|
||||
if (GameObject* questGiver = object->ToGameObject())
|
||||
questGiver->AI()->QuestReward(_player, quest, reward);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -1560,78 +1560,6 @@ bool ScriptMgr::OnCastItemCombatSpell(Player* player, Unit* victim, SpellInfo co
|
||||
return tmpscript->OnCastItemCombatSpell(player, victim, spellInfo, item);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
ASSERT(player);
|
||||
ASSERT(creature);
|
||||
|
||||
GET_SCRIPT_RET(CreatureScript, creature->GetScriptId(), tmpscript, false);
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
return tmpscript->OnGossipHello(player, creature);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action)
|
||||
{
|
||||
ASSERT(player);
|
||||
ASSERT(creature);
|
||||
|
||||
GET_SCRIPT_RET(CreatureScript, creature->GetScriptId(), tmpscript, false);
|
||||
return tmpscript->OnGossipSelect(player, creature, sender, action);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 action, const char* code)
|
||||
{
|
||||
ASSERT(player);
|
||||
ASSERT(creature);
|
||||
ASSERT(code);
|
||||
|
||||
GET_SCRIPT_RET(CreatureScript, creature->GetScriptId(), tmpscript, false);
|
||||
return tmpscript->OnGossipSelectCode(player, creature, sender, action, code);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
|
||||
{
|
||||
ASSERT(player);
|
||||
ASSERT(creature);
|
||||
ASSERT(quest);
|
||||
|
||||
GET_SCRIPT_RET(CreatureScript, creature->GetScriptId(), tmpscript, false);
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
return tmpscript->OnQuestAccept(player, creature, quest);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnQuestSelect(Player* player, Creature* creature, Quest const* quest)
|
||||
{
|
||||
ASSERT(player);
|
||||
ASSERT(creature);
|
||||
ASSERT(quest);
|
||||
|
||||
GET_SCRIPT_RET(CreatureScript, creature->GetScriptId(), tmpscript, false);
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
return tmpscript->OnQuestSelect(player, creature, quest);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnQuestReward(Player* player, Creature* creature, Quest const* quest, uint32 opt)
|
||||
{
|
||||
ASSERT(player);
|
||||
ASSERT(creature);
|
||||
ASSERT(quest);
|
||||
|
||||
GET_SCRIPT_RET(CreatureScript, creature->GetScriptId(), tmpscript, false);
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
return tmpscript->OnQuestReward(player, creature, quest, opt);
|
||||
}
|
||||
|
||||
uint32 ScriptMgr::GetDialogStatus(Player* player, Creature* creature)
|
||||
{
|
||||
ASSERT(player);
|
||||
ASSERT(creature);
|
||||
|
||||
GET_SCRIPT_RET(CreatureScript, creature->GetScriptId(), tmpscript, DIALOG_STATUS_SCRIPTED_NO_STATUS);
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
return tmpscript->GetDialogStatus(player, creature);
|
||||
}
|
||||
|
||||
bool ScriptMgr::CanSpawn(ObjectGuid::LowType spawnId, uint32 entry, CreatureTemplate const* actTemplate, CreatureData const* cData, Map const* map)
|
||||
{
|
||||
ASSERT(actTemplate);
|
||||
@@ -1662,115 +1590,6 @@ GameObjectAI* ScriptMgr::GetGameObjectAI(GameObject* gameobject)
|
||||
return tmpscript->GetAI(gameobject);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnCreatureUpdate(Creature* creature, uint32 diff)
|
||||
{
|
||||
ASSERT(creature);
|
||||
|
||||
GET_SCRIPT(CreatureScript, creature->GetScriptId(), tmpscript);
|
||||
tmpscript->OnUpdate(creature, diff);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
ASSERT(player);
|
||||
ASSERT(go);
|
||||
|
||||
GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, false);
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
return tmpscript->OnGossipHello(player, go);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnGossipSelect(Player* player, GameObject* go, uint32 sender, uint32 action)
|
||||
{
|
||||
ASSERT(player);
|
||||
ASSERT(go);
|
||||
|
||||
GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, false);
|
||||
return tmpscript->OnGossipSelect(player, go, sender, action);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnGossipSelectCode(Player* player, GameObject* go, uint32 sender, uint32 action, const char* code)
|
||||
{
|
||||
ASSERT(player);
|
||||
ASSERT(go);
|
||||
ASSERT(code);
|
||||
|
||||
GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, false);
|
||||
return tmpscript->OnGossipSelectCode(player, go, sender, action, code);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnQuestAccept(Player* player, GameObject* go, Quest const* quest)
|
||||
{
|
||||
ASSERT(player);
|
||||
ASSERT(go);
|
||||
ASSERT(quest);
|
||||
|
||||
GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, false);
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
return tmpscript->OnQuestAccept(player, go, quest);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnQuestReward(Player* player, GameObject* go, Quest const* quest, uint32 opt)
|
||||
{
|
||||
ASSERT(player);
|
||||
ASSERT(go);
|
||||
ASSERT(quest);
|
||||
|
||||
GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, false);
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
return tmpscript->OnQuestReward(player, go, quest, opt);
|
||||
}
|
||||
|
||||
uint32 ScriptMgr::GetDialogStatus(Player* player, GameObject* go)
|
||||
{
|
||||
ASSERT(player);
|
||||
ASSERT(go);
|
||||
|
||||
GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, DIALOG_STATUS_SCRIPTED_NO_STATUS);
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
return tmpscript->GetDialogStatus(player, go);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGameObjectDestroyed(GameObject* go, Player* player)
|
||||
{
|
||||
ASSERT(go);
|
||||
|
||||
GET_SCRIPT(GameObjectScript, go->GetScriptId(), tmpscript);
|
||||
tmpscript->OnDestroyed(go, player);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGameObjectDamaged(GameObject* go, Player* player)
|
||||
{
|
||||
ASSERT(go);
|
||||
|
||||
GET_SCRIPT(GameObjectScript, go->GetScriptId(), tmpscript);
|
||||
tmpscript->OnDamaged(go, player);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGameObjectLootStateChanged(GameObject* go, uint32 state, Unit* unit)
|
||||
{
|
||||
ASSERT(go);
|
||||
|
||||
GET_SCRIPT(GameObjectScript, go->GetScriptId(), tmpscript);
|
||||
tmpscript->OnLootStateChanged(go, state, unit);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGameObjectStateChanged(GameObject* go, uint32 state)
|
||||
{
|
||||
ASSERT(go);
|
||||
|
||||
GET_SCRIPT(GameObjectScript, go->GetScriptId(), tmpscript);
|
||||
tmpscript->OnGameObjectStateChanged(go, state);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGameObjectUpdate(GameObject* go, uint32 diff)
|
||||
{
|
||||
ASSERT(go);
|
||||
|
||||
GET_SCRIPT(GameObjectScript, go->GetScriptId(), tmpscript);
|
||||
tmpscript->OnUpdate(go, diff);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger)
|
||||
{
|
||||
ASSERT(player);
|
||||
|
||||
@@ -403,7 +403,7 @@ class TC_GAME_API UnitScript : public ScriptObject
|
||||
virtual void ModifySpellDamageTaken(Unit* /*target*/, Unit* /*attacker*/, int32& /*damage*/) { }
|
||||
};
|
||||
|
||||
class TC_GAME_API CreatureScript : public UnitScript, public UpdatableScript<Creature>
|
||||
class TC_GAME_API CreatureScript : public UnitScript
|
||||
{
|
||||
protected:
|
||||
|
||||
@@ -411,32 +411,11 @@ class TC_GAME_API CreatureScript : public UnitScript, public UpdatableScript<Cre
|
||||
|
||||
public:
|
||||
|
||||
// Called when a player opens a gossip dialog with the creature.
|
||||
virtual bool OnGossipHello(Player* /*player*/, Creature* /*creature*/) { return false; }
|
||||
|
||||
// Called when a player selects a gossip item in the creature's gossip menu.
|
||||
virtual bool OnGossipSelect(Player* /*player*/, Creature* /*creature*/, uint32 /*sender*/, uint32 /*action*/) { return false; }
|
||||
|
||||
// Called when a player selects a gossip with a code in the creature's gossip menu.
|
||||
virtual bool OnGossipSelectCode(Player* /*player*/, Creature* /*creature*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/) { return false; }
|
||||
|
||||
// Called when a player accepts a quest from the creature.
|
||||
virtual bool OnQuestAccept(Player* /*player*/, Creature* /*creature*/, Quest const* /*quest*/) { return false; }
|
||||
|
||||
// Called when a player selects a quest in the creature's quest menu.
|
||||
virtual bool OnQuestSelect(Player* /*player*/, Creature* /*creature*/, Quest const* /*quest*/) { return false; }
|
||||
|
||||
// Called when a player completes a quest and is rewarded, opt is the selected item's index or 0
|
||||
virtual bool OnQuestReward(Player* /*player*/, Creature* /*creature*/, Quest const* /*quest*/, uint32 /*opt*/) { return false; }
|
||||
|
||||
// Called when the dialog status between a player and the creature is requested.
|
||||
virtual uint32 GetDialogStatus(Player* /*player*/, Creature* /*creature*/) { return DIALOG_STATUS_SCRIPTED_NO_STATUS; }
|
||||
|
||||
// Called when the creature tries to spawn. Return false to block spawn and re-evaluate on next tick.
|
||||
virtual bool CanSpawn(ObjectGuid::LowType /*spawnId*/, uint32 /*entry*/, CreatureTemplate const* /*baseTemplate*/, CreatureTemplate const* /*actTemplate*/, CreatureData const* /*cData*/, Map const* /*map*/) const { return true; }
|
||||
|
||||
// Called when a CreatureAI object is needed for the creature.
|
||||
virtual CreatureAI* GetAI(Creature* /*creature*/) const { return NULL; }
|
||||
virtual CreatureAI* GetAI(Creature* /*creature*/) const = 0;
|
||||
};
|
||||
|
||||
class TC_GAME_API GameObjectScript : public ScriptObject, public UpdatableScript<GameObject>
|
||||
@@ -447,38 +426,8 @@ class TC_GAME_API GameObjectScript : public ScriptObject, public UpdatableScript
|
||||
|
||||
public:
|
||||
|
||||
// Called when a player opens a gossip dialog with the gameobject.
|
||||
virtual bool OnGossipHello(Player* /*player*/, GameObject* /*go*/) { return false; }
|
||||
|
||||
// Called when a player selects a gossip item in the gameobject's gossip menu.
|
||||
virtual bool OnGossipSelect(Player* /*player*/, GameObject* /*go*/, uint32 /*sender*/, uint32 /*action*/) { return false; }
|
||||
|
||||
// Called when a player selects a gossip with a code in the gameobject's gossip menu.
|
||||
virtual bool OnGossipSelectCode(Player* /*player*/, GameObject* /*go*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/) { return false; }
|
||||
|
||||
// Called when a player accepts a quest from the gameobject.
|
||||
virtual bool OnQuestAccept(Player* /*player*/, GameObject* /*go*/, Quest const* /*quest*/) { return false; }
|
||||
|
||||
// Called when a player completes a quest and is rewarded, opt is the selected item's index or 0
|
||||
virtual bool OnQuestReward(Player* /*player*/, GameObject* /*go*/, Quest const* /*quest*/, uint32 /*opt*/) { return false; }
|
||||
|
||||
// Called when the dialog status between a player and the gameobject is requested.
|
||||
virtual uint32 GetDialogStatus(Player* /*player*/, GameObject* /*go*/) { return DIALOG_STATUS_SCRIPTED_NO_STATUS; }
|
||||
|
||||
// Called when the game object is destroyed (destructible buildings only).
|
||||
virtual void OnDestroyed(GameObject* /*go*/, Player* /*player*/) { }
|
||||
|
||||
// Called when the game object is damaged (destructible buildings only).
|
||||
virtual void OnDamaged(GameObject* /*go*/, Player* /*player*/) { }
|
||||
|
||||
// Called when the game object loot state is changed.
|
||||
virtual void OnLootStateChanged(GameObject* /*go*/, uint32 /*state*/, Unit* /*unit*/) { }
|
||||
|
||||
// Called when the game object state is changed.
|
||||
virtual void OnGameObjectStateChanged(GameObject* /*go*/, uint32 /*state*/) { }
|
||||
|
||||
// Called when a GameObjectAI object is needed for the gameobject.
|
||||
virtual GameObjectAI* GetAI(GameObject* /*go*/) const { return NULL; }
|
||||
virtual GameObjectAI* GetAI(GameObject* /*go*/) const = 0;
|
||||
};
|
||||
|
||||
class TC_GAME_API AreaTriggerScript : public ScriptObject
|
||||
@@ -952,30 +901,11 @@ class TC_GAME_API ScriptMgr
|
||||
|
||||
public: /* CreatureScript */
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature);
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action);
|
||||
bool OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 action, const char* code);
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest);
|
||||
bool OnQuestSelect(Player* player, Creature* creature, Quest const* quest);
|
||||
bool OnQuestReward(Player* player, Creature* creature, Quest const* quest, uint32 opt);
|
||||
uint32 GetDialogStatus(Player* player, Creature* creature);
|
||||
bool CanSpawn(ObjectGuid::LowType spawnId, uint32 entry, CreatureTemplate const* actTemplate, CreatureData const* cData, Map const* map);
|
||||
CreatureAI* GetCreatureAI(Creature* creature);
|
||||
void OnCreatureUpdate(Creature* creature, uint32 diff);
|
||||
|
||||
public: /* GameObjectScript */
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go);
|
||||
bool OnGossipSelect(Player* player, GameObject* go, uint32 sender, uint32 action);
|
||||
bool OnGossipSelectCode(Player* player, GameObject* go, uint32 sender, uint32 action, const char* code);
|
||||
bool OnQuestAccept(Player* player, GameObject* go, Quest const* quest);
|
||||
bool OnQuestReward(Player* player, GameObject* go, Quest const* quest, uint32 opt);
|
||||
uint32 GetDialogStatus(Player* player, GameObject* go);
|
||||
void OnGameObjectDestroyed(GameObject* go, Player* player);
|
||||
void OnGameObjectDamaged(GameObject* go, Player* player);
|
||||
void OnGameObjectLootStateChanged(GameObject* go, uint32 state, Unit* unit);
|
||||
void OnGameObjectStateChanged(GameObject* go, uint32 state);
|
||||
void OnGameObjectUpdate(GameObject* go, uint32 diff);
|
||||
GameObjectAI* GetGameObjectAI(GameObject* go);
|
||||
|
||||
public: /* AreaTriggerScript */
|
||||
|
||||
@@ -1675,9 +1675,7 @@ void Spell::SendLoot(ObjectGuid guid, LootType loottype)
|
||||
return;
|
||||
}
|
||||
|
||||
if (sScriptMgr->OnGossipHello(player, gameObjTarget))
|
||||
return;
|
||||
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
if (gameObjTarget->AI()->GossipHello(player, false))
|
||||
return;
|
||||
|
||||
@@ -4153,23 +4151,23 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex)
|
||||
|
||||
void Spell::EffectSummonDynObj(SpellEffIndex effIndex)
|
||||
{
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
|
||||
return;
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
|
||||
return;
|
||||
|
||||
Player* player = m_caster->ToPlayer();
|
||||
if (!player)
|
||||
return;
|
||||
Player* player = m_caster->ToPlayer();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
float radius = m_spellInfo->Effects[effIndex].CalcRadius(m_caster);
|
||||
DynamicObject* dynObj = new DynamicObject(false);
|
||||
float radius = m_spellInfo->Effects[effIndex].CalcRadius(m_caster);
|
||||
DynamicObject* dynObj = new DynamicObject(false);
|
||||
if (!dynObj->CreateDynamicObject(m_caster->GetMap()->GenerateLowGuid<HighGuid::DynamicObject>(), m_caster, m_spellInfo, *destTarget, radius, DYNAMIC_OBJECT_RAID_MARKER))
|
||||
{
|
||||
delete dynObj;
|
||||
return;
|
||||
}
|
||||
{
|
||||
delete dynObj;
|
||||
return;
|
||||
}
|
||||
|
||||
int32 duration = m_spellInfo->GetDuration();
|
||||
dynObj->SetDuration(duration);
|
||||
int32 duration = m_spellInfo->GetDuration();
|
||||
dynObj->SetDuration(duration);
|
||||
}
|
||||
|
||||
void Spell::EffectSummonRaidMarker(SpellEffIndex effIndex)
|
||||
|
||||
+174
-151
@@ -22,6 +22,7 @@
|
||||
#include "blackrock_depths.h"
|
||||
#include "Player.h"
|
||||
#include "WorldSession.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
//go_shadowforge_brazier
|
||||
class go_shadowforge_brazier : public GameObjectScript
|
||||
@@ -29,21 +30,31 @@ class go_shadowforge_brazier : public GameObjectScript
|
||||
public:
|
||||
go_shadowforge_brazier() : GameObjectScript("go_shadowforge_brazier") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
struct go_shadowforge_brazierAI : public GameObjectAI
|
||||
{
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
go_shadowforge_brazierAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool GossipHello(Player* /*player*/, bool /*reportUse*/) override
|
||||
{
|
||||
if (instance->GetData(TYPE_LYCEUM) == IN_PROGRESS)
|
||||
instance->SetData(TYPE_LYCEUM, DONE);
|
||||
else
|
||||
instance->SetData(TYPE_LYCEUM, IN_PROGRESS);
|
||||
// If used brazier open linked doors (North or South)
|
||||
if (go->GetGUID() == instance->GetGuidData(DATA_SF_BRAZIER_N))
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_N), true);
|
||||
else if (go->GetGUID() == instance->GetGuidData(DATA_SF_BRAZIER_S))
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_S), true);
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
{
|
||||
if (instance->GetData(TYPE_LYCEUM) == IN_PROGRESS)
|
||||
instance->SetData(TYPE_LYCEUM, DONE);
|
||||
else
|
||||
instance->SetData(TYPE_LYCEUM, IN_PROGRESS);
|
||||
// If used brazier open linked doors (North or South)
|
||||
if (me->GetGUID() == instance->GetGuidData(DATA_SF_BRAZIER_N))
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_N), true);
|
||||
else if (me->GetGUID() == instance->GetGuidData(DATA_SF_BRAZIER_S))
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_S), true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_shadowforge_brazierAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -429,45 +440,57 @@ enum Lokhtos
|
||||
|
||||
class npc_lokhtos_darkbargainer : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_lokhtos_darkbargainer() : CreatureScript("npc_lokhtos_darkbargainer") { }
|
||||
public:
|
||||
npc_lokhtos_darkbargainer() : CreatureScript("npc_lokhtos_darkbargainer") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
struct npc_lokhtos_darkbargainerAI : public ScriptedAI
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
player->CastSpell(player, SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND, false);
|
||||
}
|
||||
if (action == GOSSIP_ACTION_TRADE)
|
||||
player->GetSession()->SendListInventory(creature->GetGUID());
|
||||
npc_lokhtos_darkbargainerAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
return true;
|
||||
}
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
player->CastSpell(player, SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND, false);
|
||||
}
|
||||
if (action == GOSSIP_ACTION_TRADE)
|
||||
player->GetSession()->SendListInventory(me->GetGUID());
|
||||
|
||||
if (creature->IsVendor() && player->GetReputationRank(59) >= REP_FRIENDLY)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_VENDOR, GOSSIP_ITEM_SHOW_ACCESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (player->GetQuestRewardStatus(QUEST_A_BINDING_CONTRACT) != 1 &&
|
||||
!player->HasItemCount(ITEM_THRORIUM_BROTHERHOOD_CONTRACT, 1, true) &&
|
||||
player->HasItemCount(ITEM_SULFURON_INGOT))
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (me->IsQuestGiver())
|
||||
player->PrepareQuestMenu(me->GetGUID());
|
||||
|
||||
if (me->IsVendor() && player->GetReputationRank(59) >= REP_FRIENDLY)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_VENDOR, GOSSIP_ITEM_SHOW_ACCESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||
|
||||
if (player->GetQuestRewardStatus(QUEST_A_BINDING_CONTRACT) != 1 &&
|
||||
!player->HasItemCount(ITEM_THRORIUM_BROTHERHOOD_CONTRACT, 1, true) &&
|
||||
player->HasItemCount(ITEM_SULFURON_INGOT))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_GET_CONTRACT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
}
|
||||
|
||||
if (player->GetReputationRank(59) < REP_FRIENDLY)
|
||||
SendGossipMenuFor(player, 3673, me->GetGUID());
|
||||
else
|
||||
SendGossipMenuFor(player, 3677, me->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_GET_CONTRACT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
return new npc_lokhtos_darkbargainerAI(creature);
|
||||
}
|
||||
|
||||
if (player->GetReputationRank(59) < REP_FRIENDLY)
|
||||
SendGossipMenuFor(player, 3673, creature->GetGUID());
|
||||
else
|
||||
SendGossipMenuFor(player, 3677, creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// npc_rocknot
|
||||
@@ -480,134 +503,134 @@ enum Rocknot
|
||||
|
||||
class npc_rocknot : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_rocknot() : CreatureScript("npc_rocknot") { }
|
||||
public:
|
||||
npc_rocknot() : CreatureScript("npc_rocknot") { }
|
||||
|
||||
bool OnQuestReward(Player* /*player*/, Creature* creature, Quest const* quest, uint32 /*item*/) override
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (!instance)
|
||||
return true;
|
||||
|
||||
if (instance->GetData(TYPE_BAR) == DONE || instance->GetData(TYPE_BAR) == SPECIAL)
|
||||
return true;
|
||||
|
||||
if (quest->GetQuestId() == QUEST_ALE)
|
||||
struct npc_rocknotAI : public npc_escortAI
|
||||
{
|
||||
if (instance->GetData(TYPE_BAR) != IN_PROGRESS)
|
||||
instance->SetData(TYPE_BAR, IN_PROGRESS);
|
||||
|
||||
instance->SetData(TYPE_BAR, SPECIAL);
|
||||
|
||||
//keep track of amount in instance script, returns SPECIAL if amount ok and event in progress
|
||||
if (instance->GetData(TYPE_BAR) == SPECIAL)
|
||||
npc_rocknotAI(Creature* creature) : npc_escortAI(creature)
|
||||
{
|
||||
creature->AI()->Talk(SAY_GOT_BEER);
|
||||
creature->CastSpell(creature, SPELL_DRUNKEN_RAGE, false);
|
||||
|
||||
if (npc_escortAI* escortAI = CAST_AI(npc_rocknot::npc_rocknotAI, creature->AI()))
|
||||
escortAI->Start(false, false);
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<npc_rocknotAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_rocknotAI : public npc_escortAI
|
||||
{
|
||||
npc_rocknotAI(Creature* creature) : npc_escortAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
BreakKeg_Timer = 0;
|
||||
BreakDoor_Timer = 0;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 BreakKeg_Timer;
|
||||
uint32 BreakDoor_Timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
return;
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void DoGo(uint32 id, uint32 state)
|
||||
{
|
||||
if (GameObject* go = instance->instance->GetGameObject(instance->GetGuidData(id)))
|
||||
go->SetGoState((GOState)state);
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId) override
|
||||
{
|
||||
switch (waypointId)
|
||||
void Initialize()
|
||||
{
|
||||
case 1:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
|
||||
break;
|
||||
case 2:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED);
|
||||
break;
|
||||
case 3:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED);
|
||||
break;
|
||||
case 4:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
|
||||
break;
|
||||
case 5:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
|
||||
BreakKeg_Timer = 2000;
|
||||
break;
|
||||
BreakKeg_Timer = 0;
|
||||
BreakDoor_Timer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (BreakKeg_Timer)
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 BreakKeg_Timer;
|
||||
uint32 BreakDoor_Timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
if (BreakKeg_Timer <= diff)
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
return;
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void DoGo(uint32 id, uint32 state)
|
||||
{
|
||||
if (GameObject* go = instance->instance->GetGameObject(instance->GetGuidData(id)))
|
||||
go->SetGoState((GOState)state);
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId) override
|
||||
{
|
||||
switch (waypointId)
|
||||
{
|
||||
DoGo(DATA_GO_BAR_KEG, 0);
|
||||
BreakKeg_Timer = 0;
|
||||
BreakDoor_Timer = 1000;
|
||||
} else BreakKeg_Timer -= diff;
|
||||
case 1:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
|
||||
break;
|
||||
case 2:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED);
|
||||
break;
|
||||
case 3:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED);
|
||||
break;
|
||||
case 4:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
|
||||
break;
|
||||
case 5:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
|
||||
BreakKeg_Timer = 2000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (BreakDoor_Timer)
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (BreakDoor_Timer <= diff)
|
||||
if (BreakKeg_Timer)
|
||||
{
|
||||
DoGo(DATA_GO_BAR_DOOR, 2);
|
||||
DoGo(DATA_GO_BAR_KEG_TRAP, 0); //doesn't work very well, leaving code here for future
|
||||
//spell by trap has effect61, this indicate the bar go hostile
|
||||
if (BreakKeg_Timer <= diff)
|
||||
{
|
||||
DoGo(DATA_GO_BAR_KEG, 0);
|
||||
BreakKeg_Timer = 0;
|
||||
BreakDoor_Timer = 1000;
|
||||
}
|
||||
else BreakKeg_Timer -= diff;
|
||||
}
|
||||
|
||||
if (Unit* tmp = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_PHALANX)))
|
||||
tmp->SetFaction(FACTION_MONSTER);
|
||||
if (BreakDoor_Timer)
|
||||
{
|
||||
if (BreakDoor_Timer <= diff)
|
||||
{
|
||||
DoGo(DATA_GO_BAR_DOOR, 2);
|
||||
DoGo(DATA_GO_BAR_KEG_TRAP, 0); //doesn't work very well, leaving code here for future
|
||||
//spell by trap has effect61, this indicate the bar go hostile
|
||||
|
||||
//for later, this event(s) has alot more to it.
|
||||
//optionally, DONE can trigger bar to go hostile.
|
||||
instance->SetData(TYPE_BAR, DONE);
|
||||
if (Unit* tmp = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_PHALANX)))
|
||||
tmp->SetFaction(FACTION_MONSTER);
|
||||
|
||||
BreakDoor_Timer = 0;
|
||||
} else BreakDoor_Timer -= diff;
|
||||
//for later, this event(s) has alot more to it.
|
||||
//optionally, DONE can trigger bar to go hostile.
|
||||
instance->SetData(TYPE_BAR, DONE);
|
||||
|
||||
BreakDoor_Timer = 0;
|
||||
}
|
||||
else BreakDoor_Timer -= diff;
|
||||
}
|
||||
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
}
|
||||
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
void QuestReward(Player* /*player*/, Quest const* quest, uint32 /*opt*/) override
|
||||
{
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (instance->GetData(TYPE_BAR) == DONE || instance->GetData(TYPE_BAR) == SPECIAL)
|
||||
return;
|
||||
|
||||
if (quest->GetQuestId() == QUEST_ALE)
|
||||
{
|
||||
if (instance->GetData(TYPE_BAR) != IN_PROGRESS)
|
||||
instance->SetData(TYPE_BAR, IN_PROGRESS);
|
||||
|
||||
instance->SetData(TYPE_BAR, SPECIAL);
|
||||
|
||||
//keep track of amount in instance script, returns SPECIAL if amount ok and event in progress
|
||||
if (instance->GetData(TYPE_BAR) == SPECIAL)
|
||||
{
|
||||
me->AI()->Talk(SAY_GOT_BEER);
|
||||
me->CastSpell(me, SPELL_DRUNKEN_RAGE, false);
|
||||
|
||||
if (npc_escortAI* escortAI = CAST_AI(npc_rocknot::npc_rocknotAI, me->AI()))
|
||||
escortAI->Start(false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_rocknotAI(creature);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_blackrock_depths()
|
||||
|
||||
+8
-6
@@ -119,10 +119,10 @@ public:
|
||||
{
|
||||
boss_coren_direbrewAI(Creature* creature) : BossAI(creature, DATA_COREN) { }
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (menuId != GOSSIP_ID)
|
||||
return;
|
||||
return false;
|
||||
|
||||
if (gossipListId == GOSSIP_OPTION_FIGHT)
|
||||
{
|
||||
@@ -131,6 +131,8 @@ public:
|
||||
}
|
||||
else if (gossipListId == GOSSIP_OPTION_APOLOGIZE)
|
||||
CloseGossipMenuFor(player);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
@@ -425,16 +427,16 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
go->SetLootState(GO_READY);
|
||||
me->SetLootState(GO_READY);
|
||||
_scheduler
|
||||
.Schedule(Seconds(1), [this](TaskContext /*context*/)
|
||||
{
|
||||
go->UseDoorOrButton(8);
|
||||
go->CastSpell((Unit*)nullptr, SPELL_MOLE_MACHINE_EMERGE, true);
|
||||
me->UseDoorOrButton(8);
|
||||
me->CastSpell((Unit*)nullptr, SPELL_MOLE_MACHINE_EMERGE, true);
|
||||
})
|
||||
.Schedule(Seconds(4), [this](TaskContext /*context*/)
|
||||
{
|
||||
if (GameObject* trap = go->FindNearestGameObject(GO_MOLE_MACHINE_TRAP, 3.0f))
|
||||
if (GameObject* trap = me->FindNearestGameObject(GO_MOLE_MACHINE_TRAP, 3.0f))
|
||||
{
|
||||
trap->SetLootState(GO_ACTIVATED);
|
||||
trap->UseDoorOrButton();
|
||||
|
||||
+78
-65
@@ -54,45 +54,56 @@ class boss_gloomrel : public CreatureScript
|
||||
public:
|
||||
boss_gloomrel() : CreatureScript("boss_gloomrel") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
struct boss_gloomrelAI : public ScriptedAI
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
switch (action)
|
||||
boss_gloomrelAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
|
||||
SendGossipMenuFor(player, 2606, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+11:
|
||||
CloseGossipMenuFor(player);
|
||||
player->CastSpell(player, SPELL_LEARN_SMELT, false);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
|
||||
SendGossipMenuFor(player, 2604, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+22:
|
||||
CloseGossipMenuFor(player);
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
{
|
||||
//are 5 minutes expected? go template may have data to despawn when used at quest
|
||||
instance->DoRespawnGameObject(instance->GetGuidData(DATA_GO_CHALICE), MINUTE*5);
|
||||
}
|
||||
break;
|
||||
if (player->GetQuestRewardStatus(QUEST_SPECTRAL_CHALICE) == 1 && player->GetSkillValue(SKILL_MINING) >= DATA_SKILLPOINT_MIN && !player->HasSpell(SPELL_SMELT_DARK_IRON))
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
if (player->GetQuestRewardStatus(QUEST_SPECTRAL_CHALICE) == 0 && player->GetSkillValue(SKILL_MINING) >= DATA_SKILLPOINT_MIN)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_TRIBUTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
|
||||
SendGossipMenuFor(player, 2606, me->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 11:
|
||||
CloseGossipMenuFor(player);
|
||||
player->CastSpell(player, SPELL_LEARN_SMELT, false);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
|
||||
SendGossipMenuFor(player, 2604, me->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 22:
|
||||
CloseGossipMenuFor(player);
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
{
|
||||
//are 5 minutes expected? go template may have data to despawn when used at quest
|
||||
instance->DoRespawnGameObject(instance->GetGuidData(DATA_GO_CHALICE), MINUTE * 5);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
if (player->GetQuestRewardStatus(QUEST_SPECTRAL_CHALICE) == 1 && player->GetSkillValue(SKILL_MINING) >= DATA_SKILLPOINT_MIN && !player->HasSpell(SPELL_SMELT_DARK_IRON))
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
if (player->GetQuestRewardStatus(QUEST_SPECTRAL_CHALICE) == 0 && player->GetSkillValue(SKILL_MINING) >= DATA_SKILLPOINT_MIN)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_TRIBUTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
|
||||
return true;
|
||||
return new boss_gloomrelAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -122,37 +133,6 @@ class boss_doomrel : public CreatureScript
|
||||
public:
|
||||
boss_doomrel() : CreatureScript("boss_doomrel") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_SELECT_DOOMREL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
SendGossipMenuFor(player, 2605, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
CloseGossipMenuFor(player);
|
||||
//start event here
|
||||
creature->SetFaction(FACTION_DARK_IRON_DWARVES);
|
||||
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
creature->AI()->AttackStart(player);
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance)
|
||||
instance->SetGuidData(DATA_EVENSTARTER, player->GetGUID());
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_CHALLENGE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, 2601, creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
struct boss_doomrelAI : public ScriptedAI
|
||||
{
|
||||
boss_doomrelAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -161,6 +141,39 @@ class boss_doomrel : public CreatureScript
|
||||
_instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_SELECT_DOOMREL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
SendGossipMenuFor(player, 2605, me->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
CloseGossipMenuFor(player);
|
||||
//start event here
|
||||
me->SetFaction(FACTION_DARK_IRON_DWARVES);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
me->AI()->AttackStart(player);
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (instance)
|
||||
instance->SetGuidData(DATA_EVENSTARTER, player->GetGUID());
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_CHALLENGE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, 2601, me->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_voidwalkers = false;
|
||||
|
||||
+2
-1
@@ -370,7 +370,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (menuId == GOSSIP_ID && gossipListId == GOSSIP_OPTION_ID)
|
||||
{
|
||||
@@ -378,6 +378,7 @@ public:
|
||||
Talk(SAY_GAMESBEGIN_1);
|
||||
BeginEvent(player);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
+24
-13
@@ -21,6 +21,7 @@
|
||||
#include "SpellScript.h"
|
||||
#include "blackwing_lair.h"
|
||||
#include "Player.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
enum Say
|
||||
{
|
||||
@@ -174,20 +175,30 @@ public:
|
||||
|
||||
class go_orb_of_domination : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_orb_of_domination() : GameObjectScript("go_orb_of_domination") { }
|
||||
public:
|
||||
go_orb_of_domination() : GameObjectScript("go_orb_of_domination") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go) override
|
||||
{
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
if (instance->GetData(DATA_EGG_EVENT) != DONE)
|
||||
if (Creature* razorgore = instance->GetCreature(DATA_RAZORGORE_THE_UNTAMED))
|
||||
{
|
||||
razorgore->Attack(player, true);
|
||||
player->CastSpell(razorgore, SPELL_MINDCONTROL);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
struct go_orb_of_dominationAI : public GameObjectAI
|
||||
{
|
||||
go_orb_of_dominationAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
if (instance->GetData(DATA_EGG_EVENT) != DONE)
|
||||
if (Creature* razorgore = instance->GetCreature(DATA_RAZORGORE_THE_UNTAMED))
|
||||
{
|
||||
razorgore->Attack(player, true);
|
||||
player->CastSpell(razorgore, SPELL_MINDCONTROL);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_orb_of_dominationAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_egg_event : public SpellScriptLoader
|
||||
|
||||
+2
-1
@@ -222,13 +222,14 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (menuId == GOSSIP_ID && gossipListId == 0)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
BeginSpeech(player);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
+3
-1
@@ -195,13 +195,15 @@ class boss_majordomo : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (menuId == MENU_OPTION_YOU_CHALLENGED_US && gossipListId == OPTION_ID_YOU_CHALLENGED_US)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
DoAction(ACTION_START_RAGNAROS);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
if (gossipListId == 0)
|
||||
{
|
||||
@@ -132,6 +132,7 @@ public:
|
||||
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void NextStep(uint32 uiTimerStep, bool bNextStep = true, uint8 uiPhaseStep = 0)
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "karazhan.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
enum NightbaneSpells
|
||||
{
|
||||
@@ -415,25 +416,35 @@ class spell_rain_of_bones : public SpellScriptLoader
|
||||
|
||||
class go_blackened_urn : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_blackened_urn() : GameObjectScript("go_blackened_urn") { }
|
||||
public:
|
||||
go_blackened_urn() : GameObjectScript("go_blackened_urn") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
{
|
||||
if (go->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE))
|
||||
return false;
|
||||
|
||||
InstanceScript* instance = go->GetInstanceScript();
|
||||
if (!instance || instance->GetBossState(DATA_NIGHTBANE) == DONE || instance->GetBossState(DATA_NIGHTBANE) == IN_PROGRESS)
|
||||
return false;
|
||||
|
||||
if (Creature* nightbane = ObjectAccessor::GetCreature(*go, instance->GetGuidData(DATA_NIGHTBANE)))
|
||||
struct go_blackened_urnAI : public GameObjectAI
|
||||
{
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
|
||||
nightbane->AI()->DoAction(ACTION_SUMMON);
|
||||
go_blackened_urnAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
if (me->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE))
|
||||
return false;
|
||||
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (!instance || instance->GetBossState(DATA_NIGHTBANE) == DONE || instance->GetBossState(DATA_NIGHTBANE) == IN_PROGRESS)
|
||||
return false;
|
||||
|
||||
if (Creature* nightbane = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_NIGHTBANE)))
|
||||
{
|
||||
me->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
|
||||
nightbane->AI()->DoAction(ACTION_SUMMON);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_blackened_urnAI(go);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_nightbane()
|
||||
|
||||
@@ -816,7 +816,7 @@ class npc_grandmother : public CreatureScript
|
||||
{
|
||||
npc_grandmotherAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (menuId == OPTION_WHAT_PHAT_LEWTS_YOU_HAVE && gossipListId == 0)
|
||||
{
|
||||
@@ -828,6 +828,7 @@ class npc_grandmother : public CreatureScript
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -335,74 +335,71 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
npc_barnesAI* pBarnesAI = ENSURE_AI(npc_barnes::npc_barnesAI, creature->AI());
|
||||
|
||||
switch (action)
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
SendGossipMenuFor(player, 8971, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
CloseGossipMenuFor(player);
|
||||
pBarnesAI->StartEvent();
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
CloseGossipMenuFor(player);
|
||||
pBarnesAI->m_uiEventId = EVENT_OZ;
|
||||
TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_OZ", player->GetGUID().ToString().c_str());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+4:
|
||||
CloseGossipMenuFor(player);
|
||||
pBarnesAI->m_uiEventId = EVENT_HOOD;
|
||||
TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_HOOD", player->GetGUID().ToString().c_str());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+5:
|
||||
CloseGossipMenuFor(player);
|
||||
pBarnesAI->m_uiEventId = EVENT_RAJ;
|
||||
TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_RAJ", player->GetGUID().ToString().c_str());
|
||||
break;
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
SendGossipMenuFor(player, 8971, me->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
CloseGossipMenuFor(player);
|
||||
StartEvent();
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
CloseGossipMenuFor(player);
|
||||
m_uiEventId = EVENT_OZ;
|
||||
TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_OZ", player->GetGUID().ToString().c_str());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 4:
|
||||
CloseGossipMenuFor(player);
|
||||
m_uiEventId = EVENT_HOOD;
|
||||
TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_HOOD", player->GetGUID().ToString().c_str());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 5:
|
||||
CloseGossipMenuFor(player);
|
||||
m_uiEventId = EVENT_RAJ;
|
||||
TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_RAJ", player->GetGUID().ToString().c_str());
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
// Check for death of Moroes and if opera event is not done already
|
||||
if (instance->GetBossState(DATA_MOROES) == DONE && instance->GetBossState(DATA_OPERA_PERFORMANCE) != DONE)
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, OZ_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
if (player->IsGameMaster())
|
||||
// Check for death of Moroes and if opera event is not done already
|
||||
if (instance->GetBossState(DATA_MOROES) == DONE && instance->GetBossState(DATA_OPERA_PERFORMANCE) != DONE)
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_DOT, OZ_GM_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_DOT, OZ_GM_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_DOT, OZ_GM_GOSSIP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
||||
}
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, OZ_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
if (npc_barnesAI* pBarnesAI = CAST_AI(npc_barnes::npc_barnesAI, creature->AI()))
|
||||
{
|
||||
if (!pBarnesAI->RaidWiped)
|
||||
SendGossipMenuFor(player, 8970, creature->GetGUID());
|
||||
if (player->IsGameMaster())
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_DOT, OZ_GM_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_DOT, OZ_GM_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_DOT, OZ_GM_GOSSIP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
||||
}
|
||||
|
||||
if (!RaidWiped)
|
||||
SendGossipMenuFor(player, 8970, me->GetGUID());
|
||||
else
|
||||
SendGossipMenuFor(player, 8975, creature->GetGUID());
|
||||
SendGossipMenuFor(player, 8975, me->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SendGossipMenuFor(player, 8978, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
SendGossipMenuFor(player, 8978, me->GetGUID());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
|
||||
@@ -68,46 +68,6 @@ class npc_kalecgos : public CreatureScript
|
||||
public:
|
||||
npc_kalecgos() : CreatureScript("npc_kalecgos") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, 12500, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
SendGossipMenuFor(player, 12502, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
SendGossipMenuFor(player, 12606, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
SendGossipMenuFor(player, 12607, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+4:
|
||||
SendGossipMenuFor(player, 12608, creature->GetGUID());
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
SendGossipMenuFor(player, 12498, creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_kalecgosAI(creature);
|
||||
@@ -153,6 +113,47 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, 12500, me->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
SendGossipMenuFor(player, 12502, me->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
SendGossipMenuFor(player, 12606, me->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
SendGossipMenuFor(player, 12607, me->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 4:
|
||||
SendGossipMenuFor(player, 12608, me->GetGUID());
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (me->IsQuestGiver())
|
||||
player->PrepareQuestMenu(me->GetGUID());
|
||||
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
SendGossipMenuFor(player, 12498, me->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
};
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "SpellInfo.h"
|
||||
#include "CreatureTextMgr.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
/*######
|
||||
##Quest 12848
|
||||
@@ -322,16 +323,25 @@ class go_acherus_soul_prison : public GameObjectScript
|
||||
public:
|
||||
go_acherus_soul_prison() : GameObjectScript("go_acherus_soul_prison") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go) override
|
||||
struct go_acherus_soul_prisonAI : public GameObjectAI
|
||||
{
|
||||
if (Creature* anchor = go->FindNearestCreature(29521, 15))
|
||||
if (ObjectGuid prisonerGUID = anchor->AI()->GetGUID())
|
||||
if (Creature* prisoner = ObjectAccessor::GetCreature(*player, prisonerGUID))
|
||||
ENSURE_AI(npc_unworthy_initiate::npc_unworthy_initiateAI, prisoner->AI())->EventStart(anchor, player);
|
||||
go_acherus_soul_prisonAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
return false;
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
if (Creature* anchor = me->FindNearestCreature(29521, 15))
|
||||
if (ObjectGuid prisonerGUID = anchor->AI()->GetGUID())
|
||||
if (Creature* prisoner = ObjectAccessor::GetCreature(*player, prisonerGUID))
|
||||
ENSURE_AI(npc_unworthy_initiate::npc_unworthy_initiateAI, prisoner->AI())->EventStart(anchor, player);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_acherus_soul_prisonAI(go);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/*######
|
||||
@@ -473,47 +483,6 @@ class npc_death_knight_initiate : public CreatureScript
|
||||
public:
|
||||
npc_death_knight_initiate() : CreatureScript("npc_death_knight_initiate") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
|
||||
if (player->IsInCombat() || creature->IsInCombat())
|
||||
return true;
|
||||
|
||||
if (npc_death_knight_initiateAI* pInitiateAI = CAST_AI(npc_death_knight_initiate::npc_death_knight_initiateAI, creature->AI()))
|
||||
{
|
||||
if (pInitiateAI->m_bIsDuelInProgress)
|
||||
return true;
|
||||
}
|
||||
|
||||
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15);
|
||||
|
||||
player->CastSpell(creature, SPELL_DUEL, false);
|
||||
player->CastSpell(player, SPELL_DUEL_FLAG, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_DEATH_CHALLENGE) == QUEST_STATUS_INCOMPLETE && creature->IsFullHealth())
|
||||
{
|
||||
if (player->HealthBelowPct(10))
|
||||
return true;
|
||||
|
||||
if (player->IsInCombat() || creature->IsInCombat())
|
||||
return true;
|
||||
|
||||
AddGossipItemFor(player, Player::GetDefaultGossipMenuForSource(creature), 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
struct npc_death_knight_initiateAI : public CombatAI
|
||||
{
|
||||
npc_death_knight_initiateAI(Creature* creature) : CombatAI(creature)
|
||||
@@ -616,6 +585,48 @@ public:
|
||||
|
||||
CombatAI::UpdateAI(uiDiff);
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
|
||||
if (player->IsInCombat() || me->IsInCombat())
|
||||
return true;
|
||||
|
||||
if (npc_death_knight_initiateAI* pInitiateAI = CAST_AI(npc_death_knight_initiate::npc_death_knight_initiateAI, me->AI()))
|
||||
{
|
||||
if (pInitiateAI->m_bIsDuelInProgress)
|
||||
return true;
|
||||
}
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15);
|
||||
|
||||
player->CastSpell(me, SPELL_DUEL, false);
|
||||
player->CastSpell(player, SPELL_DUEL_FLAG, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_DEATH_CHALLENGE) == QUEST_STATUS_INCOMPLETE && me->IsFullHealth())
|
||||
{
|
||||
if (player->HealthBelowPct(10))
|
||||
return true;
|
||||
|
||||
if (player->IsInCombat() || me->IsInCombat())
|
||||
return true;
|
||||
|
||||
AddGossipItemFor(player, Player::GetDefaultGossipMenuForSource(me), 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
@@ -749,13 +760,14 @@ public:
|
||||
{
|
||||
npc_salanar_the_horsemanAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (menuId == GOSSIP_SALANAR_MENU && gossipListId == GOSSIP_SALANAR_OPTION)
|
||||
{
|
||||
player->CastSpell(player, SPELL_REALM_OF_SHADOWS, true);
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void SpellHit(Unit* caster, const SpellInfo* spell) override
|
||||
|
||||
@@ -199,18 +199,6 @@ class npc_koltira_deathweaver : public CreatureScript
|
||||
public:
|
||||
npc_koltira_deathweaver() : CreatureScript("npc_koltira_deathweaver") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_BREAKOUT)
|
||||
{
|
||||
creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
if (npc_escortAI* escortAI = CAST_AI(npc_koltira_deathweaver::npc_koltira_deathweaverAI, creature->AI()))
|
||||
escortAI->Start(false, false, player->GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
struct npc_koltira_deathweaverAI : public npc_escortAI
|
||||
{
|
||||
npc_koltira_deathweaverAI(Creature* creature) : npc_escortAI(creature)
|
||||
@@ -354,6 +342,16 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void QuestAccept(Player* player, const Quest* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_BREAKOUT)
|
||||
{
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
Start(false, false, player->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint8 wave;
|
||||
uint32 waveTimer;
|
||||
|
||||
@@ -270,33 +270,6 @@ class npc_highlord_darion_mograine : public CreatureScript
|
||||
public:
|
||||
npc_highlord_darion_mograine() : CreatureScript("npc_highlord_darion_mograine") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
CloseGossipMenuFor(player);
|
||||
ENSURE_AI(npc_highlord_darion_mograine::npc_highlord_darion_mograineAI, creature->AI())->uiStep = 1;
|
||||
ENSURE_AI(npc_highlord_darion_mograine::npc_highlord_darion_mograineAI, creature->AI())->Start(true, false, player->GetGUID());
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
if (player->GetQuestStatus(12801) == QUEST_STATUS_INCOMPLETE)
|
||||
AddGossipItemFor(player, 0, "I am ready.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_highlord_darion_mograineAI(creature);
|
||||
@@ -1636,6 +1609,34 @@ public:
|
||||
temp->KillSelf();
|
||||
}
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
CloseGossipMenuFor(player);
|
||||
uiStep = 1;
|
||||
Start(true, false, player->GetGUID());
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (me->IsQuestGiver())
|
||||
player->PrepareQuestMenu(me->GetGUID());
|
||||
|
||||
if (player->GetQuestStatus(12801) == QUEST_STATUS_INCOMPLETE)
|
||||
AddGossipItemFor(player, 0, "I am ready.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
@@ -31,6 +31,7 @@ EndScriptData */
|
||||
#include "Player.h"
|
||||
#include "Group.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
//this texts are already used by 3975 and 3976
|
||||
enum Says
|
||||
@@ -876,32 +877,41 @@ enum LooselyTurnedSoil
|
||||
|
||||
class go_loosely_turned_soil : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_loosely_turned_soil() : GameObjectScript("go_loosely_turned_soil") { }
|
||||
public:
|
||||
go_loosely_turned_soil() : GameObjectScript("go_loosely_turned_soil") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* /*go*/) override
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
if (instance->GetBossState(DATA_HORSEMAN_EVENT) == IN_PROGRESS || player->GetQuestStatus(QUEST_CALL_THE_HEADLESS_HORSEMAN) != QUEST_STATUS_COMPLETE)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool OnQuestReward(Player* player, GameObject* go, Quest const* /*quest*/, uint32 /*opt*/) override
|
||||
{
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
if (instance->GetBossState(DATA_HORSEMAN_EVENT) == IN_PROGRESS)
|
||||
return false;
|
||||
|
||||
player->AreaExploredOrEventHappens(11405);
|
||||
if (Creature* horseman = go->SummonCreature(HH_MOUNTED, FlightPoint[20].x, FlightPoint[20].y, FlightPoint[20].z, 0, TEMPSUMMON_MANUAL_DESPAWN, 0))
|
||||
struct go_loosely_turned_soilAI : public GameObjectAI
|
||||
{
|
||||
ENSURE_AI(boss_headless_horseman::boss_headless_horsemanAI, horseman->AI())->PlayerGUID = player->GetGUID();
|
||||
ENSURE_AI(boss_headless_horseman::boss_headless_horsemanAI, horseman->AI())->FlyMode();
|
||||
go_loosely_turned_soilAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
if (instance->GetBossState(DATA_HORSEMAN_EVENT) == IN_PROGRESS || player->GetQuestStatus(QUEST_CALL_THE_HEADLESS_HORSEMAN) != QUEST_STATUS_COMPLETE)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void QuestReward(Player* player, Quest const* /*quest*/, uint32 /*opt*/) override
|
||||
{
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
if (instance->GetBossState(DATA_HORSEMAN_EVENT) == IN_PROGRESS)
|
||||
return;
|
||||
|
||||
player->AreaExploredOrEventHappens(11405);
|
||||
if (Creature* horseman = me->SummonCreature(HH_MOUNTED, FlightPoint[20].x, FlightPoint[20].y, FlightPoint[20].z, 0, TEMPSUMMON_MANUAL_DESPAWN, 0))
|
||||
{
|
||||
ENSURE_AI(boss_headless_horseman::boss_headless_horsemanAI, horseman->AI())->PlayerGUID = player->GetGUID();
|
||||
ENSURE_AI(boss_headless_horseman::boss_headless_horsemanAI, horseman->AI())->FlyMode();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_loosely_turned_soilAI(go);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void npc_head::npc_headAI::Disappear()
|
||||
|
||||
@@ -280,12 +280,22 @@ class go_brazier_of_the_herald : public GameObjectScript
|
||||
public:
|
||||
go_brazier_of_the_herald() : GameObjectScript("go_brazier_of_the_herald") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go) override
|
||||
struct go_brazier_of_the_heraldAI : public GameObjectAI
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
go->PlayDirectSound(SOUND_SCREECH, 0);
|
||||
player->SummonCreature(NPC_KIRTONOS, PosSummon[0], TEMPSUMMON_DEAD_DESPAWN, 900000);
|
||||
return true;
|
||||
go_brazier_of_the_heraldAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
me->UseDoorOrButton();
|
||||
me->PlayDirectSound(SOUND_SCREECH, 0);
|
||||
player->SummonCreature(NPC_KIRTONOS, PosSummon[0], TEMPSUMMON_DEAD_DESPAWN, 900000);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_brazier_of_the_heraldAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ class boss_apothecary_hummel : public CreatureScript
|
||||
{
|
||||
boss_apothecary_hummelAI(Creature* creature) : BossAI(creature, DATA_APOTHECARY_HUMMEL), _deadCount(0), _isDead(false) { }
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (menuId == GOSSIP_MENU_HUMMEL && gossipListId == GOSSIP_OPTION_START)
|
||||
{
|
||||
@@ -105,6 +105,7 @@ class boss_apothecary_hummel : public CreatureScript
|
||||
CloseGossipMenuFor(player);
|
||||
DoAction(ACTION_START_EVENT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
@@ -259,6 +260,12 @@ class boss_apothecary_hummel : public CreatureScript
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void QuestReward(Player* /*player*/, Quest const* quest, uint32 /*opt*/) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_YOUVE_BEEN_SERVED)
|
||||
DoAction(ACTION_START_EVENT);
|
||||
}
|
||||
|
||||
private:
|
||||
uint8 _deadCount;
|
||||
bool _isDead;
|
||||
@@ -268,14 +275,6 @@ class boss_apothecary_hummel : public CreatureScript
|
||||
{
|
||||
return GetInstanceAI<boss_apothecary_hummelAI>(creature);
|
||||
}
|
||||
|
||||
bool OnQuestReward(Player* /*player*/, Creature* creature, Quest const* quest, uint32 /*opt*/) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_YOUVE_BEEN_SERVED)
|
||||
creature->AI()->DoAction(ACTION_START_EVENT);
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
struct npc_apothecary_genericAI : public ScriptedAI
|
||||
|
||||
@@ -72,31 +72,6 @@ public:
|
||||
return GetInstanceAI<npc_shadowfang_prisonerAI>(creature);
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
|
||||
if (npc_escortAI* pEscortAI = CAST_AI(npc_shadowfang_prisoner::npc_shadowfang_prisonerAI, creature->AI()))
|
||||
pEscortAI->Start(false, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
|
||||
if (instance && instance->GetData(TYPE_FREE_NPC) != DONE && instance->GetData(TYPE_RETHILGORE) == DONE)
|
||||
AddGossipItemFor(player, Player::GetDefaultGossipMenuForSource(creature), 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
struct npc_shadowfang_prisonerAI : public npc_escortAI
|
||||
{
|
||||
npc_shadowfang_prisonerAI(Creature* creature) : npc_escortAI(creature)
|
||||
@@ -106,6 +81,31 @@ public:
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
|
||||
Start(false, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
|
||||
if (instance && instance->GetData(TYPE_FREE_NPC) != DONE && instance->GetData(TYPE_RETHILGORE) == DONE)
|
||||
AddGossipItemFor(player, Player::GetDefaultGossipMenuForSource(me), 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId) override
|
||||
{
|
||||
switch (waypointId)
|
||||
|
||||
@@ -36,6 +36,7 @@ EndContentData */
|
||||
#include "Group.h"
|
||||
#include "Player.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
/*######
|
||||
## go_gauntlet_gate (this is the _first_ of the gauntlet gates, two exist)
|
||||
@@ -46,38 +47,48 @@ class go_gauntlet_gate : public GameObjectScript
|
||||
public:
|
||||
go_gauntlet_gate() : GameObjectScript("go_gauntlet_gate") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go) override
|
||||
struct go_gauntlet_gateAI : public GameObjectAI
|
||||
{
|
||||
InstanceScript* instance = go->GetInstanceScript();
|
||||
go_gauntlet_gateAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
if (!instance)
|
||||
return false;
|
||||
|
||||
if (instance->GetData(TYPE_BARON_RUN) != NOT_STARTED)
|
||||
return false;
|
||||
|
||||
if (Group* group = player->GetGroup())
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
|
||||
if (!instance)
|
||||
return false;
|
||||
|
||||
if (instance->GetData(TYPE_BARON_RUN) != NOT_STARTED)
|
||||
return false;
|
||||
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
Player* pGroupie = itr->GetSource();
|
||||
if (!pGroupie || !pGroupie->IsInMap(player))
|
||||
continue;
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* pGroupie = itr->GetSource();
|
||||
if (!pGroupie || !pGroupie->IsInMap(player))
|
||||
continue;
|
||||
|
||||
if (pGroupie->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE &&
|
||||
!pGroupie->HasAura(SPELL_BARON_ULTIMATUM) &&
|
||||
pGroupie->GetMap() == go->GetMap())
|
||||
pGroupie->CastSpell(pGroupie, SPELL_BARON_ULTIMATUM, true);
|
||||
if (pGroupie->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE &&
|
||||
!pGroupie->HasAura(SPELL_BARON_ULTIMATUM) &&
|
||||
pGroupie->GetMap() == me->GetMap())
|
||||
pGroupie->CastSpell(pGroupie, SPELL_BARON_ULTIMATUM, true);
|
||||
}
|
||||
}
|
||||
} else if (player->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE &&
|
||||
!player->HasAura(SPELL_BARON_ULTIMATUM) &&
|
||||
player->GetMap() == go->GetMap())
|
||||
player->CastSpell(player, SPELL_BARON_ULTIMATUM, true);
|
||||
else if (player->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE &&
|
||||
!player->HasAura(SPELL_BARON_ULTIMATUM) &&
|
||||
player->GetMap() == me->GetMap())
|
||||
player->CastSpell(player, SPELL_BARON_ULTIMATUM, true);
|
||||
|
||||
instance->SetData(TYPE_BARON_RUN, IN_PROGRESS);
|
||||
return false;
|
||||
instance->SetData(TYPE_BARON_RUN, IN_PROGRESS);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_gauntlet_gateAI(go);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/*######
|
||||
|
||||
@@ -31,6 +31,7 @@ EndContentData */
|
||||
#include "ScriptedCreature.h"
|
||||
#include "sunken_temple.h"
|
||||
#include "Player.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
/*#####
|
||||
# at_malfurion_Stormrage_trigger
|
||||
@@ -63,16 +64,25 @@ class at_malfurion_stormrage : public AreaTriggerScript
|
||||
|
||||
class go_atalai_statue : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_atalai_statue() : GameObjectScript("go_atalai_statue") { }
|
||||
public:
|
||||
go_atalai_statue() : GameObjectScript("go_atalai_statue") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go) override
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
instance->SetData(EVENT_STATE, go->GetEntry());
|
||||
return false;
|
||||
}
|
||||
struct go_atalai_statueAI : public GameObjectAI
|
||||
{
|
||||
go_atalai_statueAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
instance->SetData(EVENT_STATE, me->GetEntry());
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_atalai_statueAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_sunken_temple()
|
||||
|
||||
@@ -28,6 +28,7 @@ EndScriptData */
|
||||
#include "sunwell_plateau.h"
|
||||
#include "Player.h"
|
||||
#include "WorldSession.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
enum Yells
|
||||
{
|
||||
@@ -536,27 +537,37 @@ class kalecgos_teleporter : public GameObjectScript
|
||||
public:
|
||||
kalecgos_teleporter() : GameObjectScript("kalecgos_teleporter") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go) override
|
||||
struct kalecgos_teleporterAI : public GameObjectAI
|
||||
{
|
||||
#if MAX_PLAYERS_IN_SPECTRAL_REALM > 0
|
||||
uint8 SpectralPlayers = 0;
|
||||
Map::PlayerList const &PlayerList = go->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
{
|
||||
if (i->GetSource() && i->GetSource()->GetPositionZ() < DEMON_REALM_Z + 5)
|
||||
++SpectralPlayers;
|
||||
}
|
||||
kalecgos_teleporterAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
if (player->HasAura(AURA_SPECTRAL_EXHAUSTION) || SpectralPlayers >= MAX_PLAYERS_IN_SPECTRAL_REALM)
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#if MAX_PLAYERS_IN_SPECTRAL_REALM > 0
|
||||
uint8 SpectralPlayers = 0;
|
||||
Map::PlayerList const &PlayerList = go->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
{
|
||||
if (i->GetSource() && i->GetSource()->GetPositionZ() < DEMON_REALM_Z + 5)
|
||||
++SpectralPlayers;
|
||||
}
|
||||
|
||||
if (player->HasAura(AURA_SPECTRAL_EXHAUSTION) || SpectralPlayers >= MAX_PLAYERS_IN_SPECTRAL_REALM)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
(void)go;
|
||||
(void)me;
|
||||
#endif
|
||||
|
||||
player->CastSpell(player, SPELL_TELEPORT_SPECTRAL, true);
|
||||
return true;
|
||||
player->CastSpell(player, SPELL_TELEPORT_SPECTRAL, true);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new kalecgos_teleporterAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ EndScriptData */
|
||||
#include "sunwell_plateau.h"
|
||||
#include <math.h>
|
||||
#include "Player.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
/*** Speech and sounds***/
|
||||
enum Yells
|
||||
@@ -359,25 +360,35 @@ public:
|
||||
|
||||
class go_orb_of_the_blue_flight : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_orb_of_the_blue_flight() : GameObjectScript("go_orb_of_the_blue_flight") { }
|
||||
public:
|
||||
go_orb_of_the_blue_flight() : GameObjectScript("go_orb_of_the_blue_flight") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go) override
|
||||
{
|
||||
if (go->GetFaction() == 35)
|
||||
struct go_orb_of_the_blue_flightAI : public GameObjectAI
|
||||
{
|
||||
InstanceScript* instance = go->GetInstanceScript();
|
||||
player->SummonCreature(NPC_POWER_OF_THE_BLUE_DRAGONFLIGHT, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 121000);
|
||||
player->CastSpell(player, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, false);
|
||||
go->SetFaction(FACTION_NONE);
|
||||
go_orb_of_the_blue_flightAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
if (Creature* pKalec = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_KALECGOS_KJ)))
|
||||
ENSURE_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalec->AI())->SetRingOfBlueFlames();
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
if (me->GetFaction() == 35)
|
||||
{
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
player->SummonCreature(NPC_POWER_OF_THE_BLUE_DRAGONFLIGHT, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 121000);
|
||||
player->CastSpell(player, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, false);
|
||||
me->SetFaction(FACTION_NONE);
|
||||
|
||||
go->Refresh();
|
||||
if (Creature* pKalec = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_KALECGOS_KJ)))
|
||||
ENSURE_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalec->AI())->SetRingOfBlueFlames();
|
||||
|
||||
me->Refresh();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_orb_of_the_blue_flightAI(go);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
//AI for Kil'jaeden Event Controller
|
||||
|
||||
@@ -30,6 +30,7 @@ EndScriptData */
|
||||
#include "ScriptedCreature.h"
|
||||
#include "uldaman.h"
|
||||
#include "Player.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
@@ -394,22 +395,28 @@ EndScriptData */
|
||||
class go_altar_of_archaedas : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_altar_of_archaedas() : GameObjectScript("go_altar_of_archaedas") { }
|
||||
|
||||
go_altar_of_archaedas()
|
||||
: GameObjectScript("go_altar_of_archaedas")
|
||||
struct go_altar_of_archaedasAI : public GameObjectAI
|
||||
{
|
||||
}
|
||||
go_altar_of_archaedasAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* /*go*/) override
|
||||
{
|
||||
InstanceScript* instance = player->GetInstanceScript();
|
||||
if (!instance)
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
InstanceScript* instance = player->GetInstanceScript();
|
||||
if (!instance)
|
||||
return false;
|
||||
|
||||
player->CastSpell(player, SPELL_BOSS_OBJECT_VISUAL, false);
|
||||
|
||||
instance->SetGuidData(0, player->GetGUID()); // activate archaedas
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
player->CastSpell (player, SPELL_BOSS_OBJECT_VISUAL, false);
|
||||
|
||||
instance->SetGuidData(0, player->GetGUID()); // activate archaedas
|
||||
return false;
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_altar_of_archaedasAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ EndContentData */
|
||||
#include "ScriptedCreature.h"
|
||||
#include "uldaman.h"
|
||||
#include "Player.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
/*######
|
||||
## npc_jadespine_basilisk
|
||||
@@ -116,16 +117,26 @@ class npc_jadespine_basilisk : public CreatureScript
|
||||
|
||||
class go_keystone_chamber : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_keystone_chamber() : GameObjectScript("go_keystone_chamber") { }
|
||||
public:
|
||||
go_keystone_chamber() : GameObjectScript("go_keystone_chamber") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
{
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
instance->SetData(DATA_IRONAYA_SEAL, IN_PROGRESS); //door animation and save state.
|
||||
struct go_keystone_chamberAI : public GameObjectAI
|
||||
{
|
||||
go_keystone_chamberAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
return false;
|
||||
}
|
||||
bool GossipHello(Player* /*player*/, bool /*reportUse*/) override
|
||||
{
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
instance->SetData(DATA_IRONAYA_SEAL, IN_PROGRESS); //door animation and save state.
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_keystone_chamberAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
|
||||
@@ -97,10 +97,10 @@ class npc_voljin_zulaman : public CreatureScript
|
||||
_gongCount = 0;
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (_instance->GetData(DATA_ZULAMAN_STATE) != NOT_STARTED)
|
||||
return;
|
||||
return true;
|
||||
|
||||
if (me->GetCreatureTemplate()->GossipMenuId == menuId && !gossipListId)
|
||||
{
|
||||
@@ -112,6 +112,8 @@ class npc_voljin_zulaman : public CreatureScript
|
||||
Talk(SAY_INTRO_1, player);
|
||||
me->SetWalk(true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
|
||||
@@ -107,7 +107,7 @@ class npc_professor_phizzlethorpe : public CreatureScript
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void sQuestAccept(Player* player, Quest const* quest) override
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
|
||||
{
|
||||
|
||||
@@ -126,25 +126,21 @@ public:
|
||||
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
|
||||
Cage->SetGoState(GO_STATE_READY);
|
||||
}
|
||||
};
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS)
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
|
||||
|
||||
if (npc_escortAI* pEscortAI = CAST_AI(npc_ranger_lilatha::npc_ranger_lilathaAI, creature->AI()))
|
||||
pEscortAI->Start(true, false, player->GetGUID());
|
||||
if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS)
|
||||
{
|
||||
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
|
||||
Start(true, false, player->GetGUID());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_ranger_lilathaAI(creature);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
void AddSC_ghostlands()
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
|
||||
}
|
||||
|
||||
void sQuestAccept(Player* player, Quest const* quest) override
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_RESQUE_OOX_09)
|
||||
{
|
||||
|
||||
@@ -113,20 +113,16 @@ public:
|
||||
{
|
||||
Talk(SAY_AGGRO, who);
|
||||
}
|
||||
};
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_ESCORTING)
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
creature->AI()->Talk(SAY_QUESTACCEPT, player);
|
||||
|
||||
if (npc_escortAI* pEscortAI = CAST_AI(npc_deathstalker_erland::npc_deathstalker_erlandAI, creature->AI()))
|
||||
pEscortAI->Start(true, false, player->GetGUID());
|
||||
if (quest->GetQuestId() == QUEST_ESCORTING)
|
||||
{
|
||||
Talk(SAY_QUESTACCEPT, player);
|
||||
Start(true, false, player->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ class npc_tb_spirit_guide : public CreatureScript
|
||||
DoCast(me, SPELL_CHANNEL_SPIRIT_HEAL);
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
|
||||
@@ -78,11 +78,12 @@ class npc_tb_spirit_guide : public CreatureScript
|
||||
areaId = TB_GY_SOUTH_SPIRE;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (WorldSafeLocsEntry const* safeLoc = sWorldSafeLocsStore.LookupEntry(areaId))
|
||||
player->TeleportTo(safeLoc->map_id, safeLoc->x, safeLoc->y, safeLoc->z, 0);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -101,14 +101,6 @@ class npc_lady_sylvanas_windrunner : public CreatureScript
|
||||
public:
|
||||
npc_lady_sylvanas_windrunner() : CreatureScript("npc_lady_sylvanas_windrunner") { }
|
||||
|
||||
bool OnQuestReward(Player* player, Creature* creature, const Quest *_Quest, uint32 /*slot*/) override
|
||||
{
|
||||
if (_Quest->GetQuestId() == QUEST_JOURNEY_TO_UNDERCITY)
|
||||
creature->AI()->SetGUID(player->GetGUID(), GUID_EVENT_INVOKER);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
struct npc_lady_sylvanas_windrunnerAI : public ScriptedAI
|
||||
{
|
||||
npc_lady_sylvanas_windrunnerAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -116,6 +108,12 @@ public:
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void QuestReward(Player* player, const Quest *_Quest, uint32 /*slot*/) override
|
||||
{
|
||||
if (_Quest->GetQuestId() == QUEST_JOURNEY_TO_UNDERCITY)
|
||||
SetGUID(player->GetGUID(), GUID_EVENT_INVOKER);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
LamentEvent = false;
|
||||
|
||||
@@ -134,26 +134,35 @@ public:
|
||||
|
||||
class npc_mikhail : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_mikhail() : CreatureScript("npc_mikhail") { }
|
||||
public:
|
||||
npc_mikhail() : CreatureScript("npc_mikhail") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_MISSING_DIPLO_PT11)
|
||||
struct npc_mikhailAI : public ScriptedAI
|
||||
{
|
||||
Creature* pSlim = creature->FindNearestCreature(NPC_TAPOKE_SLIM_JAHN, 25.0f);
|
||||
npc_mikhailAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
if (!pSlim)
|
||||
return false;
|
||||
void QuestAccept(Player* player, const Quest* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_MISSING_DIPLO_PT11)
|
||||
{
|
||||
Creature* pSlim = me->FindNearestCreature(NPC_TAPOKE_SLIM_JAHN, 25.0f);
|
||||
|
||||
if (!pSlim->HasStealthAura())
|
||||
pSlim->CastSpell(pSlim, SPELL_STEALTH, true);
|
||||
if (!pSlim)
|
||||
return;
|
||||
|
||||
if (npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI* pEscortAI = CAST_AI(npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI, pSlim->AI()))
|
||||
pEscortAI->Start(false, false, player->GetGUID(), quest);
|
||||
if (!pSlim->HasStealthAura())
|
||||
pSlim->CastSpell(pSlim, SPELL_STEALTH, true);
|
||||
|
||||
if (npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI* pEscortAI = CAST_AI(npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI, pSlim->AI()))
|
||||
pEscortAI->Start(false, false, player->GetGUID(), quest);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_mikhailAI(creature);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
|
||||
@@ -674,7 +674,7 @@ class npc_the_etymidian : public CreatureScript
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void sQuestReward(Player* /*player*/, Quest const* quest, uint32 /*opt*/) override
|
||||
void QuestReward(Player* /*player*/, Quest const* quest, uint32 /*opt*/) override
|
||||
{
|
||||
if (quest->GetQuestId() != QUEST_THE_ACTIVATION_RUNE)
|
||||
return;
|
||||
|
||||
@@ -843,12 +843,12 @@ public:
|
||||
{
|
||||
case EVENT_CHEER:
|
||||
{
|
||||
go->PlayDistanceSound(CheerPicker());
|
||||
me->PlayDistanceSound(CheerPicker());
|
||||
break;
|
||||
}
|
||||
case EVENT_FIRE:
|
||||
{
|
||||
auto it = pos.find(go->GetZoneId());
|
||||
auto it = pos.find(me->GetZoneId());
|
||||
if (it != pos.end())
|
||||
{
|
||||
Position const& rndpos = Trinity::Containers::SelectRandomContainerElement(it->second);
|
||||
@@ -857,7 +857,7 @@ public:
|
||||
|
||||
if (_big)
|
||||
{
|
||||
if (GameObject* firework = go->SummonGameObject(FireworksBIGOnlyPicker(), rndpos, G3D::Quat(0.f, 0.f, rndrot, rndrot2), 300))
|
||||
if (GameObject* firework = me->SummonGameObject(FireworksBIGOnlyPicker(), rndpos, G3D::Quat(0.f, 0.f, rndrot, rndrot2), 300))
|
||||
{
|
||||
firework->SetRespawnTime(0);
|
||||
firework->Delete();
|
||||
@@ -865,7 +865,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GameObject* firework = go->SummonGameObject(FireworksPicker(), rndpos, G3D::Quat(0.f, 0.f, rndrot, rndrot2), 300))
|
||||
if (GameObject* firework = me->SummonGameObject(FireworksPicker(), rndpos, G3D::Quat(0.f, 0.f, rndrot, rndrot2), 300))
|
||||
{
|
||||
firework->SetRespawnTime(0);
|
||||
firework->Delete();
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "GameObjectAI.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
@@ -35,35 +36,53 @@ const Position HomePosition = {-815.817f, -145.299f, -25.870f, 0};
|
||||
|
||||
class go_blackfathom_altar : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_blackfathom_altar() : GameObjectScript("go_blackfathom_altar") { }
|
||||
public:
|
||||
go_blackfathom_altar() : GameObjectScript("go_blackfathom_altar") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* /*go*/) override
|
||||
{
|
||||
if (!player->HasAura(SPELL_BLESSING_OF_BLACKFATHOM))
|
||||
player->AddAura(SPELL_BLESSING_OF_BLACKFATHOM, player);
|
||||
return true;
|
||||
}
|
||||
struct go_blackfathom_altarAI : public GameObjectAI
|
||||
{
|
||||
go_blackfathom_altarAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
if (!player->HasAura(SPELL_BLESSING_OF_BLACKFATHOM))
|
||||
player->AddAura(SPELL_BLESSING_OF_BLACKFATHOM, player);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_blackfathom_altarAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
class go_blackfathom_fire : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_blackfathom_fire() : GameObjectScript("go_blackfathom_fire") { }
|
||||
public:
|
||||
go_blackfathom_fire() : GameObjectScript("go_blackfathom_fire") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
{
|
||||
InstanceScript* instance = go->GetInstanceScript();
|
||||
|
||||
if (instance)
|
||||
struct go_blackfathom_fireAI : public GameObjectAI
|
||||
{
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
instance->SetData(DATA_FIRE, instance->GetData(DATA_FIRE) + 1);
|
||||
return true;
|
||||
go_blackfathom_fireAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool GossipHello(Player* /*player*/, bool /*reportUse*/) override
|
||||
{
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
{
|
||||
me->SetGoState(GO_STATE_ACTIVE);
|
||||
me->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
instance->SetData(DATA_FIRE, instance->GetData(DATA_FIRE) + 1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_blackfathom_fireAI(go);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class npc_blackfathom_deeps_event : public CreatureScript
|
||||
@@ -226,9 +245,10 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
|
||||
{
|
||||
DoCast(player, SPELL_TELEPORT_DARNASSUS);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -50,208 +50,208 @@ EndContentData */
|
||||
|
||||
class npc_jaina_proudmoore : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_jaina_proudmoore() : CreatureScript("npc_jaina_proudmoore") { }
|
||||
public:
|
||||
npc_jaina_proudmoore() : CreatureScript("npc_jaina_proudmoore") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
hyjalAI* ai = ENSURE_AI(hyjalAI, creature->AI());
|
||||
switch (action)
|
||||
struct npc_jaina_proudmooreAI : public hyjalAI
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
ai->StartEvent(player);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
ai->FirstBossDead = true;
|
||||
ai->WaveCount = 9;
|
||||
ai->StartEvent(player);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
ai->Retreat();
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF:
|
||||
ai->Debug = !ai->Debug;
|
||||
TC_LOG_DEBUG("scripts", "HyjalAI - Debug mode has been toggled");
|
||||
break;
|
||||
npc_jaina_proudmooreAI(Creature* creature) : hyjalAI(creature)
|
||||
{
|
||||
Reset();
|
||||
EnterEvadeMode();
|
||||
|
||||
Spells[0].SpellId = SPELL_BLIZZARD;
|
||||
Spells[0].Cooldown = urand(15000, 35000);
|
||||
Spells[0].TargetType = TARGETTYPE_RANDOM;
|
||||
|
||||
Spells[1].SpellId = SPELL_PYROBLAST;
|
||||
Spells[1].Cooldown = urand(5500, 9500);
|
||||
Spells[1].TargetType = TARGETTYPE_RANDOM;
|
||||
|
||||
Spells[2].SpellId = SPELL_SUMMON_ELEMENTALS;
|
||||
Spells[2].Cooldown = urand(15000, 45000);
|
||||
Spells[2].TargetType = TARGETTYPE_SELF;
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
StartEvent(player);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
FirstBossDead = true;
|
||||
WaveCount = 9;
|
||||
StartEvent(player);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
Retreat();
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF:
|
||||
Debug = !Debug;
|
||||
TC_LOG_DEBUG("scripts", "HyjalAI - Debug mode has been toggled");
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (EventBegun)
|
||||
return false;
|
||||
|
||||
uint32 RageEncounter = GetInstanceData(DATA_RAGEWINTERCHILLEVENT);
|
||||
uint32 AnetheronEncounter = GetInstanceData(DATA_ANETHERONEVENT);
|
||||
if (RageEncounter == NOT_STARTED)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_ALLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
else if (RageEncounter == DONE && AnetheronEncounter == NOT_STARTED)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ANETHERON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
else if (RageEncounter == DONE && AnetheronEncounter == DONE)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
|
||||
if (player->IsGameMaster())
|
||||
AddGossipItemFor(player, GOSSIP_ICON_TRAINER, GOSSIP_ITEM_GM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
|
||||
SendGossipMenuFor(player, 907, me->GetGUID());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_jaina_proudmooreAI(creature);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
hyjalAI* ai = ENSURE_AI(hyjalAI, creature->AI());
|
||||
if (ai->EventBegun)
|
||||
return false;
|
||||
|
||||
uint32 RageEncounter = ai->GetInstanceData(DATA_RAGEWINTERCHILLEVENT);
|
||||
uint32 AnetheronEncounter = ai->GetInstanceData(DATA_ANETHERONEVENT);
|
||||
if (RageEncounter == NOT_STARTED)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_ALLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
else if (RageEncounter == DONE && AnetheronEncounter == NOT_STARTED)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ANETHERON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
else if (RageEncounter == DONE && AnetheronEncounter == DONE)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
|
||||
if (player->IsGameMaster())
|
||||
AddGossipItemFor(player, GOSSIP_ICON_TRAINER, GOSSIP_ITEM_GM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
|
||||
SendGossipMenuFor(player, 907, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
if (!creature->GetInstanceScript())
|
||||
return NULL;
|
||||
|
||||
hyjalAI* ai = new hyjalAI(creature);
|
||||
|
||||
ai->Reset();
|
||||
ai->EnterEvadeMode();
|
||||
|
||||
ai->Spells[0].SpellId = SPELL_BLIZZARD;
|
||||
ai->Spells[0].Cooldown = urand(15000, 35000);
|
||||
ai->Spells[0].TargetType = TARGETTYPE_RANDOM;
|
||||
|
||||
ai->Spells[1].SpellId = SPELL_PYROBLAST;
|
||||
ai->Spells[1].Cooldown = urand(5500, 9500);
|
||||
ai->Spells[1].TargetType = TARGETTYPE_RANDOM;
|
||||
|
||||
ai->Spells[2].SpellId = SPELL_SUMMON_ELEMENTALS;
|
||||
ai->Spells[2].Cooldown = urand(15000, 45000);
|
||||
ai->Spells[2].TargetType = TARGETTYPE_SELF;
|
||||
|
||||
return ai;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class npc_thrall : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_thrall() : CreatureScript("npc_thrall") { }
|
||||
public:
|
||||
npc_thrall() : CreatureScript("npc_thrall") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
hyjalAI* ai = ENSURE_AI(hyjalAI, creature->AI());
|
||||
ai->DeSpawnVeins();//despawn the alliance veins
|
||||
switch (action)
|
||||
struct npc_thrallAI : public hyjalAI
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
ai->StartEvent(player);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
ai->FirstBossDead = true;
|
||||
ai->WaveCount = 9;
|
||||
ai->StartEvent(player);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
ai->Retreat();
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF:
|
||||
ai->Debug = !ai->Debug;
|
||||
TC_LOG_DEBUG("scripts", "HyjalAI - Debug mode has been toggled");
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
npc_thrallAI(Creature* creature) : hyjalAI(creature)
|
||||
{
|
||||
Reset();
|
||||
EnterEvadeMode();
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
hyjalAI* ai = ENSURE_AI(hyjalAI, creature->AI());
|
||||
if (ai->EventBegun)
|
||||
return false;
|
||||
Spells[0].SpellId = SPELL_CHAIN_LIGHTNING;
|
||||
Spells[0].Cooldown = urand(3000, 8000);
|
||||
Spells[0].TargetType = TARGETTYPE_VICTIM;
|
||||
|
||||
uint32 AnetheronEvent = ai->GetInstanceData(DATA_ANETHERONEVENT);
|
||||
// Only let them start the Horde phases if Anetheron is dead.
|
||||
if (AnetheronEvent == DONE && ai->GetInstanceData(DATA_ALLIANCE_RETREAT))
|
||||
Spells[1].SpellId = SPELL_SUMMON_DIRE_WOLF;
|
||||
Spells[1].Cooldown = urand(6000, 41000);
|
||||
Spells[1].TargetType = TARGETTYPE_RANDOM;
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
DeSpawnVeins();//despawn the alliance veins
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
StartEvent(player);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
FirstBossDead = true;
|
||||
WaveCount = 9;
|
||||
StartEvent(player);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
Retreat();
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF:
|
||||
Debug = !Debug;
|
||||
TC_LOG_DEBUG("scripts", "HyjalAI - Debug mode has been toggled");
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (EventBegun)
|
||||
return false;
|
||||
|
||||
uint32 AnetheronEvent = GetInstanceData(DATA_ANETHERONEVENT);
|
||||
// Only let them start the Horde phases if Anetheron is dead.
|
||||
if (AnetheronEvent == DONE && GetInstanceData(DATA_ALLIANCE_RETREAT))
|
||||
{
|
||||
uint32 KazrogalEvent = GetInstanceData(DATA_KAZROGALEVENT);
|
||||
uint32 AzgalorEvent = GetInstanceData(DATA_AZGALOREVENT);
|
||||
if (KazrogalEvent == NOT_STARTED)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_HORDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
else if (KazrogalEvent == DONE && AzgalorEvent == NOT_STARTED)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_AZGALOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
else if (AzgalorEvent == DONE)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
}
|
||||
|
||||
if (player->IsGameMaster())
|
||||
AddGossipItemFor(player, GOSSIP_ICON_TRAINER, GOSSIP_ITEM_GM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
|
||||
SendGossipMenuFor(player, 907, me->GetGUID());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
uint32 KazrogalEvent = ai->GetInstanceData(DATA_KAZROGALEVENT);
|
||||
uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT);
|
||||
if (KazrogalEvent == NOT_STARTED)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_HORDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
else if (KazrogalEvent == DONE && AzgalorEvent == NOT_STARTED)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_AZGALOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
else if (AzgalorEvent == DONE)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
return new npc_thrallAI(creature);
|
||||
}
|
||||
|
||||
if (player->IsGameMaster())
|
||||
AddGossipItemFor(player, GOSSIP_ICON_TRAINER, GOSSIP_ITEM_GM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
|
||||
SendGossipMenuFor(player, 907, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
if (!creature->GetInstanceScript())
|
||||
return NULL;
|
||||
|
||||
hyjalAI* ai = new hyjalAI(creature);
|
||||
|
||||
ai->Reset();
|
||||
ai->EnterEvadeMode();
|
||||
|
||||
ai->Spells[0].SpellId = SPELL_CHAIN_LIGHTNING;
|
||||
ai->Spells[0].Cooldown = urand(3000, 8000);
|
||||
ai->Spells[0].TargetType = TARGETTYPE_VICTIM;
|
||||
|
||||
ai->Spells[1].SpellId = SPELL_SUMMON_DIRE_WOLF;
|
||||
ai->Spells[1].Cooldown = urand(6000, 41000);
|
||||
ai->Spells[1].TargetType = TARGETTYPE_RANDOM;
|
||||
|
||||
return ai;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class npc_tyrande_whisperwind : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_tyrande_whisperwind() : CreatureScript("npc_tyrande_whisperwind") { }
|
||||
public:
|
||||
npc_tyrande_whisperwind() : CreatureScript("npc_tyrande_whisperwind") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
if (!creature->GetInstanceScript())
|
||||
return NULL;
|
||||
|
||||
hyjalAI* ai = new hyjalAI(creature);
|
||||
ai->Reset();
|
||||
ai->EnterEvadeMode();
|
||||
return ai;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF)
|
||||
struct npc_tyrande_whisperwindAI : public hyjalAI
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
if (Item* item = player->StoreNewItem(dest, ITEM_TEAR_OF_GODDESS, true))
|
||||
player->SendNewItem(item, 1, true, false, true);
|
||||
npc_tyrande_whisperwindAI(Creature* creature) : hyjalAI(creature)
|
||||
{
|
||||
Reset();
|
||||
EnterEvadeMode();
|
||||
}
|
||||
|
||||
SendGossipMenuFor(player, 907, creature->GetGUID());
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF)
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
if (Item* item = player->StoreNewItem(dest, ITEM_TEAR_OF_GODDESS, true))
|
||||
player->SendNewItem(item, 1, true, false, true);
|
||||
|
||||
SendGossipMenuFor(player, 907, me->GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
uint32 AzgalorEvent = GetInstanceData(DATA_AZGALOREVENT);
|
||||
|
||||
// Only let them get item if Azgalor is dead.
|
||||
if (AzgalorEvent == DONE && !player->HasItemCount(ITEM_TEAR_OF_GODDESS))
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_TYRANDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
SendGossipMenuFor(player, 907, me->GetGUID());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_tyrande_whisperwindAI(creature);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
hyjalAI* ai = ENSURE_AI(hyjalAI, creature->AI());
|
||||
uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT);
|
||||
|
||||
// Only let them get item if Azgalor is dead.
|
||||
if (AzgalorEvent == DONE && !player->HasItemCount(ITEM_TEAR_OF_GODDESS))
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_TYRANDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
SendGossipMenuFor(player, 907, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
void AddSC_hyjal()
|
||||
|
||||
+82
-87
@@ -254,93 +254,6 @@ class npc_arthas : public CreatureScript
|
||||
public:
|
||||
npc_arthas() : CreatureScript("npc_arthas") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
npc_arthasAI* ai = CAST_AI(npc_arthas::npc_arthasAI, creature->AI());
|
||||
|
||||
if (!ai)
|
||||
return false;
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF:
|
||||
ai->Start(true, true, player->GetGUID(), 0, false, false);
|
||||
ai->SetDespawnAtEnd(false);
|
||||
ai->bStepping = false;
|
||||
ai->step = 1;
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
ai->bStepping = true;
|
||||
ai->step = 24;
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
ai->SetHoldState(false);
|
||||
ai->bStepping = false;
|
||||
ai->step = 61;
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
ai->SetHoldState(false);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+4:
|
||||
ai->bStepping = true;
|
||||
ai->step = 84;
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+5:
|
||||
ai->bStepping = true;
|
||||
ai->step = 85;
|
||||
break;
|
||||
}
|
||||
CloseGossipMenuFor(player);
|
||||
ai->SetDespawnAtFar(false);
|
||||
creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
npc_arthasAI* ai = CAST_AI(npc_arthas::npc_arthasAI, creature->AI());
|
||||
|
||||
if (ai && ai->bStepping == false)
|
||||
{
|
||||
switch (ai->gossipStep)
|
||||
{
|
||||
case 0: //This one is a workaround since the very beggining of the script is wrong.
|
||||
{
|
||||
QuestStatus status = player->GetQuestStatus(13149);
|
||||
if (status != QUEST_STATUS_COMPLETE && status != QUEST_STATUS_REWARDED)
|
||||
return false;
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
SendGossipMenuFor(player, 907, creature->GetGUID());
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_1, creature->GetGUID());
|
||||
break;
|
||||
case 2:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_2, creature->GetGUID());
|
||||
break;
|
||||
case 3:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
|
||||
SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_3, creature->GetGUID());
|
||||
break;
|
||||
case 4:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
|
||||
SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_4, creature->GetGUID());
|
||||
break;
|
||||
case 5:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
|
||||
SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_5, creature->GetGUID());
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<npc_arthasAI>(creature);
|
||||
@@ -1231,6 +1144,88 @@ public:
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF:
|
||||
Start(true, true, player->GetGUID(), 0, false, false);
|
||||
SetDespawnAtEnd(false);
|
||||
bStepping = false;
|
||||
step = 1;
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
bStepping = true;
|
||||
step = 24;
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
SetHoldState(false);
|
||||
bStepping = false;
|
||||
step = 61;
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
SetHoldState(false);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 4:
|
||||
bStepping = true;
|
||||
step = 84;
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 5:
|
||||
bStepping = true;
|
||||
step = 85;
|
||||
break;
|
||||
}
|
||||
CloseGossipMenuFor(player);
|
||||
SetDespawnAtFar(false);
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (!bStepping)
|
||||
{
|
||||
switch (gossipStep)
|
||||
{
|
||||
case 0: //This one is a workaround since the very beggining of the script is wrong.
|
||||
{
|
||||
QuestStatus status = player->GetQuestStatus(13149);
|
||||
if (status != QUEST_STATUS_COMPLETE && status != QUEST_STATUS_REWARDED)
|
||||
return false;
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
SendGossipMenuFor(player, 907, me->GetGUID());
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_1, me->GetGUID());
|
||||
break;
|
||||
case 2:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_2, me->GetGUID());
|
||||
break;
|
||||
case 3:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_3, me->GetGUID());
|
||||
break;
|
||||
case 4:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_4, me->GetGUID());
|
||||
break;
|
||||
case 5:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_ARTHAS_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
||||
SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_5, me->GetGUID());
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
+17
-6
@@ -27,6 +27,7 @@ EndScriptData */
|
||||
#include "ScriptedCreature.h"
|
||||
#include "old_hillsbrad.h"
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
/*######
|
||||
## go_barrel_old_hillsbrad
|
||||
@@ -37,17 +38,27 @@ class go_barrel_old_hillsbrad : public GameObjectScript
|
||||
public:
|
||||
go_barrel_old_hillsbrad() : GameObjectScript("go_barrel_old_hillsbrad") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
struct go_barrel_old_hillsbradAI : public GameObjectAI
|
||||
{
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
go_barrel_old_hillsbradAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool GossipHello(Player* /*player*/, bool /*reportUse*/) override
|
||||
{
|
||||
if (instance->GetData(TYPE_BARREL_DIVERSION) == DONE)
|
||||
return false;
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
{
|
||||
if (instance->GetData(TYPE_BARREL_DIVERSION) == DONE)
|
||||
return false;
|
||||
|
||||
instance->SetData(TYPE_BARREL_DIVERSION, IN_PROGRESS);
|
||||
instance->SetData(TYPE_BARREL_DIVERSION, IN_PROGRESS);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
return false;
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_barrel_old_hillsbradAI(go);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
+157
-146
@@ -56,41 +56,52 @@ class npc_erozion : public CreatureScript
|
||||
public:
|
||||
npc_erozion() : CreatureScript("npc_erozion") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
struct npc_erozionAI : public ScriptedAI
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
npc_erozionAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_ENTRY_BOMBS, 1);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
player->StoreNewItem(dest, ITEM_ENTRY_BOMBS, true);
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_ENTRY_BOMBS, 1);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
{
|
||||
player->StoreNewItem(dest, ITEM_ENTRY_BOMBS, true);
|
||||
}
|
||||
SendGossipMenuFor(player, 9515, me->GetGUID());
|
||||
}
|
||||
SendGossipMenuFor(player, 9515, creature->GetGUID());
|
||||
if (gossipListId == GOSSIP_ACTION_INFO_DEF + 2)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+2)
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
if (me->IsQuestGiver())
|
||||
player->PrepareQuestMenu(me->GetGUID());
|
||||
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (instance->GetData(TYPE_BARREL_DIVERSION) != DONE && !player->HasItemCount(ITEM_ENTRY_BOMBS))
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HELLO_EROZION1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
if (player->GetQuestStatus(QUEST_ENTRY_RETURN) == QUEST_STATUS_COMPLETE)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HELLO_EROZION2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
|
||||
SendGossipMenuFor(player, 9778, me->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance->GetData(TYPE_BARREL_DIVERSION) != DONE && !player->HasItemCount(ITEM_ENTRY_BOMBS))
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HELLO_EROZION1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
if (player->GetQuestStatus(QUEST_ENTRY_RETURN) == QUEST_STATUS_COMPLETE)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HELLO_EROZION2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
|
||||
SendGossipMenuFor(player, 9778, creature->GetGUID());
|
||||
|
||||
return true;
|
||||
return new npc_erozionAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -190,88 +201,6 @@ public:
|
||||
return GetInstanceAI<npc_thrall_old_hillsbradAI>(creature);
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
CloseGossipMenuFor(player);
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(TYPE_THRALL_EVENT, IN_PROGRESS);
|
||||
instance->SetData(TYPE_THRALL_PART1, IN_PROGRESS);
|
||||
}
|
||||
|
||||
creature->AI()->Talk(SAY_TH_START_EVENT_PART1);
|
||||
|
||||
if (npc_escortAI* pEscortAI = CAST_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, creature->AI()))
|
||||
pEscortAI->Start(true, true, player->GetGUID());
|
||||
|
||||
ENSURE_AI(npc_escortAI, (creature->AI()))->SetMaxPlayerDistance(100.0f);//not really needed, because it will not despawn if player is too far
|
||||
ENSURE_AI(npc_escortAI, (creature->AI()))->SetDespawnAtEnd(false);
|
||||
ENSURE_AI(npc_escortAI, (creature->AI()))->SetDespawnAtFar(false);
|
||||
break;
|
||||
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20);
|
||||
SendGossipMenuFor(player, GOSSIP_ID_SKARLOC2, creature->GetGUID());
|
||||
break;
|
||||
|
||||
case GOSSIP_ACTION_INFO_DEF+20:
|
||||
SendGossipMenuFor(player, GOSSIP_ID_SKARLOC3, creature->GetGUID());
|
||||
creature->SummonCreature(SKARLOC_MOUNT, 2038.81f, 270.26f, 63.20f, 5.41f, TEMPSUMMON_TIMED_DESPAWN, 12000);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_THRALL_PART2, IN_PROGRESS);
|
||||
|
||||
creature->AI()->Talk(SAY_TH_START_EVENT_PART2);
|
||||
|
||||
ENSURE_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, creature->AI())->StartWP();
|
||||
break;
|
||||
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
CloseGossipMenuFor(player);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_THRALL_PART3, IN_PROGRESS);
|
||||
ENSURE_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, creature->AI())->StartWP();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
{
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
player->SendPreparedQuest(creature->GetGUID());
|
||||
}
|
||||
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance)
|
||||
{
|
||||
if (instance->GetData(TYPE_BARREL_DIVERSION) == DONE && !instance->GetData(TYPE_THRALL_EVENT))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_WALKING, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
SendGossipMenuFor(player, GOSSIP_ID_START, creature->GetGUID());
|
||||
}
|
||||
|
||||
if (instance->GetData(TYPE_THRALL_PART1) == DONE && !instance->GetData(TYPE_THRALL_PART2))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
SendGossipMenuFor(player, GOSSIP_ID_SKARLOC1, creature->GetGUID());
|
||||
}
|
||||
|
||||
if (instance->GetData(TYPE_THRALL_PART2) == DONE && !instance->GetData(TYPE_THRALL_PART3))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_TARREN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
|
||||
SendGossipMenuFor(player, GOSSIP_ID_TARREN, creature->GetGUID());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
struct npc_thrall_old_hillsbradAI : public npc_escortAI
|
||||
{
|
||||
npc_thrall_old_hillsbradAI(Creature* creature) : npc_escortAI(creature)
|
||||
@@ -292,6 +221,88 @@ public:
|
||||
bool LowHp;
|
||||
bool HadMount;
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
CloseGossipMenuFor(player);
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(TYPE_THRALL_EVENT, IN_PROGRESS);
|
||||
instance->SetData(TYPE_THRALL_PART1, IN_PROGRESS);
|
||||
}
|
||||
|
||||
Talk(SAY_TH_START_EVENT_PART1);
|
||||
|
||||
Start(true, true, player->GetGUID());
|
||||
|
||||
SetMaxPlayerDistance(100.0f);//not really needed, because it will not despawn if player is too far
|
||||
SetDespawnAtEnd(false);
|
||||
SetDespawnAtFar(false);
|
||||
break;
|
||||
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 20);
|
||||
SendGossipMenuFor(player, GOSSIP_ID_SKARLOC2, me->GetGUID());
|
||||
break;
|
||||
|
||||
case GOSSIP_ACTION_INFO_DEF + 20:
|
||||
SendGossipMenuFor(player, GOSSIP_ID_SKARLOC3, me->GetGUID());
|
||||
me->SummonCreature(SKARLOC_MOUNT, 2038.81f, 270.26f, 63.20f, 5.41f, TEMPSUMMON_TIMED_DESPAWN, 12000);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_THRALL_PART2, IN_PROGRESS);
|
||||
|
||||
me->AI()->Talk(SAY_TH_START_EVENT_PART2);
|
||||
|
||||
StartWP();
|
||||
break;
|
||||
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
CloseGossipMenuFor(player);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_THRALL_PART3, IN_PROGRESS);
|
||||
StartWP();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (me->IsQuestGiver())
|
||||
{
|
||||
player->PrepareQuestMenu(me->GetGUID());
|
||||
player->SendPreparedQuest(me->GetGUID());
|
||||
}
|
||||
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (instance)
|
||||
{
|
||||
if (instance->GetData(TYPE_BARREL_DIVERSION) == DONE && !instance->GetData(TYPE_THRALL_EVENT))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_WALKING, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, GOSSIP_ID_START, me->GetGUID());
|
||||
}
|
||||
|
||||
if (instance->GetData(TYPE_THRALL_PART1) == DONE && !instance->GetData(TYPE_THRALL_PART2))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
SendGossipMenuFor(player, GOSSIP_ID_SKARLOC1, me->GetGUID());
|
||||
}
|
||||
|
||||
if (instance->GetData(TYPE_THRALL_PART2) == DONE && !instance->GetData(TYPE_THRALL_PART3))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_TARREN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
SendGossipMenuFor(player, GOSSIP_ID_TARREN, me->GetGUID());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId) override
|
||||
{
|
||||
switch (waypointId)
|
||||
@@ -568,43 +579,6 @@ public:
|
||||
return GetInstanceAI<npc_tarethaAI>(creature);
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
SendGossipMenuFor(player, GOSSIP_ID_EPOCH2, creature->GetGUID());
|
||||
}
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+2)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
|
||||
if (instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
|
||||
{
|
||||
instance->SetData(TYPE_THRALL_PART4, IN_PROGRESS);
|
||||
if (instance->GetGuidData(DATA_EPOCH).IsEmpty())
|
||||
creature->SummonCreature(ENTRY_EPOCH, 2639.13f, 698.55f, 65.43f, 4.59f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
|
||||
|
||||
if (Creature* thrall = (ObjectAccessor::GetCreature(*creature, instance->GetGuidData(DATA_THRALL))))
|
||||
ENSURE_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, thrall->AI())->StartWP();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance->GetData(TYPE_THRALL_PART3) == DONE && instance->GetData(TYPE_THRALL_PART4) == NOT_STARTED)
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
SendGossipMenuFor(player, GOSSIP_ID_EPOCH1, creature->GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
struct npc_tarethaAI : public npc_escortAI
|
||||
{
|
||||
npc_tarethaAI(Creature* creature) : npc_escortAI(creature)
|
||||
@@ -614,6 +588,44 @@ public:
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
SendGossipMenuFor(player, GOSSIP_ID_EPOCH2, me->GetGUID());
|
||||
}
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 2)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
|
||||
if (instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
|
||||
{
|
||||
instance->SetData(TYPE_THRALL_PART4, IN_PROGRESS);
|
||||
if (instance->GetGuidData(DATA_EPOCH).IsEmpty())
|
||||
me->SummonCreature(ENTRY_EPOCH, 2639.13f, 698.55f, 65.43f, 4.59f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
|
||||
|
||||
if (Creature* thrall = (ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL))))
|
||||
ENSURE_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, thrall->AI())->StartWP();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (instance->GetData(TYPE_THRALL_PART3) == DONE && instance->GetData(TYPE_THRALL_PART4) == NOT_STARTED)
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, GOSSIP_ID_EPOCH1, me->GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId) override
|
||||
{
|
||||
switch (waypointId)
|
||||
@@ -635,7 +647,6 @@ public:
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
/*######
|
||||
|
||||
@@ -329,12 +329,12 @@ class npc_brann_bronzebeard_anraphet : public CreatureScript
|
||||
{
|
||||
npc_brann_bronzebeard_anraphetAI(Creature* creature) : CreatureAI(creature), _currentPoint(0), _instance(creature->GetInstanceScript()) { }
|
||||
|
||||
void sGossipSelect(Player* /*player*/, uint32 sender, uint32 action) override
|
||||
bool GossipSelect(Player* /*player*/, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (_instance->GetBossState(DATA_VAULT_OF_LIGHTS) == DONE)
|
||||
return;
|
||||
return true;
|
||||
|
||||
if (me->GetCreatureTemplate()->GossipMenuId == sender && !action)
|
||||
if (me->GetCreatureTemplate()->GossipMenuId == menuId && !gossipListId)
|
||||
{
|
||||
_instance->SetBossState(DATA_VAULT_OF_LIGHTS, IN_PROGRESS);
|
||||
_currentPoint = 0;
|
||||
@@ -344,6 +344,8 @@ class npc_brann_bronzebeard_anraphet : public CreatureScript
|
||||
Talk(BRANN_SAY_DOOR_INTRO);
|
||||
events.ScheduleEvent(EVENT_BRANN_UNLOCK_DOOR, 7500);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
|
||||
@@ -36,6 +36,7 @@ EndContentData */
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Cell.h"
|
||||
#include "CellImpl.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
/*###
|
||||
## npc_belnistrasz for Quest 3525 "Extinguishing the Idol"
|
||||
@@ -127,7 +128,7 @@ public:
|
||||
me->DespawnOrUnsummon(5000);
|
||||
}
|
||||
|
||||
void sQuestAccept(Player* /*player*/, Quest const* quest) override
|
||||
void QuestAccept(Player* /*player*/, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_EXTINGUISHING_THE_IDOL)
|
||||
{
|
||||
@@ -371,22 +372,31 @@ public:
|
||||
|
||||
class go_gong : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_gong() : GameObjectScript("go_gong") { }
|
||||
public:
|
||||
go_gong() : GameObjectScript("go_gong") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
{
|
||||
InstanceScript* instance = go->GetInstanceScript();
|
||||
|
||||
if (instance)
|
||||
struct go_gongAI : public GameObjectAI
|
||||
{
|
||||
go->SendCustomAnim(0);
|
||||
instance->SetData(DATA_WAVE, IN_PROGRESS);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
go_gongAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
|
||||
if (instance)
|
||||
{
|
||||
me->SendCustomAnim(0);
|
||||
instance->SetData(DATA_WAVE, IN_PROGRESS);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_gongAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_razorfen_downs()
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
{
|
||||
npc_willixAI(Creature* creature) : npc_escortAI(creature) { }
|
||||
|
||||
void sQuestAccept(Player* player, Quest const* quest) override
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_WILLIX_THE_IMPORTER)
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "SpellInfo.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "Opcodes.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
enum Texts
|
||||
{
|
||||
@@ -278,18 +279,28 @@ class go_ossirian_crystal : public GameObjectScript
|
||||
public:
|
||||
go_ossirian_crystal() : GameObjectScript("go_ossirian_crystal") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* /*go*/) override
|
||||
struct go_ossirian_crystalAI : public GameObjectAI
|
||||
{
|
||||
InstanceScript* Instance = player->GetInstanceScript();
|
||||
if (!Instance)
|
||||
return false;
|
||||
go_ossirian_crystalAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
Creature* Ossirian = player->FindNearestCreature(NPC_OSSIRIAN, 30.0f);
|
||||
if (!Ossirian || Instance->GetBossState(DATA_OSSIRIAN) != IN_PROGRESS)
|
||||
return false;
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
InstanceScript* Instance = player->GetInstanceScript();
|
||||
if (!Instance)
|
||||
return false;
|
||||
|
||||
Ossirian->AI()->DoAction(ACTION_TRIGGER_WEAKNESS);
|
||||
return true;
|
||||
Creature* Ossirian = player->FindNearestCreature(NPC_OSSIRIAN, 30.0f);
|
||||
if (!Ossirian || Instance->GetBossState(DATA_OSSIRIAN) != IN_PROGRESS)
|
||||
return false;
|
||||
|
||||
Ossirian->AI()->DoAction(ACTION_TRIGGER_WEAKNESS);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_ossirian_crystalAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -73,53 +73,6 @@ class npc_disciple_of_naralex : public CreatureScript
|
||||
public:
|
||||
npc_disciple_of_naralex() : CreatureScript("npc_disciple_of_naralex") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
if (instance)
|
||||
instance->SetData(DATA_NARALEX_EVENT, IN_PROGRESS);
|
||||
|
||||
creature->AI()->Talk(SAY_MAKE_PREPARATIONS);
|
||||
|
||||
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE);
|
||||
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
|
||||
ENSURE_AI(npc_escortAI, (creature->AI()))->Start(false, false, player->GetGUID());
|
||||
ENSURE_AI(npc_escortAI, (creature->AI()))->SetDespawnAtFar(false);
|
||||
ENSURE_AI(npc_escortAI, (creature->AI()))->SetDespawnAtEnd(false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if(InstanceScript* instance = creature->GetInstanceScript())
|
||||
{
|
||||
creature->CastSpell(player, SPELL_MARK_OF_THE_WILD_RANK_2, true);
|
||||
if ((instance->GetBossState(DATA_LORD_COBRAHN) == DONE) && (instance->GetBossState(DATA_LORD_PYTHAS) == DONE) &&
|
||||
(instance->GetBossState(DATA_LADY_ANACONDRA) == DONE) && (instance->GetBossState(DATA_LORD_SERPENTIS) == DONE))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_OPTION_LET_EVENT_BEGIN, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, NPC_TEXT_FANGLORDS_ARE_DEAD, creature->GetGUID());
|
||||
|
||||
if (!instance->GetData(DATA_NARALEX_YELLED))
|
||||
{
|
||||
creature->AI()->Talk(SAY_AT_LAST);
|
||||
instance->SetData(DATA_NARALEX_YELLED, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SendGossipMenuFor(player, NPC_TEXT_NARALEX_SLEEPS_AGAIN, creature->GetGUID());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
struct npc_disciple_of_naralexAI : public npc_escortAI
|
||||
{
|
||||
npc_disciple_of_naralexAI(Creature* creature) : npc_escortAI(creature)
|
||||
@@ -132,7 +85,53 @@ public:
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
if (instance)
|
||||
instance->SetData(DATA_NARALEX_EVENT, IN_PROGRESS);
|
||||
|
||||
Talk(SAY_MAKE_PREPARATIONS);
|
||||
|
||||
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
|
||||
Start(false, false, player->GetGUID());
|
||||
SetDespawnAtFar(false);
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
{
|
||||
me->CastSpell(player, SPELL_MARK_OF_THE_WILD_RANK_2, true);
|
||||
if ((instance->GetBossState(DATA_LORD_COBRAHN) == DONE) && (instance->GetBossState(DATA_LORD_PYTHAS) == DONE) &&
|
||||
(instance->GetBossState(DATA_LADY_ANACONDRA) == DONE) && (instance->GetBossState(DATA_LORD_SERPENTIS) == DONE))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_OPTION_LET_EVENT_BEGIN, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, NPC_TEXT_FANGLORDS_ARE_DEAD, me->GetGUID());
|
||||
|
||||
if (!instance->GetData(DATA_NARALEX_YELLED))
|
||||
{
|
||||
Talk(SAY_AT_LAST);
|
||||
instance->SetData(DATA_NARALEX_YELLED, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SendGossipMenuFor(player, NPC_TEXT_NARALEX_SLEEPS_AGAIN, me->GetGUID());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId) override
|
||||
{
|
||||
|
||||
@@ -33,6 +33,7 @@ EndContentData */
|
||||
#include "ScriptedGossip.h"
|
||||
#include "zulfarrak.h"
|
||||
#include "Player.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
/*######
|
||||
## npc_sergeant_bly
|
||||
@@ -57,37 +58,6 @@ class npc_sergeant_bly : public CreatureScript
|
||||
public:
|
||||
npc_sergeant_bly() : CreatureScript("npc_sergeant_bly") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
ENSURE_AI(npc_sergeant_bly::npc_sergeant_blyAI, creature->AI())->PlayerGUID = player->GetGUID();
|
||||
creature->AI()->DoAction(0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
{
|
||||
if (instance->GetData(EVENT_PYRAMID) == PYRAMID_KILLED_ALL_TROLLS)
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_BLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
SendGossipMenuFor(player, 1517, creature->GetGUID());
|
||||
}
|
||||
else
|
||||
if (instance->GetData(EVENT_PYRAMID) == PYRAMID_NOT_STARTED)
|
||||
SendGossipMenuFor(player, 1515, creature->GetGUID());
|
||||
else
|
||||
SendGossipMenuFor(player, 1516, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<npc_sergeant_blyAI>(creature);
|
||||
@@ -117,6 +87,38 @@ public:
|
||||
uint32 Revenge_Timer; //this is wrong, spell should never be used unless me->GetVictim() dodge, parry or block attack. Trinity support required.
|
||||
ObjectGuid PlayerGUID;
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
PlayerGUID = player->GetGUID();
|
||||
DoAction(0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
{
|
||||
if (instance->GetData(EVENT_PYRAMID) == PYRAMID_KILLED_ALL_TROLLS)
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_BLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, 1517, me->GetGUID());
|
||||
}
|
||||
else
|
||||
if (instance->GetData(EVENT_PYRAMID) == PYRAMID_NOT_STARTED)
|
||||
SendGossipMenuFor(player, 1515, me->GetGUID());
|
||||
else
|
||||
SendGossipMenuFor(player, 1516, me->GetGUID());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
@@ -204,32 +206,42 @@ class go_troll_cage : public GameObjectScript
|
||||
public:
|
||||
go_troll_cage() : GameObjectScript("go_troll_cage") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
struct go_troll_cageAI : public GameObjectAI
|
||||
{
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
{
|
||||
instance->SetData(EVENT_PYRAMID, PYRAMID_CAGES_OPEN);
|
||||
//set bly & co to aggressive & start moving to top of stairs
|
||||
initBlyCrewMember(instance, ENTRY_BLY, 1884.99f, 1263, 41.52f);
|
||||
initBlyCrewMember(instance, ENTRY_RAVEN, 1882.5f, 1263, 41.52f);
|
||||
initBlyCrewMember(instance, ENTRY_ORO, 1886.47f, 1270.68f, 41.68f);
|
||||
initBlyCrewMember(instance, ENTRY_WEEGLI, 1890, 1263, 41.52f);
|
||||
initBlyCrewMember(instance, ENTRY_MURTA, 1891.19f, 1272.03f, 41.60f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
go_troll_cageAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
private:
|
||||
void initBlyCrewMember(InstanceScript* instance, uint32 entry, float x, float y, float z)
|
||||
{
|
||||
if (Creature* crew = instance->instance->GetCreature(instance->GetGuidData(entry)))
|
||||
bool GossipHello(Player* /*player*/, bool /*reportUse*/) override
|
||||
{
|
||||
crew->SetReactState(REACT_AGGRESSIVE);
|
||||
crew->SetWalk(true);
|
||||
crew->SetHomePosition(x, y, z, 0);
|
||||
crew->GetMotionMaster()->MovePoint(1, x, y, z);
|
||||
crew->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE);
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
{
|
||||
instance->SetData(EVENT_PYRAMID, PYRAMID_CAGES_OPEN);
|
||||
//set bly & co to aggressive & start moving to top of stairs
|
||||
initBlyCrewMember(instance, ENTRY_BLY, 1884.99f, 1263, 41.52f);
|
||||
initBlyCrewMember(instance, ENTRY_RAVEN, 1882.5f, 1263, 41.52f);
|
||||
initBlyCrewMember(instance, ENTRY_ORO, 1886.47f, 1270.68f, 41.68f);
|
||||
initBlyCrewMember(instance, ENTRY_WEEGLI, 1890, 1263, 41.52f);
|
||||
initBlyCrewMember(instance, ENTRY_MURTA, 1891.19f, 1272.03f, 41.60f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
void initBlyCrewMember(InstanceScript* instance, uint32 entry, float x, float y, float z) const
|
||||
{
|
||||
if (Creature* crew = instance->instance->GetCreature(instance->GetGuidData(entry)))
|
||||
{
|
||||
crew->SetReactState(REACT_AGGRESSIVE);
|
||||
crew->SetWalk(true);
|
||||
crew->SetHomePosition(x, y, z, 0);
|
||||
crew->GetMotionMaster()->MovePoint(1, x, y, z);
|
||||
crew->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_troll_cageAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -258,39 +270,6 @@ class npc_weegli_blastfuse : public CreatureScript
|
||||
public:
|
||||
npc_weegli_blastfuse() : CreatureScript("npc_weegli_blastfuse") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
//here we make him run to door, set the charge and run away off to nowhere
|
||||
creature->AI()->DoAction(0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
{
|
||||
switch (instance->GetData(EVENT_PYRAMID))
|
||||
{
|
||||
case PYRAMID_KILLED_ALL_TROLLS:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_WEEGLI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
SendGossipMenuFor(player, 1514, creature->GetGUID()); //if event can proceed to end
|
||||
break;
|
||||
case PYRAMID_NOT_STARTED:
|
||||
SendGossipMenuFor(player, 1511, creature->GetGUID()); //if event not started
|
||||
break;
|
||||
default:
|
||||
SendGossipMenuFor(player, 1513, creature->GetGUID()); //if event are in progress
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<npc_weegli_blastfuseAI>(creature);
|
||||
@@ -311,6 +290,40 @@ public:
|
||||
bool destroyingDoor;
|
||||
InstanceScript* instance;
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
//here we make him run to door, set the charge and run away off to nowhere
|
||||
DestroyDoor();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
{
|
||||
switch (instance->GetData(EVENT_PYRAMID))
|
||||
{
|
||||
case PYRAMID_KILLED_ALL_TROLLS:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_WEEGLI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, 1514, me->GetGUID()); //if event can proceed to end
|
||||
break;
|
||||
case PYRAMID_NOT_STARTED:
|
||||
SendGossipMenuFor(player, 1511, me->GetGUID()); //if event not started
|
||||
break;
|
||||
default:
|
||||
SendGossipMenuFor(player, 1513, me->GetGUID()); //if event are in progress
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
/*instance->SetData(0, NOT_STARTED);*/
|
||||
@@ -368,11 +381,6 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
void DoAction(int32 /*param*/) override
|
||||
{
|
||||
DestroyDoor();
|
||||
}
|
||||
|
||||
void DestroyDoor()
|
||||
{
|
||||
if (me->IsAlive())
|
||||
@@ -402,24 +410,34 @@ enum ShallowGrave
|
||||
|
||||
class go_shallow_grave : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_shallow_grave() : GameObjectScript("go_shallow_grave") { }
|
||||
public:
|
||||
go_shallow_grave() : GameObjectScript("go_shallow_grave") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
{
|
||||
// randomly summon a zombie or dead hero the first time a grave is used
|
||||
if (go->GetUseCount() == 0)
|
||||
struct go_shallow_graveAI : public GameObjectAI
|
||||
{
|
||||
uint32 randomchance = urand(0, 100);
|
||||
if (randomchance < CHANCE_ZOMBIE)
|
||||
go->SummonCreature(NPC_ZOMBIE, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
|
||||
else
|
||||
if ((randomchance - CHANCE_ZOMBIE) < CHANCE_DEAD_HERO)
|
||||
go->SummonCreature(NPC_DEAD_HERO, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
|
||||
go_shallow_graveAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool GossipHello(Player* /*player*/, bool /*reportUse*/) override
|
||||
{
|
||||
// randomly summon a zombie or dead hero the first time a grave is used
|
||||
if (me->GetUseCount() == 0)
|
||||
{
|
||||
uint32 randomchance = urand(0, 100);
|
||||
if (randomchance < CHANCE_ZOMBIE)
|
||||
me->SummonCreature(NPC_ZOMBIE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
|
||||
else
|
||||
if ((randomchance - CHANCE_ZOMBIE) < CHANCE_DEAD_HERO)
|
||||
me->SummonCreature(NPC_DEAD_HERO, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
|
||||
}
|
||||
me->AddUse();
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_shallow_graveAI(go);
|
||||
}
|
||||
go->AddUse();
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
|
||||
@@ -32,6 +32,7 @@ EndContentData */
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "Player.h"
|
||||
#include "SpellScript.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
/*####
|
||||
# npc_ruul_snowhoof
|
||||
@@ -78,7 +79,7 @@ public:
|
||||
summoned->AI()->AttackStart(me);
|
||||
}
|
||||
|
||||
void sQuestAccept(Player* player, Quest const* quest) override
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_FREEDOM_TO_RUUL)
|
||||
{
|
||||
@@ -220,7 +221,7 @@ public:
|
||||
summoned->AI()->AttackStart(me);
|
||||
}
|
||||
|
||||
void sQuestAccept(Player* player, Quest const* quest) override
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_VORSHA)
|
||||
{
|
||||
@@ -327,20 +328,30 @@ class go_naga_brazier : public GameObjectScript
|
||||
public:
|
||||
go_naga_brazier() : GameObjectScript("go_naga_brazier") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
struct go_naga_brazierAI : public GameObjectAI
|
||||
{
|
||||
if (Creature* creature = GetClosestCreatureWithEntry(go, NPC_MUGLASH, INTERACTION_DISTANCE*2))
|
||||
go_naga_brazierAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool GossipHello(Player* /*player*/, bool /*reportUse*/) override
|
||||
{
|
||||
if (npc_muglash::npc_muglashAI* pEscortAI = CAST_AI(npc_muglash::npc_muglashAI, creature->AI()))
|
||||
if (Creature* creature = GetClosestCreatureWithEntry(me, NPC_MUGLASH, INTERACTION_DISTANCE * 2))
|
||||
{
|
||||
creature->AI()->Talk(SAY_MUG_BRAZIER_WAIT);
|
||||
if (npc_muglash::npc_muglashAI* pEscortAI = CAST_AI(npc_muglash::npc_muglashAI, creature->AI()))
|
||||
{
|
||||
creature->AI()->Talk(SAY_MUG_BRAZIER_WAIT);
|
||||
|
||||
pEscortAI->_isBrazierExtinguished = true;
|
||||
return false;
|
||||
pEscortAI->_isBrazierExtinguished = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_naga_brazierAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ EndContentData */
|
||||
#include "CellImpl.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
/*######
|
||||
## npc_draenei_survivor
|
||||
@@ -228,11 +229,12 @@ public:
|
||||
Talk(ATTACK_YELL, who);
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
me->SetFaction(FACTION_MONSTER);
|
||||
me->Attack(player, true);
|
||||
return false;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@@ -358,7 +360,7 @@ public:
|
||||
Talk(SAY_AGGRO, who);
|
||||
}
|
||||
|
||||
void sQuestAccept(Player* player, Quest const* quest) override
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_A_CRY_FOR_HELP)
|
||||
{
|
||||
@@ -627,23 +629,33 @@ enum RavegerCage
|
||||
|
||||
class go_ravager_cage : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_ravager_cage() : GameObjectScript("go_ravager_cage") { }
|
||||
public:
|
||||
go_ravager_cage() : GameObjectScript("go_ravager_cage") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go) override
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
if (player->GetQuestStatus(QUEST_STRENGTH_ONE) == QUEST_STATUS_INCOMPLETE)
|
||||
struct go_ravager_cageAI : public GameObjectAI
|
||||
{
|
||||
if (Creature* ravager = go->FindNearestCreature(NPC_DEATH_RAVAGER, 5.0f, true))
|
||||
go_ravager_cageAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
ravager->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
ravager->SetReactState(REACT_AGGRESSIVE);
|
||||
ravager->AI()->AttackStart(player);
|
||||
me->UseDoorOrButton();
|
||||
if (player->GetQuestStatus(QUEST_STRENGTH_ONE) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (Creature* ravager = me->FindNearestCreature(NPC_DEATH_RAVAGER, 5.0f, true))
|
||||
{
|
||||
ravager->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
ravager->SetReactState(REACT_AGGRESSIVE);
|
||||
ravager->AI()->AttackStart(player);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_ravager_cageAI(go);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class npc_death_ravager : public CreatureScript
|
||||
|
||||
@@ -361,7 +361,7 @@ public:
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void sQuestAccept(Player* player, Quest const* quest) override
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_ENDING_THEIR_WORLD)
|
||||
{
|
||||
|
||||
@@ -102,25 +102,24 @@ public:
|
||||
me->DespawnOrUnsummon(60000);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (player->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) && creature->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
player->TalkedToCreature(creature->GetEntry(), ObjectGuid::Empty);
|
||||
player->RemoveAurasDueToSpell(SPELL_KODO_KOMBO_PLAYER_BUFF);
|
||||
}
|
||||
if (player->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) && me->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
|
||||
{
|
||||
player->TalkedToCreature(me->GetEntry(), ObjectGuid::Empty);
|
||||
player->RemoveAurasDueToSpell(SPELL_KODO_KOMBO_PLAYER_BUFF);
|
||||
}
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_aged_dying_ancient_kodoAI(creature);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
void AddSC_desolace()
|
||||
|
||||
@@ -33,6 +33,7 @@ EndContentData */
|
||||
#include "ScriptedGossip.h"
|
||||
#include "Group.h"
|
||||
#include "Player.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
/*#####
|
||||
# Quest: A Pawn on the Eternal Board
|
||||
@@ -949,60 +950,68 @@ class go_crystalline_tear : public GameObjectScript
|
||||
public:
|
||||
go_crystalline_tear() : GameObjectScript("go_crystalline_tear") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, GameObject* go, Quest const* quest) override
|
||||
struct go_crystalline_tearAI : public GameObjectAI
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_A_PAWN_ON_THE_ETERNAL_BOARD)
|
||||
go_crystalline_tearAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (Creature* trigger = go->FindNearestCreature(ANACHRONOS_QUEST_TRIGGER_INVISIBLE, 100))
|
||||
if (quest->GetQuestId() == QUEST_A_PAWN_ON_THE_ETERNAL_BOARD)
|
||||
{
|
||||
Unit* Merithra = trigger->SummonCreature(NPC_MERITHRA_OF_THE_DREAM, -8034.535f, 1535.14f, 2.61f, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
|
||||
Unit* Caelestrasz = trigger->SummonCreature(NPC_CAELESTRASZ, -8032.767f, 1533.148f, 2.61f, 1.5f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
|
||||
Unit* Arygos = trigger->SummonCreature(NPC_ARYGOS, -8034.52f, 1537.843f, 2.61f, 5.7f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
|
||||
/* Unit* Fandral = */ trigger->SummonCreature(NPC_FANDRAL_STAGHELM, -8028.462f, 1535.843f, 2.61f, 3.141592f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
|
||||
Creature* Anachronos = trigger->SummonCreature(NPC_ANACHRONOS, -8028.75f, 1538.795f, 2.61f, 4, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
|
||||
|
||||
if (Merithra)
|
||||
if (Creature* trigger = me->FindNearestCreature(ANACHRONOS_QUEST_TRIGGER_INVISIBLE, 100))
|
||||
{
|
||||
Merithra->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
Merithra->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
Merithra->SetUInt32Value(UNIT_FIELD_DISPLAYID, MERITHRA_NIGHT_ELF_FORM);
|
||||
Merithra->SetFaction(FACTION_FRIENDLY);
|
||||
}
|
||||
Unit* Merithra = trigger->SummonCreature(NPC_MERITHRA_OF_THE_DREAM, -8034.535f, 1535.14f, 2.61f, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
|
||||
Unit* Caelestrasz = trigger->SummonCreature(NPC_CAELESTRASZ, -8032.767f, 1533.148f, 2.61f, 1.5f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
|
||||
Unit* Arygos = trigger->SummonCreature(NPC_ARYGOS, -8034.52f, 1537.843f, 2.61f, 5.7f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
|
||||
/* Unit* Fandral = */ trigger->SummonCreature(NPC_FANDRAL_STAGHELM, -8028.462f, 1535.843f, 2.61f, 3.141592f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
|
||||
Creature* Anachronos = trigger->SummonCreature(NPC_ANACHRONOS, -8028.75f, 1538.795f, 2.61f, 4, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
|
||||
|
||||
if (Caelestrasz)
|
||||
{
|
||||
Caelestrasz->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
Caelestrasz->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
Caelestrasz->SetUInt32Value(UNIT_FIELD_DISPLAYID, CAELESTRASZ_NIGHT_ELF_FORM);
|
||||
Caelestrasz->SetFaction(FACTION_FRIENDLY);
|
||||
}
|
||||
|
||||
if (Arygos)
|
||||
{
|
||||
Arygos->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
Arygos->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
Arygos->SetUInt32Value(UNIT_FIELD_DISPLAYID, ARYGOS_GNOME_FORM);
|
||||
Arygos->SetFaction(FACTION_FRIENDLY);
|
||||
}
|
||||
|
||||
if (Anachronos)
|
||||
{
|
||||
if (npc_anachronos_the_ancient::npc_anachronos_the_ancientAI* anachronosAI = CAST_AI(npc_anachronos_the_ancient::npc_anachronos_the_ancientAI, Anachronos->AI()))
|
||||
anachronosAI->PlayerGUID = player->GetGUID();
|
||||
|
||||
if (npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI* triggerAI = CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, trigger->AI()))
|
||||
if (Merithra)
|
||||
{
|
||||
triggerAI->Failed = false;
|
||||
triggerAI->PlayerGUID = player->GetGUID();
|
||||
triggerAI->EventStarted = true;
|
||||
triggerAI->Announced = true;
|
||||
Merithra->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
Merithra->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
Merithra->SetUInt32Value(UNIT_FIELD_DISPLAYID, MERITHRA_NIGHT_ELF_FORM);
|
||||
Merithra->SetFaction(FACTION_FRIENDLY);
|
||||
}
|
||||
|
||||
if (Caelestrasz)
|
||||
{
|
||||
Caelestrasz->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
Caelestrasz->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
Caelestrasz->SetUInt32Value(UNIT_FIELD_DISPLAYID, CAELESTRASZ_NIGHT_ELF_FORM);
|
||||
Caelestrasz->SetFaction(FACTION_FRIENDLY);
|
||||
}
|
||||
|
||||
if (Arygos)
|
||||
{
|
||||
Arygos->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
Arygos->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
Arygos->SetUInt32Value(UNIT_FIELD_DISPLAYID, ARYGOS_GNOME_FORM);
|
||||
Arygos->SetFaction(FACTION_FRIENDLY);
|
||||
}
|
||||
|
||||
if (Anachronos)
|
||||
{
|
||||
if (npc_anachronos_the_ancient::npc_anachronos_the_ancientAI* anachronosAI = CAST_AI(npc_anachronos_the_ancient::npc_anachronos_the_ancientAI, Anachronos->AI()))
|
||||
anachronosAI->PlayerGUID = player->GetGUID();
|
||||
|
||||
if (npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI* triggerAI = CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, trigger->AI()))
|
||||
{
|
||||
triggerAI->Failed = false;
|
||||
triggerAI->PlayerGUID = player->GetGUID();
|
||||
triggerAI->EventStarted = true;
|
||||
triggerAI->Announced = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_crystalline_tearAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
/*###
|
||||
@@ -1117,241 +1126,251 @@ class go_wind_stone : public GameObjectScript
|
||||
public:
|
||||
go_wind_stone() : GameObjectScript("go_wind_stone") { }
|
||||
|
||||
private:
|
||||
uint8 GetPlayerRank(Player* player) // For random summoning
|
||||
struct go_wind_stoneAI : public GameObjectAI
|
||||
{
|
||||
bool setAura = player->HasAura(AURA_TWILIGHT_SET);
|
||||
bool medallionAura = player->HasAura(AURA_MEDALLION);
|
||||
bool ringAura = player->HasAura(AURA_RING);
|
||||
go_wind_stoneAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
if (setAura && medallionAura && ringAura)
|
||||
return 3;
|
||||
else if (setAura && medallionAura)
|
||||
return 2;
|
||||
else if (setAura)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8 GetItems(Player* player, WS type)
|
||||
{
|
||||
uint8 result = 0x0;
|
||||
|
||||
switch (type)
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
case TEMPLAR:
|
||||
{
|
||||
if (player->HasItemCount(ITEM_TEMPLAR_FIRE))
|
||||
result |= FIRE;
|
||||
if (player->HasItemCount(ITEM_TEMPLAR_WATER))
|
||||
result |= WATER;
|
||||
if (player->HasItemCount(ITEM_TEMPLAR_EARTH))
|
||||
result |= EARTH;
|
||||
if (player->HasItemCount(ITEM_TEMPLAR_AIR))
|
||||
result |= AIR;
|
||||
break;
|
||||
}
|
||||
case DUKE:
|
||||
{
|
||||
if (player->HasItemCount(ITEM_DUKE_FIRE))
|
||||
result |= FIRE;
|
||||
if (player->HasItemCount(ITEM_DUKE_WATER))
|
||||
result |= WATER;
|
||||
if (player->HasItemCount(ITEM_DUKE_EARTH))
|
||||
result |= EARTH;
|
||||
if (player->HasItemCount(ITEM_DUKE_AIR))
|
||||
result |= AIR;
|
||||
break;
|
||||
}
|
||||
case ROYAL:
|
||||
{
|
||||
if (player->HasItemCount(ITEM_ROYAL_FIRE))
|
||||
result |= FIRE;
|
||||
if (player->HasItemCount(ITEM_ROYAL_WATER))
|
||||
result |= WATER;
|
||||
if (player->HasItemCount(ITEM_ROYAL_EARTH))
|
||||
result |= EARTH;
|
||||
if (player->HasItemCount(ITEM_ROYAL_AIR))
|
||||
result |= AIR;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
uint8 rank = GetPlayerRank(player);
|
||||
|
||||
void SummonNPC(GameObject* go, Player* player, uint32 npc, uint32 spell)
|
||||
{
|
||||
go->CastSpell(player, spell);
|
||||
TempSummon* summons = go->SummonCreature(npc, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), player->GetOrientation() - float(M_PI), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 10 * 60 * 1000);
|
||||
summons->CastSpell(summons, SPELL_SPAWN_IN, false);
|
||||
switch (summons->GetEntry())
|
||||
{
|
||||
case NPC_TEMPLAR_FIRE:
|
||||
case NPC_TEMPLAR_WATER:
|
||||
case NPC_TEMPLAR_AIR:
|
||||
case NPC_TEMPLAR_EARTH:
|
||||
summons->AI()->Talk(SAY_TEMPLAR_AGGRO, player);
|
||||
break;
|
||||
|
||||
case NPC_DUKE_FIRE:
|
||||
case NPC_DUKE_WATER:
|
||||
case NPC_DUKE_EARTH:
|
||||
case NPC_DUKE_AIR:
|
||||
summons->AI()->Talk(SAY_DUKE_AGGRO, player);
|
||||
break;
|
||||
case NPC_ROYAL_FIRE:
|
||||
case NPC_ROYAL_AIR:
|
||||
case NPC_ROYAL_EARTH:
|
||||
case NPC_ROYAL_WATER:
|
||||
summons->AI()->Talk(YELL_ROYAL_AGGRO, player);
|
||||
break;
|
||||
}
|
||||
summons->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
summons->SendMeleeAttackStart(player);
|
||||
summons->CombatStart(player);
|
||||
}
|
||||
|
||||
public:
|
||||
bool OnGossipHello(Player* player, GameObject* go) override
|
||||
{
|
||||
uint8 rank = GetPlayerRank(player);
|
||||
|
||||
uint32 gossipId = go->GetGOInfo()->GetGossipMenuId();
|
||||
switch (gossipId)
|
||||
{
|
||||
case GOSSIP_ID_LESSER_WS:
|
||||
uint32 gossipId = me->GetGOInfo()->GetGossipMenuId();
|
||||
switch (gossipId)
|
||||
{
|
||||
if (rank >= 1) // 1 or 2 or 3
|
||||
AddGossipItemFor(player, GOSSIP_ID_LESSER_WS, OPTION_ID_WS_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
else
|
||||
case GOSSIP_ID_LESSER_WS:
|
||||
{
|
||||
go->CastSpell(player, SPELL_PUNISHMENT);
|
||||
if (rank >= 1) // 1 or 2 or 3
|
||||
AddGossipItemFor(player, GOSSIP_ID_LESSER_WS, OPTION_ID_WS_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
else
|
||||
{
|
||||
me->CastSpell(player, SPELL_PUNISHMENT);
|
||||
break;
|
||||
}
|
||||
|
||||
uint8 item = GetItems(player, TEMPLAR);
|
||||
if (item & FIRE)
|
||||
AddGossipItemFor(player, GOSSIP_ID_LESSER_WS, OPTION_ID_1_CRIMSON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
if (item & WATER)
|
||||
AddGossipItemFor(player, GOSSIP_ID_LESSER_WS, OPTION_ID_2_AZURE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
if (item & EARTH)
|
||||
AddGossipItemFor(player, GOSSIP_ID_LESSER_WS, OPTION_ID_3_EARTHEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
if (item & AIR)
|
||||
AddGossipItemFor(player, GOSSIP_ID_LESSER_WS, OPTION_ID_4_HOARY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
||||
break;
|
||||
}
|
||||
|
||||
uint8 item = GetItems(player, TEMPLAR);
|
||||
if (item & FIRE)
|
||||
AddGossipItemFor(player, GOSSIP_ID_LESSER_WS, OPTION_ID_1_CRIMSON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
if (item & WATER)
|
||||
AddGossipItemFor(player, GOSSIP_ID_LESSER_WS, OPTION_ID_2_AZURE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
if (item & EARTH)
|
||||
AddGossipItemFor(player, GOSSIP_ID_LESSER_WS, OPTION_ID_3_EARTHEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
if (item & AIR)
|
||||
AddGossipItemFor(player, GOSSIP_ID_LESSER_WS, OPTION_ID_4_HOARY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
||||
break;
|
||||
}
|
||||
case GOSSIP_ID_WIND_STONE:
|
||||
{
|
||||
if (rank >= 2) // 2 or 3
|
||||
AddGossipItemFor(player, GOSSIP_ID_WIND_STONE, OPTION_ID_WS_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
|
||||
else
|
||||
case GOSSIP_ID_WIND_STONE:
|
||||
{
|
||||
go->CastSpell(player, SPELL_PUNISHMENT);
|
||||
if (rank >= 2) // 2 or 3
|
||||
AddGossipItemFor(player, GOSSIP_ID_WIND_STONE, OPTION_ID_WS_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
|
||||
else
|
||||
{
|
||||
me->CastSpell(player, SPELL_PUNISHMENT);
|
||||
break;
|
||||
}
|
||||
|
||||
uint8 item = GetItems(player, DUKE);
|
||||
if (item & FIRE)
|
||||
AddGossipItemFor(player, GOSSIP_ID_WIND_STONE, OPTION_ID_1_CYNDERS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
|
||||
if (item & WATER)
|
||||
AddGossipItemFor(player, GOSSIP_ID_WIND_STONE, OPTION_ID_2_FATHOMS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
|
||||
if (item & EARTH)
|
||||
AddGossipItemFor(player, GOSSIP_ID_WIND_STONE, OPTION_ID_3_SHARDS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
|
||||
if (item & AIR)
|
||||
AddGossipItemFor(player, GOSSIP_ID_WIND_STONE, OPTION_ID_4_ZEPHYRS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
|
||||
break;
|
||||
}
|
||||
|
||||
uint8 item = GetItems(player, DUKE);
|
||||
if (item & FIRE)
|
||||
AddGossipItemFor(player, GOSSIP_ID_WIND_STONE, OPTION_ID_1_CYNDERS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
|
||||
if (item & WATER)
|
||||
AddGossipItemFor(player, GOSSIP_ID_WIND_STONE, OPTION_ID_2_FATHOMS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
|
||||
if (item & EARTH)
|
||||
AddGossipItemFor(player, GOSSIP_ID_WIND_STONE, OPTION_ID_3_SHARDS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
|
||||
if (item & AIR)
|
||||
AddGossipItemFor(player, GOSSIP_ID_WIND_STONE, OPTION_ID_4_ZEPHYRS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
|
||||
break;
|
||||
}
|
||||
case GOSSIP_ID_GREATER_WS:
|
||||
{
|
||||
if (rank == 3) // 3
|
||||
AddGossipItemFor(player, GOSSIP_ID_GREATER_WS, OPTION_ID_WS_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
|
||||
else
|
||||
case GOSSIP_ID_GREATER_WS:
|
||||
{
|
||||
go->CastSpell(player, SPELL_PUNISHMENT);
|
||||
if (rank == 3) // 3
|
||||
AddGossipItemFor(player, GOSSIP_ID_GREATER_WS, OPTION_ID_WS_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
|
||||
else
|
||||
{
|
||||
me->CastSpell(player, SPELL_PUNISHMENT);
|
||||
break;
|
||||
}
|
||||
|
||||
uint8 item = GetItems(player, ROYAL);
|
||||
if (item & FIRE)
|
||||
AddGossipItemFor(player, GOSSIP_ID_GREATER_WS, OPTION_ID_1_SKALDRENOX, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
|
||||
if (item & WATER)
|
||||
AddGossipItemFor(player, GOSSIP_ID_GREATER_WS, OPTION_ID_2_SKWOL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
|
||||
if (item & EARTH)
|
||||
AddGossipItemFor(player, GOSSIP_ID_GREATER_WS, OPTION_ID_3_KAZUM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
|
||||
if (item & AIR)
|
||||
AddGossipItemFor(player, GOSSIP_ID_GREATER_WS, OPTION_ID_4_WHIRLAXIS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
|
||||
break;
|
||||
}
|
||||
|
||||
uint8 item = GetItems(player, ROYAL);
|
||||
if (item & FIRE)
|
||||
AddGossipItemFor(player, GOSSIP_ID_GREATER_WS, OPTION_ID_1_SKALDRENOX, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
|
||||
if (item & WATER)
|
||||
AddGossipItemFor(player, GOSSIP_ID_GREATER_WS, OPTION_ID_2_SKWOL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
|
||||
if (item & EARTH)
|
||||
AddGossipItemFor(player, GOSSIP_ID_GREATER_WS, OPTION_ID_3_KAZUM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
|
||||
if (item & AIR)
|
||||
AddGossipItemFor(player, GOSSIP_ID_GREATER_WS, OPTION_ID_4_WHIRLAXIS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(gossipId, me), me->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(gossipId, go), go->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
|
||||
switch (action)
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
SummonNPC(go, player, RAND(NPC_TEMPLAR_WATER, NPC_TEMPLAR_FIRE, NPC_TEMPLAR_EARTH, NPC_TEMPLAR_AIR), SPELL_TEMPLAR_RANDOM);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
SummonNPC(go, player, NPC_TEMPLAR_FIRE, SPELL_TEMPLAR_FIRE);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
SummonNPC(go, player, NPC_TEMPLAR_WATER, SPELL_TEMPLAR_WATER);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 4:
|
||||
SummonNPC(go, player, NPC_TEMPLAR_EARTH, SPELL_TEMPLAR_EARTH);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 5:
|
||||
SummonNPC(go, player, NPC_TEMPLAR_AIR, SPELL_TEMPLAR_AIR);
|
||||
break;
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
|
||||
case GOSSIP_ACTION_INFO_DEF + 6:
|
||||
SummonNPC(go, player, RAND(NPC_DUKE_FIRE, NPC_DUKE_WATER, NPC_DUKE_EARTH, NPC_DUKE_AIR), SPELL_DUKE_RANDOM);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 7:
|
||||
SummonNPC(go, player, NPC_DUKE_FIRE, SPELL_DUKE_FIRE);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 8:
|
||||
SummonNPC(go, player, NPC_DUKE_WATER, SPELL_DUKE_WATER);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 9:
|
||||
SummonNPC(go, player, NPC_DUKE_EARTH, SPELL_DUKE_EARTH);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 10:
|
||||
SummonNPC(go, player, NPC_DUKE_AIR, SPELL_DUKE_AIR);
|
||||
break;
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
SummonNPC(me, player, RAND(NPC_TEMPLAR_WATER, NPC_TEMPLAR_FIRE, NPC_TEMPLAR_EARTH, NPC_TEMPLAR_AIR), SPELL_TEMPLAR_RANDOM);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
SummonNPC(me, player, NPC_TEMPLAR_FIRE, SPELL_TEMPLAR_FIRE);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
SummonNPC(me, player, NPC_TEMPLAR_WATER, SPELL_TEMPLAR_WATER);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 4:
|
||||
SummonNPC(me, player, NPC_TEMPLAR_EARTH, SPELL_TEMPLAR_EARTH);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 5:
|
||||
SummonNPC(me, player, NPC_TEMPLAR_AIR, SPELL_TEMPLAR_AIR);
|
||||
break;
|
||||
|
||||
case GOSSIP_ACTION_INFO_DEF + 11:
|
||||
SummonNPC(go, player, RAND(NPC_ROYAL_FIRE, NPC_ROYAL_AIR, NPC_ROYAL_EARTH, NPC_ROYAL_WATER), SPELL_ROYAL_RANDOM);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 12:
|
||||
SummonNPC(go, player, NPC_ROYAL_FIRE, SPELL_ROYAL_FIRE);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 13:
|
||||
SummonNPC(go, player, NPC_ROYAL_WATER, SPELL_ROYAL_WATER);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 14:
|
||||
SummonNPC(go, player, NPC_ROYAL_EARTH, SPELL_ROYAL_EARTH);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 15:
|
||||
SummonNPC(go, player, NPC_ROYAL_AIR, SPELL_ROYAL_AIR);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 6:
|
||||
SummonNPC(me, player, RAND(NPC_DUKE_FIRE, NPC_DUKE_WATER, NPC_DUKE_EARTH, NPC_DUKE_AIR), SPELL_DUKE_RANDOM);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 7:
|
||||
SummonNPC(me, player, NPC_DUKE_FIRE, SPELL_DUKE_FIRE);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 8:
|
||||
SummonNPC(me, player, NPC_DUKE_WATER, SPELL_DUKE_WATER);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 9:
|
||||
SummonNPC(me, player, NPC_DUKE_EARTH, SPELL_DUKE_EARTH);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 10:
|
||||
SummonNPC(me, player, NPC_DUKE_AIR, SPELL_DUKE_AIR);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 11:
|
||||
SummonNPC(me, player, RAND(NPC_ROYAL_FIRE, NPC_ROYAL_AIR, NPC_ROYAL_EARTH, NPC_ROYAL_WATER), SPELL_ROYAL_RANDOM);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 12:
|
||||
SummonNPC(me, player, NPC_ROYAL_FIRE, SPELL_ROYAL_FIRE);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 13:
|
||||
SummonNPC(me, player, NPC_ROYAL_WATER, SPELL_ROYAL_WATER);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 14:
|
||||
SummonNPC(me, player, NPC_ROYAL_EARTH, SPELL_ROYAL_EARTH);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 15:
|
||||
SummonNPC(me, player, NPC_ROYAL_AIR, SPELL_ROYAL_AIR);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
private:
|
||||
uint8 GetPlayerRank(Player* player) const // For random summoning
|
||||
{
|
||||
bool setAura = player->HasAura(AURA_TWILIGHT_SET);
|
||||
bool medallionAura = player->HasAura(AURA_MEDALLION);
|
||||
bool ringAura = player->HasAura(AURA_RING);
|
||||
|
||||
if (setAura && medallionAura && ringAura)
|
||||
return 3;
|
||||
else if (setAura && medallionAura)
|
||||
return 2;
|
||||
else if (setAura)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8 GetItems(Player* player, WS type) const
|
||||
{
|
||||
uint8 result = 0x0;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case TEMPLAR:
|
||||
{
|
||||
if (player->HasItemCount(ITEM_TEMPLAR_FIRE))
|
||||
result |= FIRE;
|
||||
if (player->HasItemCount(ITEM_TEMPLAR_WATER))
|
||||
result |= WATER;
|
||||
if (player->HasItemCount(ITEM_TEMPLAR_EARTH))
|
||||
result |= EARTH;
|
||||
if (player->HasItemCount(ITEM_TEMPLAR_AIR))
|
||||
result |= AIR;
|
||||
break;
|
||||
}
|
||||
case DUKE:
|
||||
{
|
||||
if (player->HasItemCount(ITEM_DUKE_FIRE))
|
||||
result |= FIRE;
|
||||
if (player->HasItemCount(ITEM_DUKE_WATER))
|
||||
result |= WATER;
|
||||
if (player->HasItemCount(ITEM_DUKE_EARTH))
|
||||
result |= EARTH;
|
||||
if (player->HasItemCount(ITEM_DUKE_AIR))
|
||||
result |= AIR;
|
||||
break;
|
||||
}
|
||||
case ROYAL:
|
||||
{
|
||||
if (player->HasItemCount(ITEM_ROYAL_FIRE))
|
||||
result |= FIRE;
|
||||
if (player->HasItemCount(ITEM_ROYAL_WATER))
|
||||
result |= WATER;
|
||||
if (player->HasItemCount(ITEM_ROYAL_EARTH))
|
||||
result |= EARTH;
|
||||
if (player->HasItemCount(ITEM_ROYAL_AIR))
|
||||
result |= AIR;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void SummonNPC(GameObject* go, Player* player, uint32 npc, uint32 spell) const
|
||||
{
|
||||
go->CastSpell(player, spell);
|
||||
TempSummon* summons = go->SummonCreature(npc, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), player->GetOrientation() - float(M_PI), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 10 * 60 * 1000);
|
||||
summons->CastSpell(summons, SPELL_SPAWN_IN, false);
|
||||
switch (summons->GetEntry())
|
||||
{
|
||||
case NPC_TEMPLAR_FIRE:
|
||||
case NPC_TEMPLAR_WATER:
|
||||
case NPC_TEMPLAR_AIR:
|
||||
case NPC_TEMPLAR_EARTH:
|
||||
summons->AI()->Talk(SAY_TEMPLAR_AGGRO, player);
|
||||
break;
|
||||
|
||||
case NPC_DUKE_FIRE:
|
||||
case NPC_DUKE_WATER:
|
||||
case NPC_DUKE_EARTH:
|
||||
case NPC_DUKE_AIR:
|
||||
summons->AI()->Talk(SAY_DUKE_AGGRO, player);
|
||||
break;
|
||||
case NPC_ROYAL_FIRE:
|
||||
case NPC_ROYAL_AIR:
|
||||
case NPC_ROYAL_EARTH:
|
||||
case NPC_ROYAL_WATER:
|
||||
summons->AI()->Talk(YELL_ROYAL_AGGRO, player);
|
||||
break;
|
||||
}
|
||||
summons->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
summons->SendMeleeAttackStart(player);
|
||||
summons->CombatStart(player);
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_wind_stoneAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -194,22 +194,6 @@ class npc_OOX17 : public CreatureScript
|
||||
public:
|
||||
npc_OOX17() : CreatureScript("npc_OOX17") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == Q_OOX17)
|
||||
{
|
||||
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
|
||||
creature->SetFullHealth();
|
||||
creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
creature->AI()->Talk(SAY_OOX_START);
|
||||
|
||||
if (npc_escortAI* pEscortAI = CAST_AI(npc_OOX17::npc_OOX17AI, creature->AI()))
|
||||
pEscortAI->Start(true, false, player->GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_OOX17AI(creature);
|
||||
@@ -219,6 +203,19 @@ public:
|
||||
{
|
||||
npc_OOX17AI(Creature* creature) : npc_escortAI(creature) { }
|
||||
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == Q_OOX17)
|
||||
{
|
||||
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
|
||||
me->SetFullHealth();
|
||||
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
Talk(SAY_OOX_START);
|
||||
Start(true, false, player->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId) override
|
||||
{
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
@@ -286,149 +283,143 @@ Position const ToWaterLoc = {-7032.664551f, -4906.199219f, -1.606446f, 0.0f};
|
||||
|
||||
class npc_tooga : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_tooga() : CreatureScript("npc_tooga") { }
|
||||
public:
|
||||
npc_tooga() : CreatureScript("npc_tooga") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_TOOGA)
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
if (npc_toogaAI* pToogaAI = CAST_AI(npc_tooga::npc_toogaAI, creature->AI()))
|
||||
pToogaAI->StartFollow(player, FACTION_TOOG_ESCORTEE, quest);
|
||||
return new npc_toogaAI(creature);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_toogaAI(creature);
|
||||
}
|
||||
|
||||
struct npc_toogaAI : public FollowerAI
|
||||
{
|
||||
npc_toogaAI(Creature* creature) : FollowerAI(creature)
|
||||
struct npc_toogaAI : public FollowerAI
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
CheckSpeechTimer = 2500;
|
||||
PostEventTimer = 1000;
|
||||
PhasePostEvent = 0;
|
||||
|
||||
TortaGUID.Clear();
|
||||
}
|
||||
|
||||
uint32 CheckSpeechTimer;
|
||||
uint32 PostEventTimer;
|
||||
uint32 PhasePostEvent;
|
||||
|
||||
ObjectGuid TortaGUID;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
{
|
||||
FollowerAI::MoveInLineOfSight(who);
|
||||
|
||||
if (!me->GetVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE | STATE_FOLLOW_POSTEVENT) && who->GetEntry() == NPC_TORTA)
|
||||
npc_toogaAI(Creature* creature) : FollowerAI(creature)
|
||||
{
|
||||
if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE))
|
||||
{
|
||||
Player* player = GetLeaderForFollower();
|
||||
if (player && player->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE)
|
||||
player->GroupEventHappens(QUEST_TOOGA, me);
|
||||
|
||||
TortaGUID = who->GetGUID();
|
||||
SetFollowComplete(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 MotionType, uint32 PointId) override
|
||||
{
|
||||
FollowerAI::MovementInform(MotionType, PointId);
|
||||
|
||||
if (MotionType != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (PointId == POINT_ID_TO_WATER)
|
||||
SetFollowComplete();
|
||||
}
|
||||
|
||||
void UpdateFollowerAI(uint32 Diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
{
|
||||
//we are doing the post-event, or...
|
||||
if (HasFollowState(STATE_FOLLOW_POSTEVENT))
|
||||
{
|
||||
if (PostEventTimer <= Diff)
|
||||
{
|
||||
PostEventTimer = 5000;
|
||||
|
||||
Creature* torta = ObjectAccessor::GetCreature(*me, TortaGUID);
|
||||
if (!torta || !torta->IsAlive())
|
||||
{
|
||||
//something happened, so just complete
|
||||
SetFollowComplete();
|
||||
return;
|
||||
}
|
||||
|
||||
switch (PhasePostEvent)
|
||||
{
|
||||
case 1:
|
||||
Talk(SAY_TOOG_POST_1);
|
||||
break;
|
||||
case 2:
|
||||
torta->AI()->Talk(SAY_TORT_POST_2);
|
||||
break;
|
||||
case 3:
|
||||
Talk(SAY_TOOG_POST_3);
|
||||
break;
|
||||
case 4:
|
||||
torta->AI()->Talk(SAY_TORT_POST_4);
|
||||
break;
|
||||
case 5:
|
||||
Talk(SAY_TOOG_POST_5);
|
||||
break;
|
||||
case 6:
|
||||
torta->AI()->Talk(SAY_TORT_POST_6);
|
||||
me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, ToWaterLoc);
|
||||
break;
|
||||
}
|
||||
|
||||
++PhasePostEvent;
|
||||
}
|
||||
else
|
||||
PostEventTimer -= Diff;
|
||||
}
|
||||
//...we are doing regular speech check
|
||||
else if (HasFollowState(STATE_FOLLOW_INPROGRESS))
|
||||
{
|
||||
if (CheckSpeechTimer <= Diff)
|
||||
{
|
||||
CheckSpeechTimer = 5000;
|
||||
|
||||
if (urand(0, 9) > 8)
|
||||
Talk(SAY_TOOG_WORRIED);
|
||||
}
|
||||
else
|
||||
CheckSpeechTimer -= Diff;
|
||||
}
|
||||
|
||||
return;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
void Initialize()
|
||||
{
|
||||
CheckSpeechTimer = 2500;
|
||||
PostEventTimer = 1000;
|
||||
PhasePostEvent = 0;
|
||||
|
||||
TortaGUID.Clear();
|
||||
}
|
||||
|
||||
uint32 CheckSpeechTimer;
|
||||
uint32 PostEventTimer;
|
||||
uint32 PhasePostEvent;
|
||||
|
||||
ObjectGuid TortaGUID;
|
||||
|
||||
void QuestAccept(Player* player, const Quest* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_TOOGA)
|
||||
StartFollow(player, FACTION_TOOG_ESCORTEE, quest);
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
{
|
||||
FollowerAI::MoveInLineOfSight(who);
|
||||
|
||||
if (!me->GetVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE | STATE_FOLLOW_POSTEVENT) && who->GetEntry() == NPC_TORTA)
|
||||
{
|
||||
if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE))
|
||||
{
|
||||
Player* player = GetLeaderForFollower();
|
||||
if (player && player->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE)
|
||||
player->GroupEventHappens(QUEST_TOOGA, me);
|
||||
|
||||
TortaGUID = who->GetGUID();
|
||||
SetFollowComplete(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 MotionType, uint32 PointId) override
|
||||
{
|
||||
FollowerAI::MovementInform(MotionType, PointId);
|
||||
|
||||
if (MotionType != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (PointId == POINT_ID_TO_WATER)
|
||||
SetFollowComplete();
|
||||
}
|
||||
|
||||
void UpdateFollowerAI(uint32 Diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
{
|
||||
//we are doing the post-event, or...
|
||||
if (HasFollowState(STATE_FOLLOW_POSTEVENT))
|
||||
{
|
||||
if (PostEventTimer <= Diff)
|
||||
{
|
||||
PostEventTimer = 5000;
|
||||
|
||||
Creature* torta = ObjectAccessor::GetCreature(*me, TortaGUID);
|
||||
if (!torta || !torta->IsAlive())
|
||||
{
|
||||
//something happened, so just complete
|
||||
SetFollowComplete();
|
||||
return;
|
||||
}
|
||||
|
||||
switch (PhasePostEvent)
|
||||
{
|
||||
case 1:
|
||||
Talk(SAY_TOOG_POST_1);
|
||||
break;
|
||||
case 2:
|
||||
torta->AI()->Talk(SAY_TORT_POST_2);
|
||||
break;
|
||||
case 3:
|
||||
Talk(SAY_TOOG_POST_3);
|
||||
break;
|
||||
case 4:
|
||||
torta->AI()->Talk(SAY_TORT_POST_4);
|
||||
break;
|
||||
case 5:
|
||||
Talk(SAY_TOOG_POST_5);
|
||||
break;
|
||||
case 6:
|
||||
torta->AI()->Talk(SAY_TORT_POST_6);
|
||||
me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, ToWaterLoc);
|
||||
break;
|
||||
}
|
||||
|
||||
++PhasePostEvent;
|
||||
}
|
||||
else
|
||||
PostEventTimer -= Diff;
|
||||
}
|
||||
//...we are doing regular speech check
|
||||
else if (HasFollowState(STATE_FOLLOW_INPROGRESS))
|
||||
{
|
||||
if (CheckSpeechTimer <= Diff)
|
||||
{
|
||||
CheckSpeechTimer = 5000;
|
||||
|
||||
if (urand(0, 9) > 8)
|
||||
Talk(SAY_TOOG_WORRIED);
|
||||
}
|
||||
else
|
||||
CheckSpeechTimer -= Diff;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_tanaris()
|
||||
|
||||
@@ -55,13 +55,14 @@ class npc_beaten_corpse : public CreatureScript
|
||||
{
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (menuId == GOSSIP_MENU_OPTION_INSPECT_BODY && gossipListId == GOSSIP_OPTION_ID_BEATEN_CORPSE)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
player->TalkedToCreature(me->GetEntry(), me->GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -96,21 +97,6 @@ class npc_gilthares : public CreatureScript
|
||||
public:
|
||||
npc_gilthares() : CreatureScript("npc_gilthares") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_FREE_FROM_HOLD)
|
||||
{
|
||||
creature->SetFaction(FACTION_ESCORTEE);
|
||||
creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
creature->AI()->Talk(SAY_GIL_START, player);
|
||||
|
||||
if (npc_giltharesAI* pEscortAI = CAST_AI(npc_gilthares::npc_giltharesAI, creature->AI()))
|
||||
pEscortAI->Start(false, false, player->GetGUID(), quest);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_giltharesAI(creature);
|
||||
@@ -120,6 +106,19 @@ public:
|
||||
{
|
||||
npc_giltharesAI(Creature* creature) : npc_escortAI(creature) { }
|
||||
|
||||
void QuestAccept(Player* player, const Quest* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_FREE_FROM_HOLD)
|
||||
{
|
||||
me->SetFaction(FACTION_ESCORTEE);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
Talk(SAY_GIL_START, player);
|
||||
|
||||
Start(false, false, player->GetGUID(), quest);
|
||||
}
|
||||
}
|
||||
|
||||
void Reset() override { }
|
||||
|
||||
void WaypointReached(uint32 waypointId) override
|
||||
@@ -646,19 +645,17 @@ public:
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_ESCAPE)
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
creature->SetFaction(FACTION_RATCHET);
|
||||
creature->AI()->Talk(SAY_START);
|
||||
if (npc_escortAI* pEscortAI = CAST_AI(npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI, creature->AI()))
|
||||
pEscortAI->Start(true, false, player->GetGUID());
|
||||
if (quest->GetQuestId() == QUEST_ESCAPE)
|
||||
{
|
||||
me->SetFaction(FACTION_RATCHET);
|
||||
Talk(SAY_START);
|
||||
Start(true, false, player->GetGUID());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
|
||||
@@ -33,6 +33,7 @@ EndContentData */
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "Player.h"
|
||||
#include "WorldSession.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
@@ -258,21 +259,7 @@ class npc_ranshalla : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_ranshalla() : CreatureScript("npc_ranshalla") { }
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_GUARDIANS_ALTAR)
|
||||
{
|
||||
creature->AI()->Talk(SAY_QUEST_START);
|
||||
creature->SetFaction(FACTION_ESCORTEE_A_NEUTRAL_PASSIVE);
|
||||
|
||||
if (npc_ranshallaAI* escortAI = dynamic_cast<npc_ranshallaAI*>(creature->AI()))
|
||||
escortAI->Start(false, false, player->GetGUID(), quest);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_ranshallaAI(creature);
|
||||
@@ -299,6 +286,16 @@ public:
|
||||
ObjectGuid _voiceEluneGUID;
|
||||
ObjectGuid _altarGUID;
|
||||
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_GUARDIANS_ALTAR)
|
||||
{
|
||||
Talk(SAY_QUEST_START);
|
||||
me->SetFaction(FACTION_ESCORTEE_A_NEUTRAL_PASSIVE);
|
||||
Start(false, false, player->GetGUID(), quest);
|
||||
}
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
@@ -565,25 +562,35 @@ public:
|
||||
|
||||
class go_elune_fire : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_elune_fire() : GameObjectScript("go_elune_fire") { }
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
{
|
||||
// Check if we are using the torches or the altar
|
||||
bool isAltar = false;
|
||||
public:
|
||||
go_elune_fire() : GameObjectScript("go_elune_fire") { }
|
||||
|
||||
if (go->GetEntry() == GO_ELUNE_ALTAR)
|
||||
isAltar = true;
|
||||
|
||||
if (Creature* ranshalla = GetClosestCreatureWithEntry(go, NPC_RANSHALLA, 10.0f))
|
||||
struct go_elune_fireAI : public GameObjectAI
|
||||
{
|
||||
if (npc_ranshalla::npc_ranshallaAI* escortAI = dynamic_cast<npc_ranshalla::npc_ranshallaAI*>(ranshalla->AI()))
|
||||
escortAI->DoContinueEscort(isAltar);
|
||||
}
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
go_elune_fireAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
return false;
|
||||
}
|
||||
bool GossipHello(Player* /*player*/, bool /*reportUse*/) override
|
||||
{
|
||||
// Check if we are using the torches or the altar
|
||||
bool isAltar = false;
|
||||
|
||||
if (me->GetEntry() == GO_ELUNE_ALTAR)
|
||||
isAltar = true;
|
||||
|
||||
if (Creature* ranshalla = GetClosestCreatureWithEntry(me, NPC_RANSHALLA, 10.0f))
|
||||
{
|
||||
if (npc_ranshalla::npc_ranshallaAI* escortAI = dynamic_cast<npc_ranshalla::npc_ranshallaAI*>(ranshalla->AI()))
|
||||
escortAI->DoContinueEscort(isAltar);
|
||||
}
|
||||
me->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_elune_fireAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_winterspring()
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "SpellScript.h"
|
||||
#include "Player.h"
|
||||
#include "ahnkahet.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
@@ -380,33 +381,43 @@ class go_prince_taldaram_sphere : public GameObjectScript
|
||||
public:
|
||||
go_prince_taldaram_sphere() : GameObjectScript("go_prince_taldaram_sphere") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
struct go_prince_taldaram_sphereAI : public GameObjectAI
|
||||
{
|
||||
InstanceScript* instance = go->GetInstanceScript();
|
||||
if (!instance)
|
||||
return false;
|
||||
go_prince_taldaram_sphereAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
Creature* PrinceTaldaram = ObjectAccessor::GetCreature(*go, instance->GetGuidData(DATA_PRINCE_TALDARAM));
|
||||
if (PrinceTaldaram && PrinceTaldaram->IsAlive())
|
||||
bool GossipHello(Player* /*player*/, bool /*reportUse*/) override
|
||||
{
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (!instance)
|
||||
return false;
|
||||
|
||||
switch (go->GetEntry())
|
||||
Creature* PrinceTaldaram = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_PRINCE_TALDARAM));
|
||||
if (PrinceTaldaram && PrinceTaldaram->IsAlive())
|
||||
{
|
||||
case GO_SPHERE_1:
|
||||
instance->SetData(DATA_SPHERE_1, IN_PROGRESS);
|
||||
PrinceTaldaram->AI()->Talk(SAY_1);
|
||||
break;
|
||||
case GO_SPHERE_2:
|
||||
instance->SetData(DATA_SPHERE_2, IN_PROGRESS);
|
||||
PrinceTaldaram->AI()->Talk(SAY_1);
|
||||
break;
|
||||
}
|
||||
me->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
me->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
ENSURE_AI(boss_prince_taldaram::boss_prince_taldaramAI, PrinceTaldaram->AI())->CheckSpheres();
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case GO_SPHERE_1:
|
||||
instance->SetData(DATA_SPHERE_1, IN_PROGRESS);
|
||||
PrinceTaldaram->AI()->Talk(SAY_1);
|
||||
break;
|
||||
case GO_SPHERE_2:
|
||||
instance->SetData(DATA_SPHERE_2, IN_PROGRESS);
|
||||
PrinceTaldaram->AI()->Talk(SAY_1);
|
||||
break;
|
||||
}
|
||||
|
||||
ENSURE_AI(boss_prince_taldaram::boss_prince_taldaramAI, PrinceTaldaram->AI())->CheckSpheres();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_prince_taldaram_sphereAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1379,7 +1379,7 @@ class go_twilight_portal : public GameObjectScript
|
||||
if (!_deleted)
|
||||
{
|
||||
_deleted = true;
|
||||
go->Delete();
|
||||
me->Delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+37
-37
@@ -446,49 +446,49 @@ public:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
|
||||
if (instance &&
|
||||
((instance->GetData(BOSS_GRAND_CHAMPIONS) == DONE &&
|
||||
instance->GetData(BOSS_BLACK_KNIGHT) == DONE &&
|
||||
instance->GetData(BOSS_ARGENT_CHALLENGE_E) == DONE) ||
|
||||
instance->GetData(BOSS_ARGENT_CHALLENGE_P) == DONE))
|
||||
return false;
|
||||
|
||||
if (instance &&
|
||||
instance->GetData(BOSS_GRAND_CHAMPIONS) == NOT_STARTED &&
|
||||
instance->GetData(BOSS_ARGENT_CHALLENGE_E) == NOT_STARTED &&
|
||||
instance->GetData(BOSS_ARGENT_CHALLENGE_P) == NOT_STARTED &&
|
||||
instance->GetData(BOSS_BLACK_KNIGHT) == NOT_STARTED)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_START_EVENT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
else
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_START_EVENT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
StartEncounter();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<npc_announcer_toc5AI>(creature);
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
|
||||
if (instance &&
|
||||
((instance->GetData(BOSS_GRAND_CHAMPIONS) == DONE &&
|
||||
instance->GetData(BOSS_BLACK_KNIGHT) == DONE &&
|
||||
instance->GetData(BOSS_ARGENT_CHALLENGE_E) == DONE) ||
|
||||
instance->GetData(BOSS_ARGENT_CHALLENGE_P) == DONE))
|
||||
return false;
|
||||
|
||||
if (instance &&
|
||||
instance->GetData(BOSS_GRAND_CHAMPIONS) == NOT_STARTED &&
|
||||
instance->GetData(BOSS_ARGENT_CHALLENGE_E) == NOT_STARTED &&
|
||||
instance->GetData(BOSS_ARGENT_CHALLENGE_P) == NOT_STARTED &&
|
||||
instance->GetData(BOSS_BLACK_KNIGHT) == NOT_STARTED)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_START_EVENT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
else
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_START_EVENT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
ENSURE_AI(npc_announcer_toc5::npc_announcer_toc5AI, creature->AI())->StartEncounter();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_trial_of_the_champion()
|
||||
|
||||
+8
-8
@@ -514,20 +514,20 @@ class npc_essence_of_twin : public CreatureScript
|
||||
|
||||
return spellReturned;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
player->RemoveAurasDueToSpell(GetData(ESSENCE_REMOVE));
|
||||
player->CastSpell(player, GetData(ESSENCE_APPLY), true);
|
||||
CloseGossipMenuFor(player);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_essence_of_twinAI(creature);
|
||||
};
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
player->RemoveAurasDueToSpell(creature->GetAI()->GetData(ESSENCE_REMOVE));
|
||||
player->CastSpell(player, creature->GetAI()->GetData(ESSENCE_APPLY), true);
|
||||
CloseGossipMenuFor(player);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
struct npc_unleashed_ballAI : public ScriptedAI
|
||||
|
||||
+84
-84
@@ -123,92 +123,92 @@ class npc_announcer_toc10 : public CreatureScript
|
||||
}
|
||||
|
||||
void AttackStart(Unit* /*who*/) override { }
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (!instance)
|
||||
return true;
|
||||
|
||||
char const* _message = "We are ready!";
|
||||
|
||||
if (player->IsInCombat() || instance->IsEncounterInProgress())
|
||||
return true;
|
||||
|
||||
uint8 i = 0;
|
||||
for (; i < NUM_MESSAGES; ++i)
|
||||
{
|
||||
if ((!_GossipMessage[i].state && instance->GetBossState(_GossipMessage[i].encounter) != DONE)
|
||||
|| (_GossipMessage[i].state && instance->GetBossState(_GossipMessage[i].encounter) == DONE))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, _message, GOSSIP_SENDER_MAIN, _GossipMessage[i].id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i >= NUM_MESSAGES)
|
||||
return false;
|
||||
|
||||
SendGossipMenuFor(player, _GossipMessage[i].msgnum, me->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
CloseGossipMenuFor(player);
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (!instance)
|
||||
return true;
|
||||
|
||||
if (instance->GetBossState(BOSS_BEASTS) != DONE)
|
||||
{
|
||||
instance->SetData(TYPE_EVENT, 110);
|
||||
instance->SetData(TYPE_NORTHREND_BEASTS, NOT_STARTED);
|
||||
instance->SetBossState(BOSS_BEASTS, NOT_STARTED);
|
||||
}
|
||||
else if (instance->GetBossState(BOSS_JARAXXUS) != DONE)
|
||||
{
|
||||
// if Jaraxxus is spawned, but the raid wiped
|
||||
if (Creature* jaraxxus = ObjectAccessor::GetCreature(*player, instance->GetGuidData(NPC_JARAXXUS)))
|
||||
{
|
||||
jaraxxus->RemoveAurasDueToSpell(SPELL_JARAXXUS_CHAINS);
|
||||
jaraxxus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
|
||||
jaraxxus->SetReactState(REACT_DEFENSIVE);
|
||||
jaraxxus->SetInCombatWithZone();
|
||||
}
|
||||
else
|
||||
{
|
||||
instance->SetData(TYPE_EVENT, 1010);
|
||||
instance->SetBossState(BOSS_JARAXXUS, NOT_STARTED);
|
||||
}
|
||||
}
|
||||
else if (instance->GetBossState(BOSS_CRUSADERS) != DONE)
|
||||
{
|
||||
if (player->GetTeam() == ALLIANCE)
|
||||
instance->SetData(TYPE_EVENT, 3000);
|
||||
else
|
||||
instance->SetData(TYPE_EVENT, 3001);
|
||||
instance->SetBossState(BOSS_CRUSADERS, NOT_STARTED);
|
||||
}
|
||||
else if (instance->GetBossState(BOSS_VALKIRIES) != DONE)
|
||||
{
|
||||
instance->SetData(TYPE_EVENT, 4000);
|
||||
instance->SetBossState(BOSS_VALKIRIES, NOT_STARTED);
|
||||
}
|
||||
else if (instance->GetBossState(BOSS_LICH_KING) != DONE)
|
||||
{
|
||||
if (me->GetMap()->GetPlayers().getFirst()->GetSource()->GetTeam() == ALLIANCE)
|
||||
instance->SetData(TYPE_EVENT, 4020);
|
||||
else
|
||||
instance->SetData(TYPE_EVENT, 4030);
|
||||
instance->SetBossState(BOSS_LICH_KING, NOT_STARTED);
|
||||
}
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (!instance)
|
||||
return true;
|
||||
|
||||
char const* _message = "We are ready!";
|
||||
|
||||
if (player->IsInCombat() || instance->IsEncounterInProgress())
|
||||
return true;
|
||||
|
||||
uint8 i = 0;
|
||||
for (; i < NUM_MESSAGES; ++i)
|
||||
{
|
||||
if ((!_GossipMessage[i].state && instance->GetBossState(_GossipMessage[i].encounter) != DONE)
|
||||
|| (_GossipMessage[i].state && instance->GetBossState(_GossipMessage[i].encounter) == DONE))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, _message, GOSSIP_SENDER_MAIN, _GossipMessage[i].id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i >= NUM_MESSAGES)
|
||||
return false;
|
||||
|
||||
SendGossipMenuFor(player, _GossipMessage[i].msgnum, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
CloseGossipMenuFor(player);
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (!instance)
|
||||
return true;
|
||||
|
||||
if (instance->GetBossState(BOSS_BEASTS) != DONE)
|
||||
{
|
||||
instance->SetData(TYPE_EVENT, 110);
|
||||
instance->SetData(TYPE_NORTHREND_BEASTS, NOT_STARTED);
|
||||
instance->SetBossState(BOSS_BEASTS, NOT_STARTED);
|
||||
}
|
||||
else if (instance->GetBossState(BOSS_JARAXXUS) != DONE)
|
||||
{
|
||||
// if Jaraxxus is spawned, but the raid wiped
|
||||
if (Creature* jaraxxus = ObjectAccessor::GetCreature(*player, instance->GetGuidData(NPC_JARAXXUS)))
|
||||
{
|
||||
jaraxxus->RemoveAurasDueToSpell(SPELL_JARAXXUS_CHAINS);
|
||||
jaraxxus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
|
||||
jaraxxus->SetReactState(REACT_DEFENSIVE);
|
||||
jaraxxus->SetInCombatWithZone();
|
||||
}
|
||||
else
|
||||
{
|
||||
instance->SetData(TYPE_EVENT, 1010);
|
||||
instance->SetBossState(BOSS_JARAXXUS, NOT_STARTED);
|
||||
}
|
||||
}
|
||||
else if (instance->GetBossState(BOSS_CRUSADERS) != DONE)
|
||||
{
|
||||
if (player->GetTeam() == ALLIANCE)
|
||||
instance->SetData(TYPE_EVENT, 3000);
|
||||
else
|
||||
instance->SetData(TYPE_EVENT, 3001);
|
||||
instance->SetBossState(BOSS_CRUSADERS, NOT_STARTED);
|
||||
}
|
||||
else if (instance->GetBossState(BOSS_VALKIRIES) != DONE)
|
||||
{
|
||||
instance->SetData(TYPE_EVENT, 4000);
|
||||
instance->SetBossState(BOSS_VALKIRIES, NOT_STARTED);
|
||||
}
|
||||
else if (instance->GetBossState(BOSS_LICH_KING) != DONE)
|
||||
{
|
||||
if (creature->GetMap()->GetPlayers().getFirst()->GetSource()->GetTeam() == ALLIANCE)
|
||||
instance->SetData(TYPE_EVENT, 4020);
|
||||
else
|
||||
instance->SetData(TYPE_EVENT, 4030);
|
||||
instance->SetBossState(BOSS_LICH_KING, NOT_STARTED);
|
||||
}
|
||||
creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_announcer_toc10AI(creature);
|
||||
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (menuId == MENU_ID_SYLVANAS && gossipListId == GOSSIP_OPTION_ID)
|
||||
{
|
||||
@@ -109,6 +109,7 @@ public:
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_INTRO_1, 1000);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@@ -196,7 +197,7 @@ public:
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (menuId == MENU_ID_JAINA && gossipListId == GOSSIP_OPTION_ID)
|
||||
{
|
||||
@@ -206,6 +207,7 @@ public:
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_INTRO_1, 1000);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
|
||||
+33
-31
@@ -343,20 +343,6 @@ class npc_jaina_or_sylvanas_intro_hor : public CreatureScript
|
||||
public:
|
||||
npc_jaina_or_sylvanas_intro_hor() : CreatureScript("npc_jaina_or_sylvanas_intro_hor") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
// override default gossip
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
if (instance->GetData(DATA_QUEL_DELAR_EVENT) == IN_PROGRESS || instance->GetData(DATA_QUEL_DELAR_EVENT) == SPECIAL)
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
return true;
|
||||
}
|
||||
|
||||
// load default gossip
|
||||
return false;
|
||||
}
|
||||
|
||||
struct npc_jaina_or_sylvanas_intro_horAI : public ScriptedAI
|
||||
{
|
||||
npc_jaina_or_sylvanas_intro_horAI(Creature* creature) : ScriptedAI(creature)
|
||||
@@ -364,7 +350,21 @@ class npc_jaina_or_sylvanas_intro_hor : public CreatureScript
|
||||
_instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
// override default gossip
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
if (instance->GetData(DATA_QUEL_DELAR_EVENT) == IN_PROGRESS || instance->GetData(DATA_QUEL_DELAR_EVENT) == SPECIAL)
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
return true;
|
||||
}
|
||||
|
||||
// load default gossip
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
|
||||
@@ -383,6 +383,7 @@ class npc_jaina_or_sylvanas_intro_hor : public CreatureScript
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
@@ -790,21 +791,6 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript
|
||||
public:
|
||||
npc_jaina_or_sylvanas_escape_hor() : CreatureScript("npc_jaina_or_sylvanas_escape_hor") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
// override default gossip
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
if (instance->GetBossState(DATA_THE_LICH_KING_ESCAPE) == DONE)
|
||||
{
|
||||
player->PrepareGossipMenu(creature, creature->GetEntry() == NPC_JAINA_ESCAPE ? GOSSIP_MENU_JAINA_FINAL : GOSSIP_MENU_SYLVANAS_FINAL, true);
|
||||
player->SendPreparedGossip(creature);
|
||||
return true;
|
||||
}
|
||||
|
||||
// load default gossip
|
||||
return false;
|
||||
}
|
||||
|
||||
struct npc_jaina_or_sylvanas_escape_horAI : public ScriptedAI
|
||||
{
|
||||
npc_jaina_or_sylvanas_escape_horAI(Creature* creature) : ScriptedAI(creature),
|
||||
@@ -858,7 +844,22 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
// override default gossip
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
if (instance->GetBossState(DATA_THE_LICH_KING_ESCAPE) == DONE)
|
||||
{
|
||||
player->PrepareGossipMenu(me, me->GetEntry() == NPC_JAINA_ESCAPE ? GOSSIP_MENU_JAINA_FINAL : GOSSIP_MENU_SYLVANAS_FINAL, true);
|
||||
player->SendPreparedGossip(me);
|
||||
return true;
|
||||
}
|
||||
|
||||
// load default gossip
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
|
||||
@@ -872,6 +873,7 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void DestroyIceWall()
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "ScriptMgr.h"
|
||||
#include "gundrak.h"
|
||||
#include "EventMap.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
@@ -350,18 +351,28 @@ class go_gundrak_altar : public GameObjectScript
|
||||
public:
|
||||
go_gundrak_altar() : GameObjectScript("go_gundrak_altar") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
struct go_gundrak_altarAI : public GameObjectAI
|
||||
{
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
go_gundrak_altarAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
instance->SetData(DATA_STATUE_ACTIVATE, go->GetEntry());
|
||||
return true;
|
||||
}
|
||||
me->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
me->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
return false;
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
{
|
||||
instance->SetData(DATA_STATUE_ACTIVATE, me->GetEntry());
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_gundrak_altarAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -635,13 +635,14 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
|
||||
_events.Reset();
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 /*gossipListId*/) override
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 /*gossipListId*/) override
|
||||
{
|
||||
if (menuId == GOSSIP_MENU_HIGH_OVERLORD_SAURFANG)
|
||||
{
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
DoAction(ACTION_START_EVENT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
@@ -831,13 +832,14 @@ class npc_muradin_bronzebeard_icc : public CreatureScript
|
||||
_events.Reset();
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 /*gossipListId*/) override
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 /*gossipListId*/) override
|
||||
{
|
||||
if (menuId == GOSSIP_MENU_MURADIN_BRONZEBEARD)
|
||||
{
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
DoAction(ACTION_START_EVENT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
|
||||
@@ -962,7 +962,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/) override
|
||||
bool GossipSelect(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/) override
|
||||
{
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
me->GetTransport()->EnableMovement(true);
|
||||
@@ -972,6 +972,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
|
||||
_events.ScheduleEvent(EVENT_INTRO_SUMMON_SKYBREAKER, 24600, 0, PHASE_INTRO);
|
||||
_events.ScheduleEvent(EVENT_INTRO_H_3, 29600, 0, PHASE_INTRO);
|
||||
_events.ScheduleEvent(EVENT_INTRO_H_4, 39200, 0, PHASE_INTRO);
|
||||
return false;
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* , uint32& damage) override
|
||||
@@ -1230,7 +1231,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/) override
|
||||
bool GossipSelect(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/) override
|
||||
{
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
me->GetTransport()->EnableMovement(true);
|
||||
@@ -1241,6 +1242,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
|
||||
_events.ScheduleEvent(EVENT_INTRO_A_3, 33000, 0, PHASE_INTRO);
|
||||
_events.ScheduleEvent(EVENT_INTRO_A_4, 39000, 0, PHASE_INTRO);
|
||||
_events.ScheduleEvent(EVENT_INTRO_A_5, 45000, 0, PHASE_INTRO);
|
||||
return false;
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* , uint32& damage) override
|
||||
@@ -1395,10 +1397,11 @@ class npc_zafod_boombox : public CreatureScript
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
|
||||
{
|
||||
player->AddItem(ITEM_GOBLIN_ROCKET_PACK, 1);
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
return false;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) override
|
||||
|
||||
@@ -1202,7 +1202,7 @@ class npc_tirion_fordring_tft : public CreatureScript
|
||||
me->LoadEquipment(1); // remove glow on ashbringer
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* /*player*/, uint32 menuId, uint32 gossipListId) override
|
||||
bool GossipSelect(Player* /*player*/, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (me->GetCreatureTemplate()->GossipMenuId == menuId && !gossipListId)
|
||||
{
|
||||
@@ -1211,6 +1211,7 @@ class npc_tirion_fordring_tft : public CreatureScript
|
||||
me->SetWalk(true);
|
||||
me->GetMotionMaster()->MovePoint(POINT_TIRION_INTRO, TirionIntro);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void JustReachedHome() override
|
||||
|
||||
@@ -717,12 +717,22 @@ class npc_alchemist_adrianna : public CreatureScript
|
||||
public:
|
||||
npc_alchemist_adrianna() : CreatureScript("npc_alchemist_adrianna") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
struct npc_alchemist_adriannaAI : public ScriptedAI
|
||||
{
|
||||
if (!creature->FindCurrentSpellBySpellId(SPELL_HARVEST_BLIGHT_SPECIMEN) && !creature->FindCurrentSpellBySpellId(SPELL_HARVEST_BLIGHT_SPECIMEN25))
|
||||
if (player->HasAura(SPELL_ORANGE_BLIGHT_RESIDUE) && player->HasAura(SPELL_GREEN_BLIGHT_RESIDUE))
|
||||
creature->CastSpell(creature, SPELL_HARVEST_BLIGHT_SPECIMEN, false);
|
||||
return false;
|
||||
npc_alchemist_adriannaAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
|
||||
{
|
||||
if (!me->FindCurrentSpellBySpellId(SPELL_HARVEST_BLIGHT_SPECIMEN) && !me->FindCurrentSpellBySpellId(SPELL_HARVEST_BLIGHT_SPECIMEN25))
|
||||
if (player->HasAura(SPELL_ORANGE_BLIGHT_RESIDUE) && player->HasAura(SPELL_GREEN_BLIGHT_RESIDUE))
|
||||
me->CastSpell(me, SPELL_HARVEST_BLIGHT_SPECIMEN, false);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_alchemist_adriannaAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -389,21 +389,21 @@ class go_sapphiron_birth : public GameObjectScript
|
||||
{
|
||||
go_sapphiron_birthAI(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
|
||||
|
||||
void OnStateChanged(uint32 state, Unit* who) override
|
||||
void OnLootStateChanged(uint32 state, Unit* who) override
|
||||
{
|
||||
if (state == GO_ACTIVATED)
|
||||
{
|
||||
if (who)
|
||||
{
|
||||
if (Creature* sapphiron = ObjectAccessor::GetCreature(*go, instance->GetGuidData(DATA_SAPPHIRON)))
|
||||
if (Creature* sapphiron = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SAPPHIRON)))
|
||||
sapphiron->AI()->DoAction(ACTION_BIRTH);
|
||||
instance->SetData(DATA_HAD_SAPPHIRON_BIRTH, 1u);
|
||||
}
|
||||
}
|
||||
else if (state == GO_JUST_DEACTIVATED)
|
||||
{ // prevent ourselves from going back to _READY and resetting the client anim
|
||||
go->SetRespawnTime(0);
|
||||
go->Delete();
|
||||
me->SetRespawnTime(0);
|
||||
me->Delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "Player.h"
|
||||
#include "nexus.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
@@ -224,22 +225,31 @@ class containment_sphere : public GameObjectScript
|
||||
public:
|
||||
containment_sphere() : GameObjectScript("containment_sphere") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
struct containment_sphereAI : public GameObjectAI
|
||||
{
|
||||
InstanceScript* instance = go->GetInstanceScript();
|
||||
containment_sphereAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
Creature* pKeristrasza = ObjectAccessor::GetCreature(*go, instance->GetGuidData(DATA_KERISTRASZA));
|
||||
if (pKeristrasza && pKeristrasza->IsAlive())
|
||||
bool GossipHello(Player* /*player*/, bool /*reportUse*/) override
|
||||
{
|
||||
// maybe these are hacks :(
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
|
||||
ENSURE_AI(boss_keristrasza::boss_keristraszaAI, pKeristrasza->AI())->CheckContainmentSpheres(true);
|
||||
Creature* pKeristrasza = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_KERISTRASZA));
|
||||
if (pKeristrasza && pKeristrasza->IsAlive())
|
||||
{
|
||||
// maybe these are hacks :(
|
||||
me->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
me->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
ENSURE_AI(boss_keristrasza::boss_keristraszaAI, pKeristrasza->AI())->CheckContainmentSpheres(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new containment_sphereAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_intense_cold : public SpellScriptLoader
|
||||
|
||||
@@ -141,7 +141,7 @@ class npc_verdisa_beglaristrasz_eternos : public CreatureScript
|
||||
player->DestroyItemCount(itemId, 1, true, false);
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
switch (menuId)
|
||||
{
|
||||
@@ -156,7 +156,6 @@ class npc_verdisa_beglaristrasz_eternos : public CreatureScript
|
||||
StoreEssence(player, ITEM_EMERALD_ESSENCE);
|
||||
break;
|
||||
}
|
||||
return;
|
||||
case GOSSIP_MENU_ETERNOS:
|
||||
if (gossipListId >= 1 && gossipListId <= 3)
|
||||
{
|
||||
@@ -168,7 +167,6 @@ class npc_verdisa_beglaristrasz_eternos : public CreatureScript
|
||||
StoreEssence(player, ITEM_AMBER_ESSENCE);
|
||||
break;
|
||||
}
|
||||
return;
|
||||
case GOSSIP_MENU_BELGARISTRASZ:
|
||||
if (gossipListId <= 2)
|
||||
{
|
||||
@@ -180,11 +178,11 @@ class npc_verdisa_beglaristrasz_eternos : public CreatureScript
|
||||
StoreEssence(player, ITEM_RUBY_ESSENCE);
|
||||
break;
|
||||
}
|
||||
return;
|
||||
default:
|
||||
return;
|
||||
break;
|
||||
}
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
return false;
|
||||
}
|
||||
|
||||
void MovementInform(uint32 /*type*/, uint32 id) override
|
||||
|
||||
@@ -269,29 +269,6 @@ class npc_brann_hos : public CreatureScript
|
||||
public:
|
||||
npc_brann_hos() : CreatureScript("npc_brann_hos") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1 || action == GOSSIP_ACTION_INFO_DEF+2)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
ENSURE_AI(npc_brann_hos::npc_brann_hosAI, creature->AI())->StartWP();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_START, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
SendGossipMenuFor(player, TEXT_ID_START, creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
struct npc_brann_hosAI : public npc_escortAI
|
||||
{
|
||||
npc_brann_hosAI(Creature* creature) : npc_escortAI(creature)
|
||||
@@ -322,6 +299,30 @@ public:
|
||||
bool bIsLowHP;
|
||||
bool brannSparklinNews;
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1 || action == GOSSIP_ACTION_INFO_DEF + 2)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
StartWP();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (me->IsQuestGiver())
|
||||
player->PrepareQuestMenu(me->GetGUID());
|
||||
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_START, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, TEXT_ID_START, me->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
if (!HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
|
||||
@@ -981,11 +981,11 @@ class go_celestial_planetarium_access : public GameObjectScript
|
||||
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
if (go->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE))
|
||||
if (me->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE))
|
||||
return true;
|
||||
|
||||
bool hasKey = true;
|
||||
if (LockEntry const* lock = sLockStore.LookupEntry(go->GetGOInfo()->goober.lockId))
|
||||
if (LockEntry const* lock = sLockStore.LookupEntry(me->GetGOInfo()->goober.lockId))
|
||||
{
|
||||
hasKey = false;
|
||||
for (uint32 i = 0; i < MAX_LOCK_CASE; ++i)
|
||||
@@ -1005,18 +1005,18 @@ class go_celestial_planetarium_access : public GameObjectScript
|
||||
return false;
|
||||
|
||||
// Start Algalon event
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
|
||||
me->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
|
||||
_events.ScheduleEvent(EVENT_DESPAWN_CONSOLE, 5000);
|
||||
if (Creature* brann = go->SummonCreature(NPC_BRANN_BRONZBEARD_ALG, BrannIntroSpawnPos))
|
||||
if (Creature* brann = me->SummonCreature(NPC_BRANN_BRONZBEARD_ALG, BrannIntroSpawnPos))
|
||||
brann->AI()->DoAction(ACTION_START_INTRO);
|
||||
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
{
|
||||
instance->SetData(DATA_ALGALON_SUMMON_STATE, 1);
|
||||
if (GameObject* sigil = ObjectAccessor::GetGameObject(*go, instance->GetGuidData(DATA_SIGILDOOR_01)))
|
||||
if (GameObject* sigil = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_SIGILDOOR_01)))
|
||||
sigil->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
if (GameObject* sigil = ObjectAccessor::GetGameObject(*go, instance->GetGuidData(DATA_SIGILDOOR_02)))
|
||||
if (GameObject* sigil = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_SIGILDOOR_02)))
|
||||
sigil->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
|
||||
@@ -1035,7 +1035,7 @@ class go_celestial_planetarium_access : public GameObjectScript
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_DESPAWN_CONSOLE:
|
||||
go->Delete();
|
||||
me->Delete();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "VehicleDefines.h"
|
||||
#include "ulduar.h"
|
||||
#include "Spell.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
@@ -1185,7 +1186,7 @@ class npc_brann_bronzebeard_ulduar_intro : public CreatureScript
|
||||
_instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (menuId == GOSSIP_MENU_BRANN_BRONZEBEARD && gossipListId == GOSSIP_OPTION_BRANN_BRONZEBEARD)
|
||||
{
|
||||
@@ -1194,6 +1195,7 @@ class npc_brann_bronzebeard_ulduar_intro : public CreatureScript
|
||||
if (Creature* loreKeeper = _instance->GetCreature(DATA_LORE_KEEPER_OF_NORGANNON))
|
||||
loreKeeper->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -1238,7 +1240,7 @@ class npc_lorekeeper : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (menuId == GOSSIP_MENU_LORE_KEEPER && gossipListId == GOSSIP_OPTION_LORE_KEEPER)
|
||||
{
|
||||
@@ -1262,6 +1264,7 @@ class npc_lorekeeper : public CreatureScript
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -1279,30 +1282,40 @@ class go_ulduar_tower : public GameObjectScript
|
||||
public:
|
||||
go_ulduar_tower() : GameObjectScript("go_ulduar_tower") { }
|
||||
|
||||
void OnDestroyed(GameObject* go, Player* /*player*/) override
|
||||
struct go_ulduar_towerAI : public GameObjectAI
|
||||
{
|
||||
InstanceScript* instance = go->GetInstanceScript();
|
||||
if (!instance)
|
||||
return;
|
||||
go_ulduar_towerAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
switch (go->GetEntry())
|
||||
void Destroyed(Player* /*player*/, uint32 /*eventId*/) override
|
||||
{
|
||||
case GO_TOWER_OF_STORMS:
|
||||
instance->ProcessEvent(go, EVENT_TOWER_OF_STORM_DESTROYED);
|
||||
break;
|
||||
case GO_TOWER_OF_FLAMES:
|
||||
instance->ProcessEvent(go, EVENT_TOWER_OF_FLAMES_DESTROYED);
|
||||
break;
|
||||
case GO_TOWER_OF_FROST:
|
||||
instance->ProcessEvent(go, EVENT_TOWER_OF_FROST_DESTROYED);
|
||||
break;
|
||||
case GO_TOWER_OF_LIFE:
|
||||
instance->ProcessEvent(go, EVENT_TOWER_OF_LIFE_DESTROYED);
|
||||
break;
|
||||
}
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (Creature* trigger = go->FindNearestCreature(NPC_ULDUAR_GAUNTLET_GENERATOR, 15.0f, true))
|
||||
trigger->DisappearAndDie();
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case GO_TOWER_OF_STORMS:
|
||||
instance->ProcessEvent(me, EVENT_TOWER_OF_STORM_DESTROYED);
|
||||
break;
|
||||
case GO_TOWER_OF_FLAMES:
|
||||
instance->ProcessEvent(me, EVENT_TOWER_OF_FLAMES_DESTROYED);
|
||||
break;
|
||||
case GO_TOWER_OF_FROST:
|
||||
instance->ProcessEvent(me, EVENT_TOWER_OF_FROST_DESTROYED);
|
||||
break;
|
||||
case GO_TOWER_OF_LIFE:
|
||||
instance->ProcessEvent(me, EVENT_TOWER_OF_LIFE_DESTROYED);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Creature* trigger = me->FindNearestCreature(NPC_ULDUAR_GAUNTLET_GENERATOR, 15.0f, true))
|
||||
trigger->DisappearAndDie();
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_ulduar_towerAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "ulduar.h"
|
||||
#include "Vehicle.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
enum Yells
|
||||
{
|
||||
@@ -1645,20 +1646,30 @@ class go_mimiron_hardmode_button : public GameObjectScript
|
||||
public:
|
||||
go_mimiron_hardmode_button() : GameObjectScript("go_mimiron_hardmode_button") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
struct go_mimiron_hardmode_buttonAI : public GameObjectAI
|
||||
{
|
||||
if (go->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE))
|
||||
go_mimiron_hardmode_buttonAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
if (me->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE))
|
||||
return true;
|
||||
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (!instance)
|
||||
return false;
|
||||
|
||||
if (Creature* computer = instance->GetCreature(DATA_COMPUTER))
|
||||
computer->AI()->DoAction(DO_ACTIVATE_COMPUTER);
|
||||
me->SetGoState(GO_STATE_ACTIVE);
|
||||
me->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceScript* instance = go->GetInstanceScript();
|
||||
if (!instance)
|
||||
return false;
|
||||
|
||||
if (Creature* computer = instance->GetCreature(DATA_COMPUTER))
|
||||
computer->AI()->DoAction(DO_ACTIVATE_COMPUTER);
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
return true;
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_mimiron_hardmode_buttonAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "ulduar.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "Player.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
@@ -316,12 +317,22 @@ class go_razorscale_harpoon : public GameObjectScript
|
||||
public:
|
||||
go_razorscale_harpoon() : GameObjectScript("go_razorscale_harpoon") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
struct go_razorscale_harpoonAI : public GameObjectAI
|
||||
{
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
if (instance->GetCreature(BOSS_RAZORSCALE))
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
return false;
|
||||
go_razorscale_harpoonAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool GossipHello(Player* /*player*/, bool /*reportUse*/) override
|
||||
{
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
if (instance->GetCreature(BOSS_RAZORSCALE))
|
||||
me->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_razorscale_harpoonAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -734,37 +745,37 @@ class npc_expedition_commander : public CreatureScript
|
||||
else
|
||||
AttackStartTimer -= Diff;
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
switch (gossipListId)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF:
|
||||
CloseGossipMenuFor(player);
|
||||
ENSURE_AI(npc_expedition_commanderAI, me->AI())->Phase = 1;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (instance && instance->GetBossState(BOSS_RAZORSCALE) == NOT_STARTED)
|
||||
{
|
||||
player->PrepareGossipMenu(me);
|
||||
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
SendGossipMenuFor(player, 13853, me->GetGUID());
|
||||
}
|
||||
else
|
||||
SendGossipMenuFor(player, 13910, me->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF:
|
||||
CloseGossipMenuFor(player);
|
||||
ENSURE_AI(npc_expedition_commanderAI, creature->AI())->Phase = 1;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance && instance->GetBossState(BOSS_RAZORSCALE) == NOT_STARTED)
|
||||
{
|
||||
player->PrepareGossipMenu(creature);
|
||||
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
SendGossipMenuFor(player, 13853, creature->GetGUID());
|
||||
}
|
||||
else
|
||||
SendGossipMenuFor(player, 13910, creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetUlduarAI<npc_expedition_commanderAI>(creature);
|
||||
|
||||
@@ -1523,10 +1523,10 @@ class npc_observation_ring_keeper : public CreatureScript
|
||||
DoCast(SPELL_KEEPER_ACTIVE);
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 /*gossipListId*/) override
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 /*gossipListId*/) override
|
||||
{
|
||||
if (menuId != 10333)
|
||||
return;
|
||||
return true;
|
||||
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
me->DespawnOrUnsummon(2000);
|
||||
@@ -1549,6 +1549,7 @@ class npc_observation_ring_keeper : public CreatureScript
|
||||
me->SummonCreature(NPC_MIMIRON_YS, YSKeepersPos[3]);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) override { }
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "utgarde_pinnacle.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
@@ -555,19 +556,29 @@ class go_palehoof_sphere : public GameObjectScript
|
||||
public:
|
||||
go_palehoof_sphere() : GameObjectScript("go_palehoof_sphere") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
struct go_palehoof_sphereAI : public GameObjectAI
|
||||
{
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
go_palehoof_sphereAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
if (Creature* palehoof = instance->GetCreature(DATA_GORTOK_PALEHOOF))
|
||||
if (palehoof->IsAlive() && instance->GetBossState(DATA_GORTOK_PALEHOOF) != DONE)
|
||||
{
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
palehoof->AI()->DoAction(ACTION_START_ENCOUNTER);
|
||||
}
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
{
|
||||
if (Creature* palehoof = instance->GetCreature(DATA_GORTOK_PALEHOOF))
|
||||
if (palehoof->IsAlive() && instance->GetBossState(DATA_GORTOK_PALEHOOF) != DONE)
|
||||
{
|
||||
me->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
me->SetGoState(GO_STATE_ACTIVE);
|
||||
palehoof->AI()->DoAction(ACTION_START_ENCOUNTER);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_palehoof_sphereAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
#include "violet_hold.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
/*
|
||||
* TODO:
|
||||
@@ -317,30 +318,6 @@ class npc_sinclari_vh : public CreatureScript
|
||||
public:
|
||||
npc_sinclari_vh() : CreatureScript("npc_sinclari_vh") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
// override default gossip
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
{
|
||||
switch (instance->GetData(DATA_MAIN_EVENT_STATE))
|
||||
{
|
||||
case IN_PROGRESS:
|
||||
player->PrepareGossipMenu(creature, GOSSIP_MENU_SEND_ME_IN, true);
|
||||
player->SendPreparedGossip(creature);
|
||||
return true;
|
||||
case DONE:
|
||||
return true; // NYI
|
||||
case NOT_STARTED:
|
||||
case FAIL:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// load default gossip
|
||||
return false;
|
||||
}
|
||||
|
||||
struct npc_sinclariAI : public ScriptedAI
|
||||
{
|
||||
npc_sinclariAI(Creature* creature) : ScriptedAI(creature), _summons(creature)
|
||||
@@ -369,7 +346,31 @@ class npc_sinclari_vh : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
// override default gossip
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
{
|
||||
switch (instance->GetData(DATA_MAIN_EVENT_STATE))
|
||||
{
|
||||
case IN_PROGRESS:
|
||||
player->PrepareGossipMenu(me, GOSSIP_MENU_SEND_ME_IN, true);
|
||||
player->SendPreparedGossip(me);
|
||||
return true;
|
||||
case DONE:
|
||||
return true; // NYI
|
||||
case NOT_STARTED:
|
||||
case FAIL:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// load default gossip
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (menuId == GOSSIP_MENU_START_ENCOUNTER && gossipListId == 0)
|
||||
{
|
||||
@@ -383,6 +384,7 @@ class npc_sinclari_vh : public CreatureScript
|
||||
me->CastSpell(player, SPELL_TELEPORT_PLAYER, true);
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void DoAction(int32 actionId) override
|
||||
@@ -1309,10 +1311,20 @@ class go_activation_crystal : public GameObjectScript
|
||||
public:
|
||||
go_activation_crystal() : GameObjectScript("go_activation_crystal") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* /*go*/) override
|
||||
struct go_blackfathom_altarAI : public GameObjectAI
|
||||
{
|
||||
player->CastSpell(player, SPELL_CRYSTAL_ACTIVATION, true);
|
||||
return false;
|
||||
go_blackfathom_altarAI(GameObject* go) : GameObjectAI(go) { }
|
||||
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
player->CastSpell(player, SPELL_CRYSTAL_ACTIVATION, true);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_blackfathom_altarAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -241,31 +241,40 @@ class npc_corastrasza : public CreatureScript
|
||||
public:
|
||||
npc_corastrasza() : CreatureScript("npc_corastrasza") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
struct npc_corastraszaAI : public ScriptedAI
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
npc_corastraszaAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
if (player->GetQuestStatus(QUEST_ACES_HIGH) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_ACES_HIGH_DAILY) == QUEST_STATUS_INCOMPLETE) //It's the same dragon for both quests.
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_C_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
if (me->IsQuestGiver())
|
||||
player->PrepareQuestMenu(me->GetGUID());
|
||||
|
||||
player->CastSpell(player, SPELL_SUMMON_WYRMREST_SKYTALON, true);
|
||||
player->CastSpell(player, SPELL_WYRMREST_SKYTALON_RIDE_PERIODIC, true);
|
||||
if (player->GetQuestStatus(QUEST_ACES_HIGH) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_ACES_HIGH_DAILY) == QUEST_STATUS_INCOMPLETE) //It's the same dragon for both quests.
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_C_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
|
||||
player->CastSpell(player, SPELL_SUMMON_WYRMREST_SKYTALON, true);
|
||||
player->CastSpell(player, SPELL_WYRMREST_SKYTALON_RIDE_PERIODIC, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_corastraszaAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -284,31 +293,42 @@ enum Iruk
|
||||
|
||||
class npc_iruk : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_iruk() : CreatureScript("npc_iruk") { }
|
||||
public:
|
||||
npc_iruk() : CreatureScript("npc_iruk") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_SPIRITS_WATCH_OVER_US) == QUEST_STATUS_INCOMPLETE)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_I, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
player->PlayerTalkClass->SendGossipMenu(GOSSIP_TEXT_I, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
switch (action)
|
||||
struct npc_irukAI : public ScriptedAI
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
player->CastSpell(player, SPELL_CREATURE_TOTEM_OF_ISSLIRUK, true);
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
npc_irukAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_SPIRITS_WATCH_OVER_US) == QUEST_STATUS_INCOMPLETE)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_I, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
player->PlayerTalkClass->SendGossipMenu(GOSSIP_TEXT_I, me->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
player->CastSpell(player, SPELL_CREATURE_TOTEM_OF_ISSLIRUK, true);
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_irukAI(creature);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
@@ -544,136 +564,132 @@ enum Lurgglbr
|
||||
|
||||
class npc_lurgglbr : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_lurgglbr() : CreatureScript("npc_lurgglbr") { }
|
||||
public:
|
||||
npc_lurgglbr() : CreatureScript("npc_lurgglbr") { }
|
||||
|
||||
struct npc_lurgglbrAI : public npc_escortAI
|
||||
{
|
||||
npc_lurgglbrAI(Creature* creature) : npc_escortAI(creature)
|
||||
struct npc_lurgglbrAI : public npc_escortAI
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
IntroTimer = 0;
|
||||
IntroPhase = 0;
|
||||
}
|
||||
|
||||
uint32 IntroTimer;
|
||||
uint32 IntroPhase;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
if (!HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
npc_lurgglbrAI(Creature* creature) : npc_escortAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId) override
|
||||
{
|
||||
switch (waypointId)
|
||||
{
|
||||
case 0:
|
||||
IntroPhase = 1;
|
||||
IntroTimer = 2000;
|
||||
break;
|
||||
case 41:
|
||||
SetEscortPaused(true);
|
||||
IntroPhase = 4;
|
||||
IntroTimer = 2000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (IntroPhase)
|
||||
void Initialize()
|
||||
{
|
||||
if (IntroTimer <= diff)
|
||||
IntroTimer = 0;
|
||||
IntroPhase = 0;
|
||||
}
|
||||
|
||||
uint32 IntroTimer;
|
||||
uint32 IntroPhase;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
if (!HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId) override
|
||||
{
|
||||
switch (waypointId)
|
||||
{
|
||||
switch (IntroPhase)
|
||||
case 0:
|
||||
IntroPhase = 1;
|
||||
IntroTimer = 2000;
|
||||
break;
|
||||
case 41:
|
||||
SetEscortPaused(true);
|
||||
IntroPhase = 4;
|
||||
IntroTimer = 2000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (IntroPhase)
|
||||
{
|
||||
if (IntroTimer <= diff)
|
||||
{
|
||||
case 1:
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
Talk(SAY_START_1, player);
|
||||
IntroPhase = 2;
|
||||
IntroTimer = 7500;
|
||||
switch (IntroPhase)
|
||||
{
|
||||
case 1:
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
Talk(SAY_START_1, player);
|
||||
IntroPhase = 2;
|
||||
IntroTimer = 7500;
|
||||
break;
|
||||
case 2:
|
||||
Talk(SAY_START_2);
|
||||
IntroPhase = 3;
|
||||
IntroTimer = 7500;
|
||||
break;
|
||||
case 3:
|
||||
me->SetReactState(REACT_DEFENSIVE);
|
||||
IntroPhase = 0;
|
||||
IntroTimer = 0;
|
||||
break;
|
||||
case 4:
|
||||
Talk(SAY_END_1);
|
||||
IntroPhase = 5;
|
||||
IntroTimer = 8000;
|
||||
break;
|
||||
case 5:
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
Talk(SAY_END_2, player);
|
||||
IntroPhase = 6;
|
||||
IntroTimer = 2500;
|
||||
break;
|
||||
case 6:
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
player->AreaExploredOrEventHappens(QUEST_ESCAPE_WINTERFIN_CAVERNS);
|
||||
IntroPhase = 7;
|
||||
IntroTimer = 2500;
|
||||
break;
|
||||
case 7:
|
||||
me->DespawnOrUnsummon();
|
||||
IntroPhase = 0;
|
||||
IntroTimer = 0;
|
||||
break;
|
||||
}
|
||||
} else IntroTimer -= diff;
|
||||
}
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
}
|
||||
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_ESCAPE_WINTERFIN_CAVERNS)
|
||||
{
|
||||
if (GameObject* go = me->FindNearestGameObject(GO_CAGE, 5.0f))
|
||||
{
|
||||
go->SetRespawnTime(0);
|
||||
go->UseDoorOrButton(20000);
|
||||
}
|
||||
|
||||
Start(true, false, player->GetGUID());
|
||||
|
||||
switch (player->GetTeam())
|
||||
{
|
||||
case ALLIANCE:
|
||||
me->SetFaction(FACTION_ESCORTEE_A_PASSIVE);
|
||||
break;
|
||||
case 2:
|
||||
Talk(SAY_START_2);
|
||||
IntroPhase = 3;
|
||||
IntroTimer = 7500;
|
||||
break;
|
||||
case 3:
|
||||
me->SetReactState(REACT_DEFENSIVE);
|
||||
IntroPhase = 0;
|
||||
IntroTimer = 0;
|
||||
break;
|
||||
case 4:
|
||||
Talk(SAY_END_1);
|
||||
IntroPhase = 5;
|
||||
IntroTimer = 8000;
|
||||
break;
|
||||
case 5:
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
Talk(SAY_END_2, player);
|
||||
IntroPhase = 6;
|
||||
IntroTimer = 2500;
|
||||
break;
|
||||
case 6:
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
player->AreaExploredOrEventHappens(QUEST_ESCAPE_WINTERFIN_CAVERNS);
|
||||
IntroPhase = 7;
|
||||
IntroTimer = 2500;
|
||||
break;
|
||||
case 7:
|
||||
me->DespawnOrUnsummon();
|
||||
IntroPhase = 0;
|
||||
IntroTimer = 0;
|
||||
default:
|
||||
case HORDE:
|
||||
me->SetFaction(FACTION_ESCORTEE_H_PASSIVE);
|
||||
break;
|
||||
}
|
||||
} else IntroTimer -= diff;
|
||||
}
|
||||
}
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
};
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_lurgglbrAI(creature);
|
||||
}
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_ESCAPE_WINTERFIN_CAVERNS)
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
if (GameObject* go = creature->FindNearestGameObject(GO_CAGE, 5.0f))
|
||||
{
|
||||
go->SetRespawnTime(0);
|
||||
go->UseDoorOrButton(20000);
|
||||
}
|
||||
|
||||
if (npc_escortAI* pEscortAI = CAST_AI(npc_lurgglbr::npc_lurgglbrAI, creature->AI()))
|
||||
pEscortAI->Start(true, false, player->GetGUID());
|
||||
|
||||
switch (player->GetTeam())
|
||||
{
|
||||
case ALLIANCE:
|
||||
creature->SetFaction(FACTION_ESCORTEE_A_PASSIVE);
|
||||
break;
|
||||
default:
|
||||
case HORDE:
|
||||
creature->SetFaction(FACTION_ESCORTEE_H_PASSIVE);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
return new npc_lurgglbrAI(creature);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
enum red_dragonblood
|
||||
@@ -1041,33 +1057,34 @@ public:
|
||||
if (Creature* arthas = ObjectAccessor::GetCreature(*me, arthasGUID))
|
||||
arthas->RemoveFromWorld();
|
||||
}
|
||||
};
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
if (player->GetQuestStatus(QUEST_LAST_RITES) == QUEST_STATUS_INCOMPLETE && creature->GetAreaId() == 4128)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_T, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
switch (action)
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
ENSURE_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
|
||||
ENSURE_AI(npc_escortAI, (creature->AI()))->SetMaxPlayerDistance(200.0f);
|
||||
break;
|
||||
if (me->IsQuestGiver())
|
||||
player->PrepareQuestMenu(me->GetGUID());
|
||||
|
||||
if (player->GetQuestStatus(QUEST_LAST_RITES) == QUEST_STATUS_INCOMPLETE && me->GetAreaId() == 4128)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_T, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
Start(true, false, player->GetGUID());
|
||||
SetMaxPlayerDistance(200.0f);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
@@ -1616,30 +1633,29 @@ class npc_mootoo_the_younger : public CreatureScript
|
||||
public:
|
||||
npc_mootoo_the_younger() : CreatureScript("npc_mootoo_the_younger") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_ESCAPING_THE_MIST)
|
||||
{
|
||||
switch (player->GetTeam())
|
||||
{
|
||||
case ALLIANCE:
|
||||
creature->SetFaction(FACTION_ESCORTEE_A_PASSIVE);
|
||||
break;
|
||||
case HORDE:
|
||||
creature->SetFaction(FACTION_ESCORTEE_H_PASSIVE);
|
||||
break;
|
||||
}
|
||||
creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
creature->AI()->Talk(SAY_1, player);
|
||||
ENSURE_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
struct npc_mootoo_the_youngerAI : public npc_escortAI
|
||||
{
|
||||
npc_mootoo_the_youngerAI(Creature* creature) : npc_escortAI(creature) { }
|
||||
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_ESCAPING_THE_MIST)
|
||||
{
|
||||
switch (player->GetTeam())
|
||||
{
|
||||
case ALLIANCE:
|
||||
me->SetFaction(FACTION_ESCORTEE_A_PASSIVE);
|
||||
break;
|
||||
case HORDE:
|
||||
me->SetFaction(FACTION_ESCORTEE_H_PASSIVE);
|
||||
break;
|
||||
}
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
Talk(SAY_1, player);
|
||||
Start(true, false, player->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
SetDespawnAtFar(false);
|
||||
@@ -1706,17 +1722,6 @@ class npc_bonker_togglevolt : public CreatureScript
|
||||
public:
|
||||
npc_bonker_togglevolt() : CreatureScript("npc_bonker_togglevolt") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_GET_ME_OUTA_HERE)
|
||||
{
|
||||
creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
creature->AI()->Talk(SAY_BONKER_2, player);
|
||||
ENSURE_AI(npc_escortAI, (creature->AI()))->Start(true, true, player->GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
struct npc_bonker_togglevoltAI : public npc_escortAI
|
||||
{
|
||||
npc_bonker_togglevoltAI(Creature* creature) : npc_escortAI(creature)
|
||||
@@ -1731,6 +1736,16 @@ public:
|
||||
|
||||
uint32 Bonker_agro;
|
||||
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_GET_ME_OUTA_HERE)
|
||||
{
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
Talk(SAY_BONKER_2, player);
|
||||
Start(true, true, player->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
@@ -2204,7 +2219,7 @@ public:
|
||||
uiEventPhase = 1;
|
||||
}
|
||||
|
||||
void SetGUID(ObjectGuid uiGuid, int32 /*iId*/) override
|
||||
void SetGUID(ObjectGuid uiGuid, int32 /*iId*/ = 0) override
|
||||
{
|
||||
uiPlayerGUID = uiGuid;
|
||||
}
|
||||
@@ -2275,65 +2290,65 @@ public:
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
uint32 uiGossipText = 0;
|
||||
const char* charGossipItem;
|
||||
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_TOM_HEGGER:
|
||||
uiGossipText = GOSSIP_TEXT_TOM_HEGGER;
|
||||
charGossipItem = GOSSIP_ITEM_TOM_HEGGER;
|
||||
break;
|
||||
case NPC_SALTY_JOHN_THORPE:
|
||||
uiGossipText = GOSSIP_TEXT_SALTY_JOHN_THORPE;
|
||||
charGossipItem = GOSSIP_ITEM_SALTY_JOHN_THORPE;
|
||||
break;
|
||||
case NPC_GUARD_MITCHELLS:
|
||||
uiGossipText = GOSSIP_TEXT_GUARD_MITCHELSS;
|
||||
charGossipItem = GOSSIP_ITEM_GUARD_MITCHELLS;
|
||||
break;
|
||||
default:
|
||||
charGossipItem = "";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player->HasAura(SPELL_RIGHTEOUS_VISION) && player->GetQuestStatus(QUEST_THE_HUNT_IS_ON) == QUEST_STATUS_INCOMPLETE)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, charGossipItem, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
if (me->IsVendor())
|
||||
AddGossipItemFor(player, GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||
|
||||
SendGossipMenuFor(player, uiGossipText, me->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
SetGUID(player->GetGUID());
|
||||
DoAction(1);
|
||||
}
|
||||
|
||||
if (action == GOSSIP_ACTION_TRADE)
|
||||
player->GetSession()->SendListInventory(me->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_hidden_cultistAI(creature);
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
uint32 uiGossipText = 0;
|
||||
const char* charGossipItem;
|
||||
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_TOM_HEGGER:
|
||||
uiGossipText = GOSSIP_TEXT_TOM_HEGGER;
|
||||
charGossipItem = GOSSIP_ITEM_TOM_HEGGER;
|
||||
break;
|
||||
case NPC_SALTY_JOHN_THORPE:
|
||||
uiGossipText = GOSSIP_TEXT_SALTY_JOHN_THORPE;
|
||||
charGossipItem = GOSSIP_ITEM_SALTY_JOHN_THORPE;
|
||||
break;
|
||||
case NPC_GUARD_MITCHELLS:
|
||||
uiGossipText = GOSSIP_TEXT_GUARD_MITCHELSS;
|
||||
charGossipItem = GOSSIP_ITEM_GUARD_MITCHELLS;
|
||||
break;
|
||||
default:
|
||||
charGossipItem = "";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player->HasAura(SPELL_RIGHTEOUS_VISION) && player->GetQuestStatus(QUEST_THE_HUNT_IS_ON) == QUEST_STATUS_INCOMPLETE)
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, charGossipItem, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
if (creature->IsVendor())
|
||||
AddGossipItemFor(player, GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||
|
||||
SendGossipMenuFor(player, uiGossipText, creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
creature->AI()->SetGUID(player->GetGUID());
|
||||
creature->AI()->DoAction(1);
|
||||
}
|
||||
|
||||
if (action == GOSSIP_ACTION_TRADE)
|
||||
player->GetSession()->SendListInventory(creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
enum WindsoulTotemAura
|
||||
|
||||
@@ -492,33 +492,6 @@ class npc_wyrmrest_defender : public CreatureScript
|
||||
public:
|
||||
npc_wyrmrest_defender() : CreatureScript("npc_wyrmrest_defender") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_DEFENDING_WYRMREST_TEMPLE) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
SendGossipMenuFor(player, GOSSIP_TEXTID_DEF1, creature->GetGUID());
|
||||
}
|
||||
else
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
SendGossipMenuFor(player, GOSSIP_TEXTID_DEF2, creature->GetGUID());
|
||||
// Makes player cast trigger spell for 49207 on self
|
||||
player->CastSpell(player, SPELL_CHARACTER_SCRIPT, true);
|
||||
// The gossip should not auto close
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
struct npc_wyrmrest_defenderAI : public VehicleAI
|
||||
{
|
||||
npc_wyrmrest_defenderAI(Creature* creature) : VehicleAI(creature)
|
||||
@@ -539,6 +512,34 @@ class npc_wyrmrest_defender : public CreatureScript
|
||||
|
||||
uint32 RenewRecoveryChecker;
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_DEFENDING_WYRMREST_TEMPLE) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, GOSSIP_TEXTID_DEF1, me->GetGUID());
|
||||
}
|
||||
else
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
if (gossipListId == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
SendGossipMenuFor(player, GOSSIP_TEXTID_DEF2, me->GetGUID());
|
||||
// Makes player cast trigger spell for 49207 on self
|
||||
player->CastSpell(player, SPELL_CHARACTER_SCRIPT, true);
|
||||
// The gossip should not auto close
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
|
||||
@@ -182,25 +182,23 @@ public:
|
||||
_RavenousworgGUID.Clear();
|
||||
}
|
||||
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_PERILOUS_ADVENTURE)
|
||||
{
|
||||
Talk(SAY_QUEST_ACCEPT);
|
||||
if (Creature* Mrfloppy = GetClosestCreatureWithEntry(me, NPC_MRFLOPPY, 180.0f))
|
||||
Mrfloppy->GetMotionMaster()->MoveFollow(me, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
|
||||
|
||||
Start(true, false, player->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
ObjectGuid _RavenousworgGUID;
|
||||
ObjectGuid _mrfloppyGUID;
|
||||
};
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_PERILOUS_ADVENTURE)
|
||||
{
|
||||
creature->AI()->Talk(SAY_QUEST_ACCEPT);
|
||||
if (Creature* Mrfloppy = GetClosestCreatureWithEntry(creature, NPC_MRFLOPPY, 180.0f))
|
||||
Mrfloppy->GetMotionMaster()->MoveFollow(creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
|
||||
|
||||
if (npc_escortAI* pEscortAI = CAST_AI(npc_emily::npc_emilyAI, (creature->AI())))
|
||||
pEscortAI->Start(true, false, player->GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_emilyAI(creature);
|
||||
@@ -764,9 +762,10 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
|
||||
{
|
||||
DoCast(player, SPELL_SUMMON_ASHWOOD_BRAND);
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -78,15 +78,6 @@ class npc_apothecary_hanes : public CreatureScript
|
||||
public:
|
||||
npc_apothecary_hanes() : CreatureScript("npc_apothecary_hanes") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_TRAIL_OF_FIRE)
|
||||
{
|
||||
ENSURE_AI(npc_Apothecary_HanesAI, (creature->AI()))->StartEscort(player);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
struct npc_Apothecary_HanesAI : public npc_escortAI
|
||||
{
|
||||
npc_Apothecary_HanesAI(Creature* creature) : npc_escortAI(creature)
|
||||
@@ -94,6 +85,12 @@ public:
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void QuestAccept(Player* player, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_TRAIL_OF_FIRE)
|
||||
StartEscort(player);
|
||||
}
|
||||
|
||||
void StartEscort(Player* player)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_BEGIN, Seconds(2));
|
||||
@@ -331,50 +328,61 @@ class npc_razael_and_lyana : public CreatureScript
|
||||
public:
|
||||
npc_razael_and_lyana() : CreatureScript("npc_razael_and_lyana") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
struct npc_razael_and_lyanaAI : public ScriptedAI
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
npc_razael_and_lyanaAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
if (player->GetQuestStatus(QUEST_REPORTS_FROM_THE_FIELD) == QUEST_STATUS_INCOMPLETE)
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_RAZAEL:
|
||||
if (!player->GetReqKillOrCastCurrentCount(QUEST_REPORTS_FROM_THE_FIELD, NPC_RAZAEL))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_RAZAEL_REPORT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, GOSSIP_TEXTID_RAZAEL1, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case NPC_LYANA:
|
||||
if (!player->GetReqKillOrCastCurrentCount(QUEST_REPORTS_FROM_THE_FIELD, NPC_LYANA))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_LYANA_REPORT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
SendGossipMenuFor(player, GOSSIP_TEXTID_LYANA1, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
switch (action)
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
SendGossipMenuFor(player, GOSSIP_TEXTID_RAZAEL2, creature->GetGUID());
|
||||
player->TalkedToCreature(NPC_RAZAEL, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
SendGossipMenuFor(player, GOSSIP_TEXTID_LYANA2, creature->GetGUID());
|
||||
player->TalkedToCreature(NPC_LYANA, creature->GetGUID());
|
||||
break;
|
||||
if (me->IsQuestGiver())
|
||||
player->PrepareQuestMenu(me->GetGUID());
|
||||
|
||||
if (player->GetQuestStatus(QUEST_REPORTS_FROM_THE_FIELD) == QUEST_STATUS_INCOMPLETE)
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_RAZAEL:
|
||||
if (!player->GetReqKillOrCastCurrentCount(QUEST_REPORTS_FROM_THE_FIELD, NPC_RAZAEL))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_RAZAEL_REPORT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, GOSSIP_TEXTID_RAZAEL1, me->GetGUID());
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case NPC_LYANA:
|
||||
if (!player->GetReqKillOrCastCurrentCount(QUEST_REPORTS_FROM_THE_FIELD, NPC_LYANA))
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_LYANA_REPORT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
SendGossipMenuFor(player, GOSSIP_TEXTID_LYANA1, me->GetGUID());
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
SendGossipMenuFor(player, GOSSIP_TEXTID_RAZAEL2, me->GetGUID());
|
||||
player->TalkedToCreature(NPC_RAZAEL, me->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
SendGossipMenuFor(player, GOSSIP_TEXTID_LYANA2, me->GetGUID());
|
||||
player->TalkedToCreature(NPC_LYANA, me->GetGUID());
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_razael_and_lyanaAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -404,17 +412,6 @@ class npc_daegarn : public CreatureScript
|
||||
public:
|
||||
npc_daegarn() : CreatureScript("npc_daegarn") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_DEFEAT_AT_RING)
|
||||
{
|
||||
if (npc_daegarnAI* pDaegarnAI = CAST_AI(npc_daegarn::npc_daegarnAI, creature->AI()))
|
||||
pDaegarnAI->StartEvent(player->GetGUID());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// @todo make prisoners help (unclear if summoned or using npc's from surrounding cages (summon inside small cages?))
|
||||
struct npc_daegarnAI : public ScriptedAI
|
||||
{
|
||||
@@ -432,6 +429,12 @@ public:
|
||||
bool bEventInProgress;
|
||||
ObjectGuid uiPlayerGUID;
|
||||
|
||||
void QuestAccept(Player* player, const Quest* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_DEFEAT_AT_RING)
|
||||
StartEvent(player->GetGUID());
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
|
||||
@@ -150,28 +150,24 @@ public:
|
||||
m_uiChatTimer -= uiDiff;
|
||||
}
|
||||
}
|
||||
|
||||
void QuestAccept(Player* player, const Quest* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_DISASTER)
|
||||
{
|
||||
me->GetMotionMaster()->MoveJumpTo(0, 0.4f, 0.4f);
|
||||
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
|
||||
|
||||
Start(false, false, player->GetGUID());
|
||||
Talk(SAY_WP_1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_engineer_heliceAI(creature);
|
||||
}
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_DISASTER)
|
||||
{
|
||||
if (npc_engineer_heliceAI* pEscortAI = CAST_AI(npc_engineer_helice::npc_engineer_heliceAI, creature->AI()))
|
||||
{
|
||||
creature->GetMotionMaster()->MoveJumpTo(0, 0.4f, 0.4f);
|
||||
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
|
||||
|
||||
pEscortAI->Start(false, false, player->GetGUID());
|
||||
creature->AI()->Talk(SAY_WP_1);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*#####
|
||||
|
||||
@@ -42,72 +42,71 @@ enum InjuredGoblinMiner
|
||||
|
||||
class npc_injured_goblin : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_injured_goblin() : CreatureScript("npc_injured_goblin") { }
|
||||
public:
|
||||
npc_injured_goblin() : CreatureScript("npc_injured_goblin") { }
|
||||
|
||||
struct npc_injured_goblinAI : public npc_escortAI
|
||||
{
|
||||
npc_injured_goblinAI(Creature* creature) : npc_escortAI(creature) { }
|
||||
|
||||
void WaypointReached(uint32 waypointId) override
|
||||
struct npc_injured_goblinAI : public npc_escortAI
|
||||
{
|
||||
Player* player = GetPlayerForEscort();
|
||||
if (!player)
|
||||
return;
|
||||
npc_injured_goblinAI(Creature* creature) : npc_escortAI(creature) { }
|
||||
|
||||
switch (waypointId)
|
||||
void WaypointReached(uint32 waypointId) override
|
||||
{
|
||||
case 26:
|
||||
Talk(SAY_END_WP_REACHED, player);
|
||||
break;
|
||||
case 27:
|
||||
player->GroupEventHappens(QUEST_BITTER_DEPARTURE, me);
|
||||
break;
|
||||
Player* player = GetPlayerForEscort();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
switch (waypointId)
|
||||
{
|
||||
case 26:
|
||||
Talk(SAY_END_WP_REACHED, player);
|
||||
break;
|
||||
case 27:
|
||||
player->GroupEventHappens(QUEST_BITTER_DEPARTURE, me);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override { }
|
||||
void EnterCombat(Unit* /*who*/) override { }
|
||||
|
||||
void Reset() override { }
|
||||
void Reset() override { }
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
Player* player = GetPlayerForEscort();
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING) && player)
|
||||
player->FailQuest(QUEST_BITTER_DEPARTURE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 uiDiff) override
|
||||
{
|
||||
npc_escortAI::UpdateAI(uiDiff);
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (menuId == GOSSIP_ID && gossipListId == GOSSIP_OPTION_ID)
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
|
||||
Start(true, true, player->GetGUID());
|
||||
Player* player = GetPlayerForEscort();
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING) && player)
|
||||
player->FailQuest(QUEST_BITTER_DEPARTURE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 uiDiff) override
|
||||
{
|
||||
npc_escortAI::UpdateAI(uiDiff);
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
|
||||
{
|
||||
if (menuId == GOSSIP_ID && gossipListId == GOSSIP_OPTION_ID)
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
|
||||
Start(true, true, player->GetGUID());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void QuestAccept(Player* /*player*/, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_BITTER_DEPARTURE)
|
||||
Talk(SAY_QUEST_ACCEPT);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_injured_goblinAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_injured_goblinAI(creature);
|
||||
}
|
||||
|
||||
bool OnQuestAccept(Player* /*player*/, Creature* creature, Quest const* quest) override
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_BITTER_DEPARTURE)
|
||||
creature->AI()->Talk(SAY_QUEST_ACCEPT);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
@@ -122,42 +121,53 @@ enum RoxiRamrocket
|
||||
|
||||
class npc_roxi_ramrocket : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_roxi_ramrocket() : CreatureScript("npc_roxi_ramrocket") { }
|
||||
public:
|
||||
npc_roxi_ramrocket() : CreatureScript("npc_roxi_ramrocket") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
//Quest Menu
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
//Trainer Menu
|
||||
if ( creature->IsTrainer() )
|
||||
AddGossipItemFor(player, GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
|
||||
|
||||
//Vendor Menu
|
||||
if ( creature->IsVendor() )
|
||||
if (player->HasSpell(SPELL_MECHANO_HOG) || player->HasSpell(SPELL_MEKGINEERS_CHOPPER))
|
||||
AddGossipItemFor(player, GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
switch (action)
|
||||
struct npc_roxi_ramrocketAI : public ScriptedAI
|
||||
{
|
||||
case GOSSIP_ACTION_TRAIN:
|
||||
player->GetSession()->SendTrainerList(creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_TRADE:
|
||||
player->GetSession()->SendListInventory(creature->GetGUID());
|
||||
break;
|
||||
npc_roxi_ramrocketAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
//Quest Menu
|
||||
if (me->IsQuestGiver())
|
||||
player->PrepareQuestMenu(me->GetGUID());
|
||||
|
||||
//Trainer Menu
|
||||
if (me->IsTrainer())
|
||||
AddGossipItemFor(player, GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
|
||||
|
||||
//Vendor Menu
|
||||
if (me->IsVendor())
|
||||
if (player->HasSpell(SPELL_MECHANO_HOG) || player->HasSpell(SPELL_MEKGINEERS_CHOPPER))
|
||||
AddGossipItemFor(player, GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||
|
||||
SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
|
||||
{
|
||||
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
|
||||
ClearGossipMenuFor(player);
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_TRAIN:
|
||||
player->GetSession()->SendTrainerList(me->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_TRADE:
|
||||
player->GetSession()->SendListInventory(me->GetGUID());
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_roxi_ramrocketAI(creature);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
@@ -457,151 +467,152 @@ enum BrannBronzebeard
|
||||
|
||||
class npc_brann_bronzebeard_keystone : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_brann_bronzebeard_keystone() : CreatureScript("npc_brann_bronzebeard_keystone") { }
|
||||
public:
|
||||
npc_brann_bronzebeard_keystone() : CreatureScript("npc_brann_bronzebeard_keystone") { }
|
||||
|
||||
struct npc_brann_bronzebeard_keystoneAI : public ScriptedAI
|
||||
{
|
||||
npc_brann_bronzebeard_keystoneAI(Creature* creature) : ScriptedAI(creature)
|
||||
struct npc_brann_bronzebeard_keystoneAI : public ScriptedAI
|
||||
{
|
||||
objectCounter = 0;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
for (ObjectGuid& guid : objectGUID)
|
||||
guid.Clear();
|
||||
|
||||
playerGUID.Clear();
|
||||
voiceGUID.Clear();
|
||||
objectCounter = 0;
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
playerGUID = player->GetGUID();
|
||||
events.ScheduleEvent(EVENT_SCRIPT_1, 100);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
npc_brann_bronzebeard_keystoneAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
switch (eventId)
|
||||
objectCounter = 0;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
for (ObjectGuid& guid : objectGUID)
|
||||
guid.Clear();
|
||||
|
||||
playerGUID.Clear();
|
||||
voiceGUID.Clear();
|
||||
objectCounter = 0;
|
||||
}
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
|
||||
{
|
||||
CloseGossipMenuFor(player);
|
||||
playerGUID = player->GetGUID();
|
||||
events.ScheduleEvent(EVENT_SCRIPT_1, 100);
|
||||
return false;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SCRIPT_1:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
Talk(SAY_BRANN_1, player);
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
|
||||
if (Creature* voice = me->SummonCreature(NPC_A_DISTANT_VOICE, 7863.43f, -1396.585f, 1538.076f, 2.949606f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 49000))
|
||||
voiceGUID = voice->GetGUID();
|
||||
events.ScheduleEvent(EVENT_SCRIPT_2, 4000);
|
||||
break;
|
||||
case EVENT_SCRIPT_2:
|
||||
me->SetWalk(true);
|
||||
me->GetMotionMaster()->MovePoint(0, 7861.488f, -1396.376f, 1534.059f, false);
|
||||
events.ScheduleEvent(EVENT_SCRIPT_3, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_3:
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_WORK_MINING);
|
||||
events.ScheduleEvent(EVENT_SCRIPT_4, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_4:
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
|
||||
if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
|
||||
{
|
||||
voice->CastSpell(voice, SPELL_RESURRECTION);
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SCRIPT_1:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
voice->AI()->Talk(SAY_VOICE_1, player);
|
||||
}
|
||||
if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_1, 7860.273f, -1383.622f, 1538.302f, -1.658062f, G3D::Quat(0.f, 0.f, -0.737277f, 0.6755905f), 0))
|
||||
objectGUID[objectCounter++] = go->GetGUID();
|
||||
events.ScheduleEvent(EVENT_SCRIPT_5, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_5:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
Talk(SAY_BRANN_1, player);
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
|
||||
if (Creature* voice = me->SummonCreature(NPC_A_DISTANT_VOICE, 7863.43f, -1396.585f, 1538.076f, 2.949606f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 49000))
|
||||
voiceGUID = voice->GetGUID();
|
||||
events.ScheduleEvent(EVENT_SCRIPT_2, 4000);
|
||||
break;
|
||||
case EVENT_SCRIPT_2:
|
||||
me->SetWalk(true);
|
||||
me->GetMotionMaster()->MovePoint(0, 7861.488f, -1396.376f, 1534.059f, false);
|
||||
events.ScheduleEvent(EVENT_SCRIPT_3, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_3:
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_WORK_MINING);
|
||||
events.ScheduleEvent(EVENT_SCRIPT_4, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_4:
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
|
||||
if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
|
||||
voice->AI()->Talk(SAY_VOICE_2, player);
|
||||
if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_2, 7875.67f, -1387.266f, 1538.323f, -2.373644f, G3D::Quat(0.f, 0.f, -0.9271832f, 0.3746083f), 0))
|
||||
objectGUID[objectCounter++] = go->GetGUID();
|
||||
events.ScheduleEvent(EVENT_SCRIPT_6, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_6:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
{
|
||||
voice->CastSpell(voice, SPELL_RESURRECTION);
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
voice->AI()->Talk(SAY_VOICE_1, player);
|
||||
}
|
||||
if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_1, 7860.273f, -1383.622f, 1538.302f, -1.658062f, G3D::Quat(0.f, 0.f, -0.737277f, 0.6755905f), 0))
|
||||
objectGUID[objectCounter++] = go->GetGUID();
|
||||
events.ScheduleEvent(EVENT_SCRIPT_5, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_5:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
|
||||
voice->AI()->Talk(SAY_VOICE_2, player);
|
||||
if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_2, 7875.67f, -1387.266f, 1538.323f, -2.373644f, G3D::Quat(0.f, 0.f, -0.9271832f, 0.3746083f), 0))
|
||||
objectGUID[objectCounter++] = go->GetGUID();
|
||||
events.ScheduleEvent(EVENT_SCRIPT_6, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_6:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
|
||||
voice->AI()->Talk(SAY_VOICE_3, player);
|
||||
if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_3, 7879.212f, -1401.175f, 1538.279f, 2.967041f, G3D::Quat(0.f, 0.f, 0.9961939f, 0.08716504f), 0))
|
||||
objectGUID[objectCounter++] = go->GetGUID();
|
||||
events.ScheduleEvent(EVENT_SCRIPT_7, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_7:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
|
||||
voice->AI()->Talk(SAY_VOICE_4, player);
|
||||
if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_4, 7868.944f, -1411.18f, 1538.213f, 2.111848f, G3D::Quat(0.f, 0.f, 0.8703556f, 0.4924237f), 0))
|
||||
objectGUID[objectCounter++] = go->GetGUID();
|
||||
events.ScheduleEvent(EVENT_SCRIPT_8, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_8:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
|
||||
voice->AI()->Talk(SAY_VOICE_5, player);
|
||||
if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_5, 7855.11f, -1406.839f, 1538.42f, 1.151916f, G3D::Quat(0.f, 0.f, 0.5446386f, 0.8386708f), 0))
|
||||
objectGUID[objectCounter] = go->GetGUID();
|
||||
events.ScheduleEvent(EVENT_SCRIPT_9, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_9:
|
||||
if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
|
||||
voice->AI()->Talk(SAY_VOICE_3, player);
|
||||
if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_3, 7879.212f, -1401.175f, 1538.279f, 2.967041f, G3D::Quat(0.f, 0.f, 0.9961939f, 0.08716504f), 0))
|
||||
objectGUID[objectCounter++] = go->GetGUID();
|
||||
events.ScheduleEvent(EVENT_SCRIPT_7, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_7:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
|
||||
voice->AI()->Talk(SAY_VOICE_4, player);
|
||||
if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_4, 7868.944f, -1411.18f, 1538.213f, 2.111848f, G3D::Quat(0.f, 0.f, 0.8703556f, 0.4924237f), 0))
|
||||
objectGUID[objectCounter++] = go->GetGUID();
|
||||
events.ScheduleEvent(EVENT_SCRIPT_8, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_8:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
|
||||
voice->AI()->Talk(SAY_VOICE_5, player);
|
||||
if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_5, 7855.11f, -1406.839f, 1538.42f, 1.151916f, G3D::Quat(0.f, 0.f, 0.5446386f, 0.8386708f), 0))
|
||||
objectGUID[objectCounter] = go->GetGUID();
|
||||
events.ScheduleEvent(EVENT_SCRIPT_9, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_9:
|
||||
if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
|
||||
voice->CastSpell(voice, SPELL_RESURRECTION);
|
||||
events.ScheduleEvent(EVENT_SCRIPT_10, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_10:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
{
|
||||
Talk(SAY_BRANN_2, player);
|
||||
player->KilledMonsterCredit(me->GetEntry());
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SCRIPT_11, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_11:
|
||||
me->SetFacingTo(2.932153f);
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
Talk(SAY_BRANN_3, player);
|
||||
voice->CastSpell(voice, SPELL_RESURRECTION);
|
||||
events.ScheduleEvent(EVENT_SCRIPT_10, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_10:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
{
|
||||
Talk(SAY_BRANN_2, player);
|
||||
player->KilledMonsterCredit(me->GetEntry());
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SCRIPT_11, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_11:
|
||||
me->SetFacingTo(2.932153f);
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
|
||||
Talk(SAY_BRANN_3, player);
|
||||
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
if (GameObject* go = ObjectAccessor::GetGameObject(*me, objectGUID[i]))
|
||||
go->Delete();
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
if (GameObject* go = ObjectAccessor::GetGameObject(*me, objectGUID[i]))
|
||||
go->Delete();
|
||||
|
||||
events.ScheduleEvent(EVENT_SCRIPT_12, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_12:
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->SetWalk(false);
|
||||
me->GetMotionMaster()->MovePoint(0, 7799.908f, -1413.561f, 1534.829f, false);
|
||||
events.ScheduleEvent(EVENT_SCRIPT_13, 10000);
|
||||
break;
|
||||
case EVENT_SCRIPT_13:
|
||||
me->DisappearAndDie();
|
||||
break;
|
||||
events.ScheduleEvent(EVENT_SCRIPT_12, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_12:
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->SetWalk(false);
|
||||
me->GetMotionMaster()->MovePoint(0, 7799.908f, -1413.561f, 1534.829f, false);
|
||||
events.ScheduleEvent(EVENT_SCRIPT_13, 10000);
|
||||
break;
|
||||
case EVENT_SCRIPT_13:
|
||||
me->DisappearAndDie();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
ObjectGuid playerGUID;
|
||||
ObjectGuid objectGUID[5];
|
||||
ObjectGuid voiceGUID;
|
||||
uint8 objectCounter;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_brann_bronzebeard_keystoneAI(creature);
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
ObjectGuid playerGUID;
|
||||
ObjectGuid objectGUID[5];
|
||||
ObjectGuid voiceGUID;
|
||||
uint8 objectCounter;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_brann_bronzebeard_keystoneAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*#####
|
||||
|
||||
Loaded 100 of 122 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user