IM noob in jass i know how to read jass or use it but i cannot make it from scratch :/ im tryng to learn how to make simple spell that use Vjass system it!! atm i can do alot but i suck about making Loop
Spell use Jump library made by Dynasti
whats spell suposed to do :the caster jump to the target ,when he jumps finish he does dmg around him with a aoe 200......
Bug nothing happened after Loop Mean picked unit of the group doesnt get damage, maybe the height thingy isnt right any tips ?
p.s. 4 sure its incomplete becuz i dont know what to add ,Im also Visual reading any tutorial didnt very helped me for now any proper help alway Thanks
Spell use Jump library made by Dynasti
whats spell suposed to do :the caster jump to the target ,when he jumps finish he does dmg around him with a aoe 200......
Bug nothing happened after Loop Mean picked unit of the group doesnt get damage, maybe the height thingy isnt right any tips ?
p.s. 4 sure its incomplete becuz i dont know what to add ,Im also Visual reading any tutorial didnt very helped me for now any proper help alway Thanks
JASS:
scope JumpFunctionExample initializer Init
globals
private constant integer AW_ABIL_ID = 'A002'
private constant real X = 0.5
private constant integer Speed = 1750
private constant boolean Arced = true
private constant boolean AffectZ = true
private constant boolean Paused = true
private constant string Effect = "Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl"
private constant string EAttach = "" //I leave it empty for a spawn on the ground
private constant string Art = "Abilities\\Weapons\\RedDragonBreath\\RedDragonMissile.mdl"
private constant string AAttach = "origin"
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId( ) == AW_ABIL_ID
endfunction
function Debug takes string msg returns nothing
local integer i = 0
loop
call DisplayTimedTextToPlayer(Player(i),0,0,60,msg)
set i = i + 1
exitwhen i == bj_MAX_PLAYERS
endloop
endfunction
function Trig_tr2_dot takes nothing returns nothing
local real damage = ( 5.00 * ( I2R(GetUnitAbilityLevel(GetSpellAbilityUnit(),AW_ABIL_ID)) * ( I2R(GetHeroStatBJ(GetHeroStr(GetTriggerUnit(),true), GetSpellAbilityUnit(), false)) + 25.00 ) ) )
call UnitDamageTarget( GetTriggerUnit(),GetFilterUnit(), damage, true,false,ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL ,WEAPON_TYPE_WOOD_HEAVY_BASH )
endfunction
function Trig_tr2_group takes nothing returns boolean
return ( IsUnitAlly(GetFilterUnit(), GetLocalPlayer()) == false )
endfunction
private function Actions takes nothing returns nothing
local unit Object = GetTriggerUnit( )
//>> Used for finding the distance
local real x0 = GetUnitX( Object )
local real y0 = GetUnitY( Object )
local real x1 = GetSpellTargetX()
local real y1 = GetSpellTargetY()
local real dx = x1 - x0
local real dy = y1 - y0
local real aoe = 200
local group g = CreateGroup()
local player P1 = GetOwningPlayer(Object)
local real height = GetUnitFlyHeight(Object)
local real Dist = SquareRoot( dx * dx + dy * dy ) // SquareRoot(( x1 - x0 )*( x1 - x0 )+( y1 - y0 )*( y1 - y0 ))
local real RadAngle = Atan2( dy, dx ) // Atan2( y1 - y0, x1 - x0 )
//>> IMPORTANT: If you set the Pause to true then you need to make sure that you order your unit to "stop" beafore calling the jump.
//Why? Well you could end up with an infinite cast loop!
call IssueImmediateOrder( Object, "stop" )
//<<
//>> Done with setup, now for the call
//this line also use the Vjass system
call Jump( Object, RadAngle, X, Speed, Dist, Arced, AffectZ, Paused, Effect, EAttach, Art, AAttach )
//<<
set g = GetUnitsInRangeOfLocMatching(aoe, Location(x1, y1), Condition(function Trig_tr2_group))
call Debug("spell")
loop
set height = GetUnitFlyHeight(Object)
call Debug("LOOP")
exitwhen height <= 0
endloop
call ForGroup(g,function Trig_tr2_dot)
call Debug("spell end")
//>> nulling the variables
set Object = null
set P1 = null
set g = null
call DestroyGroup(g)
//<<
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local trigger trg = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trg, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(trg, Condition(function Conditions))
call TriggerAddAction(trg, function Actions)
set trg = null
endfunction
endscope
Last edited: