wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 01-24-2017, 05:46 AM   #1
Royalflare
User
 
Join Date: Jan 2015
Posts: 3

Royalflare has little to show at this moment (0)

Question I Need Help About Whirlwind Charge Move

Collapse JASS:

globals
hashtable Ae=null
trigger gg_trg_Whirl_Wind=null
endglobals
function Trig_Whirl_Wind_Conditions takes nothing returns boolean
    return GetSpellAbilityId()=='A005'
endfunction
function WhirlWind takes nothing returns nothing
    local timer t=GetExpiredTimer()
    local unit caster=LoadUnitHandle(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("caster"))
    local real angle=LoadReal(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("Angle"))
    local real cx=LoadReal(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("cx"))
    local real cy=LoadReal(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("cy"))
    local group OldTargets=LoadGroupHandle(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("OldTargets"))
    local group NewTargets=LoadGroupHandle(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("NewTargets"))
    local unit group_unit=null
    local player p=null
    local integer damage=0

    if( GetUnitCurrentOrder(caster)==String2OrderIdBJ("Cyclone"))then
        set p=GetOwningPlayer(caster)
        call GroupEnumUnitsInRange(NewTargets,cx,cy,600.00,null)
        set damage=100*GetUnitAbilityLevel(caster,'A005')
        call GroupRemoveGroup(OldTargets,NewTargets)
        call GroupAddGroup(NewTargets,OldTargets)
        loop
            set group_unit=FirstOfGroup(NewTargets)
            exitwhen group_unit==null
            if( GetWidgetLife(group_unit)>0.405 and IsUnitEnemy(group_unit,p) and IsUnitType(group_unit, UNIT_TYPE_STRUCTURE)==false) then
                call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl",GetUnitX(group_unit),GetUnitY(group_unit)))
                call UnitDamageTarget(caster,group_unit,(I2R(GetHeroAgi(caster,true))*(30.00*I2R(GetUnitAbilityLevel(caster,'A005')))),true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_ENHANCED,WEAPON_TYPE_WHOKNOWS)
            endif
            call GroupRemoveUnit(NewTargets,group_unit)
        endloop
        set angle =LoadReal(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("angle"))
        set cx = cx + 25 * Cos( angle )
        set cy = cy + 25 * Sin( angle )
        if(IsTerrainPathable(cx,cy,PATHING_TYPE_WALKABILITY)==false) and (IsTerrainPathable(cx,cy,PATHING_TYPE_FLYABILITY)==false) then
            call SetUnitX(caster,cx)
            call SetUnitY(caster,cy)
            call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",cx,cy))
        endif
    else
        call DestroyGroup(OldTargets)
        call DestroyGroup(NewTargets)
        set OldTargets=null
        set NewTargets=null
        call SetUnitTimeScale(caster,1.00)
        call PauseTimer(t)
        call DestroyTimer(t)
        call FlushChildHashtable(Ae,GetHandleId(t))
    endif
        set t=null
        set caster=null
        set OldTargets=null
        set NewTargets=null
endfunction
function Trig_Whirl_Wind_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local location tp = GetSpellTargetLoc()
    local real cx = GetUnitX(caster)
    local real cy = GetUnitY(caster)
    local real tx = GetLocationX(tp)
    local real ty = GetLocationY(tp)
    local real angle =Atan2(ty-cy,tx-cx)
    local group NewTarget = CreateGroup()
    local group OldTarget = CreateGroup()
    local timer t
    call SetUnitTimeScale(caster,2.00)
    set t=CreateTimer()
    call SaveUnitHandle(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("caster"),caster)
    call SaveReal(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("angle"),angle)
    call SaveReal(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("cx"),cx)
    call SaveReal(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("cy"),cy)
    call SaveGroupHandle(Ae,(StringHash(I2S(GetHandleId((caster))))),StringHash("NewTargets"),NewTarget)
    call SaveGroupHandle(Ae,(StringHash(I2S(GetHandleId((caster))))),StringHash("OldTargets"),OldTarget)
    call TimerStart(t,0.03,true,function WhirlWind)
    call RemoveLocation(tp)
    set t=null
    set tp=null
endfunction
function InitTrig_Whirl_Wind takes nothing returns nothing
    set gg_trg_Whirl_Wind=CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Whirl_Wind,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_Whirl_Wind,Condition(function Trig_Whirl_Wind_Conditions))
    call TriggerAddAction(gg_trg_Whirl_Wind, function Trig_Whirl_Wind_Actions)
endfunction

I have this spell that moves a Hero periodically to a SpellTarget Location, picks enemy units around unit nears by, dealing damage to them, removing them from New Group, and adding them to Old group,so that they won't get damaged again times,Then Clear Hashtable and All Variable to avoid Leaks.
But When I Test This Ability In Game,This Spell Doesn't Have Any Damage Effect,Could Anyone Tell Me Why? I am Very Noobs in Jass,So Please Help Me!
Royalflare is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 02-24-2017, 07:12 AM   #2
frg000987
User
 
Join Date: Feb 2017
Posts: 1

frg000987 has little to show at this moment (0)

Default

Can't help you, dude. soz
frg000987 is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 02:20 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services