Spell Frozen Orb

H

hadha

Guest
help the retard (me)

:banghead:
so i tried to copy your skill, and was gonna make it slight different..

still, even before ive edited anything..

yah. the pictures speak for itself..

roflwoothv0.jpg

roflwoot2qo4.jpg

yeah.. thats.. water elements..
 

Flare

Stops copies me!
Reaction score
662
you never added locust to the water elementals? if you read the importing instructions, you shouldve copied all the custom units which you obviously didnt if the dummies hp bar can be seen. other than that, i have no idea what could be wrong other than that. try copying it according to importing instructions into a blank map, and see if it works.
 
H

hadha

Guest
checked - i got three dummies from your map and they all got locust..
 

Sim

Forum Administrator
Staff member
Reaction score
534
The recreation would be perfect if the ice bolts wouldn't spawn so evenly.

What I mean by this is that in Diablo 2, the bolts come out randomly and towards a random angle. In your spell, the bolts come up evenly, and the angle changes evenly too. For instance, if 1 bolt comes out at 45 degrees, the second comes out at 95 degrees, the third one at 135 degrees, and so on.

It should be random. :)

Also, why does it throw something when the spell is cast? It has nothing to do with Frozen Orb.

Apart from that, nice work! Keep it up! :)
 

emootootoo

Top Banana
Reaction score
51
The recreation would be perfect if the ice bolts wouldn't spawn so evenly.

What I mean by this is that in Diablo 2, the bolts come out randomly and towards a random angle. In your spell, the bolts come up evenly, and the angle changes evenly too. For instance, if 1 bolt comes out at 45 degrees, the second comes out at 95 degrees, the third one at 135 degrees, and so on.

Almost :p. As the main orb shoots across, the bolts do come out at random angles, however, say angle intervals are 45 degrees (360/45=8) means that every 8 orbs shot will in fact fill a full 360 degrees of frost bolts. Then when the orb explodes, it releases a much more intense circle of frost bolts that goes out like a nova. (like every 10 degrees).

So to do that best, I'd pick a random angle then start making the frost bolts +45 degrees till you reach 8, unless you want to randomize, but still making the full circle (so it makes a circle, assuming the interval is 45), then pick another random angle and do the same, like 3 times, then have the nova of frost bolts at the end when it finishes. And yeah, each frost bolt has a small delay (very small actually) between it, like you've done, the only time frost bolts are created at exactly the same time is the nova at the end.

That is what needs to be done for the recreation to be perfect. :p

It's very cool already though. (excuse the pun)
 

Flare

Stops copies me!
Reaction score
662
OK, as my parting gift to GUI spell making, I'll randomize the bolt spawn. But how do I stop blood mage from throwing the thing when casting a spell? if it just involves removing the sphere ability, that makes it so much easier :D

also, the original reason i had the ice bolts spawning at regular intervals is because i like patterns, and the spell just doesnt look pleasant (to me at least) if two ice bolts are almost overlapping. it was also a test to see if i could make multiple units periodically move with a regular angle change, and still keep the ability MUI (first time i tried it, the bolts were spawning at exact same angle due to a silly mistake)

