[Request] Importing Jass

GameOver[GR]

New Member
Reaction score
11
I need some help here guys ... i tried to import a jass script but when i saved one of my triggers (demo) crashed... so i want some help from you , if you can just import the axe spell.

Here is the link with all the informations you need :

Link
Download The Map With The Axes Spell


Thanks In addition.
 

Azlier

Old World Ghost
Reaction score
461
You are using, NewGen, right? Just post the trigger, I'm too lazy to go to a site (most of which I don't trust) to download a map just to see a single trigger.
 

GameOver[GR]

New Member
Reaction score
11
Code:
function Damage_Des_Action takes nothing returns nothing
   call KillDestructable (GetEnumDestructable() )
endfunction

function Damage_Des takes real x ,real y returns nothing
local boolexpr f  = Condition ( function Destructable)

   call EnumDestructablesInRect(Rect(x-100,y-100,x+100,y+100),f,function Damage_Des_Action)
   call DestroyBoolExpr(f)
endfunction




function Axe_Mouvement takes integer i ,string m ,integer w returns nothing
local string  j   = I2S(i)
local real    x1  = GetStoredReal(udg_Axe,m,"x1"+j)
local real    x2  = GetStoredReal(udg_Axe,m,"x2"+j)
local real    y1  = GetStoredReal(udg_Axe,m,"y1"+j)
local real    y2  = GetStoredReal(udg_Axe,m,"y2"+j)
local unit    u1  = GetUnit(m,"u1") 
local unit    u2  = GetUnit(m,"u2") 
local real    o   = Abs(Height()*Sin((bj_PI*2*i)/w))

  call SetUnitPosition(u1,x1,y1)
  call SetUnitPosition(u2,x2,y2)
  call SetUnitFlyHeight(u1,o,0)
  call SetUnitFlyHeight(u2,o,0)
  call Damage_Des(x1,y1)
  call Damage_Des(x2,y2)
endfunction


function Axe_Switch takes string m returns nothing
local integer u1 = GetStoredInteger(udg_Axe,m,"u1")

  call StoreInteger(udg_Axe,m,"u1",GetStoredInteger(udg_Axe,m,"u2"))
  call StoreInteger(udg_Axe,m,"u2",u1)
endfunction

function Axe_Back takes nothing returns nothing
local timer   t   = GetExpiredTimer()
local string  m   = I2S(H2I(t))
local integer i   = GetStoredInteger(udg_Axe,m,"i")
local integer w   = GetStoredInteger(udg_Axe,m,"w")

  if(i>0)then
    call StoreInteger(udg_Axe,m,"i",i-1)
    call Axe_Mouvement(i,m,w)
  else 
    call DestroyTimer(t)
    call PauseUnit(GetUnit(m,"Caster"),false)
    call RemoveUnit(GetUnit(m,"u1"))
    call RemoveUnit(GetUnit(m,"u2"))
    call FlushStoredMission(udg_Axe,m)
  endif
endfunction

function Axe_Come takes nothing returns nothing
local timer   t   = GetExpiredTimer()
local string  m   = I2S(H2I(t))
local integer i   = GetStoredInteger(udg_Axe,m,"i")
local integer w   = GetStoredInteger(udg_Axe,m,"w")

  if(i<w)then
    call StoreInteger(udg_Axe,m,"i",i+1)
    call Axe_Mouvement(i,m,w)
  else
    call Axe_Switch(m)
    call TimerStart (t,Timer(),true ,function Axe_Back )
  endif
endfunction

function Axe takes nothing returns nothing
local location Target = GetSpellTargetLoc()
local unit     Caster = GetTriggerUnit()
local real xc         = GetUnitX(Caster)
local real yc         = GetUnitY(Caster)
local real xt         = GetLocationX(Target)
local real yt         = GetLocationY(Target)

local real    a     = Atan2(yt-yc,xt-xc)
local real    c     = Cos(a)
local real    s     = Sin(a)
local real    d     = 2*(xt-xc)/c
local real    v     = Speed()
local real    h     = d/(4*Tan((Angle()*bj_DEGTORAD)/2))
local real    p     = (bj_PI*2)/d
local integer z     = GetUnitAbilityLevel(Caster,Abilitie_Caster())
local real    r     = Pow(Speed()*Timer(),2)

local real    x     = 0
local real    y     
local real    n     
     
local integer i     = 0
local string  j 
local timer   t     = CreateTimer()
local string  m     = I2S(H2I(t))
local unit    u1
local unit    u2

loop
  set n = Pow(h*p*Cos(p*x),2)+1
  set x = x +( SquareRoot(4*r*n) / (2*n))  
exitwhen x>d
  set i = i+1
  set j = I2S(i)
  set y = h*Sin(p*x)
  call StoreReal(udg_Axe,m ,"x1"+j,x*c - y*s + xc)
  call StoreReal(udg_Axe,m ,"y1"+j,x*s + y*c + yc)
  call StoreReal(udg_Axe,m ,"x2"+j,x*c + y*s + xc)
  call StoreReal(udg_Axe,m ,"y2"+j,x*s - y*c + yc)
endloop
  call StoreInteger(udg_Axe,m ,"i",0)
  call StoreInteger(udg_Axe,m ,"w",i)
  set u1 = CreateUnit(GetOwningPlayer(Caster),Axe_Unit(),xc,yc,a)
  set u2 = CreateUnit(GetOwningPlayer(Caster),Axe_Unit(),xc,yc,a)
  call SetUnitAbilityLevel(u1,Abilitie_Axe(),z)
  call SetUnitAbilityLevel(u2,Abilitie_Axe(),z)
  call StoreInteger(udg_Axe,m,"u1",H2I(u1))
  call StoreInteger(udg_Axe,m,"u2",H2I(u2))
  call StoreInteger(udg_Axe,m,"Caster",H2I(Caster))
  call TimerStart (t,Timer(),true ,function Axe_Come )
  call PauseUnit(Caster,true)
endfunction

function InitTrig_Axe takes nothing returns nothing
 set gg_trg_Event = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Event,EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddAction( gg_trg_Event, function Axe )
endfunction


you do not trust mediafire? hmm ok
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top