Prometheus
Everything is mutable; nothing is sacred
- Reaction score
- 589
I forget how one does their own struct-->timer system.
Edit: Using CSData.
Edit 2: Fixed.
Edit: Using CSData.
Edit 2: Fixed.
Implementation instructions are within the map.
Credits: Uberplayer, Romek, Tinki3, Phyrex1an, Ghan, Varine, Trollvottel, azlier, Daxtreme
PUI
TT
CSData can be found in the map.
Nuke
Vid
http://www.xfire.com/video/a712c/
Code
JASS:scope NukeBomb initializer Init //Requires CSData globals //[Config Header] private constant integer ABID = 039;A000039; //The abilities ID. private constant integer DUMID = 039;u001039; //The ID of the dummy unit. private constant integer CROW = 039;Amrf039; //The ability ID for crow, leave alone unless you've changed it. private constant string BOOM = "war3mapImported\\NuclearExplosion.mdx" //The string file path for the explosion at the end. All \s become \\s. private constant real DMG = 100 //How much base damage is done per level. private constant real AOE = 500 //The AOE of the damage. private constant boolean REALISTIC = false //If set to true, the unit will damage everything around him. //If set to false, the unit will only damage enemies. //End [Config Header] private sound SOUND private unit temp endglobals private constant function SPECDMG takes integer lvl returns real return DMG*lvl //This function multiplies the base damage (Variable: DMG) by the level of the ability. endfunction private function NukeCond takes nothing returns boolean return GetSpellAbilityId() == ABID endfunction private function IsEnemy takes nothing returns boolean if IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(temp)) then return true endif return false endfunction private struct Nuke unit u unit d group g location l location q integer lvl method onDestroy takes nothing returns nothing set .u = null set .d = null call DestroyGroup(.g) set .g = null call RemoveLocation(.l) call RemoveLocation(.q) set .l = null set .q = null endmethod method DmgE takes group g, unit u returns nothing loop exitwhen FirstOfGroup(g) == null call UnitDamageTarget(u,FirstOfGroup(g),SPECDMG(GetUnitAbilityLevel(u,ABID)),true,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNKNOWN,WEAPON_TYPE_WHOKNOWS) call GroupRemoveUnit(g,FirstOfGroup(g)) endloop endmethod static method Nukes takes nothing returns nothing local Nuke this = GetCSData(GetExpiredTimer()) call KillUnit(.d) if REALISTIC == true then call UnitDamagePoint(.u,0,AOE,GetLocationX(.l),GetLocationY(.l),SPECDMG(.lvl),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNKNOWN,WEAPON_TYPE_WHOKNOWS) else set temp = .u call GroupEnumUnitsInRangeOfLoc(.g,.q,AOE,Condition(function IsEnemy)) call .DmgE(.g,.u) endif call DestroyEffect(AddSpecialEffectLoc(BOOM,.l)) endmethod endstruct private function NukeAct takes nothing returns nothing local Nuke this = Nuke.create() local timer t = CreateTimer() set this.u = GetTriggerUnit() set this.g = CreateGroup() set this.l = GetSpellTargetLoc() set this.q = GetUnitLoc(this.u) set this.lvl = GetUnitAbilityLevel(this.u,ABID) set this.d = CreateUnitAtLoc(GetOwningPlayer(this.u),DUMID,this.q,0) call StartSound(SOUND) call UnitAddAbility(this.d,CROW) call UnitRemoveAbility(this.d,CROW) call SetUnitFlyHeight(this.d,1,GetUnitFlyHeight(this.d)*GetUnitMoveSpeed(this.d)/DistanceBetweenPoints(this.q,this.l)) call IssuePointOrder(this.d,"move",GetLocationX(this.l),GetLocationY(this.l)) call TimerStart(t,DistanceBetweenPoints(this.q,this.l)/GetUnitMoveSpeed(this.d),false,function Nuke.Nukes) call SetCSData(t,this) endfunction private function SoundInit takes nothing returns nothing set SOUND = gg_snd_nuclear endfunction private function Init takes nothing returns nothing local trigger t = CreateTrigger() local integer i = 0 loop exitwhen i > 15 call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,Condition(function FailSafe)) set i = i + 1 endloop call TriggerAddAction(t,function NukeAct) call TriggerAddCondition(t, Condition(function NukeCond)) set t = CreateTrigger() call TriggerRegisterTimerEvent(t,1,false) call TriggerAddAction(t,function SoundInit) endfunction endscope
Flame Storm
Vid
http://www.xfire.com/video/a715e/
Code
JASS:scope FlameStorm initializer Init //Requires TT globals //[Config Header] private constant integer ABID = 039;A002039; //The ability ID of the spell. private constant integer DUMID = 039;u000039; //The unit ID of the dummy that is created. private constant real TIME = 20 //The length of time that the spell lasts, in seconds private constant real MINLENG = 20 //The minimum length the flame is from the caster. private constant real MAXLENG = 400 //The maximum length the flame is from the caster. private constant real DMG = 50 //The base damage done. private constant string FX = "war3mapImported\\NuclearExplosion.mdx" //The ending effect, AKA those big booms. private constant boolean REALISTIC = false //If set to true, the unit will damage everything around him. //If set to false, the unit will only damage enemies. //End [Config Header] private unit tempUnit endglobals struct flamemove unit base unit array flames[4] group g = CreateGroup() real ticker = 0 real curleng = 20 real array angles[4] location array uni[4] boolean uord = true method onDestroy takes nothing returns nothing set .base = null set .flames[0] = null set .flames[1] = null set .flames[2] = null set .flames[3] = null call DestroyGroup(.g) set .g = null call RemoveLocation(.uni[0]) call RemoveLocation(.uni[1]) call RemoveLocation(.uni[2]) call RemoveLocation(.uni[3]) set .uni[0] = null set .uni[1] = null set .uni[2] = null set .uni[3] = null endmethod endstruct private constant function SPECDMG takes integer lvl returns real return DMG*lvl //This function multiplies the base damage (Variable: DMG) by the level of the ability. endfunction private function IsEnemy takes nothing returns boolean if IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(tempUnit)) then call UnitDamageTarget(tempUnit,GetFilterUnit(),SPECDMG(GetUnitAbilityLevel(tempUnit,ABID)),true,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNKNOWN,WEAPON_TYPE_WHOKNOWS) return true endif return false endfunction private function move takes nothing returns boolean local flamemove a = TT_GetData() local integer i = 0 local location l = GetUnitLoc(a.base) set a.ticker = a.ticker + TT_PERIOD * 100 if a.ticker == TIME * 100 then call DestroyEffect(AddSpecialEffectLoc(FX,l)) loop exitwhen i > 3 call KillUnit(a.flames<i>) call DestroyEffect(AddSpecialEffectLoc(FX,a.uni<i>)) if REALISTIC == true then call UnitDamagePoint(a.base,0,a.curleng,GetLocationX(l),GetLocationY(l),SPECDMG(GetUnitAbilityLevel(GetTriggerUnit(),ABID)),true,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNKNOWN,WEAPON_TYPE_WHOKNOWS) else set tempUnit = a.base call GroupEnumUnitsInRangeOfLoc(a.g,l,a.curleng,Condition(function IsEnemy)) endif set i = i + 1 endloop return true endif loop exitwhen i > 3 set a.angles<i> = a.angles<i>+10 if a.uord == true then set a.curleng = a.curleng + 5 if a.curleng == MAXLENG then set a.uord = false endif elseif a.uord == false then set a.curleng = a.curleng - 5 if a.curleng == MINLENG then set a.uord = true endif endif set a.uni<i> = PolarProjectionBJ(l,a.curleng,a.angles<i>) call SetUnitPositionLoc(a.flames<i>,a.uni<i>) call SetUnitFacing(a.flames<i>,GetUnitFacing(a.flames<i>)+1) set i = i + 1 endloop return false endfunction private function FSC takes nothing returns boolean return GetSpellAbilityId() == ABID endfunction private function FSA takes nothing returns nothing local flamemove a = flamemove.create() local integer i = 0 set a.base = GetTriggerUnit() loop exitwhen i > 3 set a.angles<i> = i*90 set a.uni<i> = PolarProjectionBJ(GetUnitLoc(a.base),a.curleng,a.angles) set a.flames<i> = CreateUnitAtLoc(GetOwningPlayer(a.base),DUMID,a.uni<i>,0) set i = i + 1 endloop call TT_Start(function move,a) endfunction private function Init takes nothing returns nothing local trigger t = CreateTrigger() local integer i = 0 loop exitwhen i > 15 call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,Condition(function FailSafe)) set i = i + 1 endloop call TriggerAddAction(t,function FSA) call TriggerAddCondition(t,Condition(function FSC)) endfunction endscope</i></i></i></i></i></i></i></i></i></i></i></i></i></i>
Blink Back
Vid
http://www.xfire.com/video/a75ab/
Code
JASS:scope BlinkBack initializer Init //Requires PUI //! runtextmacro PUI_PROPERTY("private", "location", "BKTOLOC", "null") //! runtextmacro PUI_PROPERTY("private", "integer", "NUMTELE", "0") globals private constant integer ABID = 039;A001039; //The ID of the main ability. private constant integer TELEBK = 039;A004039; //The ID of the teleporting back spell. private constant integer NUMTELES = 3 //The maximum number of teleports a player can do, per location. private constant real RANGE = 1000 //The range that the unit can be called back. private constant string FX = "Abilities\\Spells\\Demon\\ReviveDemon\\ReviveDemon.mdx" //The string path of the effect. endglobals private function BBA takes nothing returns nothing local unit u = GetTriggerUnit() local location l = GetUnitLoc(u) if GetSpellAbilityId() == ABID then if NUMTELE[GetTriggerUnit()] == 0 then set BKTOLOC[GetTriggerUnit()] = GetUnitLoc(u) call UnitAddAbility(u,TELEBK) else call RemoveLocation(BKTOLOC[GetTriggerUnit()]) set BKTOLOC[GetTriggerUnit()] = GetUnitLoc(u) set NUMTELE[GetTriggerUnit()] = 0 endif endif if GetSpellAbilityId() == TELEBK and IsUnitInRangeLoc(u,BKTOLOC[GetTriggerUnit()],RANGE) == true then call DestroyEffect(AddSpecialEffectLoc(FX,l)) call DestroyEffect(AddSpecialEffectLoc(FX,BKTOLOC[GetTriggerUnit()])) call TriggerSleepAction(1) call SetUnitPositionLoc(u,BKTOLOC[GetTriggerUnit()]) set NUMTELE[GetTriggerUnit()] = NUMTELE[GetTriggerUnit()] + 1 if NUMTELE[GetTriggerUnit()] >= NUMTELES then call UnitRemoveAbility(u,TELEBK) set NUMTELE[GetTriggerUnit()] = 0 call RemoveLocation(BKTOLOC[GetTriggerUnit()]) endif endif call RemoveLocation(l) set l = null set u = null endfunction private function Init takes nothing returns nothing local trigger t = CreateTrigger() local integer i = 0 loop exitwhen i > 15 call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,Condition(function FailSafe)) set i = i + 1 endloop call TriggerAddAction(t,function BBA) endfunction endscope
Fade Run
Vid
http://www.xfire.com/video/a7170/
Code
JASS:scope FadeRun initializer Init //Requires TT globals private constant integer ABID = 039;A005039; //The ID of the ability. private constant integer LOKUST = 039;Aloc039; //The ID of the ability to make the trail unselectable. private constant integer ACTK = 039;Aatk039; //ID for removing the attack of the clone. private constant integer TRAIL = 5 //This controls the trail. It's really damn weird. //Use 1 for a really thick trail, I suggest testing different numbers. //The TT inteverval affects this. private constant real TIME = 20 //The length it will last in seconds. endglobals private struct Fade unit anchor real ticks method onDestroy takes nothing returns nothing set .anchor = null endmethod method fade takes unit u returns nothing local integer i = 255 loop exitwhen i <= 0 call SetUnitVertexColor(u,255,255,255,i) call TriggerSleepAction(0.01) set i = i - 5 endloop call RemoveUnit(u) endmethod static method Do takes nothing returns boolean local Fade this = TT_GetData() local unit d if ModuloReal(.ticks,TRAIL) == 0 then set d = CreateUnit(GetOwningPlayer(.anchor),GetUnitTypeId(.anchor),GetUnitX(.anchor),GetUnitY(.anchor),GetUnitFacing(.anchor)) call UnitAddAbility(d,LOKUST) call UnitRemoveAbility(d,ACTK) call SetUnitAnimation(d,"stand") call PauseUnit(d,true) call SetUnitTimeScale(d,0) call SetUnitOwner(d,Player(15),false) call .fade.execute(d) set d = null endif debug call BJDebugMsg(R2S(.ticks)) set .ticks = .ticks + TT_PERIOD * 100 if .ticks == TIME*100 then return true endif return false endmethod endstruct private function FRC takes nothing returns boolean return GetSpellAbilityId() == ABID endfunction private function FRA takes nothing returns nothing local Fade a = Fade.create() set a.anchor = GetTriggerUnit() set a.ticks = 0 call TT_Start(function Fade.Do,a) endfunction private function Init takes nothing returns nothing local trigger t = CreateTrigger() local integer i = 0 loop exitwhen i > 15 call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,Condition(function FailSafe)) set i = i + 1 endloop call TriggerAddAction(t,function FRA) call TriggerAddCondition(t,Condition(function FRC)) endfunction endscope
Good job making such an uber thing.
Wish it made cookies that come out of my usb ports though, only con with it.
call SetUnitAnimationByIndex(.d,GetUnitCurrentOrder(.anchor))
Okay, I don't know how. I've tried several methods.
JASS:call SetUnitAnimationByIndex(.d,GetUnitCurrentOrder(.anchor))
Didn't work.
it is very possible, I have done it before
Does that look better?