Update: Final version of Frozen Orb complete (unless significant bugs are found, but please don't expect me to try and fix the small stuff, I need to break away from GUI). Uploaded on first post

Code:
Change Log:
-Added the cold effect sfx (effect created when attacking a frost armor'ed unit) to units hit by bolts.
-Added a cool sfx to units hit by the orb, but I will not say which. It is up to you to test and see which (it could be a bit excessive but its still nice ^^)
-ALL floating text removed, it becomes too cluttered onscreen
-Changed spawn angle of bolts so they travel at totally random angles

Edit: As a last word, ENJOY! You won't be seeing any new material from me in this setion until I figure out a cool spell in JASS, and how to make it.
 

Sim

Forum Administrator
Staff member
Reaction score
534
Looks so much like Frozen Orb now! :)

My D2 expert friend said there should be more spikes coming out of the orb really, and the orb should be a bit faster.

Simply reduce the event's periodic timer from 0.04 to 0.02 or 0.01 and reduce a bit the distance the orb moves every time the trigger runs.
 

Flare

Stops copies me!
Reaction score
662
Reducing the periodic timer is begging for lag (makes the game unplayable REALLY fast). Bah, this was supposed to be the final version of the spell, and I'm straying back to GUI too often (with help threads and stuff). There was 9 spikes appearing per second in a previous version, but I reduced the duration of ALL things by roughly 1/4 of their original time (orbs went from 3->2.31, bolts went from 1->0.77 so bolt spawn and stuff all fitted in nicely [21 bolts spawned every 2.31, not a millisecond to spare and it allows for a maximum for 8 things to be onscreen at any one time for each instance of the spell])

Curse D2 players everywhere who set out to give me more work...
 

Sim

Forum Administrator
Staff member
Reaction score
534
It's ok, the spell is ready for approval. :)
 

Kazuga

Let the game begin...
Reaction score
110
Great spell!

Hi I just wanted to tell you that this spell rocks^^ And it's good that you didn't make it in Jass or anything like that (since I still can't use it...)
Anyway good job!:cool:
 

Flare

Stops copies me!
Reaction score
662
HUGE (potential) problem

I think I've found a very big problem with the spell (can cause alot of problem with bounty etc (anything related to damaging enemies) if I'm correct. I'll just make an example since it's kind of awkward trying to describe.

Unit A casts the spell on neutral hostile units, no problems there.
Unit B casts the spell on a differe group of neutral hostile units, nowhere near unit A and his target. Here's the problem.

Whenever the periodic trigger fires, the first unit in the dummy groups will have their ownership/alliance checked VS any units in the damage group (lets call the dummy orbs A and B).

So, dummy A is picked first in the dummy group. A unit is added to OrbDamageGroup because it came within 100 range of dummy B. Since the triggering unit is neutral hostile, it is elligible for damage, and since dummy A was picked in the dummy group first, it will deal the damage, gain any bounty that the unit may carry, and dummy B will deal NOTHING since the damaged unit was immediately removed after first unit in dummy group was picked.

In a nutshell
2 units cast (owned by different players)
A unit (who is enemy to both) comes within range of the second unit's orb (adding it to the OrbDamageGroup)
The first unit will deal the damage, and the unit will be immediately removed from the damage group to prevent damage being repeated.
Since the unit is no longer in the damage group when the second unit is picked, it will deal no damage.

If the damaged unit dies, the first player will get gold/exp reward without having any involvement (other than the damage caused by this flaw).

Unfortunately, it will be pretty tricky to test out this problem, since I need a second hero (belonging to another player) to cast the ability, and I can't host. If anyone wants to help me out, and has some spare time (and can host), I can alter the player settings so that 2 separate players can cast the ability, and check who receives bounty. Just send me a PM.

If anyone wishes to use this ability anytime, please wait until this bug is confirmed and fixed, or proven wrong.


This is also a bump, or are you only allowed to bump question threads or non-approved resources?
 

cr4xzZz

Also known as azwraith_ftL.
Reaction score
51
> I can alter the player settings so that 2 separate players can cast the ability, and check who receives bounty. Just send me a PM.

Make an AI for a computer player? You can easily check his bounty and such.

Anyway, you moved to JASS, right? Why not make a JASS version, too? :)
I made my own for my map (u get credits) and I just wanted you to have a look. Uses ABC and TT.

JASS:

scope FrozenOrb
//############ CONFIGURATION MENU #############
globals
// Ability raw code
    private constant integer ABILITY_RAW = 'A000'
// Raw code of the missile unit
    private constant integer MISSILE_RAW = 'h001'
// Raw code of the shard units
    private constant integer BOLT_RAW = 'h002'
// Raw code of the dummy unit
    private constant integer DUMMY = 'h000'
// Raw code of the Frost Nova slow ability
    private constant integer FROST_NOVA = 'A002'
// Raw code for the buff checkup
// This prevents a lot of lag
    private constant integer BUFF_RAW = 'Bfro'
// Maximum travel distance of the missile
    private constant real MAX_DIST = 1600.
// Speed of the missile
    private constant real SPEED = 750.
// Radius of effect of the missile
    private constant real M_RADIUS = 225.
// Radius of effect of each shard
    private constant real S_RADIUS = 100.
endglobals
// Missile damage
    private function M_DAMAGE takes integer Level returns real
        return Level * 20.
    endfunction
// Shard damage
    private function S_DAMAGE takes integer Level returns real
        return Level * 10.
    endfunction
//######### END OF CONFIGURATION MENU ##########

private struct Data
    unit missile
    integer ticks
    real dx
    real dy
    trigger trig = CreateTrigger()
    
    method onDestroy takes nothing returns nothing
        call RemoveUnit(.missile)
        call ClearTriggerStructA(.trig)
        call DestroyTrigger(.trig)
    endmethod
endstruct

private struct Shard
    unit shard
    trigger trig = CreateTrigger()
    
    method onDestroy takes nothing returns nothing
        call RemoveUnit(.shard)
        call ClearTriggerStructA(.trig)
        call DestroyTrigger(.trig)
    endmethod
endstruct

private function Conditions takes nothing returns boolean
    return GetSpellAbilityId() == ABILITY_RAW
endfunction

private function MoveMissile takes nothing returns boolean
    local Data d = TT_GetData()
    local real x = GetUnitX(d.missile)
    local real y = GetUnitY(d.missile)
    local real dx = x + d.dx
    local real dy = y + d.dy
    call SetUnitPosition(d.missile, dx, dy) 
    set d.ticks = d.ticks - 1
    if d.ticks <= 0 then
        call d.destroy()
        return true
    endif
    return false
endfunction

private function MissileDmg takes nothing returns boolean
    local Data d = GetTriggerStructA(GetTriggeringTrigger())
    local unit pick = GetTriggerUnit()
    local unit dummy 
    if IsUnitEnemy(pick, GetOwningPlayer(d.missile)) and GetWidgetLife(pick) > 0.405 and IsUnitType(pick, UNIT_TYPE_STRUCTURE) == false then
        if GetUnitAbilityLevel(pick, BUFF_RAW) > 0 then
        else
            set dummy = CreateUnit(GetOwningPlayer(d.missile), DUMMY, 0., 0., 0.)
            call UnitAddAbility(dummy, FROST_NOVA)
            call IssueTargetOrder(dummy, "frostnova", pick)
            call UnitApplyTimedLife(dummy, 'BTLF', 2.)
        endif
        call UnitDamageTarget(d.missile, pick, M_DAMAGE(1), false, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, null)
    endif
    set dummy = null
    set pick = null
    return false
endfunction

private function RemoveShard takes nothing returns boolean
    local Shard i = TT_GetData()
    if GetWidgetLife(i.shard) < 0.405 then
        call i.destroy()
        return true 
    endif
    return false
endfunction

private function ShardDmg takes nothing returns boolean
    local Shard i = GetTriggerStructA(GetTriggeringTrigger())
    local unit pick = GetTriggerUnit()
    local unit dummy 
    if IsUnitEnemy(pick, GetOwningPlayer(i.shard)) and GetWidgetLife(pick) > 0.405 and IsUnitType(pick, UNIT_TYPE_STRUCTURE) == false then
        if GetUnitAbilityLevel(pick, BUFF_RAW) > 0 then
        else
            set dummy = CreateUnit(GetOwningPlayer(i.shard), DUMMY, 0., 0., 0.)
            call UnitAddAbility(dummy, FROST_NOVA)
            call IssueTargetOrder(dummy, "frostnova", pick)
            call UnitApplyTimedLife(dummy, 'BTLF', 2.)
        endif
        call UnitDamageTarget(i.shard, pick, S_DAMAGE(1), false, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, null)
    endif
    set dummy = null
    set pick = null
    return false
endfunction

private function CreateShards takes nothing returns boolean
    local Data d = TT_GetData()
    local Shard i = Shard.create()
    local real x 
    local real y 
    local unit shard
    local location loc
    local location move 
    if GetWidgetLife(d.missile) > 0.405 then
        set x = GetUnitX(d.missile)
        set y = GetUnitY(d.missile)
        set i.shard = CreateUnit(GetOwningPlayer(d.missile), BOLT_RAW, x, y, GetRandomReal(1, 360))
        set loc = GetUnitLoc(i.shard)
        set x = GetLocationX(loc) + 850. * Cos(GetUnitFacing(i.shard) * bj_DEGTORAD)
        set y = GetLocationY(loc) + 850. * Sin(GetUnitFacing(i.shard) * bj_DEGTORAD)
        set move = Location(x, y)
        call IssuePointOrderLoc(i.shard, "move", move)
        call RemoveLocation(move)
        call RemoveLocation(loc)
        
        call TriggerRegisterUnitInRange(i.trig, i.shard, S_RADIUS, null)
        call TriggerAddCondition(i.trig, Condition(function ShardDmg))
        call SetTriggerStructA(i.trig, i)
        call TT_Start(function RemoveShard, i)
        call UnitApplyTimedLife(i.shard, 'BTLF', GetRandomReal(0.4, 1.2))
    else
        return true
    endif
    set shard = null
    set loc = null
    set move = null
    return false
endfunction

private function Actions takes nothing returns nothing
    local unit cast = GetTriggerUnit()
    local location targ = GetSpellTargetLoc()
    local real x = GetUnitX(cast)
    local real y = GetUnitY(cast)
    local real dx = GetLocationX(targ) - x
    local real dy = GetLocationY(targ) - y
    local real distance = RMinBJ(MAX_DIST, SquareRoot(dx * dx + dy * dy))
    local real angle = Atan2(dy, dx)
    
    local Data d = Data.create()
    set d.missile = CreateUnit(GetOwningPlayer(cast), MISSILE_RAW, x, y, GetUnitFacing(cast))
    set d.ticks = R2I(distance / (SPEED * TT_PERIOD))
    set d.dx = (SPEED * TT_PERIOD) * Cos(angle)
    set d.dy = (SPEED * TT_PERIOD) * Sin(angle)
    call RemoveLocation(targ)
    
    call TT_Start(function MoveMissile, d)
    call TT_Start(function CreateShards, d)

    call TriggerRegisterUnitInRange(d.trig, d.missile, M_RADIUS, null)
    call TriggerAddCondition(d.trig, Condition(function MissileDmg))
    call SetTriggerStructA(d.trig, d)
    set cast = null
    set targ = null
endfunction

function InitTrig_FrozenOrb takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t, Condition(function Conditions))
    call TriggerAddAction(t, function Actions)
