• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Titanic (GUI/VJASS)

  • Like
Reactions: Soul Theft
Detail
Status

Forum: http://septimus.invisionplus.net
Coding: GUI/VJASS
Current Version: 1.03

Ability Description

Summon the Titanic from the sky that would dash towards the iceberg the moment it land; damaging every land unit and knock them back. Once the Titanic crash the iceberg, the ice would shattered and deal damage to every enemy unit within 500 range of the iceberg while slowing them down by 75%.

Level 1 - 50 damage knockback and 100 area of effect damage.
Level 2 - 100 damage knockback and 200 area of effect damage.
Level 3 - 150 damage knockback and 300 area of effect damage.

Version 1.03 Update

Remove unnecessary document.

Version 1.02

Fix what The_Reborn_Devils told.

Version 1.01

Fix errors.




Rmx - Developer of GUI version.
Kingz - Developer of VJASS version.
Dr Super Good - Fix and improve VJASS version.
The_Reborn_Devil - Point out the error in code.

  • Titanic On
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Titanic (GUI)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • T_Skip Equal to 0
        • Then - Actions
          • Trigger - Turn on Titanic Loop <gen>
        • Else - Actions
      • Set T_Times = (T_Times + 1)
      • Set T_Skip = (T_Skip + 1)
      • Set T_Off[T_Times] = True
      • Set T_Hero[T_Times] = (Casting unit)
      • Set T_Point[0] = (Position of T_Hero[T_Times])
      • Set T_Point[1] = (Target point of ability being cast)
      • Set T_Point[2] = (T_Point[0] offset by 100.00 towards (Angle from T_Point[0] to T_Point[1]) degrees)
      • Set T_Distance[T_Times] = (Distance between T_Point[0] and T_Point[1])
      • Set T_Angle[T_Times] = (Angle from T_Point[0] to T_Point[1])
      • Set T_Damage[T_Times] = (50.00 x (Real((Level of Titanic (GUI) for T_Hero[T_Times]))))
      • Set T_Speed[T_Times] = 15.00
      • Set T_Spam[T_Times] = 0
      • Set T_Height[T_Times] = 850.00
      • Set T_Fall_Speed[T_Times] = 15.00
      • Set T_Swap[T_Times] = 0
      • Unit - Create 1 Titanic for (Owner of T_Hero[T_Times]) at T_Point[2] facing T_Angle[T_Times] degrees
      • Set T_Dummy1[T_Times] = (Last created unit)
      • Unit - Create 1 Iceberg for (Owner of T_Hero[T_Times]) at T_Point[1] facing (Random angle) degrees
      • Set T_Dummy2[T_Times] = (Last created unit)
      • For each (Integer TT_Loop[0]) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set T_Point[3] = (T_Point[1] offset by 100.00 towards (60.00 x (Real(TT_Loop[0]))) degrees)
          • Special Effect - Create a special effect at T_Point[3] using Objects\Spawnmodels\Naga\NagaDeath\NagaDeath.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_T_Point[3])
      • Custom script: call RemoveLocation(udg_T_Point[0])
      • Custom script: call RemoveLocation(udg_T_Point[1])
      • Custom script: call RemoveLocation(udg_T_Point[2])
  • Titanic Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer T) from 1 to T_Times, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • T_Off[T] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • T_Swap[T] Equal to 0
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • T_Height[T] Less than or equal to 10.00
                    • Then - Actions
                      • Set T_Swap[T] = 1
                      • Set T_Spam[T] = 0
                    • Else - Actions
                      • Set T_Height[T] = (T_Height[T] - T_Fall_Speed[T])
                      • Animation - Change T_Dummy1[T] flying height to T_Height[T] at 0.00
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • T_Spam[T] Equal to 4
                        • Then - Actions
                          • Set T_Spam[T] = 0
                          • Special Effect - Create a special effect attached to the origin of T_Dummy1[T] using Abilities\Weapons\SpiritOfVengeanceMissile\SpiritOfVengeanceMissile.mdl
                          • Special Effect - Destroy (Last created special effect)
                        • Else - Actions
                          • Set T_Spam[T] = (T_Spam[T] + 1)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • T_Swap[T] Equal to 1
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • T_Distance[T] Less than or equal to 150.00
                        • Then - Actions
                          • Set T_Skip = (T_Skip - 1)
                          • Set T_Off[T] = False
                          • Set T_Point[6] = (Position of T_Dummy2[T])
                          • For each (Integer TT_Loop[1]) from 1 to 6, do (Actions)
                            • Loop - Actions
                              • Set T_Point[7] = (T_Point[6] offset by 100.00 towards (60.00 x (Real(TT_Loop[1]))) degrees)
                              • Special Effect - Create a special effect at T_Point[7] using Abilities\Spells\Undead\FreezingBreath\FreezingBreathMissile.mdl
                              • Special Effect - Destroy (Last created special effect)
                              • Custom script: call RemoveLocation(udg_T_Point[7])
                          • Set T_Group[T] = (Units within 500.00 of T_Point[6] matching (((Owner of (Matching unit)) Not equal to (Owner of T_Hero[T])) and ((((Matching unit) belongs to an ally of (Owner of T_Hero[T])) Not equal to True) and ((((Matching unit) is A structure) Not equal to True) and (((
                          • Unit Group - Pick every unit in T_Group[T] and do (Actions)
                            • Loop - Actions
                              • Unit - Cause T_Hero[T] to damage (Picked unit), dealing (T_Damage[T] x 2.00) damage of attack type Spells and damage type Normal
                              • Set T_Times = (T_Times + 1)
                              • Set T_Skip = (T_Skip + 1)
                              • Set T_Off[T_Times] = True
                              • Set T_Hero[T_Times] = (Picked unit)
                              • Set T_Point[8] = (Position of T_Hero[T_Times])
                              • Unit - Create 1 Dummy for (Owner of T_Hero[T]) at T_Point[8] facing Default building facing degrees
                              • Unit - Hide (Last created unit)
                              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                              • Unit - Order (Last created unit) to Human Sorceress - Slow T_Hero[T_Times]
                              • Set T_Angle[T_Times] = (Angle from T_Point[4] to T_Point[8])
                              • Set T_Distance[T_Times] = 400.00
                              • Set T_Speed[T_Times] = 15.00
                              • Set T_Height[T_Times] = (T_Distance[T_Times] / T_Speed[T_Times])
                              • Set T_Spam[T_Times] = 0
                              • Set T_Swap[T_Times] = 3
                              • Custom script: call RemoveLocation(udg_T_Point[8])
                              • Unit Group - Add T_Hero[T_Times] to T_Debug
                          • Custom script: call RemoveLocation(udg_T_Point[6])
                          • Unit - Add a 0.01 second Generic expiration timer to T_Dummy1[T]
                          • Unit - Add a 0.01 second Generic expiration timer to T_Dummy2[T]
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • T_Skip Equal to 0
                            • Then - Actions
                              • Set T_Times = 0
                              • Trigger - Turn off Titanic Loop <gen>
                            • Else - Actions
                        • Else - Actions
                          • Set T_Distance[T] = (T_Distance[T] - T_Speed[T])
                          • Set T_Point[4] = (Position of T_Dummy1[T])
                          • Set T_Point[5] = (T_Point[4] offset by T_Speed[T] towards T_Angle[T] degrees)
                          • Unit - Move T_Dummy1[T] instantly to T_Point[5]
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • T_Spam[T] Equal to 5
                            • Then - Actions
                              • Set T_Spam[T] = 0
                              • Special Effect - Create a special effect at T_Point[4] using Abilities\Spells\Other\CrushingWave\CrushingWaveDamage.mdl
                              • Special Effect - Destroy (Last created special effect)
                            • Else - Actions
                              • Set T_Spam[T] = (T_Spam[T] + 1)
                          • Set T_Group[T] = (Units within 300.00 of T_Point[4] matching (((Owner of (Matching unit)) Not equal to (Owner of T_Hero[T])) and ((((Matching unit) belongs to an ally of (Owner of T_Hero[T])) Not equal to True) and ((((Matching unit) is A structure) Not equal to True) and (((
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Number of units in T_Group[T]) Greater than or equal to 1
                            • Then - Actions
                              • Unit Group - Pick every unit in T_Group[T] and do (Actions)
                                • Loop - Actions
                                  • Unit - Cause T_Hero[T] to damage (Picked unit), dealing T_Damage[T] damage of attack type Spells and damage type Normal
                                  • Set T_Times = (T_Times + 1)
                                  • Set T_Skip = (T_Skip + 1)
                                  • Set T_Off[T_Times] = True
                                  • Set T_Hero[T_Times] = (Picked unit)
                                  • Unit Group - Add T_Hero[T_Times] to T_Debug
                                  • Set T_Point[8] = (Position of T_Hero[T_Times])
                                  • Set T_Angle[T_Times] = (Angle from T_Point[4] to T_Point[8])
                                  • Set T_Distance[T_Times] = 400.00
                                  • Set T_Speed[T_Times] = 15.00
                                  • Set T_Height[T_Times] = (T_Distance[T_Times] / T_Speed[T_Times])
                                  • Set T_Spam[T_Times] = 0
                                  • Set T_Swap[T_Times] = 2
                                  • Custom script: call RemoveLocation(udg_T_Point[8])
                            • Else - Actions
                          • Custom script: call DestroyGroup(udg_T_Group[udg_T])
                          • Custom script: call RemoveLocation(udg_T_Point[4])
                          • Custom script: call RemoveLocation(udg_T_Point[5])
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • T_Swap[T] Equal to 2
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • T_Distance[T] Less than or equal to 0.00
                            • Then - Actions
                              • Set T_Skip = (T_Skip - 1)
                              • Set T_Off[T] = False
                              • Unit Group - Remove T_Hero[T] from T_Debug
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • T_Skip Equal to 0
                                • Then - Actions
                                  • Set T_Times = 0
                                  • Trigger - Turn off Titanic Loop <gen>
                                • Else - Actions
                            • Else - Actions
                              • Set T_Distance[T] = (T_Distance[T] - T_Speed[T])
                              • Set T_Point[9] = (Position of T_Hero[T])
                              • Set T_Speed[T] = (T_Distance[T] / T_Height[T])
                              • Set T_Speed[T] = (T_Speed[T] + 1.00)
                              • Set T_Point[10] = (T_Point[9] offset by T_Speed[T] towards T_Angle[T] degrees)
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Terrain pathing at T_Point[10] of type Walkability is off) Equal to True
                                • Then - Actions
                                  • Set T_Distance[T] = 0.00
                                • Else - Actions
                                  • Unit - Move T_Hero[T] instantly to T_Point[10]
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • T_Spam[T] Equal to 5
                                • Then - Actions
                                  • Set T_Spam[T] = 0
                                  • Special Effect - Create a special effect at T_Point[9] using Abilities\Weapons\ZigguratFrostMissile\ZigguratFrostMissile.mdl
                                  • Special Effect - Destroy (Last created special effect)
                                • Else - Actions
                                  • Set T_Spam[T] = (T_Spam[T] + 1)
                              • Custom script: call RemoveLocation(udg_T_Point[9])
                              • Custom script: call RemoveLocation(udg_T_Point[10])
                        • Else - Actions
            • Else - Actions
JASS:
library Titanic initializer InitT

globals
    private constant real DELAY = 0.03
    private constant integer TA = 'A005'
    private constant integer Ship = 'h001'
    private constant integer Iceberg = 'h002'
    private constant integer CastDummy = 'h003'
    private constant integer SlowID = 'A002'
    private constant real StartHeight = 700
    private constant real HeightChange = 750*DELAY
    private constant string Eff = "Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl"
    private constant string KB_eff = "Abilities\\Spells\\Other\\CrushingWave\\CrushingWaveDamage.mdl"
    private constant string TrailEff = "Abilities\\Weapons\\FaerieDragonMissile\\FaerieDragonMissile.mdl"
    private constant real Base_KB = 250
    private constant real KB_Inc = 50
    private constant real KB_speed = 750*DELAY
    private constant real KB_Dmg = 50
    private constant real Ship_speed = 750*DELAY
    private constant real KB_Dmg_Inc = 50
    private constant real Base_Damage = 100
    private constant real Damage_Inc = 100
    private constant real AoE = 300
    private constant integer EffectSpamRate = 6
    private constant integer TrailEffRate = 3
    private constant boolean KnockbackOnImpact = true

    private constant location Zloc = Location(0,0)
    private player TP
    private real array TR
    private unit array TU
private group KB_GROUP = CreateGroup()
    private group GROUP = CreateGroup()
endglobals

private function Cond takes nothing returns boolean
    return GetSpellAbilityId() == TA
endfunction

private function GroupFilter takes nothing returns boolean
    return IsUnitEnemy(GetFilterUnit(),TP) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL) == false) and (GetWidgetLife(GetFilterUnit()) > 0.405) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_FLYING)==false) and not IsUnitInGroup(GetFilterUnit(),KB_GROUP)
endfunction

private function RBL takes real x1,real y1,real x2, real y2 returns real
    return Atan2(y2 - y1,x2 - x1)
endfunction

private function DBL takes real x1, real y1, real x2, real y2 returns real
    return SquareRoot((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1))
endfunction

private function BuildEff takes integer num, real dist, string eff,real x, real y returns nothing
    local integer i = 0
    local real ia = 6.2831853/num
    local real rad
    loop
        exitwhen i == num
        set rad = ia * i
        call DestroyEffect(AddSpecialEffect(eff,x+dist*Cos(rad),y+dist*Sin(rad)))
        set i = i + 1
    endloop
endfunction

private function GetDmg takes integer lvl returns real
    return Base_Damage + (lvl - 1) * Damage_Inc
endfunction

private function GetKBDmg takes integer lvl returns real
    return KB_Dmg + (lvl - 1) * KB_Dmg_Inc
endfunction

private function GetKBDist takes integer lvl returns real
    return Base_KB + (lvl - 1) * KB_Inc
endfunction

private struct KB
    unit u
    unit t
    real md
    real cd
    real s
    real dmg
    real rad
    integer esr
    string eff

    static KB array index
    static integer knock = 0
    static timer knocker = CreateTimer()

        static method Knockback takes nothing returns nothing
        local KB kb
        local real x
        local real y
        local integer i = 0
        loop
            exitwhen i >= KB.knock
            set kb = KB.index[i]
                if kb.cd < kb.md and GetWidgetLife(kb.t) > 0.405 then
                    set x = GetUnitX(kb.t) + kb.s * Cos(kb.rad)
                    set y = GetUnitY(kb.t) + kb.s * Sin(kb.rad)
                    set kb.cd = kb.cd + kb.s
                    call SetUnitX(kb.t,x)
                    call SetUnitY(kb.t,y)
                    if GetRandomInt(0,kb.esr) == kb.esr then
                        call DestroyEffect(AddSpecialEffectTarget(kb.eff,kb.t,"origin"))
                    endif
                    call UnitDamageTarget(kb.u,kb.t,kb.dmg,true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
                else
                    call GroupRemoveUnit(KB_GROUP,kb.t)
                    set kb.t = null
                    set kb.u = null
                    call kb.destroy()
                    set KB.knock = KB.knock - 1
                    set KB.index[i] = KB.index[KB.knock]
                endif
            set i = i + 1
        endloop
        if KB.knock == 0 then
            call PauseTimer(KB.knocker)
        endif
    endmethod

    static method GetKB takes unit c,unit t,real rad,real d,real s,real dmg,integer esr,string eff returns nothing
        local KB kb = KB.allocate()
        set kb.u = c
        set kb.t = t
        set kb.rad = rad
        set kb.md = d
        set kb.cd = 0
        set kb.s = s
        set kb.eff = eff
        set kb.dmg = (dmg / d) * DELAY
        if KB.knock == 0 then
            call TimerStart(KB.knocker,DELAY,true, function KB.Knockback)
        endif
        set KB.index[KB.knock] = kb
        set KB.knock = KB.knock + 1
        call GroupAddUnit(KB_GROUP,t)
    endmethod
endstruct

private function GroupAction takes nothing returns nothing
    local unit eu = GetEnumUnit()
    local real a = RBL(TR[1],TR[2],GetUnitX(eu),GetUnitY(eu))
    local integer lvl = GetUnitAbilityLevel(TU[1],TA)
    local real dmg = GetDmg(lvl)
    local real kb_dist = GetKBDist(lvl)
    local real kb_dmg = GetKBDmg(lvl)
    local unit dummy = CreateUnit(TP,CastDummy,TR[1],TR[2],0)
    local real rad = Atan2(GetUnitY(eu) - GetUnitY(TU[2]),GetUnitX(eu) - GetUnitX(TU[2]))
    call IssueTargetOrder(dummy,"slow",eu)
    call UnitApplyTimedLife(dummy,'B666',0.5)
    call UnitDamageTarget(TU[1],eu,dmg,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null)
    call KB.GetKB(TU[1],eu,rad,kb_dist,KB_speed,kb_dmg,EffectSpamRate,KB_eff)
    call GroupRemoveUnit(GROUP,eu)
    set eu = null
    set dummy = null
endfunction

private struct Titanic

    unit c
    unit tit
    unit berg
    real cd
    real d
    real h
    real th
    real s
    real rad

    static Titanic array ind
    static integer sca = 0
    static timer counter = CreateTimer()

    static method Motion takes nothing returns nothing
        local Titanic dat
        local real x
        local real y
        local integer i = 0
        local conditionfunc c = Condition(function GroupFilter)
        loop
            exitwhen i >= Titanic.sca
            set dat = Titanic.ind[i]
            if dat.h > dat.th then
                set dat.h = dat.h - HeightChange
                call SetUnitFlyHeight(dat.tit,dat.h,0)
            else
                if dat.cd < dat.d then
                    set x = GetUnitX(dat.tit) + dat.s * Cos(dat.rad)
                    set y = GetUnitY(dat.tit) + dat.s * Sin(dat.rad)
                    call DestroyEffect(AddSpecialEffect(TrailEff,x,y))
                    set dat.cd = dat.cd + dat.s
                    call SetUnitX(dat.tit,x)
                    call SetUnitY(dat.tit,y)
                    set TR[1] = GetUnitX(dat.tit)
                    set TR[2] = GetUnitY(dat.tit)
                    set TP = GetOwningPlayer(dat.c)
                    set TU[1] = dat.c
                    set TU[2] = dat.tit
                    call GroupEnumUnitsInRange(GROUP,TR[1],TR[2],100,c)
                    call ForGroup(GROUP,function GroupAction)
                else
                    set TR[1] = GetUnitX(dat.berg)
                    set TR[2] = GetUnitY(dat.berg)
                    call BuildEff(6,100,Eff,TR[1],TR[2])
                    if KnockbackOnImpact == true then
                        set TP = GetOwningPlayer(dat.c)
                        set TU[1] = dat.c
                        set TU[2] = dat.tit
                        call GroupEnumUnitsInRange(GROUP,TR[1],TR[2],AoE,c)
                        call ForGroup(GROUP,function GroupAction)
                    endif
                    call KillUnit(dat.tit)
                    call KillUnit(dat.berg)
                    set dat.c = null
                    set dat.tit = null
                    set dat.berg = null
                    call dat.destroy()
                    set Titanic.sca = Titanic.sca - 1
                    set Titanic.ind[i] = Titanic.ind[Titanic.sca]
                endif
            endif
            set i = i + 1
        endloop
        if Titanic.sca == 0 then
            call PauseTimer(Titanic.counter)
            call GroupClear(GROUP)
        endif
        set c = null
    endmethod

    static method Inject takes unit c,unit tit,unit berg,real rad,real d,real h,real s returns nothing
        local Titanic dat = Titanic.allocate()
        set dat.c = c
        set dat.tit = tit
        set dat.berg = berg
        set dat.rad = rad
        set dat.d = d
        set dat.cd = 0
        set dat.h = h
        call MoveLocation(Zloc,GetUnitX(tit),GetUnitY(tit))
        set dat.th = GetLocationZ(Zloc)
        set dat.s = s
        if Titanic.sca == 0 then
            call TimerStart(Titanic.counter,DELAY,true, function Titanic.Motion)
        endif
        set Titanic.ind[Titanic.sca] = dat
        set Titanic.sca = Titanic.sca + 1
    endmethod
endstruct

private function Action takes nothing returns nothing
    local unit C = GetTriggerUnit()
    local real lx = GetSpellTargetX()
    local real ly = GetSpellTargetY()
    local real ux = GetUnitX(C)
    local real uy = GetUnitY(C)
    local real FP1 = RBL(lx,ly,ux,uy)
    local real FP2 = RBL(ux,uy,lx,ly)
    local unit berg = CreateUnit(GetOwningPlayer(C), Iceberg,lx,ly, FP1 * bj_RADTODEG)
    local unit tit = CreateUnit(GetOwningPlayer(C), Ship,ux,uy, FP2 * bj_RADTODEG)
    local real d = DBL(ux,uy,lx,ly)
    local real speed = KB_speed
    call BuildEff(6,100,Eff,lx,ly)
    call SetUnitPathing(tit,false)
    call UnitAddAbility(tit,'Arav')
    call UnitRemoveAbility(tit,'Arav')
    call SetUnitFlyHeight(tit,800,0)
    call SetUnitFlyHeight (tit,1,1)
    call Titanic.Inject(C,tit,berg,FP2,d,StartHeight,speed)
    set C = null
    set berg = null
    set tit = null
endfunction

private function InitT takes nothing returns nothing
    local trigger T = CreateTrigger()
    local integer TI = 0
    loop
        exitwhen (TI >= bj_MAX_PLAYER_SLOTS)
        call TriggerRegisterPlayerUnitEvent(T, Player(TI), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
        set TI = TI + 1
    endloop
    call TriggerAddAction(T,function Action)
    call TriggerAddCondition(T,Condition(function Cond))
    set T = null
endfunction
endlibrary
Keywords:
Titanic, Ship, Ice, Iceberg, Shattered,
Contents

Titanic Spells (Map)

Reviews
11:15, 7th Oct 2009 TriggerHappy187: I'm rejecting this until you update it, since you said you might not even do it. Why does the GUI version have a point cast while the vJass version has an AOE cast? In your init function local...

Moderator

M

Moderator

11:15, 7th Oct 2009
TriggerHappy187:

I'm rejecting this until you update it, since you said you might not even do it.

Why does the GUI version have a point cast while the vJass version has an AOE cast?

  • In your init function local filterfunc FF = Filter(function DummyFilter) is completely useless. Filterfuncs don't leak inside events.
  • Your use of locations is useless as well, I mean you could just do local real FP2 = RBL(ux, uy,lx,ly) directly.
  • Also your actions function leaks, you never null berg or tit.
  • There is no need to use GetSpellTargetLoc() since you can just use GetSpellTargetLocX/Y.
  • You should make the flying height of the titanic configurable.
  • Also in your inject method, you never null your location so it leaks.
  • Your timer interval should be configurable (and 0.02 is too small).
  • You seem to not be nulling a lot of handles. Basically anything that gets destroyed you need to null, please fix all of these I don't want to point them out individually.
  • ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL should be configurable.
  • GetUnitState(kb.t,UNIT_STATE_LIFE) should be replaced with GetWidgetLife(kb.t). Same with any other UnitState calls that refer to life (including SetUnitState).

The_Reborn_Devil:
In "Titanic Loop" you forgot to remove the group "T_Group[T]" in the "Then - Actions" after the "Else - Actions" after the "Then - Actions" at the top :D

The vJASS version looks good as far as I can see.

Status: Approved
Rating: Recommended

The vJASS version of the spell is approved, but please fix the GUI version :D
Have a nice day!
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
Um, i guess those vjass mistakes are mine, i can explain some of them:

1. Somebody once said i should use filterfunctions and null them acordingly to prevent some leaks, this may be false but i have been told so and i only knew so much at that time.

2.GetSpellTargetLoc() i didn't know about the GetSpellTargetLocX/Y and whether using them is more efficent, so again it could be it was my mistake when i was helping Septimus.

3.GetUnitState(kb.t,UNIT_STATE_LIFE), if you would care to explain why using this is worse than widget life? I see no point currently and if there is a point i think you should say why.

4.Your timer interval should be configurable (and 0.02 is too small). Don't really think 0.02 is small, this is a fast spell, and i doubt running 10 of these will cause any probs but i may be wrong :p

5.You seem to not be nulling a lot of handles. Basically anything that gets destroyed you need to null, please fix all of these I don't want to point them out individually. Major overlook should be fixed asap :3

6.You should make the flying height of the titanic configurable. It IS check the script a bit better(StartHeight is present, as well as HeightChange factor).

7.ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL should be configurable. Don't see why but it is really optional, the spell was designed as a physical spell damage :3

8.Why does the GUI version have a point cast while the vJass version has an AOE cast? They both got Point Cast, the only difrence is that you can actualy see the aoe of the damage in the jass version, i think it is a better feature overall :)

If you could adress these comments of mine also and prove some more feedback cause i helped Septimus a lot on this spell and most of those errors are bound to be mine :p
 
2. Locations are more of a hassle in general, you have to destroy them and null them which adds extra lines, and reals are most likely faster. I mean you are using GetLocationX/Y on the target location, which is useless when you could directly use GetSpellTargetX/Y.

3. GetWidgetLife is faster.

4. 0.03 is more efficient, having less executions a second while having basically the same visual aspect.

5. I was assuming this was the titanic's height;
JASS:
    call SetUnitFlyHeight(tit,800,0)
    call SetUnitFlyHeight (tit,1,1)

7. Doesn't matter how you want it to be, other people may want it to be different.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,233
I disagree with the need for destroying the filter being removed. It saves space as the filter does nothing and is only needed on map initialization, so it is pointless keeping the object alive. Also setting it to a local may be faster due to less native calls.

Anyway, at Septimus's request, I have fixed up most of the problems mentioned as well as done some minor optimizations here and there.
The spell is still a mess really but it should be ok now.
 

Attachments

  • Titanic v1.1.w3x
    40.5 KB · Views: 119
Level 6
Joined
Feb 18, 2010
Messages
153
nice skill only problem i got is the ship doesnt come down to the floor like it does on test maps it says in there air lol
 
Top