Skip to content

Instantly share code, notes, and snippets.

@sirikfoll
Last active June 23, 2017 01:46
Show Gist options
  • Save sirikfoll/74353225e081cf8c8e63 to your computer and use it in GitHub Desktop.
Save sirikfoll/74353225e081cf8c8e63 to your computer and use it in GitHub Desktop.
diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp
index f3accdf..9aad8c3 100644
--- a/src/server/scripts/World/go_scripts.cpp
+++ b/src/server/scripts/World/go_scripts.cpp
@@ -50,6 +50,7 @@ EndContentData */
#include "Spell.h"
#include "Player.h"
#include "WorldSession.h"
+#include "AchievementMgr.h"
/*######
## go_cat_figurine
@@ -1196,6 +1197,22 @@ public:
}
};
+class go_ribbon_pole : public GameObjectScript
+{
+public:
+ go_ribbon_pole() : GameObjectScript("go_ribbon_pole") { }
+
+ bool OnGossipHello(Player* player, GameObject* /*go*/) override
+ {
+ if (player && player->HasAura(58933))
+ {
+ AchievementEntry const* achievementEntry = sAchievementMgr->GetAchievement(271);
+ Creature* target = GetClosestCreatureWithEntry(player, 17066, 5.0f);
+
+ if (!target)
+ return;
+
+ player->CastSpell(target, 29726);
+ player->CompletedAchievement(achievementEntry);
+ }
+ return true;
+ }
+};
+
void AddSC_go_scripts()
{
new go_cat_figurine();
@@ -1231,4 +1248,5 @@ void AddSC_go_scripts()
new go_veil_skith_cage();
new go_frostblade_shrine();
new go_midsummer_bonfire();
+ new go_ribbon_pole();
}
@sirikfoll
Copy link
Author

diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp
index eac0ff1..75acff6 100644
--- a/src/server/scripts/Spells/spell_holiday.cpp
+++ b/src/server/scripts/Spells/spell_holiday.cpp
@@ -30,6 +30,8 @@
 #include "SpellScript.h"
 #include "Vehicle.h"
 #include "World.h"
+#include <iostream>
+#include "AchievementMgr.h"
 
 // 45102 Romantic Picnic
 enum SpellsPicnic
@@ -1568,7 +1570,7 @@ class spell_gen_ribbon_pole_dancer_check : public SpellScriptLoader
                 Unit* target = GetTarget();
 
                 // check if aura needs to be removed
-                if (!target->FindNearestGameObject(GO_RIBBON_POLE, 8.0f) || !target->HasUnitState(UNIT_STATE_CASTING))
+                if (!target->FindNearestGameObject(GO_RIBBON_POLE, 8.0f))
                 {
                     target->InterruptNonMeleeSpells(false);
                     target->RemoveAurasDueToSpell(GetId());
@@ -1584,7 +1586,16 @@ class spell_gen_ribbon_pole_dancer_check : public SpellScriptLoader
 
                     // reward achievement criteria
                     if (aur->GetMaxDuration() == 3600000 && target->HasAura(SPELL_HAS_FULL_MIDSUMMER_SET))
+                    {
+                        if (Player* player = target->ToPlayer())
+                            if (!player->HasAchieved(271))
+                            {
+                                std::cout << "\n !Achieved";
+                                AchievementEntry const* achievementEntry = sAchievementMgr->GetAchievement(271);
+                                player->CompletedAchievement(achievementEntry);
+                            }
                         target->CastSpell(target, SPELL_BURNING_HOT_POLE_DANCE, true);
+                    }
                 }
                 else
                     target->AddAura(SPELL_RIBBON_DANCE, target);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment