Spell Ice Mirage

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
JASS - Yes - vJASS REQUIRED
MUI - Yes
Works - Yes
Fun - In Soviet Russia, spell casts YOU!!
Leaks - I am not an old pipe!

Ice Mirage

This spell creates a number of dark magicians around the target, who cause a spell to be cast that does massive damage to the target and surrounding units.

IceMirage.gif


Code:

JASS:
//**************************ICE MIRAGE by GHAN_04***********************
//******************************DESCRIPTION*****************************
//**Creates a number of dark magicians around the target, who cause a
//**spell to be cast that does massive damage to the target and 
//**surrounding units.**************************************************
//**********************************************************************

scope IceMirage initializer Init                                      //When the map starts up, run the "Init" function.

    globals //Declaring some globals for our ability.
    //********************CONFIGURATION CONSTANTS - YOU MAY EDIT***********************************
        private constant integer ICE_MIRAGE_CODE = 'A000'             //Raw Code of the hero ability.
        private constant integer ICE_MIRAGE_EFFECT_CODE = 'A001'      //Raw Code of the Effect ability that the Dummy has.
        private constant integer DUMMY_UNIT_CODE = 'u000'             //Raw Code of the Dummy unit.
        private constant integer IMAGE_UNIT_CODE = 'u001'             //Raw Code of the Image units.
        private constant integer NUMBER_OF_IMAGES = 5                 //Number of images that appear around the target.
        private constant real IMAGE_RADIUS = 300.0                    //Distance from target the images will appear.
    //*********************PLEASE DO NOT EDIT BELOW THIS LINE***************************************
        private trigger t = CreateTrigger()                           //Makes a new trigger for us to use.
    endglobals
    
    private function Conditions takes nothing returns boolean
        return GetSpellAbilityId() == ICE_MIRAGE_CODE                 //Checks to make sure the ability being cast = Ice Mirage.
    endfunction
    
    private function Actions takes nothing returns nothing
        //Begin by creating some variables for our spell.
        local unit target = GetSpellTargetUnit()
        local unit caster = GetTriggerUnit()
        local real casterX = GetUnitX(caster)
        local real casterY = GetUnitY(caster)
        local real targetX = GetUnitX(target)
        local real targetY = GetUnitY(target)
        local real offsetX
        local real offsetY
        local unit dummy = CreateUnit(GetOwningPlayer(caster), DUMMY_UNIT_CODE, targetX, targetY, bj_UNIT_FACING) //Create the dummy that casts the spell.
        local integer count = 0
        local integer abilitylevel = GetUnitAbilityLevel(caster, ICE_MIRAGE_CODE)
        local unit imageunit
        call PauseUnit(target, true) //Pause the target while the ability is being cast.
        loop
            exitwhen count > NUMBER_OF_IMAGES - 1
            set offsetX = targetX + IMAGE_RADIUS * Cos(((360/NUMBER_OF_IMAGES) * count) * bj_DEGTORAD) //These two actions get the location where we will create the image.
            set offsetY = targetY + IMAGE_RADIUS * Sin(((360/NUMBER_OF_IMAGES) * count) * bj_DEGTORAD)
            set imageunit = CreateUnit(GetOwningPlayer(caster), IMAGE_UNIT_CODE, offsetX, offsetY, bj_RADTODEG * Atan2(targetY - offsetY, targetX - offsetX)) //Now that we know the location, create the unit.
            call SetUnitAnimation(imageunit, "attack") //Play the attack animation.
            set imageunit = null //Clear the potential leak. Though, I'm not sure it needs to be cleared every time....
            set count = count + 1 //No infinte loops allowed.
        endloop
        call UnitAddAbility(dummy, ICE_MIRAGE_EFFECT_CODE) //Give the dummy the ability to cast.
        call SetUnitAbilityLevel(dummy, ICE_MIRAGE_EFFECT_CODE, abilitylevel) //Set the level of the ability to the same as the Hero's ability level.
        call IssueTargetOrder(dummy, "frostnova", target) //Cast the nova ability.
        call TriggerSleepAction(0.5) //Wait to unpause the unit.
        call PauseUnit(target, false) //Now unpause the unit.
        set dummy = null //Clear leaks.
        set target = null
        set caster = null
    endfunction
    
    private function Init takes nothing returns nothing
        local integer index = 0
        loop
            call TriggerRegisterPlayerUnitEvent(t, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
            set index = index + 1
            exitwhen index == bj_MAX_PLAYER_SLOTS
        endloop
        call TriggerAddCondition(t, Condition(function Conditions))
        call TriggerAddAction(t, function Actions)
    endfunction
    
endscope


I created this spell a while back for someone in a spell request thread. Just figured I'd submit it now. I don't know if the person who requested it ever got it, actually.
 

Attachments

  • Ice Mirage.w3x
    16 KB · Views: 229

Romek

Super Moderator
Reaction score
963
Screenshot?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
Whenever I try to take screenshots of WC3, they end up as black images. I don't know why, but I can't get any.
 

Viikuna

No Marlo no game.
Reaction score
265
Fun - In Soviet Russia, spell casts YOU!!
:D

anyways, maybe NUMBER_OF_IMAGES and IMAGE_RADIUS could be turned to functions, which take integer level, so people could have more images with higher levels and stuff like that.
 
Reaction score
91
> Whenever I try to take screenshots of WC3, they end up as black images. I don't know why, but I can't get any.
I have the same problem... Does anybody know how to fix it?
 

D.V.D

Make a wish
Reaction score
73
The spell looks kinda wierd because the spirits are just made. Make a effect? And, the randomly frost nova. Maybe add a spell animation. Other than that its great.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
Hmm.... Interesting.
Surprisingly, pasting into Irfanview worked. So much for Warcraft III storing screenshots. Note to self: WC3 input is not to be trusted.
I think I know the reason for the black screenshots. It is probably because I have my resolution set to a custom number in the registry to accommodate my widescreen monitor.

Anyway, added a screenshot.
 

BlackRose

Forum User
Reaction score
239
Whenever I try to take screenshots of WC3, they end up as black images. I don't know why, but I can't get any.
Same with me, it works on one computer, but the other it does not....

The spell looks rather bland... I think I once made something like this... <In GUI>. Except they were Liches that floated upwards.

Also, Revenants in red with blue tinting looks funny, maybe just set them to blue entirely?
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
> Whenever I try to take screenshots of WC3, they end up as black images. I don't know why, but I can't get any.
I have the same problem... Does anybody know how to fix it?

Newer graphic cards have these kinds of problem. I use Fraps as alternative.
 

Julian4life

New Member
Reaction score
7
Yeah! That was mine! :D
I requested it, and i actually didn't find it to add it yet, i lost the thread.
But yeah, i think it was from a spell request thread yeah?

Thats awesome!
+rep'd
implemented into game & credited just now! :D

lol long time no see.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top