1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  5. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  6. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  7. The results are out! Check them out.
    Dismiss Notice
  8. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  9. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Titanic (GUI/VJASS)

Submitted by Septimus
This bundle is marked as approved. It works and satisfies the submission rules.
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.

Changelog
Version 1.03 Update

Remove unnecessary document.

Version 1.02

Fix what The_Reborn_Devils told.

Version 1.01

Fix errors.




Credit
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.

GUI Scripting
  • 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


VJASS Scripting
Code (vJASS):
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
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...
  1. 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!
     
  2. Septimus

    Septimus

    Joined:
    May 3, 2008
    Messages:
    4,175
    Resources:
    49
    Packs:
    1
    Maps:
    35
    Spells:
    8
    Tutorials:
    5
    Resources:
    49
    The spells was remove from hiveworkshop because I forgot to click Saves Spells during the removal of all spells for the compatability of 1.24 patch.

    All documentation and faq was inside the map, please read before asking question that are deem to be dumb. :p
     
  3. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    who helped you with this btw? :p cause it's some good coding...

    but i actually prefer the timer method which i explained to you, easier to use and understand imo, or hashtables...

    great job there =)
     
  4. Septimus

    Septimus

    Joined:
    May 3, 2008
    Messages:
    4,175
    Resources:
    49
    Packs:
    1
    Maps:
    35
    Spells:
    8
    Tutorials:
    5
    Resources:
    49
    if you read the faq, i actually haven't done the jass version. what you teach me seems to be vjass. :p
     
  5. Kingz

    Kingz

    Joined:
    Jun 5, 2008
    Messages:
    2,470
    Resources:
    6
    Spells:
    5
    Tutorials:
    1
    Resources:
    6
    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
     
  6. TriggerHappy

    TriggerHappy

    Code Moderator

    Joined:
    Jun 23, 2007
    Messages:
    3,671
    Resources:
    22
    Spells:
    11
    Tutorials:
    2
    JASS:
    9
    Resources:
    22
    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;
    Code (vJASS):

        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.
     
  7. Septimus

    Septimus

    Joined:
    May 3, 2008
    Messages:
    4,175
    Resources:
    49
    Packs:
    1
    Maps:
    35
    Spells:
    8
    Tutorials:
    5
    Resources:
    49
    Submission rules doesn't indicate that it was necessary for us to make the attack type configurable.

    I don't think it was essential to have this as a main requirement.
     
  8. TriggerHappy

    TriggerHappy

    Code Moderator

    Joined:
    Jun 23, 2007
    Messages:
    3,671
    Resources:
    22
    Spells:
    11
    Tutorials:
    2
    JASS:
    9
    Resources:
    22
    I never said it was a main requirement, it's a suggestion.

    One that takes 5 seconds at that, don't be lazy.
     
  9. Kingz

    Kingz

    Joined:
    Jun 5, 2008
    Messages:
    2,470
    Resources:
    6
    Spells:
    5
    Tutorials:
    1
    Resources:
    6
    @TriggerHappy187

    Thanks for the feedback and the constructive critizism ^^

    Those mistakes are mostly just overlooks of simple things so i guess Septimus won't have a hard time fixing them :p


    [offtopic]

    I love the bioshock avatar man :D
    /want
     
  10. Septimus

    Septimus

    Joined:
    May 3, 2008
    Messages:
    4,175
    Resources:
    49
    Packs:
    1
    Maps:
    35
    Spells:
    8
    Tutorials:
    5
    Resources:
    49
    I would try to fix it, but don't give a high hope over me yet./
     
  11. Ice Snake

    Ice Snake

    Joined:
    Oct 13, 2009
    Messages:
    28
    Resources:
    0
    Resources:
    0
    Good job! :thumbs_up:

    Thanks! :nemor:
     
  12. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,611
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    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.
     

    Attached Files:

  13. Septimus

    Septimus

    Joined:
    May 3, 2008
    Messages:
    4,175
    Resources:
    49
    Packs:
    1
    Maps:
    35
    Spells:
    8
    Tutorials:
    5
    Resources:
    49
    thx, i would have it updated as soon as possible.
     
  14. Septimus

    Septimus

    Joined:
    May 3, 2008
    Messages:
    4,175
    Resources:
    49
    Packs:
    1
    Maps:
    35
    Spells:
    8
    Tutorials:
    5
    Resources:
    49
    finally able to find a spare time to upload it.

    thx dsg.
     
  15. Catch_ya

    Catch_ya

    Joined:
    May 21, 2009
    Messages:
    982
    Resources:
    1
    Spells:
    1
    Resources:
    1
    how did you get this number oO?
    Code (vJASS):
    local real ia = 6.2831853/im
     
  16. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,611
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    pi = 3.1415926535897932384626433832795 (aprox)
    2pi = 6.283185307179586476925286766559 (aprox)

    Logically 2 pi as a constant should be faster than 2 * the costant for pi.

    I guess you can work the rest out.
     
  17. Catch_ya

    Catch_ya

    Joined:
    May 21, 2009
    Messages:
    982
    Resources:
    1
    Spells:
    1
    Resources:
    1
    oh thanks for explaining me that..
     
  18. Piwlady

    Piwlady

    Joined:
    May 31, 2009
    Messages:
    898
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Lol! this is one awesum spell idea gj
     
  19. Septimus

    Septimus

    Joined:
    May 3, 2008
    Messages:
    4,175
    Resources:
    49
    Packs:
    1
    Maps:
    35
    Spells:
    8
    Tutorials:
    5
    Resources:
    49
    ouch!! I am absent minded about the GUI version!! Would have it fix soon.