Name | Type | is_array | initial_value |
SW_Ability | abilcode | No | |
SW_Angle | real | Yes | |
SW_AoE | real | Yes | |
SW_AttachedModel | effect | Yes | |
SW_AttackType | attacktype | No | |
SW_BallArcHeight | real | No | |
SW_BallExDamage | real | Yes | |
SW_BallExEffect | string | Yes | |
SW_BallExNumber | integer | No | |
SW_BallExRadius | real | Yes | |
SW_BallMinDistance | real | No | |
SW_BallModel | string | No | |
SW_BallScale | real | No | |
SW_BallSpawnInterval | real | No | |
SW_BallSpeed | real | Yes | |
SW_Caster | unit | Yes | |
SW_DamageAlly | boolean | No | |
SW_DamageFlying | boolean | No | |
SW_DamageMagicImmnune | boolean | No | |
SW_DamageType | damagetype | No | |
SW_DestroyTrees | boolean | No | |
SW_Distance | real | Yes | |
SW_Dummy | unit | Yes | |
SW_DummyType | unitcode | No | |
SW_Gap | real | No | |
SW_Harvester | unit | No | |
SW_HarvestOrder | ordercode | No | |
SW_Index | integer | No | |
SW_Interval | real | No | |
SW_Level | integer | Yes | |
SW_Loop | integer | No | |
SW_MaxDistance | real | Yes | |
SW_MaxHeight | real | Yes | |
SW_MaxIndex | integer | No | |
SW_MissileArcHeight | real | No | |
SW_MissileModel | string | No | |
SW_MissileScale | real | No | |
SW_MissileTravelTime | real | Yes | |
SW_OrbMaxHeight | real | No | |
SW_OrbMinHeight | real | No | |
SW_OrbModel | string | No | |
SW_OrbNumber | integer | Yes | |
SW_OrbOffset | real | No | |
SW_OrbScale | real | No | |
SW_OrbSpinSpeed | real | Yes | |
SW_Owner | player | Yes | |
SW_PickedDest | destructable | No | |
SW_PickedUnit | unit | No | |
SW_RealTimer | real | Yes | |
SW_RealTimer2 | real | Yes | |
SW_Rotator | real | No | |
SW_SourceX | real | Yes | |
SW_SourceY | real | Yes | |
SW_Speed | real | Yes | |
SW_Stage | integer | Yes | |
SW_TempLoc | location | No | |
SW_WardDuration | real | Yes | |
SW_WardExBallNumber | integer | Yes | |
SW_WardExDamage | real | Yes | |
SW_WardExEffect | string | Yes | |
SW_WardExNumber | integer | No | |
SW_WardExRadius | real | Yes | |
SW_WardHeight | real | No | |
SW_WardModel | string | No | |
SW_WardScale | real | No | |
SW_WardSpinClockwise | boolean | No | |
SW_WardSpinSpeed | real | Yes | |
SW_X | real | Yes | |
SW_Y | real | Yes | |
zAuto_Cast_Order | ordercode | No | |
zAuto_Cast_Type | integer | No | |
zCreator_Name | string | No | |
zCredit_Name | string | Yes | |
zCredit_Number | integer | No | |
zEnable_Auto_Cast | boolean | No | |
zEnable_Black_Mask | boolean | No | |
zEnable_Fog_of_War | boolean | No | |
zFast_Auto_Cast | boolean | No | |
zMapHash | hashtable | No | |
zShow_Handles | boolean | No | |
zSpell_Name | string | No | |
zSpell_Version | string | No | |
zSpellpack_Name | string | Yes | |
zSpellpack_Number | integer | No | |
zSpellpack_Title | string | No | |
zSpellpack_Version | string | No | |
zTarget | unit | No | |
zTest_Type | integer | No | |
zTester_Number | integer | No | |
zTester_UnitType | unitcode | No | |
zTesterUnit | unit | Yes | |
zTesterUnitGroup | group | No | |
zUnitFacing | real | Yes | |
zUnitTypeId | unitcode | Yes | |
zUnitX | real | Yes | |
zUnitY | real | Yes |
//TESH.scrollpos=0
//TESH.alwaysfold=0
/****************************************************************************
* *
* Spinning Ward v1.0 *
* by Ofel *
* *
*****************************************************************************
* *
* + Requirements: *
* - None. *
* *
* + How to import? *
* - Open File --> Preferences... Enable the "Automatically create *
* unknown variables while pasting trigger data". *
* - Export dummy.mdx from Import Manager (F12) and import it to your *
* map. *
* - Copy Spinning Ward ability in Object Editor (F6). *
* - Copy Spinning Ward Dummy unit in Object Editor (F6). *
* - Copy all Spinning Ward triggers. Tips: Just copy the category. *
* *
* When pasting the triggers, some trigger actions will may be disabled, *
* so make sure to enable it. Also, don't forget to configure SW_Ability *
* and SW_DummyType in the Spinning Ward Init trigger. *
* *
* If you any question or suggestion about this spell, contact me by *
* sending Private Message (PM) or leave Visitor Message (VM), but you'll *
* need to register on The Hive Workshop first. *
* *
*****************************************************************************
* *
* + Requested by: *
* - None. *
* *
* + Inspired by: *
* - Serpent Ward spell. *
* - Volcano spell. *
* *
* + Credits: *
* - Vexorian: dummy.mdx model. *
* *
* + Changelog: *
* - v1.0: Initial version. *
* *
****************************************************************************/
//TESH.scrollpos=209
//TESH.alwaysfold=0
function DisplayErrorMessage takes string msg returns nothing
call DisplayTimedTextToForce(GetPlayersAll(), 3600, "|c00ff0000ERROR|r - " + msg)
endfunction
function HandleCount takes nothing returns boolean
local location l = Location(0, 0)
call DisplayTimedTextToForce(GetPlayersAll(), 0.2, I2S(GetHandleId(l) - 0x100000))
call RemoveLocation(l)
set l = null
return false
endfunction
function Init takes nothing returns nothing
local integer i = 0
local real x
local real y
local real gap
local real dist
local real angle
local group g = CreateGroup()
local unit u
local trigger t
call TriggerExecute(gg_trg_Info)
set udg_zMapHash = InitHashtable()
call GroupEnumUnitsOfPlayer(g, Player(PLAYER_NEUTRAL_AGGRESSIVE), null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
set i = i + 1
call SaveInteger(udg_zMapHash, 1, GetHandleId(u), i)
set udg_zUnitX[i] = GetUnitX(u)
set udg_zUnitY[i] = GetUnitY(u)
set udg_zUnitFacing[i] = GetUnitFacing(u)
set udg_zUnitTypeId[i] = GetUnitTypeId(u)
call GroupRemoveUnit(g, u)
endloop
call DestroyGroup(g)
call FogEnable(udg_zEnable_Fog_of_War)
call FogMaskEnable(udg_zEnable_Black_Mask)
if udg_zTest_Type != 1 and udg_zTest_Type != 2 then
if udg_zTest_Type == 3 then
call FogEnable(false)
call FogMaskEnable(false)
call DisplayTimedTextToForce(GetPlayersAll(), 1, "Screenshot Test")
set i = 1
set gap = (360 / I2R(udg_zTester_Number)) * 0.01747
set angle = GetRandomReal(0, 360) * 0.01747
loop
exitwhen i > udg_zTester_Number
set dist = GetRandomReal(0, 200)
set angle = angle + gap
set x = dist * Cos(angle)
set y = dist * Sin(angle)
set udg_zTesterUnit[i] = CreateUnit(Player(0), udg_zTester_UnitType, x, y, GetRandomReal(0, 360))
call SelectUnitAddForPlayer(udg_zTesterUnit[i], Player(0))
call GroupAddUnit(udg_zTesterUnitGroup, udg_zTesterUnit[i])
set i = i + 1
endloop
if udg_zShow_Handles then
call ClearTextMessages()
set t = CreateTrigger()
call TriggerRegisterTimerEvent(t, 0.09, true)
call TriggerAddCondition(t, Filter(function HandleCount))
endif
return
else
call DisplayErrorMessage("Wrong Test Type!")
return
endif
endif
if udg_zCreator_Name == null then
call DisplayErrorMessage("No creator name!")
return
endif
if udg_zTest_Type == 1 then
if udg_zSpell_Name == null then
call DisplayErrorMessage("No spell name!")
return
endif
if udg_zSpell_Version == null then
call DisplayTimedTextToForce(GetPlayersAll(), 3600, "|cffffcc00" + udg_zSpell_Name + "|r")
else
call DisplayTimedTextToForce(GetPlayersAll(), 3600, "|cffffcc00" + udg_zSpell_Name + "|r |c00ff0000v" + udg_zSpell_Version + "|r")
endif
call DisplayTimedTextToForce(GetPlayersAll(), 3600, "by |c0000ff00" + udg_zCreator_Name + "|r")
elseif udg_zTest_Type == 2 then
if udg_zSpellpack_Title == null then
call DisplayErrorMessage("No spellpack title!")
return
endif
if udg_zSpellpack_Number == 0 then
call DisplayErrorMessage("No spells in pack!")
return
endif
if udg_zSpellpack_Version == null then
call DisplayTimedTextToForce(GetPlayersAll(), 3600, "|cffffcc00" + udg_zSpellpack_Title + "|r")
else
call DisplayTimedTextToForce(GetPlayersAll(), 3600, "|cffffcc00" + udg_zSpellpack_Title + "|r |c00ff0000v" + udg_zSpellpack_Version + "|r")
endif
call DisplayTimedTextToForce(GetPlayersAll(), 3600, "by |c0000ff00" + udg_zCreator_Name + "|r")
call DisplayTimedTextToForce(GetPlayersAll(), 3600, " ")
call DisplayTimedTextToForce(GetPlayersAll(), 3600, "|cffffcc00Spells|r:")
set i = 1
loop
exitwhen i > udg_zSpellpack_Number
call DisplayTimedTextToForce(GetPlayersAll(), 3600, "- |c0000ffff" + udg_zSpellpack_Name[i] + "|r")
set i = i + 1
endloop
endif
if udg_zCredit_Number > 0 then
call DisplayTimedTextToForce(GetPlayersAll(), 3600, " ")
set i = 1
loop
exitwhen i > udg_zCredit_Number
if i == 1 then
set udg_zCredit_Name[0] = "|c0000ffff" + udg_zCredit_Name[i] + "|r"
else
if i < udg_zCredit_Number then
set udg_zCredit_Name[0] = udg_zCredit_Name[0] + ", |c0000ffff" + udg_zCredit_Name[i] + "|r"
else
set udg_zCredit_Name[0] = udg_zCredit_Name[0] + " and |c0000ffff" + udg_zCredit_Name[i] + "|r"
endif
endif
set i = i + 1
endloop
call DisplayTimedTextToForce(GetPlayersAll(), 3600, "Thanks to the people who helped me:")
call DisplayTimedTextToForce(GetPlayersAll(), 3600, udg_zCredit_Name[0])
endif
set i = 1
set gap = (360 / I2R(udg_zTester_Number)) * 0.01747
set angle = GetRandomReal(0, 360) * 0.01747
loop
exitwhen i > udg_zTester_Number
set dist = GetRandomReal(0, 200)
set angle = angle + gap
set x = dist * Cos(angle)
set y = dist * Sin(angle)
set udg_zTesterUnit[i] = CreateUnit(Player(0), udg_zTester_UnitType, x, y, GetRandomReal(0, 360))
call SelectUnitAddForPlayer(udg_zTesterUnit[i], Player(0))
call GroupAddUnit(udg_zTesterUnitGroup, udg_zTesterUnit[i])
set i = i + 1
endloop
if udg_zShow_Handles then
call ClearTextMessages()
set t = CreateTrigger()
call TriggerRegisterTimerEvent(t, 0.09, true)
call TriggerAddCondition(t, Filter(function HandleCount))
endif
endfunction
function onEsc takes nothing returns boolean
local integer i = 1
loop
exitwhen i > udg_zTester_Number
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIre\\AIreTarget.mdl", udg_zTesterUnit[i], "origin"))
call SetUnitLifePercentBJ(udg_zTesterUnit[i], 100)
call SetUnitManaPercentBJ(udg_zTesterUnit[i], 100)
call UnitResetCooldown(udg_zTesterUnit[i])
set i = i + 1
endloop
return false
endfunction
function onDeath takes nothing returns boolean
local unit u = GetTriggerUnit()
local real x
local real y
local integer i
local integer i2
local real dist
local real angle
if IsUnitInGroup(u, udg_zTesterUnitGroup) then
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl", GetUnitX(u), GetUnitY(u)))
set dist = GetRandomReal(0, 200)
set angle = GetRandomReal(0, 360) * 0.01747
set x = dist * Cos(angle)
set y = dist * Sin(angle)
call ReviveHero(u, x, y, true)
elseif GetTriggerPlayer() == Player(PLAYER_NEUTRAL_AGGRESSIVE) then
set i = LoadInteger(udg_zMapHash, 1, GetHandleId(u))
set u = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), udg_zUnitTypeId[i], udg_zUnitX[i], udg_zUnitY[i], udg_zUnitFacing[i])
set i2 = GetHandleId(u)
call SaveInteger(udg_zMapHash, 1, i2, i)
endif
set u = null
return false
endfunction
function onAttack takes nothing returns boolean
local unit u = GetTriggerUnit()
local unit u2
if IsUnitInGroup(u, udg_zTesterUnitGroup) then
if udg_zEnable_Auto_Cast then
if IsUnitSelected(u, Player(0)) then
if udg_zAuto_Cast_Type == 1 then
call IssueImmediateOrderById(u, udg_zAuto_Cast_Order)
elseif udg_zAuto_Cast_Type == 2 then
if udg_zFast_Auto_Cast then
call SetUnitManaPercentBJ(u, 100)
call UnitResetCooldown(u)
endif
set u2 = GetAttacker()
call IssueTargetOrderById(u, udg_zAuto_Cast_Order, u2)
set u2 = null
elseif udg_zAuto_Cast_Type == 3 then
if udg_zFast_Auto_Cast then
call SetUnitManaPercentBJ(u, 100)
call UnitResetCooldown(u)
endif
set u2 = GetAttacker()
call IssuePointOrderById(u, udg_zAuto_Cast_Order, GetUnitX(u2), GetUnitY(u2))
set u2 = null
endif
endif
else
set u = null
call DestroyTrigger(GetTriggeringTrigger())
endif
endif
set u = null
return false
endfunction
function onStart takes nothing returns boolean
if udg_zTest_Type != 3 and not udg_zShow_Handles then
call DisplayTimedTextToForce(GetPlayersAll(), 3600, " ")
call DisplayTimedTextToForce(GetPlayersAll(), 3600, "|c0000ff00Hint|r - Press |cffffcc00Esc|r to refresh")
endif
return false
endfunction
//===========================================================================
function InitTrig_Test takes nothing returns nothing
local trigger test = CreateTrigger()
local trigger test2 = CreateTrigger()
local trigger test3 = CreateTrigger()
local trigger test4 = CreateTrigger()
call TriggerRegisterPlayerEventEndCinematic(test, Player(0))
call TriggerAddCondition(test, Filter(function onEsc))
call TriggerRegisterAnyUnitEventBJ(test2, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(test2, Filter(function onDeath))
call TriggerRegisterAnyUnitEventBJ(test3, EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(test3, Filter(function onAttack))
call TriggerRegisterTimerEventSingle(test4, 2)
call TriggerAddCondition(test4, Filter(function onStart))
set test = null
set test2 = null
set test3 = null
set test4 = null
call Init()
endfunction