Name | Type | is_array | initial_value |
//TESH.scrollpos=0
//TESH.alwaysfold=0
More information here:
http://www.hiveworkshop.com/forums/spells-569/casting-text-casting-percent-system-v1-0b-241055/?prev=deleted%3D1%26u%3Dnhocklanhox6
//*************************************************************************************************
//*************************************************************************************************
//*************************************************************************************************
//*************************************************************************************************
//*************************************************************************************************
// C A S T I N G T E X T S Y S T E M
// B Y:
// E L P H I S
// V E R S I O N:
// 1.3
// C O D E A P I:
//! novjass
struct Casting..... /*
//===========================ALL ABOUT HELPING METHOD===========================
//This method help you to get current x of texttag
*/ method operator getX takes nothing returns real /*
//This method help you to get current y of texttag
*/ method operator getY takes nothing returns real /*
//This method help you to get current z of texttag
*/ method operator getZ takes nothing returns real /*
//This method help you to get current size of texttag
*/ method operator getS takes nothing returns real /*
//This method help you to set texttag position
*/ method setXYZ takes real x,real y,real z,real size returns nothing /*
//This method help you to hide text for player
*/ method hideTextForPlayer takes player p/* Which player you want to hide
*/ boolean hide /* Boolean hide text
*/ returns nothing /*
//This method help you to hide the texttag for player
*/ method hideText takes /*
*/ boolean hidetext /* Only you can see this text
*/ boolean hidetextenemies /* Only you and your allies can see this text
*/ return nothing/*
//This method help you to destroy the texttag instantly and also destroy data inside of this texttag
*/ method destroyInstantly takes nothing returns nothing /*
//This method help you to add text to method percentage when it run :)
*/ method addText takes string text returns nothing /*
*/
//
//
//==============================================================================
static method textPoint takes /*
*/ string text /* Which text you want to display
*/ string color /* Which color you want to combine when texttag reaching
*/ real x /* x of texttag
*/ real y /* y of texttag
*/ real z /* z of texttag
*/ real size /* Size of texttag
*/ real time /* Time out
*/ boolean style /* Style of Texttag (if true, STYLE: Override font color, if false, STYLE: Increase the letter)
*/ integer savenumber /* This number very important, it's a number save with table and you can load this texttag with number :)
*/ returns nothing
//Now for Example:
call Casting.textPoint("KABOOMKABOOM","|cffFFFF00",GetRectCenterX(gg_rct_P),GetRectCenterY(gg_rct_P),5.,15.,5.,false,15)
//
//
static method textNumber takes /*
*/ string color /* Which color you want to combine when texttag reaching
*/ real x /* x of texttag
*/ real y /* y of texttag
*/ real z /* z of texttag
*/ real size /* Size of texttag
*/ real time /* Time out
*/ integer savenumber /* This number very important, it's a number save with table and you can load this texttag with number :)
*/ returns nothing
//Now for Example:
call Casting.textNumber("|cffFFFF00",GetRectCenterX(gg_rct_P),GetRectCenterY(gg_rct_P),5.,15.,5.,10)
//
//
static method TextRun takes /*
*/ unit ct /* Which unit you want to add this texttag
*/ string text /* Which text you want to display
*/ string color /* Which color you want to combine when texttag reaching
*/ real size /* Size of texttag
*/ real time /* Time out
*/ boolean hidetext /* Only you can see this text
*/ boolean hidetextenemies /* Only you and your allies can see this text
*/ boolean style /* Style of Texttag (if true, STYLE: Override font color, if false, STYLE: Increase the letter)
*/ integer savenumber /* This number very important, it's a number save with table and you can load this texttag with number :)
*/ returns nothing
//Now for Example:
call Casting.TextRunning(Player(0),"CastingSystem","|cff00CC66",5.,13.,3.,true,false,true)
//
//
static method TextChannel takes /*
*/ unit ct /* Which unit you want to add this texttag and check order
*/ string text /* Which text you want to display
*/ string color /* Which color you want to combine when texttag reaching
*/ string order /* Order of ability unit using, if order != Current order, this system will deny it and also destroy it, this texttag will be cancel
*/ real size /* Size of texttag
*/ real time /* Time out
*/ boolean hidetext /* Only you can see this text
*/ boolean hidetextenemies /* Only you and your allies can see this text
*/ boolean style /* Style of Texttag (if true, STYLE: Override font color, if false, STYLE: Increase the letter)
*/ returns nothing
//Now for Example:
call Casting.TextChanneling(GetTriggerUnit(),"CastingSystem","carrionswarm","|cff00CC66",GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()),5.,13.,3.,true,false,true)
//
//
static method NumberRun takes /*
*/ unit ct /* Which unit you want to add this texttag
*/ string color /* Which color you want to combine with number
*/ real size /* Size of texttag
*/ real time /* Time out
*/ boolean hidetext /* Only you can see this text
*/ boolean hidetextenemies /* Only you and your allies can see this text
*/ integer savenumber /* This number very important, it's a number save with table and you can load this texttag with number :)
//Hint: Different with Text, this method display percent of time 1 -> 100% :)
*/ returns nothing
//Now for Example:
call Casting.NumberRunning(Player(0),"|cff00CC66",5.,13.,3.,true,false,true)
//
//
static method NumberChannel takes /*
*/ unit ct /* Which unit you want to add this texttag and check order
*/ string color /* Which color you want to combine with number
*/ string order /* Order of ability unit using, if order != Current order, this system will deny it and also destroy it, this texttag will be cancel
*/ real size /* Size of texttag
*/ real time /* Time out
*/ boolean hidetext /* Only you can see this text
*/ boolean hidetextenemies /* Only you and your allies can see this text
*/ boolean style /* Style of Texttag (if true, STYLE: Override font color, if false, STYLE: Increase the letter)
//Hint: Different with Text, this method display percent of time 1 -> 100% :)
*/ returns nothing
//Now for Example:
call Casting.NumberChanneling(GetTriggerUnit(),"CastingSystem","carrionswarm","|cff00CC66",GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()),5.,13.,3.,true,false,true)
//! endnovjass
//TESH.scrollpos=539
//TESH.alwaysfold=0
//*************************************************************************************************
//*************************************************************************************************
//*************************************************************************************************
//*************************************************************************************************
//*************************************************************************************************
// C A S T I N G T E X T S Y S T E M
// B Y:
// E L P H I S
// V E R S I O N:
// 1.3
// C O D E A P I:
//! novjass
struct Casting..... /*
//===========================ALL ABOUT HELPING METHOD===========================
//This method help you to get current x of texttag
*/ method operator getX takes nothing returns real /*
//This method help you to get current y of texttag
*/ method operator getY takes nothing returns real /*
//This method help you to get current z of texttag
*/ method operator getZ takes nothing returns real /*
//This method help you to get current size of texttag
*/ method operator getS takes nothing returns real /*
//This method help you to set texttag position
*/ method setXYZ takes real x,real y,real z,real size returns nothing /*
//This method help you to hide text for player
*/ method hideTextForPlayer takes player p/* Which player you want to hide
*/ boolean hide /* Boolean hide text
*/ returns nothing /*
//This method help you to hide the texttag for player
*/ method hideText takes /*
*/ boolean hidetext /* Only you can see this text
*/ boolean hidetextenemies /* Only you and your allies can see this text
*/ return nothing/*
//This method help you to destroy the texttag instantly and also destroy data inside of this texttag
*/ method destroyInstantly takes nothing returns nothing /*
//This method help you to add text to method percentage when it run :)
*/ method addText takes string text returns nothing /*
*/
//
//
//==============================================================================
static method textPoint takes /*
*/ string text /* Which text you want to display
*/ string color /* Which color you want to combine when texttag reaching
*/ real x /* x of texttag
*/ real y /* y of texttag
*/ real z /* z of texttag
*/ real size /* Size of texttag
*/ real time /* Time out
*/ boolean style /* Style of Texttag (if true, STYLE: Override font color, if false, STYLE: Increase the letter)
*/ integer savenumber /* This number very important, it's a number save with table and you can load this texttag with number :)
*/ returns nothing
//Now for Example:
call Casting.textPoint("KABOOMKABOOM","|cffFFFF00",GetRectCenterX(gg_rct_P),GetRectCenterY(gg_rct_P),5.,15.,5.,false,15)
//
//
static method textNumber takes /*
*/ string color /* Which color you want to combine when texttag reaching
*/ real x /* x of texttag
*/ real y /* y of texttag
*/ real z /* z of texttag
*/ real size /* Size of texttag
*/ real time /* Time out
*/ integer savenumber /* This number very important, it's a number save with table and you can load this texttag with number :)
*/ returns nothing
//Now for Example:
call Casting.textNumber("|cffFFFF00",GetRectCenterX(gg_rct_P),GetRectCenterY(gg_rct_P),5.,15.,5.,10)
//
//
static method TextRun takes /*
*/ unit ct /* Which unit you want to add this texttag
*/ string text /* Which text you want to display
*/ string color /* Which color you want to combine when texttag reaching
*/ real size /* Size of texttag
*/ real time /* Time out
*/ boolean hidetext /* Only you can see this text
*/ boolean hidetextenemies /* Only you and your allies can see this text
*/ boolean style /* Style of Texttag (if true, STYLE: Override font color, if false, STYLE: Increase the letter)
*/ integer savenumber /* This number very important, it's a number save with table and you can load this texttag with number :)
*/ returns nothing
//Now for Example:
call Casting.TextRunning(Player(0),"CastingSystem","|cff00CC66",5.,13.,3.,true,false,true)
//
//
static method TextChannel takes /*
*/ unit ct /* Which unit you want to add this texttag and check order
*/ string text /* Which text you want to display
*/ string color /* Which color you want to combine when texttag reaching
*/ string order /* Order of ability unit using, if order != Current order, this system will deny it and also destroy it, this texttag will be cancel
*/ real size /* Size of texttag
*/ real time /* Time out
*/ boolean hidetext /* Only you can see this text
*/ boolean hidetextenemies /* Only you and your allies can see this text
*/ boolean style /* Style of Texttag (if true, STYLE: Override font color, if false, STYLE: Increase the letter)
*/ returns nothing
//Now for Example:
call Casting.TextChanneling(GetTriggerUnit(),"CastingSystem","carrionswarm","|cff00CC66",GetWidgetX(GetTriggerUnit()),GetWidgetY(GetTriggerUnit()),5.,13.,3.,true,false,true)
//
//
static method NumberRun takes /*
*/ unit ct /* Which unit you want to add this texttag
*/ string color /* Which color you want to combine with number
*/ real size /* Size of texttag
*/ real time /* Time out
*/ boolean hidetext /* Only you can see this text
*/ boolean hidetextenemies /* Only you and your allies can see this text
*/ integer savenumber /* This number very important, it's a number save with table and you can load this texttag with number :)
//Hint: Different with Text, this method display percent of time 1 -> 100% :)
*/ returns nothing
//Now for Example:
call Casting.NumberRunning(Player(0),"|cff00CC66",5.,13.,3.,true,false,true)
//
//
static method NumberChannel takes /*
*/ unit ct /* Which unit you want to add this texttag and check order
*/ string color /* Which color you want to combine with number
*/ string order /* Order of ability unit using, if order != Current order, this system will deny it and also destroy it, this texttag will be cancel
*/ real size /* Size of texttag
*/ real time /* Time out
*/ boolean hidetext /* Only you can see this text
*/ boolean hidetextenemies /* Only you and your allies can see this text
*/ boolean style /* Style of Texttag (if true, STYLE: Override font color, if false, STYLE: Increase the letter)
//Hint: Different with Text, this method display percent of time 1 -> 100% :)
*/ returns nothing
//Now for Example:
call Casting.NumberChanneling(GetTriggerUnit(),"CastingSystem","carrionswarm","|cff00CC66",GetWidgetX(GetTriggerUnit()),GetWidgetY(GetTriggerUnit()),5.,13.,3.,true,false,true)
//! endnovjass
//*************************************************************************************************
// - Installation:
// - Import/copy the required libraries and Casting Text code to your map
// - Read system API
// - You may play with the configurables below
//*************************************************************************************************
//*************************************************************************************************
//*************************************************************************************************
//*************************************************************************************************
//*************************************************************************************************
library /*
*/ CastingText /*
*/ uses/*
*/ TimerUtils /*
*/ TextTag /*
*/ Table /*
*/ Alloc /*
*/
//*************************************************************************************************
//*************************************************************************************************
//
globals
//==================================SYSTEM SETTINGS==================================
//Delay before destroy texttag, this is useful value, don't change this unless you know what you doing !!
private constant real DELAY = 0.1
//Life span of texttag
private constant real LIFE_SPAN = 1.
//Fade point of texttag
private constant real FADE_POINT = 0.7
//Age of texttag
private constant real AGE = 0.5
//Periodic for this system
private constant real PERIODIC = 0.031250000
// TABLE INSTALL
Table C_TAB
//=========================================================================================
endglobals
//
//=========================================================================================
// Do not change things below
//=========================================================================================
struct Casting extends array
//
implement Alloc
//integer
private integer SN
//unit
private unit caster
//texttag
private texttag t
//string
private string source
private string c
private string o
private string tex
//real
private real timeout
private real intevar
private real s
private real delay
private real logic
private real mt
private real xx
private real yy
private real zz
//integer
private integer l
//boolean
private boolean style
private boolean numbercast
private boolean release
//
method setXYZ takes real x,real y,real z,real size returns nothing
set xx = x
set yy = y
set zz = z
set s = size
endmethod
//
method operator getS takes nothing returns real
return s
endmethod
//
method operator getX takes nothing returns real
return xx
endmethod
//
method operator getY takes nothing returns real
return yy
endmethod
//
method operator getZ takes nothing returns real
return zz
endmethod
//
private method hideText takes boolean hidetext,boolean hidetextenemies returns nothing
//
local integer i
local player p
//
if caster == null then
set p = null
return
endif
//
set i = 0
set p = GetOwningPlayer(caster)
//
if hidetext then
loop
exitwhen i == bj_MAX_PLAYERS
if Player(i) != p then
if GetLocalPlayer() == Player(i) then
call SetTextTagVisibility(t,false)
endif
endif
set i = i + 1
endloop
elseif hidetextenemies then
loop
exitwhen i == bj_MAX_PLAYERS
if Player(i) != p and IsPlayerEnemy(p,Player(i)) then
if GetLocalPlayer() == Player(i) then
call SetTextTagVisibility(t,false)
endif
endif
set i = i + 1
endloop
endif
endmethod
//
method setTextHideForPlayer takes player p,boolean hidetext returns nothing
if caster == null then
return
endif
//
if GetLocalPlayer() == p then
call SetTextTagVisibility(t,false)
endif
endmethod
//
method addText takes string text returns nothing
set tex = text
endmethod
//
method destroyInstantly takes nothing returns nothing
set release = true
endmethod
//
private method removeText takes nothing returns nothing
call C_TAB.remove(SN)
call TextTagAge(t,LIFE_SPAN,FADE_POINT,AGE)
set t = null
set o = null
set tex = null
set source = null
set c = null
set caster = null
call this.deallocate()
endmethod
// This method is periodic
private static method onPeriodic takes nothing returns nothing
local timer ti = GetExpiredTimer()
local thistype this = GetTimerData(ti)
local real a
local string st
//Check time
if timeout > 0 then
//This boolean check this method called is a numbercast method
//
if caster != null then
//Set Texttag Position
set xx = GetWidgetX(caster)
set yy = GetWidgetY(caster)
set zz = GetUnitFlyHeight(caster)
endif
//
if not numbercast then
set intevar = intevar+PERIODIC
//Logical
set a = (intevar/mt)*l
if style then
set st = c + SubString(source,0,R2I(a)) + "|r" + SubString(source,R2I(a),l)
else
set st = c + SubString(source,0,R2I(a))
endif
//
if intevar > l or GetUnitCurrentOrder(caster) != OrderId(o) and o != "" then
set release = true
endif
else
set intevar = intevar + logic
//
set st = c + tex +I2S(R2I(intevar)) + "%"
//
if intevar >= 100. or GetUnitCurrentOrder(caster) != OrderId(o) and o != "" then
set release = true
endif
endif
//
call ChangeTextTag(t,st,s)
//
call SetTextTagPos(t,xx,yy,zz)
//
//Decrease time
set timeout = timeout - PERIODIC
//
else
if not release then
set release = true
endif
endif
//
if release then
//Run delay
if delay < DELAY then
set delay = delay + PERIODIC
else
//Clean data
call ReleaseTimer(ti)
call removeText()
endif
endif
//
set st = null
set ti = null
endmethod
//
//
static method textNumber takes string color,real x,real y,real z,real size,real time,integer savenumber returns nothing
local thistype this = allocate()
local integer i = 0
//
set release = false
set numbercast = true
//
set delay = 0.
set intevar = 0.
//Save with Table
set C_TAB[savenumber] = this
set SN = savenumber
//
set xx = x
set yy = y
set zz = z
//
set tex = ""
set o = ""
set caster = null
set timeout = time
set logic = PERIODIC/timeout*100.
set c = color
set s = size
//
set t = CreateTextTagLoc("",xx,yy,zz,s)
//Calling Periodic
call TimerStart(NewTimerEx(this),PERIODIC,true,function thistype.onPeriodic)
endmethod
//
//
static method textPoint takes string text,string color,real x,real y,real z,real size,real time,boolean style,integer savenumber returns nothing
local thistype this = allocate()
local integer i = 0
//
set release = false
set numbercast = false
//
set delay = 0.
set intevar = 0.
//Save with Table
set C_TAB[savenumber] = this
set SN = savenumber
//
set xx = x
set yy = y
set zz = z
//
set caster = null
set o = ""
set timeout = time
set mt = timeout
set c = color
set s = size
set style = style
//
set source = text
set l = StringLength(source)
//
if style then
set t = CreateTextTagLoc(source,xx,yy,zz,s)
else
set t = CreateTextTagLoc(SubString(source,0,0),GetWidgetX(caster),GetWidgetY(caster),GetUnitFlyHeight(caster),s)
endif
//Calling Periodic
call TimerStart(NewTimerEx(this),PERIODIC,true,function thistype.onPeriodic)
endmethod
//
//
static method textRun takes unit ct,string text,string color,real size,real time,boolean hidetext,boolean hidetextenemies,boolean style,integer savenumber returns nothing
local thistype this = allocate()
local integer i = 0
//
set release = false
set numbercast = false
//
set delay = 0.
set intevar = 0.
//Save with Table
set C_TAB[savenumber] = this
set SN = savenumber
//
set tex = ""
set o = ""
set caster = ct
set timeout = time
set mt = timeout
set c = color
set s = size
set style = style
//
set source = text
set l = StringLength(source)
//
if style then
set t = CreateTextTagLoc(source,GetWidgetX(caster),GetWidgetY(caster),GetUnitFlyHeight(caster),s)
else
set t = CreateTextTagLoc(SubString(source,0,0),GetWidgetX(caster),GetWidgetY(caster),GetUnitFlyHeight(caster),s)
endif
//Check 2 boolean
call hideText(hidetext,hidetextenemies)
//
//Calling Periodic
call TimerStart(NewTimerEx(this),PERIODIC,true,function thistype.onPeriodic)
endmethod
//
//
static method textChannel takes unit ct,string text,string order,string color,real size,real time,boolean hidetext,boolean hidetextenemies,boolean style returns nothing
local thistype this = allocate()
local integer i = 0
//
set release = false
set numbercast = false
//
set delay = 0.
set intevar = 0.
//
set o = order
set caster = ct
set timeout = time
set mt = timeout
set c = color
set s = size
set style = style
set o = order
//
set source = text
set l = StringLength(source)
//
if style then
set t = CreateTextTagLoc(source,GetWidgetX(caster),GetWidgetY(caster),GetUnitFlyHeight(caster),s)
else
set t = CreateTextTagLoc(SubString(source,0,0),GetWidgetX(caster),GetWidgetY(caster),GetUnitFlyHeight(caster),s)
endif
//Check 2 boolean
call hideText(hidetext,hidetextenemies)
//
//Calling Periodic
call TimerStart(NewTimerEx(this),PERIODIC,true,function thistype.onPeriodic)
endmethod
//
//
static method numberRun takes unit ct, string color,real size,real time,boolean hidetext,boolean hidetextenemies,integer savenumber returns nothing
local thistype this = allocate()
local integer i = 0
//
set release = false
set numbercast = true
//
set delay = 0.
set intevar = 1.
//Save with Table
set C_TAB[savenumber] = this
set SN = savenumber
//
set tex = ""
set o = ""
set caster = ct
set timeout = time
set logic = PERIODIC/timeout*100.
set c = color
set s = size
//
set t = CreateTextTagLoc("",GetWidgetX(caster),GetWidgetY(caster),GetUnitFlyHeight(caster),s)
//Check 2 boolean
call hideText(hidetext,hidetextenemies)
//Calling Periodic
call TimerStart(NewTimerEx(this),PERIODIC,true,function thistype.onPeriodic)
endmethod
//
//
//
static method numberChannel takes unit ct,string order,string color,real size,real time,boolean hidetext,boolean hidetextenemies returns nothing
local thistype this = allocate()
local integer i = 0
//
set release = false
set numbercast = true
//
set delay = 0.
set intevar = 0.
//
set o = order
set caster = ct
set timeout = time
set o = order
set logic = PERIODIC/timeout*100.
set c = color
set s = size
set t = CreateTextTagLoc("",GetWidgetX(caster),GetWidgetY(caster),GetUnitFlyHeight(caster),s)
//
call hideText(hidetext,hidetextenemies)
//Calling Periodic
call TimerStart(NewTimerEx(this),PERIODIC,true,function thistype.onPeriodic)
endmethod
//
private static method onInit takes nothing returns nothing
set C_TAB = Table.create()
endmethod
endstruct
endlibrary
//TESH.scrollpos=13
//TESH.alwaysfold=0
library Table /* made by Bribe, special thanks to Vexorian & Nestharus, version 3.1.0.1
One map, one hashtable. Welcome to NewTable 3.1
This library was originally called NewTable so it didn't conflict with
the API of Table by Vexorian. However, the damage is done and it's too
late to change the library name now. To help with damage control, I
have provided an extension library called TableBC, which bridges all
the functionality of Vexorian's Table except for 2-D string arrays &
the ".flush(integer)" method. I use ".flush()" to flush a child hash-
table, because I wanted the API in NewTable to reflect the API of real
hashtables (I thought this would be more intuitive).
API
------------
struct Table
| static method create takes nothing returns Table
| create a new Table
|
| method destroy takes nothing returns nothing
| destroy it
|
| method flush takes nothing returns nothing
| flush all stored values inside of it
|
| method remove takes integer key returns nothing
| remove the value at index "key"
|
| method operator []= takes integer key, $TYPE$ value returns nothing
| assign "value" to index "key"
|
| method operator [] takes integer key returns $TYPE$
| load the value at index "key"
|
| method has takes integer key returns boolean
| whether or not the key was assigned
|
----------------
struct TableArray
| static method operator [] takes integer array_size returns TableArray
| create a new array of Tables of size "array_size"
|
| method destroy takes nothing returns nothing
| destroy it
|
| method flush takes nothing returns nothing
| flush and destroy it
|
| method operator size takes nothing returns integer
| returns the size of the TableArray
|
| method operator [] takes integer key returns Table
| returns a Table accessible exclusively to index "key"
*/
globals
private integer less = 0 //Index generation for TableArrays (below 0).
private integer more = 8190 //Index generation for Tables.
//Configure it if you use more than 8190 "key" variables in your map (this will never happen though).
private hashtable ht = InitHashtable()
private key sizeK
private key listK
endglobals
private struct dex extends array
static method operator size takes nothing returns Table
return sizeK
endmethod
static method operator list takes nothing returns Table
return listK
endmethod
endstruct
private struct handles extends array
method has takes integer key returns boolean
return HaveSavedHandle(ht, this, key)
endmethod
method remove takes integer key returns nothing
call RemoveSavedHandle(ht, this, key)
endmethod
endstruct
private struct agents extends array
method operator []= takes integer key, agent value returns nothing
call SaveAgentHandle(ht, this, key, value)
endmethod
endstruct
//! textmacro NEW_ARRAY_BASIC takes SUPER, FUNC, TYPE
private struct $TYPE$s extends array
method operator [] takes integer key returns $TYPE$
return Load$FUNC$(ht, this, key)
endmethod
method operator []= takes integer key, $TYPE$ value returns nothing
call Save$FUNC$(ht, this, key, value)
endmethod
method has takes integer key returns boolean
return HaveSaved$SUPER$(ht, this, key)
endmethod
method remove takes integer key returns nothing
call RemoveSaved$SUPER$(ht, this, key)
endmethod
endstruct
private module $TYPE$m
method operator $TYPE$ takes nothing returns $TYPE$s
return this
endmethod
endmodule
//! endtextmacro
//! textmacro NEW_ARRAY takes FUNC, TYPE
private struct $TYPE$s extends array
method operator [] takes integer key returns $TYPE$
return Load$FUNC$Handle(ht, this, key)
endmethod
method operator []= takes integer key, $TYPE$ value returns nothing
call Save$FUNC$Handle(ht, this, key, value)
endmethod
endstruct
private module $TYPE$m
method operator $TYPE$ takes nothing returns $TYPE$s
return this
endmethod
endmodule
//! endtextmacro
//Run these textmacros to include the entire hashtable API as wrappers.
//Don't be intimidated by the number of macros - Vexorian's map optimizer is
//supposed to kill functions which inline (all of these functions inline).
//! runtextmacro NEW_ARRAY_BASIC("Real", "Real", "real")
//! runtextmacro NEW_ARRAY_BASIC("Boolean", "Boolean", "boolean")
//! runtextmacro NEW_ARRAY_BASIC("String", "Str", "string")
//! runtextmacro NEW_ARRAY("Player", "player")
//! runtextmacro NEW_ARRAY("Widget", "widget")
//! runtextmacro NEW_ARRAY("Destructable", "destructable")
//! runtextmacro NEW_ARRAY("Item", "item")
//! runtextmacro NEW_ARRAY("Unit", "unit")
//! runtextmacro NEW_ARRAY("Ability", "ability")
//! runtextmacro NEW_ARRAY("Timer", "timer")
//! runtextmacro NEW_ARRAY("Trigger", "trigger")
//! runtextmacro NEW_ARRAY("TriggerCondition", "triggercondition")
//! runtextmacro NEW_ARRAY("TriggerAction", "triggeraction")
//! runtextmacro NEW_ARRAY("TriggerEvent", "event")
//! runtextmacro NEW_ARRAY("Force", "force")
//! runtextmacro NEW_ARRAY("Group", "group")
//! runtextmacro NEW_ARRAY("Location", "location")
//! runtextmacro NEW_ARRAY("Rect", "rect")
//! runtextmacro NEW_ARRAY("BooleanExpr", "boolexpr")
//! runtextmacro NEW_ARRAY("Sound", "sound")
//! runtextmacro NEW_ARRAY("Effect", "effect")
//! runtextmacro NEW_ARRAY("UnitPool", "unitpool")
//! runtextmacro NEW_ARRAY("ItemPool", "itempool")
//! runtextmacro NEW_ARRAY("Quest", "quest")
//! runtextmacro NEW_ARRAY("QuestItem", "questitem")
//! runtextmacro NEW_ARRAY("DefeatCondition", "defeatcondition")
//! runtextmacro NEW_ARRAY("TimerDialog", "timerdialog")
//! runtextmacro NEW_ARRAY("Leaderboard", "leaderboard")
//! runtextmacro NEW_ARRAY("Multiboard", "multiboard")
//! runtextmacro NEW_ARRAY("MultiboardItem", "multiboarditem")
//! runtextmacro NEW_ARRAY("Trackable", "trackable")
//! runtextmacro NEW_ARRAY("Dialog", "dialog")
//! runtextmacro NEW_ARRAY("Button", "button")
//! runtextmacro NEW_ARRAY("TextTag", "texttag")
//! runtextmacro NEW_ARRAY("Lightning", "lightning")
//! runtextmacro NEW_ARRAY("Image", "image")
//! runtextmacro NEW_ARRAY("Ubersplat", "ubersplat")
//! runtextmacro NEW_ARRAY("Region", "region")
//! runtextmacro NEW_ARRAY("FogState", "fogstate")
//! runtextmacro NEW_ARRAY("FogModifier", "fogmodifier")
//! runtextmacro NEW_ARRAY("Hashtable", "hashtable")
struct Table extends array
// Implement modules for intuitive syntax (tb.handle; tb.unit; etc.)
implement realm
implement booleanm
implement stringm
implement playerm
implement widgetm
implement destructablem
implement itemm
implement unitm
implement abilitym
implement timerm
implement triggerm
implement triggerconditionm
implement triggeractionm
implement eventm
implement forcem
implement groupm
implement locationm
implement rectm
implement boolexprm
implement soundm
implement effectm
implement unitpoolm
implement itempoolm
implement questm
implement questitemm
implement defeatconditionm
implement timerdialogm
implement leaderboardm
implement multiboardm
implement multiboarditemm
implement trackablem
implement dialogm
implement buttonm
implement texttagm
implement lightningm
implement imagem
implement ubersplatm
implement regionm
implement fogstatem
implement fogmodifierm
implement hashtablem
method operator handle takes nothing returns handles
return this
endmethod
method operator agent takes nothing returns agents
return this
endmethod
//set this = tb[GetSpellAbilityId()]
method operator [] takes integer key returns Table
return LoadInteger(ht, this, key)
endmethod
//set tb[389034] = 8192
method operator []= takes integer key, Table tb returns nothing
call SaveInteger(ht, this, key, tb)
endmethod
//set b = tb.has(2493223)
method has takes integer key returns boolean
return HaveSavedInteger(ht, this, key)
endmethod
//call tb.remove(294080)
method remove takes integer key returns nothing
call RemoveSavedInteger(ht, this, key)
endmethod
//Remove all data from a Table instance
method flush takes nothing returns nothing
call FlushChildHashtable(ht, this)
endmethod
//local Table tb = Table.create()
static method create takes nothing returns Table
local Table this = dex.list[0]
if this == 0 then
set this = more + 1
set more = this
else
set dex.list[0] = dex.list[this]
call dex.list.remove(this) //Clear hashed memory
endif
debug set dex.list[this] = -1
return this
endmethod
// Removes all data from a Table instance and recycles its index.
//
// call tb.destroy()
//
method destroy takes nothing returns nothing
debug if dex.list[this] != -1 then
debug call BJDebugMsg("Table Error: Tried to double-free instance: " + I2S(this))
debug return
debug endif
call this.flush()
set dex.list[this] = dex.list[0]
set dex.list[0] = this
endmethod
//! runtextmacro optional TABLE_BC_METHODS()
endstruct
//! runtextmacro optional TABLE_BC_STRUCTS()
struct TableArray extends array
//Returns a new TableArray to do your bidding. Simply use:
//
// local TableArray ta = TableArray[array_size]
//
static method operator [] takes integer array_size returns TableArray
local Table tb = dex.size[array_size] //Get the unique recycle list for this array size
local TableArray this = tb[0] //The last-destroyed TableArray that had this array size
debug if array_size <= 0 then
debug call BJDebugMsg("TypeError: Invalid specified TableArray size: " + I2S(array_size))
debug return 0
debug endif
if this == 0 then
set this = less - array_size
set less = this
else
set tb[0] = tb[this] //Set the last destroyed to the last-last destroyed
call tb.remove(this) //Clear hashed memory
endif
set dex.size[this] = array_size //This remembers the array size
return this
endmethod
//Returns the size of the TableArray
method operator size takes nothing returns integer
return dex.size[this]
endmethod
//This magic method enables two-dimensional[array][syntax] for Tables,
//similar to the two-dimensional utility provided by hashtables them-
//selves.
//
//ta[integer a].unit[integer b] = unit u
//ta[integer a][integer c] = integer d
//
//Inline-friendly when not running in debug mode
//
method operator [] takes integer key returns Table
static if DEBUG_MODE then
local integer i = this.size
if i == 0 then
call BJDebugMsg("IndexError: Tried to get key from invalid TableArray instance: " + I2S(this))
return 0
elseif key < 0 or key >= i then
call BJDebugMsg("IndexError: Tried to get key [" + I2S(key) + "] from outside TableArray bounds: " + I2S(i))
return 0
endif
endif
return this + key
endmethod
//Destroys a TableArray without flushing it; I assume you call .flush()
//if you want it flushed too. This is a public method so that you don't
//have to loop through all TableArray indices to flush them if you don't
//need to (ie. if you were flushing all child-keys as you used them).
//
method destroy takes nothing returns nothing
local Table tb = dex.size[this.size]
debug if this.size == 0 then
debug call BJDebugMsg("TypeError: Tried to destroy an invalid TableArray: " + I2S(this))
debug return
debug endif
if tb == 0 then
//Create a Table to index recycled instances with their array size
set tb = Table.create()
set dex.size[this.size] = tb
endif
call dex.size.remove(this) //Clear the array size from hash memory
set tb[this] = tb[0]
set tb[0] = this
endmethod
private static Table tempTable
private static integer tempEnd
//Avoids hitting the op limit
private static method clean takes nothing returns nothing
local Table tb = .tempTable
local integer end = tb + 0x1000
if end < .tempEnd then
set .tempTable = end
call ForForce(bj_FORCE_PLAYER[0], function thistype.clean)
else
set end = .tempEnd
endif
loop
call tb.flush()
set tb = tb + 1
exitwhen tb == end
endloop
endmethod
//Flushes the TableArray and also destroys it. Doesn't get any more
//similar to the FlushParentHashtable native than this.
//
method flush takes nothing returns nothing
debug if this.size == 0 then
debug call BJDebugMsg("TypeError: Tried to flush an invalid TableArray instance: " + I2S(this))
debug return
debug endif
set .tempTable = this
set .tempEnd = this + this.size
call ForForce(bj_FORCE_PLAYER[0], function thistype.clean)
call this.destroy()
endmethod
endstruct
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library TimerUtils initializer init
//*********************************************************************
//* TimerUtils (red+blue+orange flavors for 1.24b+) 2.0
//* ----------
//*
//* To implement it , create a custom text trigger called TimerUtils
//* and paste the contents of this script there.
//*
//* To copy from a map to another, copy the trigger holding this
//* library to your map.
//*
//* (requires vJass) More scripts: htt://www.wc3c.net
//*
//* For your timer needs:
//* * Attaching
//* * Recycling (with double-free protection)
//*
//* set t=NewTimer() : Get a timer (alternative to CreateTimer)
//* set t=NewTimerEx(x) : Get a timer (alternative to CreateTimer), call
//* Initialize timer data as x, instead of 0.
//*
//* ReleaseTimer(t) : Relese a timer (alt to DestroyTimer)
//* SetTimerData(t,2) : Attach value 2 to timer
//* GetTimerData(t) : Get the timer's value.
//* You can assume a timer's value is 0
//* after NewTimer.
//*
//* Multi-flavor:
//* Set USE_HASH_TABLE to true if you don't want to complicate your life.
//*
//* If you like speed and giberish try learning about the other flavors.
//*
//********************************************************************
//================================================================
globals
//How to tweak timer utils:
// USE_HASH_TABLE = true (new blue)
// * SAFEST
// * SLOWEST (though hash tables are kind of fast)
//
// USE_HASH_TABLE = false, USE_FLEXIBLE_OFFSET = true (orange)
// * kinda safe (except there is a limit in the number of timers)
// * ALMOST FAST
//
// USE_HASH_TABLE = false, USE_FLEXIBLE_OFFSET = false (red)
// * THE FASTEST (though is only faster than the previous method
// after using the optimizer on the map)
// * THE LEAST SAFE ( you may have to tweak OFSSET manually for it to
// work)
//
private constant boolean USE_HASH_TABLE = true
private constant boolean USE_FLEXIBLE_OFFSET = false
private constant integer OFFSET = 0x100000
private integer VOFFSET = OFFSET
//Timers to preload at map init:
private constant integer QUANTITY = 256
//Changing this to something big will allow you to keep recycling
// timers even when there are already AN INCREDIBLE AMOUNT of timers in
// the stack. But it will make things far slower so that's probably a bad idea...
private constant integer ARRAY_SIZE = 8190
endglobals
//==================================================================================================
globals
private integer array data[ARRAY_SIZE]
private hashtable ht
endglobals
//It is dependent on jasshelper's recent inlining optimization in order to perform correctly.
function SetTimerData takes timer t, integer value returns nothing
static if(USE_HASH_TABLE) then
// new blue
call SaveInteger(ht,0,GetHandleId(t), value)
elseif (USE_FLEXIBLE_OFFSET) then
// orange
static if (DEBUG_MODE) then
if(GetHandleId(t)-VOFFSET<0) then
call BJDebugMsg("SetTimerData: Wrong handle id, only use SetTimerData on timers created by NewTimer")
endif
endif
set data[GetHandleId(t)-VOFFSET]=value
else
// new red
static if (DEBUG_MODE) then
if(GetHandleId(t)-OFFSET<0) then
call BJDebugMsg("SetTimerData: Wrong handle id, only use SetTimerData on timers created by NewTimer")
endif
endif
set data[GetHandleId(t)-OFFSET]=value
endif
endfunction
function GetTimerData takes timer t returns integer
static if(USE_HASH_TABLE) then
// new blue
return LoadInteger(ht,0,GetHandleId(t) )
elseif (USE_FLEXIBLE_OFFSET) then
// orange
static if (DEBUG_MODE) then
if(GetHandleId(t)-VOFFSET<0) then
call BJDebugMsg("SetTimerData: Wrong handle id, only use SetTimerData on timers created by NewTimer")
endif
endif
return data[GetHandleId(t)-VOFFSET]
else
// new red
static if (DEBUG_MODE) then
if(GetHandleId(t)-OFFSET<0) then
call BJDebugMsg("SetTimerData: Wrong handle id, only use SetTimerData on timers created by NewTimer")
endif
endif
return data[GetHandleId(t)-OFFSET]
endif
endfunction
//==========================================================================================
globals
private timer array tT[ARRAY_SIZE]
private integer tN = 0
private constant integer HELD=0x28829022
//use a totally random number here, the more improbable someone uses it, the better.
private boolean didinit = false
endglobals
private keyword init
//==========================================================================================
// I needed to decide between duplicating code ignoring the "Once and only once" rule
// and using the ugly textmacros. I guess textmacros won.
//
//! textmacro TIMERUTIS_PRIVATE_NewTimerCommon takes VALUE
// On second thought, no.
//! endtextmacro
function NewTimerEx takes integer value returns timer
if (tN==0) then
if (not didinit) then
//This extra if shouldn't represent a major performance drawback
//because QUANTITY rule is not supposed to be broken every day.
call init.evaluate()
set tN = tN - 1
else
//If this happens then the QUANTITY rule has already been broken, try to fix the
// issue, else fail.
debug call BJDebugMsg("NewTimer: Warning, Exceeding TimerUtils_QUANTITY, make sure all timers are getting recycled correctly")
set tT[0]=CreateTimer()
static if( not USE_HASH_TABLE) then
debug call BJDebugMsg("In case of errors, please increase it accordingly, or set TimerUtils_USE_HASH_TABLE to true")
static if( USE_FLEXIBLE_OFFSET) then
if (GetHandleId(tT[0])-VOFFSET<0) or (GetHandleId(tT[0])-VOFFSET>=ARRAY_SIZE) then
//all right, couldn't fix it
call BJDebugMsg("NewTimer: Unable to allocate a timer, you should probably set TimerUtils_USE_HASH_TABLE to true or fix timer leaks.")
return null
endif
else
if (GetHandleId(tT[0])-OFFSET<0) or (GetHandleId(tT[0])-OFFSET>=ARRAY_SIZE) then
//all right, couldn't fix it
call BJDebugMsg("NewTimer: Unable to allocate a timer, you should probably set TimerUtils_USE_HASH_TABLE to true or fix timer leaks.")
return null
endif
endif
endif
endif
else
set tN=tN-1
endif
call SetTimerData(tT[tN],value)
return tT[tN]
endfunction
function NewTimer takes nothing returns timer
return NewTimerEx(0)
endfunction
//==========================================================================================
function ReleaseTimer takes timer t returns nothing
if(t==null) then
debug call BJDebugMsg("Warning: attempt to release a null timer")
return
endif
if (tN==ARRAY_SIZE) then
debug call BJDebugMsg("Warning: Timer stack is full, destroying timer!!")
//stack is full, the map already has much more troubles than the chance of bug
call DestroyTimer(t)
else
call PauseTimer(t)
if(GetTimerData(t)==HELD) then
debug call BJDebugMsg("Warning: ReleaseTimer: Double free!")
return
endif
call SetTimerData(t,HELD)
set tT[tN]=t
set tN=tN+1
endif
endfunction
private function init takes nothing returns nothing
local integer i=0
local integer o=-1
local boolean oops = false
if ( didinit ) then
return
else
set didinit = true
endif
static if( USE_HASH_TABLE ) then
set ht = InitHashtable()
loop
exitwhen(i==QUANTITY)
set tT[i]=CreateTimer()
call SetTimerData(tT[i], HELD)
set i=i+1
endloop
set tN = QUANTITY
else
loop
set i=0
loop
exitwhen (i==QUANTITY)
set tT[i] = CreateTimer()
if(i==0) then
set VOFFSET = GetHandleId(tT[i])
static if(USE_FLEXIBLE_OFFSET) then
set o=VOFFSET
else
set o=OFFSET
endif
endif
if (GetHandleId(tT[i])-o>=ARRAY_SIZE) then
exitwhen true
endif
if (GetHandleId(tT[i])-o>=0) then
set i=i+1
endif
endloop
set tN = i
exitwhen(tN == QUANTITY)
set oops = true
exitwhen not USE_FLEXIBLE_OFFSET
debug call BJDebugMsg("TimerUtils_init: Failed a initialization attempt, will try again")
endloop
if(oops) then
static if ( USE_FLEXIBLE_OFFSET) then
debug call BJDebugMsg("The problem has been fixed.")
//If this message doesn't appear then there is so much
//handle id fragmentation that it was impossible to preload
//so many timers and the thread crashed! Therefore this
//debug message is useful.
elseif(DEBUG_MODE) then
call BJDebugMsg("There were problems and the new timer limit is "+I2S(i))
call BJDebugMsg("This is a rare ocurrence, if the timer limit is too low:")
call BJDebugMsg("a) Change USE_FLEXIBLE_OFFSET to true (reduces performance a little)")
call BJDebugMsg("b) or try changing OFFSET to "+I2S(VOFFSET) )
endif
endif
endif
endfunction
endlibrary
//TESH.scrollpos=21
//TESH.alwaysfold=0
library TextTag
function CreateTextTagUnit takes string s, unit whichUnit, real zOffset, real size returns texttag
local texttag t
set size = size * 0.023 / 10
set t = CreateTextTag()
call SetTextTagText(t, s, size)
call SetTextTagPosUnit(t, whichUnit, zOffset)
call SetTextTagColor(t,255,255,255,255)
return t
endfunction
//
function ChangeTextTag takes texttag t, string s, real size returns nothing
set size = size * 0.023 / 10
call SetTextTagText(t, s, size)
endfunction
//
function CreateTextTagLoc takes string s, real x, real y, real zOffset, real size returns texttag
local texttag t
set size = size * 0.023 / 10
set t = CreateTextTag()
call SetTextTagText(t, s, size)
call SetTextTagPos(t,x,y, zOffset)
call SetTextTagColor(t,255,255,255,255)
return t
endfunction
//
function SetTextTagVel takes texttag tt, real speed, real angle returns nothing
local real vel = speed * 0.071 / 128
local real xvel = vel * Cos(angle * bj_DEGTORAD)
local real yvel = vel * Sin(angle * bj_DEGTORAD)
call SetTextTagVelocity(tt, xvel, yvel)
endfunction
//
function TextTagAge takes texttag t,real LifeSpan,real Fade,real Age returns nothing
call SetTextTagPermanent(t, false )
call SetTextTagLifespan(t, LifeSpan)
call SetTextTagFadepoint(t,Fade )
call SetTextTagAge(t,Age )
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library Alloc /* v1.0.0.1
*************************************************************************************
*
* */uses/*
*
* */ ErrorMessage /* hiveworkshop.com/forums/submissions-414/snippet-error-message-239210/
*
************************************************************************************
*
* module Alloc
*
* static method allocate takes nothing returns thistype
* method deallocate takes nothing returns nothing
*
************************************************************************************/
module Alloc
private static integer array recycler
private static integer instanceCount = 0
static method allocate takes nothing returns thistype
local thistype this = recycler[0]
if (this == 0) then
debug call ThrowError(instanceCount == 8191, "Alloc", "allocate", "thistype", 0, "Overflow.")
set this = instanceCount + 1
set instanceCount = this
else
set recycler[0] = recycler[this]
endif
debug set recycler[this] = -1
return this
endmethod
method deallocate takes nothing returns nothing
debug call ThrowError(recycler[this] != -1, "Alloc", "deallocate", "thistype", this, "Attempted To Deallocate Null Instance.")
set recycler[this] = recycler[0]
set recycler[0] = this
endmethod
endmodule
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library ErrorMessage /* v1.0.1.4
*************************************************************************************
*
* Issue THW Compliant Error Messages
*
************************************************************************************
*
* debug function ThrowError takes boolean expression, string libraryName, string functionName, string objectName, integer objectInstance, string description returns nothing
* - In the event of an error the game will be permanently paused
*
* debug function ThrowWarning takes boolean expression, string libraryName, string functionName, string objectName, integer objectInstance, string description returns nothing
*
************************************************************************************/
static if DEBUG_MODE then
private struct Fields extends array
static constant string COLOR_RED = "|cffff0000"
static constant string COLOR_YELLOW = "|cffffff00"
static string lastError = null
endstruct
private function Pause takes nothing returns nothing
call PauseGame(true)
endfunction
private function ThrowMessage takes string libraryName, string functionName, string objectName, integer objectInstance, string description, string errorType, string color returns nothing
local string str
local string color_braces = "|cff66FF99"
local string orange = "|cffff6600"
set str = "->\n-> " + color_braces + "{|r " + "Library" + color_braces + "(" + orange + libraryName + color_braces + ")"
if (objectName != null) then
if (objectInstance > 0) then
set str = str + "|r.Object" + color_braces + "(" + orange + objectName + color_braces + " (|rinstance = " + orange + I2S(objectInstance) + color_braces + ") )" + "|r." + "Method" + color_braces + "(" + orange + functionName + color_braces + ")"
else
set str = str + "|r.Object" + color_braces + "(" + orange + objectName + color_braces + ")|r." + "Method" + color_braces + "(" + orange + functionName + color_braces + ")"
endif
else
set str = str + "|r." + "Function" + color_braces + "(" + orange + functionName + color_braces + ")"
endif
set str = str + color_braces + " }|r " + "has thrown an exception of type " + color_braces + "(" + color + errorType + color_braces + ")|r."
set Fields.lastError = str + "\n->\n" + "-> " + color + description + "|r\n->"
endfunction
function ThrowError takes boolean expression, string libraryName, string functionName, string objectName, integer objectInstance, string description returns nothing
if (Fields.lastError != null) then
set objectInstance = 1/0
endif
if (expression) then
call ThrowMessage(libraryName, functionName, objectName, objectInstance, description, "Error", Fields.COLOR_RED)
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60000,Fields.lastError)
call TimerStart(CreateTimer(), 0, true, function Pause)
set objectInstance = 1/0
endif
endfunction
function ThrowWarning takes boolean expression, string libraryName, string functionName, string objectName, integer objectInstance, string description returns nothing
if (Fields.lastError != null) then
set objectInstance = 1/0
endif
if (expression) then
call ThrowMessage(libraryName, functionName, objectName, objectInstance, description, "Warning", Fields.COLOR_YELLOW)
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60000,Fields.lastError)
set Fields.lastError = null
endif
endfunction
endif
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Example_6_Actions takes nothing returns nothing
call Casting.textNumber("|cffFFFF00",GetRectCenterX(gg_rct_P),GetRectCenterY(gg_rct_P),5.,15.,5.,10)
call Casting.textPoint("KABOOMKABOOM","|cffFFFF00",GetRectCenterX(gg_rct_P),GetRectCenterY(gg_rct_P),5.,15.,5.,false,15)
endfunction
//===========================================================================
function InitTrig_Example_6 takes nothing returns nothing
set gg_trg_Example_6 = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Example_6, 0.00 )
call TriggerAddAction( gg_trg_Example_6, function Trig_Example_6_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_MOVE_Actions takes nothing returns nothing
local Casting t = C_TAB[10]
local Casting tt = C_TAB[15]
local real x
local real y
//
set x = t.getX + 2. * Cos(0.01747)
set y = t.getY + 2. * Sin(0.01747)
//
call t.setXYZ(x,y,t.getZ,tt.getS)
//
set x = tt.getX - 2. * Cos(0.01747)
set y = tt.getY - 2. * Sin(0.01747)
//
call tt.setXYZ(x,y,tt.getZ,tt.getS)
endfunction
//===========================================================================
function InitTrig_MOVE takes nothing returns nothing
set gg_trg_MOVE = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_MOVE, 0.03 )
call TriggerAddAction( gg_trg_MOVE, function Trig_MOVE_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_KABOOM_Actions takes nothing returns nothing
local Casting t = C_TAB[10]
call AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl",t.getX,t.getY)
set t = C_TAB[15]
call AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl",t.getX,t.getY)
endfunction
//===========================================================================
function InitTrig_KABOOM takes nothing returns nothing
set gg_trg_KABOOM = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_KABOOM, 5.00 )
call TriggerAddAction( gg_trg_KABOOM, function Trig_KABOOM_Actions )
endfunction