//Handle Vars
//by KaTTaNa
// ===========================
function H2I takes handle h returns integer
return h
return 0
endfunction
// ===========================
function LocalVars takes nothing returns gamecache
// Replace InitGameCache("jasslocalvars.w3v") with a global variable!!
return InitGameCache("jasslocalvars.w3v")
endfunction
function SetHandleHandle takes handle subject, string name, handle value returns nothing
if value==null then
call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
else
call StoreInteger(LocalVars(), I2S(H2I(subject)), name, H2I(value))
endif
endfunction
function SetHandleInt takes handle subject, string name, integer value returns nothing
if value==0 then
call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
else
call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function SetHandleReal takes handle subject, string name, real value returns nothing
if value==0 then
call FlushStoredReal(LocalVars(), I2S(H2I(subject)), name)
else
call StoreReal(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
// Get's
function GetHandleHandle takes handle subject, string name returns handle
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleInt takes handle subject, string name returns integer
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleReal takes handle subject, string name returns real
return GetStoredReal(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandlePoint takes handle subject, string name returns location
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleUnit takes handle subject, string name returns unit
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function FlushHandleLocals takes handle subject returns nothing
call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )
endfunction
function PlaySoundForPlayer takes player pl, sound soundhandle returns nothing
if GetLocalPlayer() == pl then
call PlaySoundBJ(soundhandle)
endif
endfunction
function FadingText takes string msg, integer red, integer green, integer blue, real x, real y, real z, real spd, real fadetime, real life returns nothing
local texttag t=CreateTextTag()
call SetTextTagText(t,msg,0.024)
call SetTextTagPos(t,x,y,z)
call SetTextTagColor(t,red,green,blue,255)
call SetTextTagVelocity(t,0,spd)
call SetTextTagVisibility(t, true)
call SetTextTagFadepoint(t, fadetime)
call SetTextTagLifespan(t, life)
call SetTextTagPermanent(t, false)
call TriggerSleepAction( life )
call DestroyTextTagBJ( t )
set t=null
endfunction
//written by Peekaboo
function SpiralEffect takes player pl, location center, integer creator, integer aimer, real r, integer t, integer count, integer turns returns nothing
local integer i= 0
local integer z= 0
local real bm= (360/(3*t))*turns
local location point
local unit array creatorS
local unit array aimerS
loop
exitwhen i > count -1
set creatorS[i]= CreateUnitAtLoc( pl, creator, center, bj_UNIT_FACING )
call GroupAddUnitSimple( creatorS[i], udg_Dummys )
call ShowUnitHide( creatorS[i] )
set point= PolarProjectionBJ(center, r, (360/count*i))
set aimerS[i]= CreateUnitAtLoc( pl, aimer, point, bj_UNIT_FACING )
call GroupAddUnitSimple( aimerS[i], udg_Dummys )
call UnitAddAbilityBJ( 'Aloc', aimerS[i] )
call RemoveLocation(point)
set point = null
set i= i+1
endloop
set i = 0
loop
exitwhen i > count -1
call IssueTargetOrderBJ( creatorS[i], "attack", aimerS[i] )
set i= i+1
endloop
loop
exitwhen z > (3*t)
set i = 0
loop
exitwhen i > count -1
set point= PolarProjectionBJ(center, r, ((360/ count* i)+ bm* z) )
call IssuePointOrderLocBJ( aimerS[i], "move", point )
call RemoveLocation(point)
set point = null
set i= i+1
endloop
set z= z+1
call TriggerSleepAction( 0.20 )
endloop
set i= 0
loop
exitwhen i > count -1
call RemoveUnit(creatorS[i])
call RemoveUnit(aimerS[i])
set i= i+1
endloop
set center= null
call RemoveLocation(center)
//return
endfunction
function I2Tstring takes integer t returns string
local integer s= t
local integer m= 0
local integer h= 0
if t > 60 then
set m= (s/60)
set s= (s- (m*60))
if m > 60 then
set h= (m/60)
set m= (m- (h*60))
return (I2S(h) + "h " + I2S(m) + "m " + I2S(s) + "s")
else
return (I2S(m) + "m " + I2S(s) + "s")
endif
else
return I2S(s) + "s"
endif
return "0s"
endfunction
Name | Type | is_array | initial_value |
Altar | unit | Yes | |
Altar_Dummy | unit | Yes | |
bases_attackpoint | location | Yes | |
BoxDummy | unit | Yes | |
brick_trap_killrange | trigger | Yes | |
Builder | unit | Yes | |
color_string | string | Yes | |
CoprseControl_corpses | integer | No | |
CorpseControl_corpses2 | integer | Yes | 0 |
CorpseControl_group | group | Yes | |
CorpseControl_max | integer | No | |
CorpseControl_pos | integer | No | 0 |
dest | integer | No | |
dest2 | real | No | |
Dummys | group | No | |
FakeShop_Dummy | unit | Yes | |
GameEnd | timer | No | |
HeroBuildings | integer | Yes | |
Heroes | group | Yes | |
Heromode | group | No | |
LegoBricks | group | Yes | |
LockedinSchool | timer | No | |
Mines | group | No | |
Money_ATB_Multiplicator | integer | Yes | |
Money_Multiplicator | integer | No | |
Monsters | group | Yes | |
Multi_Cor | string | Yes | |
Multi_CorInit | integer | No | |
Multi_Deathtimer | integer | Yes | -1 |
Multi_PLpos | integer | Yes | |
pack_packed | unitcode | Yes | |
pack_packing | unitcode | Yes | |
restoreWood_Units | group | No | |
slotstatus | boolean | Yes | |
spell_Rage | group | No | |
spell_Stealth | group | No | |
spell_WalkOfFlame | group | No | |
Team_PL | integer | Yes | |
Teams | force | Yes | |
Teams_ATB | force | Yes | |
TechBox | unit | Yes | |
time | integer | No | |
tmp_boolean | boolean | No | |
tmp_group | group | No | |
tmp_int | integer | No | |
tmp_int2 | integer | No | |
tmp_player | player | No | |
tmp_point | location | No | |
tmp_point2 | location | No | |
tmp_point3 | location | No | |
tmp_real | real | No | |
tmp_unit | unit | No | |
Tower_Repair | group | No | |
Unittype_Allunits | unitcode | Yes | |
Unittype_doublepower | integer | Yes | |
Unittype_Monsters_buildings | unitcode | Yes | |
Unittype_Monsters_units | unitcode | Yes | |
Unittype_Towers | unitcode | Yes | |
Unittype_Units | unitcode | Yes |