endfunction

endscope

Note that it creates a lot of shards (32 per second) so it might lag a lot o_O
 

Attachments

  • JASSFrozenOrb.w3x
    49.7 KB · Views: 385

Flare

Stops copies me!
Reaction score
662
Update!

(At long last,) I have taken the time to go through the trigger, removed all the unnecessary "Custom value of picked/last created unit" and replaced them with a temporary integer. I've also reworked the damage trigger so that the previously mentioned bug cannot occur (it now checks the distance between triggering unit and all units in Orb/BoltGroup, just like in my Black Arrow spell, and it will only damage if 1) triggering unit is an enemy, and 2) the distance between triggering unit and the orb/bolt is <= 100.

Also, I was thinking about making a JASS version, but JASS is p*ssing me off right now. So far, I've had two fairly epic failures (one spell does nothing, second spell does nothing, but crashes on second cast). I'll give it a go sometime if I get a chance.
 

Flare

Stops copies me!
Reaction score
662
In the damage triggers (where the damage and SFX actions are), create an invisible dummy unit for Owner of Orb[tempinteger] (or Bolt[tempinteger]) and order it to cast Frost Nova on the Triggering Unit. I'm too lazy to actually add that myself, but it's fairly simple (I assume you know the basics of dummy spellcasting, and what a special effect action looks like so you can find where the action goes).

