{"action":"created","comment":{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments/33823423","id":33823423,"diff_hunk":"@@ -2155,6 +2171,293 @@ class at_icc_start_frostwing_gauntlet : public AreaTriggerScript\n         }\n };\n \n+class npc_flesh_eating_insect : public CreatureScript\n+{\n+public:\n+    npc_flesh_eating_insect() : CreatureScript(\"npc_flesh_eating_insect\") { }\n+\n+    struct npc_flesh_eating_insectAI : public ScriptedAI\n+    {\n+        npc_flesh_eating_insectAI(Creature* creature) : ScriptedAI(creature)\n+        {\n+            me->SetReactState(REACT_AGGRESSIVE);\n+            me->GetMotionMaster()->MoveRandom(10.0f);\n+        }\n+\n+        void Reset() override\n+        {\n+            me->SetReactState(REACT_AGGRESSIVE);\n+            me->GetMotionMaster()->MoveRandom(10.0f);\n+        }\n+\n+        void JustDied(Unit* /*killer*/) override\n+        {\n+            me->DespawnOrUnsummon();\n+        }\n+\n+        void DoAction(int32 action) override\n+        {\n+            switch (action)\n+            {\n+                case ACTION_PUTRICIDE_BUG_LEAP:\n+                    DoCast(SPELL_RANDOM_LEAP);\n+                    _events.ScheduleEvent(EVENT_END_LEAP, 3000);\n+                    break;\n+                default:\n+                    break;\n+            }\n+        }\n+\n+        void UpdateAI(uint32 diff) override\n+        {\n+            _events.Update(diff);\n+\n+            if (_events.ExecuteEvent() == EVENT_END_LEAP)\n+            {\n+                me->GetMotionMaster()->MoveRandom(10.0f);\n+            }\n+\n+            if (!UpdateVictim())\n+                return;\n+\n+            DoMeleeAttackIfReady();\n+        }\n+\n+    private:\n+        EventMap _events;\n+    };\n+\n+    CreatureAI* GetAI(Creature* creature) const override\n+    {\n+        return GetIcecrownCitadelAI<npc_flesh_eating_insectAI>(creature);\n+    }\n+};\n+\n+class npc_putricide_trap : public CreatureScript\n+{\n+public:\n+    npc_putricide_trap() : CreatureScript(\"npc_putricide_trap\") { }\n+\n+    struct npc_putricide_trapAI : public ScriptedAI\n+    {\n+        npc_putricide_trapAI(Creature* creature) : ScriptedAI(creature)\n+        {\n+            _instance = creature->GetInstanceScript();\n+        }\n+\n+        void DoAction(int32 action) override\n+        {\n+            switch (action)\n+            {\n+                case ACTION_PUTRICIDE_STALKERS:\n+                    GetCreatureListWithEntryInGrid(stalkers, me, NPC_INVISIBLE_STALKER, 35.0f);\n+                    _events.ScheduleEvent(EVENT_SUMMON_FLESH_EATING_BUG, 2000);\n+                    break;\n+                case ACTION_PUTRICIDE_TRAP:\n+                    _events.ScheduleEvent(EVENT_PUTRICIDE_TRAP, 3000);\n+                    break;\n+            }\n+        }\n+\n+        void UpdateAI(uint32 diff) override\n+        {\n+            _events.Update(diff);\n+\n+            while (uint32 eventId = _events.ExecuteEvent())\n+            {\n+                switch (eventId)\n+                {\n+                    case EVENT_PUTRICIDE_TRAP:\n+                        DoCast(SPELL_GIANT_SWARM);\n+                        _instance->SetData(DATA_PUTRICIDE_TRAP, IN_PROGRESS);\n+                        _events.ScheduleEvent(EVENT_END_TRAP, 50000);\n+                        break;\n+                    case EVENT_SUMMON_FLESH_EATING_BUG:\n+                        for (std::list<Creature*>::iterator itr = stalkers.begin(); itr != stalkers.end(); ++itr)\n+                            (*itr)->AI()->DoCast(SPELL_SUMMON_PLAGUE_INSECT);\n+                        if (_instance->GetData(DATA_PUTRICIDE_TRAP) == IN_PROGRESS)\n+                            _events.ScheduleEvent(EVENT_SUMMON_FLESH_EATING_BUG, 2500);\n+                        break;\n+                    case EVENT_END_TRAP:\n+                        me->RemoveAura(SPELL_GIANT_SWARM);\n+                        me->CastStop();\n+                        _instance->SetData(DATA_PUTRICIDE_TRAP, DONE);\n+                        Map::PlayerList const &players = me->GetMap()->GetPlayers();\n+                        for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)\n+                        {\n+                            Player* player = itr->GetSource();\n+                            if (!player)\n+                                continue;\n+                            if (player->HasAura(SPELL_GIANT_SWARM))\n+                                player->RemoveAura(SPELL_GIANT_SWARM);\n+                        }\n+                        break;\n+                }\n+            }\n+        }\n+\n+    private:\n+        EventMap _events;\n+        std::list<Creature*> stalkers;\n+        InstanceScript* _instance;\n+    };\n+\n+    CreatureAI* GetAI(Creature* creature) const override\n+    {\n+        return GetIcecrownCitadelAI<npc_putricide_trapAI>(creature);\n+    }\n+\n+};\n+\n+class spell_icc_random_leap_location : public SpellScriptLoader\n+{\n+public:\n+    spell_icc_random_leap_location() : SpellScriptLoader(\"spell_icc_random_leap_location\") { }\n+\n+    class spell_icc_random_leap_location_SpellScript : public SpellScript\n+    {\n+        PrepareSpellScript(spell_icc_random_leap_location_SpellScript);\n+\n+        void HandleJump(SpellEffIndex effIndex)\n+        {\n+            PreventHitDefaultEffect(effIndex);\n+\n+            Unit* caster = GetOriginalCaster();\n+\n+            if (Creature* creature = caster->FindNearestCreature(NPC_PUTRICIDE_TRAP, 40.0f, true))\n+            {\n+                Position pos = creature->GetRandomNearPosition(15.0f);\n+                caster->GetMotionMaster()->MoveJump(pos, 30.0f, 0.0f);\n+                caster->ToCreature()->SetHomePosition(pos);\n+            }","path":"src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp","position":199,"original_position":199,"commit_id":"8bf082770681311da7eff7935c956616da955de7","original_commit_id":"8bf082770681311da7eff7935c956616da955de7","user":{"login":"joschiwald","id":736792,"avatar_url":"https://avatars.githubusercontent.com/u/736792?v=3","gravatar_id":"","url":"https://api.github.com/users/joschiwald","html_url":"https://github.com/joschiwald","followers_url":"https://api.github.com/users/joschiwald/followers","following_url":"https://api.github.com/users/joschiwald/following{/other_user}","gists_url":"https://api.github.com/users/joschiwald/gists{/gist_id}","starred_url":"https://api.github.com/users/joschiwald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joschiwald/subscriptions","organizations_url":"https://api.github.com/users/joschiwald/orgs","repos_url":"https://api.github.com/users/joschiwald/repos","events_url":"https://api.github.com/users/joschiwald/events{/privacy}","received_events_url":"https://api.github.com/users/joschiwald/received_events","type":"User","site_admin":false},"body":"spellmgr like the other missing spellradius examples","created_at":"2015-07-02T21:12:43Z","updated_at":"2015-07-02T21:12:43Z","html_url":"https://github.com/TrinityCore/TrinityCore/pull/14997#discussion_r33823423","pull_request_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/14997","_links":{"self":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments/33823423"},"html":{"href":"https://github.com/TrinityCore/TrinityCore/pull/14997#discussion_r33823423"},"pull_request":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/14997"}}},"pull_request":{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/14997","id":39081491,"html_url":"https://github.com/TrinityCore/TrinityCore/pull/14997","diff_url":"https://github.com/TrinityCore/TrinityCore/pull/14997.diff","patch_url":"https://github.com/TrinityCore/TrinityCore/pull/14997.patch","issue_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/14997","number":14997,"state":"open","locked":false,"title":"Scripts/ICC: Implement Putricide Pre-Event","user":{"login":"mik1893","id":1483174,"avatar_url":"https://avatars.githubusercontent.com/u/1483174?v=3","gravatar_id":"","url":"https://api.github.com/users/mik1893","html_url":"https://github.com/mik1893","followers_url":"https://api.github.com/users/mik1893/followers","following_url":"https://api.github.com/users/mik1893/following{/other_user}","gists_url":"https://api.github.com/users/mik1893/gists{/gist_id}","starred_url":"https://api.github.com/users/mik1893/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mik1893/subscriptions","organizations_url":"https://api.github.com/users/mik1893/orgs","repos_url":"https://api.github.com/users/mik1893/repos","events_url":"https://api.github.com/users/mik1893/events{/privacy}","received_events_url":"https://api.github.com/users/mik1893/received_events","type":"User","site_admin":false},"body":"Need some testing, implemented from an old source!\r\nHelp me check for mistakes","created_at":"2015-07-02T13:21:02Z","updated_at":"2015-07-02T21:12:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a0777da4a051b65a614bab61a1f6b3c7c6add748","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/14997/commits","review_comments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/14997/comments","review_comment_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/14997/comments","statuses_url":"https://api.github.com/repos/TrinityCore/TrinityCore/statuses/8bf082770681311da7eff7935c956616da955de7","head":{"label":"mik1893:putricide_event","ref":"putricide_event","sha":"8bf082770681311da7eff7935c956616da955de7","user":{"login":"mik1893","id":1483174,"avatar_url":"https://avatars.githubusercontent.com/u/1483174?v=3","gravatar_id":"","url":"https://api.github.com/users/mik1893","html_url":"https://github.com/mik1893","followers_url":"https://api.github.com/users/mik1893/followers","following_url":"https://api.github.com/users/mik1893/following{/other_user}","gists_url":"https://api.github.com/users/mik1893/gists{/gist_id}","starred_url":"https://api.github.com/users/mik1893/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mik1893/subscriptions","organizations_url":"https://api.github.com/users/mik1893/orgs","repos_url":"https://api.github.com/users/mik1893/repos","events_url":"https://api.github.com/users/mik1893/events{/privacy}","received_events_url":"https://api.github.com/users/mik1893/received_events","type":"User","site_admin":false},"repo":{"id":35959003,"name":"TrinityCore","full_name":"mik1893/TrinityCore","owner":{"login":"mik1893","id":1483174,"avatar_url":"https://avatars.githubusercontent.com/u/1483174?v=3","gravatar_id":"","url":"https://api.github.com/users/mik1893","html_url":"https://github.com/mik1893","followers_url":"https://api.github.com/users/mik1893/followers","following_url":"https://api.github.com/users/mik1893/following{/other_user}","gists_url":"https://api.github.com/users/mik1893/gists{/gist_id}","starred_url":"https://api.github.com/users/mik1893/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mik1893/subscriptions","organizations_url":"https://api.github.com/users/mik1893/orgs","repos_url":"https://api.github.com/users/mik1893/repos","events_url":"https://api.github.com/users/mik1893/events{/privacy}","received_events_url":"https://api.github.com/users/mik1893/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mik1893/TrinityCore","description":"TrinityCore Open Source MMO Framework","fork":true,"url":"https://api.github.com/repos/mik1893/TrinityCore","forks_url":"https://api.github.com/repos/mik1893/TrinityCore/forks","keys_url":"https://api.github.com/repos/mik1893/TrinityCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mik1893/TrinityCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mik1893/TrinityCore/teams","hooks_url":"https://api.github.com/repos/mik1893/TrinityCore/hooks","issue_events_url":"https://api.github.com/repos/mik1893/TrinityCore/issues/events{/number}","events_url":"https://api.github.com/repos/mik1893/TrinityCore/events","assignees_url":"https://api.github.com/repos/mik1893/TrinityCore/assignees{/user}","branches_url":"https://api.github.com/repos/mik1893/TrinityCore/branches{/branch}","tags_url":"https://api.github.com/repos/mik1893/TrinityCore/tags","blobs_url":"https://api.github.com/repos/mik1893/TrinityCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mik1893/TrinityCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mik1893/TrinityCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/mik1893/TrinityCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mik1893/TrinityCore/statuses/{sha}","languages_url":"https://api.github.com/repos/mik1893/TrinityCore/languages","stargazers_url":"https://api.github.com/repos/mik1893/TrinityCore/stargazers","contributors_url":"https://api.github.com/repos/mik1893/TrinityCore/contributors","subscribers_url":"https://api.github.com/repos/mik1893/TrinityCore/subscribers","subscription_url":"https://api.github.com/repos/mik1893/TrinityCore/subscription","commits_url":"https://api.github.com/repos/mik1893/TrinityCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/mik1893/TrinityCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/mik1893/TrinityCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/mik1893/TrinityCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/mik1893/TrinityCore/contents/{+path}","compare_url":"https://api.github.com/repos/mik1893/TrinityCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mik1893/TrinityCore/merges","archive_url":"https://api.github.com/repos/mik1893/TrinityCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mik1893/TrinityCore/downloads","issues_url":"https://api.github.com/repos/mik1893/TrinityCore/issues{/number}","pulls_url":"https://api.github.com/repos/mik1893/TrinityCore/pulls{/number}","milestones_url":"https://api.github.com/repos/mik1893/TrinityCore/milestones{/number}","notifications_url":"https://api.github.com/repos/mik1893/TrinityCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mik1893/TrinityCore/labels{/name}","releases_url":"https://api.github.com/repos/mik1893/TrinityCore/releases{/id}","created_at":"2015-05-20T16:08:01Z","updated_at":"2015-06-26T12:50:57Z","pushed_at":"2015-07-02T13:18:59Z","git_url":"git://github.com/mik1893/TrinityCore.git","ssh_url":"git@github.com:mik1893/TrinityCore.git","clone_url":"https://github.com/mik1893/TrinityCore.git","svn_url":"https://github.com/mik1893/TrinityCore","homepage":"http://www.trinitycore.org","size":362985,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"6.x"}},"base":{"label":"TrinityCore:3.3.5","ref":"3.3.5","sha":"94bb71e5a1f2b341e94aa6adc661f1200b2b10aa","user":{"login":"TrinityCore","id":539602,"avatar_url":"https://avatars.githubusercontent.com/u/539602?v=3","gravatar_id":"","url":"https://api.github.com/users/TrinityCore","html_url":"https://github.com/TrinityCore","followers_url":"https://api.github.com/users/TrinityCore/followers","following_url":"https://api.github.com/users/TrinityCore/following{/other_user}","gists_url":"https://api.github.com/users/TrinityCore/gists{/gist_id}","starred_url":"https://api.github.com/users/TrinityCore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrinityCore/subscriptions","organizations_url":"https://api.github.com/users/TrinityCore/orgs","repos_url":"https://api.github.com/users/TrinityCore/repos","events_url":"https://api.github.com/users/TrinityCore/events{/privacy}","received_events_url":"https://api.github.com/users/TrinityCore/received_events","type":"Organization","site_admin":false},"repo":{"id":1204412,"name":"TrinityCore","full_name":"TrinityCore/TrinityCore","owner":{"login":"TrinityCore","id":539602,"avatar_url":"https://avatars.githubusercontent.com/u/539602?v=3","gravatar_id":"","url":"https://api.github.com/users/TrinityCore","html_url":"https://github.com/TrinityCore","followers_url":"https://api.github.com/users/TrinityCore/followers","following_url":"https://api.github.com/users/TrinityCore/following{/other_user}","gists_url":"https://api.github.com/users/TrinityCore/gists{/gist_id}","starred_url":"https://api.github.com/users/TrinityCore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrinityCore/subscriptions","organizations_url":"https://api.github.com/users/TrinityCore/orgs","repos_url":"https://api.github.com/users/TrinityCore/repos","events_url":"https://api.github.com/users/TrinityCore/events{/privacy}","received_events_url":"https://api.github.com/users/TrinityCore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TrinityCore/TrinityCore","description":"TrinityCore Open Source MMO Framework","fork":false,"url":"https://api.github.com/repos/TrinityCore/TrinityCore","forks_url":"https://api.github.com/repos/TrinityCore/TrinityCore/forks","keys_url":"https://api.github.com/repos/TrinityCore/TrinityCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TrinityCore/TrinityCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TrinityCore/TrinityCore/teams","hooks_url":"https://api.github.com/repos/TrinityCore/TrinityCore/hooks","issue_events_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/events{/number}","events_url":"https://api.github.com/repos/TrinityCore/TrinityCore/events","assignees_url":"https://api.github.com/repos/TrinityCore/TrinityCore/assignees{/user}","branches_url":"https://api.github.com/repos/TrinityCore/TrinityCore/branches{/branch}","tags_url":"https://api.github.com/repos/TrinityCore/TrinityCore/tags","blobs_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TrinityCore/TrinityCore/statuses/{sha}","languages_url":"https://api.github.com/repos/TrinityCore/TrinityCore/languages","stargazers_url":"https://api.github.com/repos/TrinityCore/TrinityCore/stargazers","contributors_url":"https://api.github.com/repos/TrinityCore/TrinityCore/contributors","subscribers_url":"https://api.github.com/repos/TrinityCore/TrinityCore/subscribers","subscription_url":"https://api.github.com/repos/TrinityCore/TrinityCore/subscription","commits_url":"https://api.github.com/repos/TrinityCore/TrinityCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/TrinityCore/TrinityCore/contents/{+path}","compare_url":"https://api.github.com/repos/TrinityCore/TrinityCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TrinityCore/TrinityCore/merges","archive_url":"https://api.github.com/repos/TrinityCore/TrinityCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TrinityCore/TrinityCore/downloads","issues_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues{/number}","pulls_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls{/number}","milestones_url":"https://api.github.com/repos/TrinityCore/TrinityCore/milestones{/number}","notifications_url":"https://api.github.com/repos/TrinityCore/TrinityCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TrinityCore/TrinityCore/labels{/name}","releases_url":"https://api.github.com/repos/TrinityCore/TrinityCore/releases{/id}","created_at":"2010-12-28T23:40:07Z","updated_at":"2015-07-01T16:18:37Z","pushed_at":"2015-07-02T20:09:20Z","git_url":"git://github.com/TrinityCore/TrinityCore.git","ssh_url":"git@github.com:TrinityCore/TrinityCore.git","clone_url":"https://github.com/TrinityCore/TrinityCore.git","svn_url":"https://github.com/TrinityCore/TrinityCore","homepage":"http://www.trinitycore.org","size":854867,"stargazers_count":2878,"watchers_count":2878,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3000,"mirror_url":null,"open_issues_count":1056,"forks":3000,"open_issues":1056,"watchers":2878,"default_branch":"6.x"}},"_links":{"self":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/14997"},"html":{"href":"https://github.com/TrinityCore/TrinityCore/pull/14997"},"issue":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/14997"},"comments":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/14997/comments"},"review_comments":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/14997/comments"},"review_comment":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/14997/commits"},"statuses":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/statuses/8bf082770681311da7eff7935c956616da955de7"}}}}