aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Events
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-05-01 18:19:36 -0300
committerariel- <ariel-@users.noreply.github.com>2017-05-01 18:19:36 -0300
commitf913f3bb8977c127d200d5d4a608ab434b21bbcd (patch)
treebb2d18ad5c0c23667271ca98bd6754cc745256a8 /src/server/scripts/Events
parente4481c016a86fe7db0b83a434ea08eb7ba50174f (diff)
Core/Scripts: unified scripted gossip/quest api
- Changed self-accessor on GameObjectAI to "me", like UnitAI - Moved all related functions to AI, now Unit and GameObject have the same function names with identical behaviour - Remove "OnUpdate" from CreatureScript/GameObjectScript, was never used and we already have AI Update method - Quest methods no longer return a bool, the return value was used to call the AI version if the ScriptMgr one returned false - Implemented GameObjectAI::Destroyed hook (was never called), implemented Damaged method - Rename OnStateChanged to OnLootStateChanged to reflect when it's really called, and created a new hook OnStateChanged that only gets called on GOState change - Since the functions are now only getting called from AI, made GetAI methods full virtual. (CanSpawn method is anyways going to be used on creatures with AI)
Diffstat (limited to 'src/server/scripts/Events')
-rw-r--r--src/server/scripts/Events/childrens_week.cpp2
-rw-r--r--src/server/scripts/Events/fireworks_show.cpp8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/server/scripts/Events/childrens_week.cpp b/src/server/scripts/Events/childrens_week.cpp
index 11877f3e372..cc38aed2964 100644
--- a/src/server/scripts/Events/childrens_week.cpp
+++ b/src/server/scripts/Events/childrens_week.cpp
@@ -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;
diff --git a/src/server/scripts/Events/fireworks_show.cpp b/src/server/scripts/Events/fireworks_show.cpp
index 97c0e33b944..b6b9cacf053 100644
--- a/src/server/scripts/Events/fireworks_show.cpp
+++ b/src/server/scripts/Events/fireworks_show.cpp
@@ -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();