[tempinteger] MAY be wrong, I forget what the name of the reference integer var was (was tempinteger or refinteger I think)
 

thevoden

New Member
Reaction score
5
I have made a definition list of how much each bolt / orb should damage.

Code:
Frozen Orb Setup
    Events
        Map initialization
    Conditions
    Actions
        Set So_FrOb_dmg_bolt[1] = 40
        Set So_FrOb_dmg_bolt[2] = 59
        Set So_FrOb_dmg_bolt[3] = 79
        Set So_FrOb_dmg_bolt[4] = 100
        Set So_FrOb_dmg_bolt[5] = 122
        Set So_FrOb_dmg_bolt[6] = 145
        Set So_FrOb_dmg_bolt[7] = 169
        Set So_FrOb_dmg_bolt[8] = 194
        Set So_FrOb_dmg_bolt[9] = 220
        Set So_FrOb_dmg_bolt[10] = 247
        Set So_FrOb_dmg_orb[1] = 100
        Set So_FrOb_dmg_orb[2] = 158
        Set So_FrOb_dmg_orb[3] = 235
        Set So_FrOb_dmg_orb[4] = 332
        Set So_FrOb_dmg_orb[5] = 450
        Set So_FrOb_dmg_orb[6] = 590
        Set So_FrOb_dmg_orb[7] = 753
        Set So_FrOb_dmg_orb[8] = 940
        Set So_FrOb_dmg_orb[9] = 1152
        Set So_FrOb_dmg_orb[10] = 1390

It seems like there is more than plug and play on the trigger. How do I set the value of the spell to the value of damage I set above?
 

Flare

Stops copies me!
Reaction score
662
bleh... so you want each hit to increase the damage dealt to the next figure in the list? or you want to set the damage for that particular level to the corresponding array?

first option, thats a pain to do

second option, just find where OrbDamage is set in the cast trigger, and where BoltDamage is set in the Bolt spawn trigger, and set them to So_FrOb_dmg_bolt[whatever you want your array to be] and SoFrOb_dmg_orb[array].

and, in the FO orb damage and bolt damage, find the (Set OrbDamage) and (Set BoltDamage) actions and just delete them.
 

Ghostwind

o________o
Reaction score
172
I can see myself learning jass in the time it would take to make that GUI trigger :nuts:

Anyways, good job d00d.
 
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