Spell Ice Trap

Discussion in 'Spells' started by BRUTAL, Jun 24, 2008.

  1. BRUTAL

    BRUTAL I'm working

    Ratings:
    +118 / 0 / -0
    bump, any suggestions/comments?
     
  2. WolfieeifloW

    WolfieeifloW WEHZ Helper

    Ratings:
    +372 / 0 / -0
    You don't need to bump approved resources BRUTAL :p .
    Unless you make an update or something of the like ;) !
     
  3. BRUTAL

    BRUTAL I'm working

    Ratings:
    +118 / 0 / -0
    ohhhh
    good thing you said so, i was gona bump my other spell lol
     
  4. LiveSsenkrad

    LiveSsenkrad Member

    Ratings:
    +3 / 0 / -0
    A simple bug where if you cast 2 of them at the same spot at different times, you will end up with the 2nd one not being a ice trap, you can then walk right through it.
     
  5. BRUTAL

    BRUTAL I'm working

    Ratings:
    +118 / 0 / -0
    i know that lol.
     
  6. LiveSsenkrad

    LiveSsenkrad Member

    Ratings:
    +3 / 0 / -0
    Also if any heroes is added to the map the JASS triggers refuses to work, thus disabling the spell.
     
  7. BRUTAL

    BRUTAL I'm working

    Ratings:
    +118 / 0 / -0
    wth?
     
  8. Rushhour

    Rushhour New Member

    Ratings:
    +46 / 0 / -0
    I would like to test the spell, but neither the gui version nor the vjass works :(

    I do have jassnewgenpack, all my other maps can be tested and all, just these two not ! :banghead:

    When I hit testmap I get to the startscreen, anyone knows a solution?
     
  9. TriggerHappy

    TriggerHappy ...

    Ratings:
    +341 / 0 / -0
    Save the map first, then hit testmap.
     
  10. BRUTAL

    BRUTAL I'm working

    Ratings:
    +118 / 0 / -0
    Updated.
    Now requires GT and KT2; all included in the map.
    Made code shorter and more efficient.
    Fixed the stupid bug that was pointed out.
     
  11. Azlier

    Azlier Old World Ghost

    Ratings:
    +461 / 0 / -0
    Recycling dummy units would make your spell even more efficient.
     
  12. BRUTAL

    BRUTAL I'm working

    Ratings:
    +118 / 0 / -0
    How would i go about doing so?
    Does this call for another system. :p
     
  13. Azlier

    Azlier Old World Ghost

    Ratings:
    +461 / 0 / -0
    Well, a struct with a dummy inside works just fine. When the struct is created, check if the dummy is null or not. If so, create a new dummy.

    Instead of removing dummies, you should 'release' them. Which means hiding them or something.
     
  14. BRUTAL

    BRUTAL I'm working

    Ratings:
    +118 / 0 / -0
    Confused.
    Can you show me an example or something.
     
  15. SanKakU

    SanKakU Member

    Ratings:
    +21 / 0 / -0
    great spell. got a bump for you.
    unit apply timed life did not work so well. i edited the spell to include the dummy unit in the struct. it is unit .a instead of local unit u. it's also different in other ways...but that's the main part of the spell that probably ought to be updated. you could ignore my customization of preventing blinking out of the circle.
    JASS:
    // Ice Trap by BRUTAL.
    // Requires GT, and KT2.
    // Credits are welcome but not necessary.
    // October 12th 2009.
    //
    // Modified to be Fire Barrier for Valkyrie Hero by SanKakU
    // My memories are a little fuzzy of the Xena episodes but
    // from what i remember, Odin's top blonde valkyrie cursed
    // Gabrielle by putting her in a fire trap much like this one.
    // In further research it can be found that in the tv show
    // Bleach, the Captain Commander Yamamoto uses an ability
    // like this.
    //
    // the spell now enables countering of escape spells.
    
    scope FireBarrier initializer I
    define{private ID='A08A';private IMMO_ID='A08B';private DUMMY_ID='h01B';;private PATH_BLOCK='YTpb'
    private PERIOD=.04;private SCALE=1. ;private ALPHA=75 ;private MAX_UNITS=36;private DISTANCE=350.}
    private struct Data;unit caster, target;real x, y;real angle;integer pbInt=0, ticks, maxTicks
    destructable array pathBlock[MAX_UNITS];unit array a[MAX_UNITS]
    static method create takes unit u, real tx, real ty, unit z returns Data
    local Data data=Data.allocate()
    set data.caster=u
    set data.target=z
    set data.x=tx
    set data.y=ty
    set data.angle=GetUnitFacing(u)+140
    set data.ticks=R2I(45*(GetUnitAbilityLevel(data.caster,ID))/PERIOD)+10
    set data.maxTicks=data.ticks
    return data
    endmethod
    method circle takes nothing returns nothing
    integer level=GetUnitAbilityLevel(.caster,ID)
    real dis=DISTANCE
    //==AS AN ULTIMATE, THIS SPELL LASTS 45 SECONDS AT LEVEL 1, 90 SECONDS AT LEVEL 2, AND 135 SECONDS AT LEVEL 3
    real x=.x+dis*Cos(.angle*bj_DEGTORAD)
    real y=.y+dis*Sin(.angle*bj_DEGTORAD)
    unit .a[.pbInt]=CreateUnit(GetOwningPlayer(.caster),DUMMY_ID,x,y,bj_RADTODEG*Atan2(y-.y,x-.x))
    call SetUnitScale(.a[pbInt],SCALE,SCALE,SCALE)
    call SetUnitVertexColor(.a[pbInt],255,255,255,R2I(2.55*ALPHA))
    call UnitAddAbility(.a[pbInt],IMMO_ID)
    call SetUnitAbilityLevel(.a[pbInt],IMMO_ID,level)
    call IssueImmediateOrder(.a[pbInt],"immolation")
    set .angle=.angle+360./MAX_UNITS
    set .pathBlock[.pbInt]=CreateDestructable(PATH_BLOCK,x,y,0,1,0)
    set .pbInt=.pbInt+1
    endmethod
    method end takes nothing returns nothing
    integer i=0;whilenot(i++==MAX_UNITS){RemoveUnit(.a[i]);KillDestructable(.pathBlock[i])};endmethod
    endstruct 
    private function PeriodicFunc takes nothing returns boolean
    local Data data=KT_GetData()
    if getdisr(data.x,data.y,data.target)>=DISTANCE then
    call SetUnitX(data.target,data.x)
    call SetUnitY(data.target,data.y)
    endif
    set data.ticks=data.ticks-1
    if data.ticks<=0 then  
    call data.end()
    return true
    else
    if data.ticks>=data.maxTicks-MAX_UNITS then
    call data.circle()
    endif
    return false
    endif  
    endfunction 
    private function actions takes nothing returns nothing
    call KT_Add(function PeriodicFunc,Data.create(GetTriggerUnit(),GetSpellTargetX(),GetSpellTargetY(),GetSpellTargetUnit()),PERIOD)
    endfunction
    private function I takes nothing returns nothing
    call TriggerAddAction(GT_RegisterStartsEffectEvent(CreateTrigger(),ID),function actions)
    endfunction
    endscope
     
  16. NeuroToxin

    NeuroToxin New Member

    Ratings:
    +46 / 0 / -0
    You realize that, UnitApplyTimedLife works perfectly right? You're making it more difficult then it needs to be (No flaming on me intended, sorry if it comes off that way), but also, he didn't ask anyone to do this for him.
     
  17. SanKakU

    SanKakU Member

    Ratings:
    +21 / 0 / -0
    you are incorrect. unitapplytimedlife kills the unit. this allows the unit to show a death animation. we need to remove the unit if we are using certain alternative models for the dummy unit. this is elementary.
     

Share This Page