1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. The Melee Mapping Contest #4: 2v2 - Results are out! Step by to congratulate the winners!
    Dismiss Notice
  3. We're hosting the 15th Mini-Mapping Contest with YouTuber Abelhawk! The contestants are to create a custom map that uses the hidden content within Warcraft 3 or is inspired by any of the many secrets within the game.
    Dismiss Notice
  4. The 20th iteration of the Terraining Contest is upon us! Join and create exquisite Water Structures for it.
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice

Summon Roflcopter v0.3

Submitted by Garfield1337
This bundle is marked as approved. It works and satisfies the submission rules.
A lulzy spell i made. The Roflcopter is made of floating text as well as the bombs he drops.

Summon Roflcopter
Call for the aid of a Roflcopter. The Rolfcopter will fly in a line and throw bombs beneath it.
Level 1 - 50 damage per bomb.
Level 2 - 100 damage per bomb.
Level 3 - 150 damage per bomb.

Requires:
-SpellEffectEvent (by Bribe) (Also the libraries that are required by this one: Table and RegisterPlayerUnitEvent)
-TimerUtils (Any, i used Vexorian's though)

Code
Code (vJASS):
library Roflcopter initializer Init requires TimerUtils, II, SpellEffectEvent, Z

    //Configurables and whatnot
    globals
        private constant integer SPELL_RAW         = 'A000'
        private constant string EXPLOSION_EFFECT   = "Abilities\\Weapons\\CannonTowerMissile\\CannonTowerMissile.mdl"
        private constant real HEIGHT               = 350.0 //Roflcopter height
        private constant real SPIN_PERIOD          = 0.16 //Period between each propeller change
        private constant attacktype ATTACK_TYPE    = ATTACK_TYPE_NORMAL
        private constant damagetype DAMAGE_TYPE    = DAMAGE_TYPE_NORMAL
        private constant weapontype WEAPON_TYPE    = WEAPON_TYPE_WHOKNOWS
    endglobals
   
    private constant function DAMAGE takes unit caster,integer lvl returns real
        return lvl * 50. //Damage dependency of level.
        //You can also make damage depend on caster's stats by refering to unit variable 'caster'
    endfunction
   
    private constant function TRAVEL_LENGTH takes integer lvl returns real
        return 1400. //How long does roflcopter fly
    endfunction
   
    private constant function BOMB_PERIOD takes integer lvl returns real
        return 0.5 //How often will roflcopter throw bombs
    endfunction
   
    private constant function BOMB_AOE takes integer lvl returns real
        return 200. //Area of effect for bomb explosion
    endfunction
   
    private constant function ROFLCOPTER_SPEED takes integer lvl returns real
        return 7. //Movement speed or roflcopter
    endfunction
   
    private constant function BOMB_SPEED takes integer lvl returns real
        return 7. //Fall speed of bombs
    endfunction
   
    private function FILTER takes unit caster,unit target,integer lvl returns boolean
        //Filters which units will be damaged on explosion
        return IsPlayerEnemy(GetOwningPlayer(caster),GetOwningPlayer(target)) /*
        */
and IsUnitType(target,UNIT_TYPE_GROUND) /*
        */
and not IsUnitType(target,UNIT_TYPE_DEAD)
    endfunction
   
    private function EFFECTS takes unit caster,unit target,real x,real y,real z,integer lvl returns nothing
        //You can add here anything you want to happen on explosion given the above arguments
        //For example, you can set damaged targets on fire with a spell casted by dummy or something
    endfunction
   
    //Don't change stuff below
    //===================================================================
    globals
        private constant string R1 = "ROFL:ROFL:LOL\n                      ^\n             ---------------\\           L\n           / [   ]            =====   O\n         /                  /             L\n        [_________/\n           I            I\n       \\-----------------"
        private constant string R2 = "                   LOL:ROFL:ROFL\n                      ^\n             ---------------\\\n           / [   ]            ===== LOL\n         /                  /\n        [_________/\n           I            I\n       \\-----------------"
        private constant string R3 = "   ROFL:ROFL:LOL\n                        ^\n               /---------------\nLOL =====             [   ] \\\n                  \\                  \\\n                    \\_________]\n                        I            I\n                    -----------------/"
        private constant string R4 = "                      LOL:ROFL:ROFL\n                        ^\n   L          /---------------\n  O   =====             [   ] \\\n   L             \\                  \\\n                    \\_________]\n                        I            I\n                    -----------------/"
        private constant real DEVIATION = 100.0
    endglobals
   
    private keyword roflcopter
   
    private struct instance
        integer n
        unit u
        real bs
        real rs
        real d
        real a
        integer lv
   
        method add takes nothing returns nothing
            set .n = .n + 1
        endmethod
       
        method sub takes nothing returns nothing
            set .n = .n - 1
            if .n == 0 then
                call .destroy()
            endif
        endmethod
   
        static method create takes unit u,real x,real y returns thistype
            local thistype this = thistype.allocate()
            local integer l = GetUnitAbilityLevel(u,SPELL_RAW)
            set .u = u
            set .bs = BOMB_SPEED(l)
            set .rs = ROFLCOPTER_SPEED(l)
            set .d = DAMAGE(u,l)
            set .a = BOMB_AOE(l)
            set .lv = l
            call roflcopter.create(this,x,y,TRAVEL_LENGTH(l),BOMB_PERIOD(l))
            return this
        endmethod
   
    endstruct
   
    private keyword bomb
   
    private struct roflcopter
        texttag t = CreateTextTag()
        instance i
        real x
        real y
        real l
        real a
        timer bp
        timer sp
        integer p
       
        method execute takes nothing returns nothing
            set .x = .x + .i.rs * Cos(.a)
            set .y = .y + .i.rs * Sin(.a)
            call SetTextTagPos(.t,.x - DEVIATION,.y,HEIGHT)
            set .l = .l - .i.rs
            if .l <= 0 then
                call .destroy()
            endif
        endmethod
   
        implement II
       
        static method bombdrop takes nothing returns nothing
            local thistype this = thistype(GetTimerData(GetExpiredTimer()))
            call bomb.create(.i,.x,.y,HEIGHT)
        endmethod
       
        static method spin takes nothing returns nothing
            local thistype this = thistype(GetTimerData(GetExpiredTimer()))
            if .p == 1 then
                call SetTextTagText(.t,R2,0.023)
                set .p = 2
            elseif .p == 2 then
                call SetTextTagText(.t,R1,0.023)
                set .p = 1
            elseif .p == 3 then
                call SetTextTagText(.t,R4,0.023)
                set .p = 4
            else
                call SetTextTagText(.t,R3,0.023)
                set .p = 3
            endif
        endmethod
   
        static method create takes instance i,real x,real y,real l,real p returns thistype
            local thistype this = thistype.allocate()
            local real a = Atan2(y - GetUnitY(i.u),x - GetUnitX(i.u))
            if a < 0 then
                set a = 2 * bj_PI + a
            endif
            set .i = i
            set .l = l
            set .a = a + bj_PI / 2
            set .bp = NewTimer()
            call TimerStart(.bp,p,true,function thistype.bombdrop)
            call SetTimerData(.bp,this)
            set .sp = NewTimer()
            call TimerStart(.sp,SPIN_PERIOD,true,function thistype.spin)
            call SetTimerData(.sp,this)
            call SetTextTagPermanent(.t,false)
            call SetTextTagVisibility(.t,true)
            set .x = x + l / 2 * Cos(a - bj_PI / 2) - DEVIATION
            set .y = y + TRAVEL_LENGTH(i) / 2 * Sin(a - bj_PI / 2)
            call SetTextTagPos(.t,.x,.y,HEIGHT)
            if a < bj_PI then
                set .p = 1
                call SetTextTagText(.t,R1,0.023)
            else
                set .p = 3
                call SetTextTagText(.t,R3,0.023)
            endif
            call .start()
            call .i.add()
            return this
        endmethod
       
        method destroy takes nothing returns nothing
            call DestroyTextTag(.t)
            call ReleaseTimer(.bp)
            call ReleaseTimer(.sp)
            call .end()
            call .i.sub()
            call .deallocate()
        endmethod
   
    endstruct
   
    private struct bomb
        static thistype This
        static group g = CreateGroup()
        texttag t = CreateTextTag()
        instance i
        real x
        real y
        real h
       
        method execute takes nothing returns nothing
            set .h = .h - .i.bs
            call SetTextTagPos(.t,.x,.y,.h)
            if .h <= 3.00 then
                call .destroy()
            endif
        endmethod
       
        implement II
       
        static method create takes instance i,real x,real y,real h returns thistype
            local thistype this = thistype.allocate()
            set .i = i
            set .x = x
            set .y = y
            set .h = h
            call SetTextTagPermanent(.t,false)
            call SetTextTagVisibility(.t,true)
            call SetTextTagPos(.t,x,y,h)
            call SetTextTagText(.t,"*",0.04)
            call .start()
            call .i.add()
            return this
        endmethod
       
        static method explosion takes nothing returns boolean
            local thistype this = .This
            local unit u = GetFilterUnit()
            local real x
            local real y
            local real z
            local real z2
            if FILTER(.i.u,u,.i.lv) then
                set x = GetUnitX(u) - .x
                set y = GetUnitY(u) - .y
                set z2 = GetZ(.x,.y) + .h
                set z = GetUnitZ(u) - z2
                if x*x+y*y+z*z <= .i.a*.i.a then
                    call UnitDamageTarget(.i.u,u,.i.d,false,false,ATTACK_TYPE,DAMAGE_TYPE,WEAPON_TYPE)
                    call EFFECTS(.i.u,u,.x,.y,z2,.i.lv)
                endif
            endif
            set u = null
            return false
        endmethod
       
        method destroy takes nothing returns nothing
            call DestroyTextTag(.t)
            call DestroyEffect(AddSpecialEffect(EXPLOSION_EFFECT,.x,.y))
            set .This = this
            call GroupEnumUnitsInRange(.g,.x,.y,.i.a,Filter(function thistype.explosion))
            call .end()
            call .i.sub()
            call .deallocate()
        endmethod
       
    endstruct
   
    private function Cast takes nothing returns nothing
        call instance.create(GetTriggerUnit(),GetSpellTargetX(),GetSpellTargetY())
    endfunction
   
    private function Init takes nothing returns nothing
        call RegisterSpellEffectEvent(SPELL_RAW, function Cast)
    endfunction

endlibrary

How to import
-Copy the triggers from Roflcopter trigger category or the whole category itself
-Copy the spell from object editor
-Configure the spell to your needs with Roflcopter trigger's constants

Note: the roflcopter text gets messed up if you test the spell with JNGP, but it does display properly if you test it by normally starting the game even if the spell is saved under JNGP. It also displays properly if you test it from vanilla WE.

Keywords:
Roflcopter, gyrocopter, flying, machine, copter, bombs, explosion, lmao, rofl, lol, lolz, lulz, funny, derp, obvious, win, awesome, Bob Marley
Contents

Summon Roflcopter (Map)

Reviews
Moderator
15 Oct 2015 08:41 Bribe: No longer a director's cut resource as this is literally a joke. Bribe: Leakless Very MUI Absolutely no lag Highly entertaining Very creative Looks just about flawless Highly Recommended, I'll ask...
  1. 15 Oct 2015
    08:41 Bribe: No longer a director's cut resource as this is literally a joke.

    Bribe:

    Leakless
    Very MUI
    Absolutely no lag
    Highly entertaining
    Very creative
    Looks just about flawless

    Highly Recommended, I'll ask The_Reborn_Devil to give this Director's Cut. Nice work!

    The_Reborn_Devil: Director's Cut has been given :D
    Derp derp.
     
  2. FibSaSk

    FibSaSk

    Joined:
    Nov 2, 2009
    Messages:
    75
    Resources:
    0
    Resources:
    0
    Tested, works great.
    Epic lulz too.
     
  3. Luffy_299

    Luffy_299

    Joined:
    Jan 17, 2010
    Messages:
    360
    Resources:
    0
    Resources:
    0
    Meh just fun, not useful 3/5
     
  4. Garfield1337

    Garfield1337

    Joined:
    Jul 6, 2009
    Messages:
    1,806
    Resources:
    4
    Maps:
    1
    Spells:
    3
    Resources:
    4
    Thanks for comment :3

    Any suggestions to improve it?
     
  5. priest170234

    priest170234

    Joined:
    Oct 31, 2010
    Messages:
    226
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    I like it! I don't do much JASS/vJASS so I can't seem to find any leaks or whatsoever. Does not lag, and MUI:)
    By the way: Would be great if I can configure the helicopter blades and rotor (The "LOL" stuff).
    4/5 for now. 5/5 if I can configure that:)
     
  6. Garfield1337

    Garfield1337

    Joined:
    Jul 6, 2009
    Messages:
    1,806
    Resources:
    4
    Maps:
    1
    Spells:
    3
    Resources:
    4
    @priest
    To configure it? You mean to change the text?
    Well,it would be hardly configurable since changing the text would mess up the copter D:
     
  7. wohuynia

    wohuynia

    Joined:
    Dec 9, 2008
    Messages:
    102
    Resources:
    0
    Resources:
    0
    It damages the caster -.- this part sucked, else is good ;D
     
  8. priest170234

    priest170234

    Joined:
    Oct 31, 2010
    Messages:
    226
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    Yeah, it's quite hard.. But it's worth a try to do that.
     
  9. Garfield1337

    Garfield1337

    Joined:
    Jul 6, 2009
    Messages:
    1,806
    Resources:
    4
    Maps:
    1
    Spells:
    3
    Resources:
    4
    It's supposed to damage allied units too...i guess i'll make a configurable boolean to set it on/off.
     
  10. FibSaSk

    FibSaSk

    Joined:
    Nov 2, 2009
    Messages:
    75
    Resources:
    0
    Resources:
    0
    Ah yea it also damages the caster, didnt see the HP bar falling because of high HP caster.
    Also, the rotation is kinda strange?
     
  11. Bg_Trinnin

    Bg_Trinnin

    Joined:
    Nov 20, 2009
    Messages:
    7
    Resources:
    0
    Resources:
    0
    Words can not describe the epicness that is this spell!
    100/5
     
  12. Garfield1337

    Garfield1337

    Joined:
    Jul 6, 2009
    Messages:
    1,806
    Resources:
    4
    Maps:
    1
    Spells:
    3
    Resources:
    4
    Quick update - now there's a boolean that checks wheter allied units should be damaged.
     
  13. GIANT_CRAB

    GIANT_CRAB

    Joined:
    Apr 4, 2010
    Messages:
    542
    Resources:
    2
    Spells:
    2
    Resources:
    2
    ROFL~~~~
    WUT IS THIS I DON'T EVEN....

    -Its like a chopper dropping bomb. (Choppers aren't suppose to drop bombs, are they? Isn't that the bombers' job??)
    --The script is very short and simple. And sweet. 3/5
     
  14. Garfield1337

    Garfield1337

    Joined:
    Jul 6, 2009
    Messages:
    1,806
    Resources:
    4
    Maps:
    1
    Spells:
    3
    Resources:
    4
    Well,gyrocopters/flying machines drop bombs also.
     
    Last edited: Dec 26, 2010
  15. FibSaSk

    FibSaSk

    Joined:
    Nov 2, 2009
    Messages:
    75
    Resources:
    0
    Resources:
    0
    Indeed, copters don`t drop bombs. This is why it`s called roflcopter.
    I can`t see why such a unique skill like this can`t have a 4/5. Will also be useful in some "lulzy maps".

    PS: Anyone else thinking to make a 4chan map? D;
     
  16. Chizume

    Chizume

    Joined:
    May 26, 2009
    Messages:
    597
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Epic indeed! :)
     
  17. chanckaka

    chanckaka

    Joined:
    Nov 2, 2010
    Messages:
    20
    Resources:
    0
    Resources:
    0
    Funny and useful ,5/5 :D
     
  18. Tank-Commander

    Tank-Commander

    Spell Reviewer

    Joined:
    May 26, 2009
    Messages:
    1,544
    Resources:
    44
    Packs:
    1
    Spells:
    41
    Tutorials:
    2
    Resources:
    44
    I'm gonna be down to earth on this one I'm afraid, as novel as as it being a 'roflcopter' which drops bombs, this is simply just another one of the bombing spells that we already have a tonne of, and in perfect honesty, it's just a line of explosions with sfx around it, not much actual functionallity in there apart from manipulation of this Text, which sole purpose is for people to find funny. Yes I can see uses for it but I don't see why this is anything special in comparison to the other various bombing spells we have. it just deals damage in little circles, I'm afraid without more functionallity I have to give this a 3/5. mostly due to the humour factor, other than this it's incredably simple and could be made in 5-10 minutes with the right know-how, try adding rockets, machine guns and what not, I'll add a point for each new weapon (if thats what you're gonna do, or just give the bombs a bit more functionallity other than damage)

    I once considered doing this, but abandoned the idea due to beleiving that it'd be a simple spell that in my eyes would be nothing special. I was tempted to give 2/5 but I'm too kind for that >__>
     
  19. Garfield1337

    Garfield1337

    Joined:
    Jul 6, 2009
    Messages:
    1,806
    Resources:
    4
    Maps:
    1
    Spells:
    3
    Resources:
    4
    @Tank-Commander,
    Thanks for comment. I know it's really simple,actually,the triggers were really easy,but the actual copter text was a bit of work. It's not same to manipulate units and text tags.
    i'll see to improve it somehow...
     
    Last edited: Dec 27, 2010