Could someone fix my map? (1.24 killed it)

HahaGetItPEE

New Member
Reaction score
0
I have a few imported custom spells in my Hero Wars map.
Tbh i don't really know anything about JASS, so the idea of trying to fix it myself is out of the question.

I have 5 or so spells, and i'm guessing it's a quick fix for anyone who knows JASS.
They're all in one category in my trigger editor so you shouldn't have to dig deep at all.

Just PM me if you'd like to help me out :D
 

Azlier

Old World Ghost
Reaction score
461
Here's a great idea: post the map. What, you afraid that we're going to steal it? :p
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Change your map header to this :
JASS:
function H2I takes handle h returns integer
    return GetHandleId(h)
endfunction

// ===========================
function LocalVars takes nothing returns gamecache
    // Replace InitGameCache("jasslocalvars.w3v") with a global variable!!
    return InitGameCache("udg_TestCache")
endfunction

struct UnitWrapper
    unit u
endstruct

struct LightningWrapper
    lightning l
endstruct

globals
    integer Wrapper
endglobals

function SetHandleUnit takes handle subject, string name, unit value returns nothing
    if value==null then
        set Wrapper = GetStoredInteger(LocalVars(),I2S(H2I(subject)),name)
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
        call UnitWrapper(Wrapper).destroy()
    else
        set Wrapper = UnitWrapper.create()
        set UnitWrapper(Wrapper).u = value
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, Wrapper)
    endif
endfunction

function SetHandleLightning takes handle subject, string name, lightning value returns nothing
    if value==null then
        set Wrapper = GetStoredInteger(LocalVars(),I2S(H2I(subject)),name)
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
        call LightningWrapper(Wrapper).destroy()
    else
        set Wrapper = LightningWrapper.create()
        set LightningWrapper(Wrapper).l = value
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, Wrapper)
    endif
endfunction

function SetHandleInt takes handle subject, string name, integer value returns nothing
    if value==0 then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleReal takes handle subject, string name, real value returns nothing
    if value==0 then
        call FlushStoredReal(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreReal(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function GetHandleInt takes handle subject, string name returns integer
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
endfunction

function GetHandleReal takes handle subject, string name returns real
    return GetStoredReal(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleUnit takes handle subject, string name returns unit
    set Wrapper = GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return UnitWrapper(Wrapper).u
endfunction

function GetHandleLightning takes handle subject, string name returns lightning
    set Wrapper = GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return LightningWrapper(Wrapper).l
endfunction

function FlushHandleLocals takes handle subject returns nothing
    call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )
endfunction

//===============================================================================
//===============================================================================

function PolarProjectionX takes real x, real distance, real angle returns real
    return x+distance*Cos(angle * (3.14159/180.0))
endfunction
function PolarProjectionY takes real y, real distance, real angle returns real
    return y+distance*Sin(angle * (3.14159/180.0))
endfunction
function DistanceBetweenPointsXY takes real x1, real y1, real x2, real y2 returns real
    return SquareRoot((x1 - x2)*(x1 - x2)+(y1 - y2)*(y1 - y2))
endfunction
function AngleBetweenPointsXY takes real x1, real y1, real x2, real y2 returns real
    return Atan2((y2-y1),(x2-x1)) * (180.0/3.14159)
endfunction
function GetParabolaHeight takes real dist, real maxdist,real curve returns real
    local real t = (dist*2)/maxdist-1
    return (-t*t+1)*(maxdist/curve)
endfunction
function DistanceBetweenUnits takes unit A, unit B returns real    
    return SquareRoot((GetUnitX(A)-GetUnitX(B))*(GetUnitX(A)-GetUnitX(B))+(GetUnitY(A)-GetUnitY(B))*(GetUnitY(A)-GetUnitY(B)))
endfunction
function AngleBetweenUnits takes unit A, unit B returns real
    return Atan2((GetUnitY(B)-GetUnitY(A)),(GetUnitX(B)-GetUnitX(A))) * (180.0/3.14159)
endfunction


New Vine Whip Trigger :
JASS:
//===========================================================================================
//Vine Whip
//by Paskovich
//
//Needed objects:
// - a unit targetted spell (like Storm Bolt), but better base it on Channel. (Or simply copy
//   my spell from the object editor.)
// 
//To implement the spell, copy and paste this trigger to your map.
//Change the datas below as they are written there.
//You will also need the Local Handle Vars and the other functions(!!!),
//so copy the script from the custom script window!
//Please give me a credit if you use this spell on your map!
//
//*UPDATE*
//  - New header: Vine_Whip_LightningEffect to set the lightning easily
//  - New header: Vine_Whip_DamageDisplay if you don't want the damage to be displayed
//============================================================================================

function Trig_Vine_Whip_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A00P'  //Raw code of your ability.
endfunction

function Vine_Whip_Speed takes nothing returns real
    local real speed = 1.0   //Speed of the throwing. (default 1.0)
    return 24.0 * speed
endfunction
function Vine_Whip_PlusRange takes nothing returns real
    return 150.0   //This is the offset from the caster where the target lands. (default 150.0)   
endfunction
function Vine_Whip_LightningEffect takes nothing returns string
//============================================================================================
//Lightning effects:    LEAS - Aerial Shackles
//			CLBP - Chain Lightning Primary
//			CLSB - Chain Lightning Secondary
//			DRAL - Drain Life (default)
//			DRAB - Drain Life and Mana
//			DRAM - Drain Mana
//			AFOD - Finger Of Death
//			FORK - Forked Lightning
//			HWPB - Healing Wave Primary
//			HWSB - Healing Wave Secondary
//			CHIM - Lightning Attack
//			MBUR - Mana Burn
//			MFBP - Mana Flare
//			SPLK - Spirit Link
//============================================================================================
    return "DRAL"  
endfunction

function Vine_Whip_DamageDependOnHeight takes nothing returns boolean
//============================================================================================
//If this is set to true, the damage will also depend on the unit's reached maximum height 
//while in the air.
//
//Important: the maximum height that can be reached is ~440, the minimum is ~160!
//Note: The height depends on the initial distance between the caster and target. 
//============================================================================================
    return true 
endfunction

function Vine_Whip_DamageModifier takes nothing returns real
//============================================================================================
//A little math required to understand:
//
//If Vine_Whip_DamageDependOnHeight is set to false:
//Vine_Whip_InitialDamage + Vine_Whip_BonusDamagePerLevel * Abilitylevel ==> Normal Damage
//
//But if Vine_Whip_DamageDependOnHeight is set to true:
//Damage = (Normal Damage * reached height) / Vine_Whip_DamageModifier
//
//If we count with a level 3 ability, then
//Maximum damage reachable =   325             *          440  / 330.0               ~    433
//                              |                          |
//                               -> the damage normally     -> maximum reachable height
//Minimum damage is 213.
//I recommend to leave this value at its default, and experiment with Vine_Whip_InitialDamage 
//and Vine_Whip_BonusDamagePerLevel.
//============================================================================================
    return 330.0 
endfunction

constant function Vine_Whip_InitialDamage takes nothing returns real
    return 100.0   //Damage = InitialDamage + (BonusDamagePerLevel * level of ability)
endfunction
constant function Vine_Whip_BonusDamagePerLevel takes nothing returns real
    return 75.0   //Damage = InitialDamage + (BonusDamagePerLevel * level of ability)
endfunction
function Vine_Whip_DamageDisplay takes nothing returns boolean
    return true   //Set this to false if you don't want the damage to be displayed on the screen.
endfunction





function Vine_Whip_ThrowUnit takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local unit ctr = GetHandleUnit(t, "caster")
    local unit trg = GetHandleUnit(t, "target")
    local real maxD = GetHandleReal(t, "maxDist")
    local real curD = GetHandleReal(t, "curDist")
    local real ang = GetHandleReal(t, "angle")
    local real hgt = GetParabolaHeight(maxD-curD, maxD, 1.8)
    local lightning l = GetHandleLightning(t, "light")
    local integer c = GetHandleInt(t, "times")
    local texttag tt
    local real dmg
    //Set the unit's position    
    call SetUnitPosition(trg, PolarProjectionX(GetUnitX(trg), Vine_Whip_Speed(), ang), PolarProjectionY(GetUnitY(trg), Vine_Whip_Speed(), ang))
    call SetUnitFlyHeight(trg, hgt, 0)
    //Get the max height reached
    if hgt > GetHandleReal(t, "maxH") then
        call SetHandleReal(t, "maxH", hgt)
    endif
    //Create the next lightning 
    call DestroyLightning(l)
    call SetHandleLightning(t, "light", AddLightningEx(Vine_Whip_LightningEffect(), false, GetUnitX(ctr), GetUnitY(ctr), GetUnitFlyHeight(ctr), GetUnitX(trg), GetUnitY(trg), GetUnitFlyHeight(trg)))
    //Set the next distance, +1 to the counter
    call SetHandleReal(t, "curDist", curD - Vine_Whip_Speed())
    call SetHandleInt(t, "times", c + 1)
    //Check if the counter reached the required value - destroy timer    
    if c > (maxD/Vine_Whip_Speed()) then
        call PauseTimer(t)
//      call DisplayTextToPlayer(Player(0), 0, 0, R2S(GetHandleReal(t, "maxH")))  //Displays the maximum height.
        call DestroyLightning(GetHandleLightning(t, "light"))
        set dmg = Vine_Whip_InitialDamage() + Vine_Whip_BonusDamagePerLevel() * GetHandleInt(t, "level")
        if Vine_Whip_DamageDependOnHeight() then
            set dmg = (dmg*GetHandleReal(t, "maxH"))/Vine_Whip_DamageModifier()
            if Vine_Whip_DamageDisplay() then
				set tt = CreateTextTagUnitBJ(R2S(R2I(dmg)*1), trg, 20, 10, 0, 255, 0, 0)
            	call SetTextTagVelocityBJ(tt, 64, 90)
            	call SetTextTagPermanent( tt, false )
            	call SetTextTagLifespan( tt, 1.00 )
            	call SetTextTagFadepoint( tt, 0.50 )
    		endif
        endif
        call UnitDamageTarget(ctr, trg, dmg, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
        call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl", GetUnitX(trg), GetUnitY(trg)))
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl", GetUnitX(trg), GetUnitY(trg)))
        call TerrainDeformCrater( GetUnitX(trg), GetUnitY(trg), 256.00, 34.00, R2I(0.05*1000), false) 
        call SetUnitPathing(trg, true)
         
        call FlushHandleLocals(t)
        set trg = null
        set ctr = null
        set t = null
        call DestroyTimer(t)
    endif
    
    set trg = null
    set ctr = null
    set t = null    
endfunction

function Trig_Vine_Whip_Actions takes nothing returns nothing
    local unit ctr  = GetTriggerUnit()
    local unit trg  = GetSpellTargetUnit()
    local timer t   = CreateTimer()
    local real dist = DistanceBetweenUnits(ctr, trg)
    local real ang  = AngleBetweenUnits(trg, ctr)
    //Store th caster and the target, create the first lightning       
    call SetHandleUnit(t, "caster", ctr)
    call SetHandleUnit(t, "target", trg)
    call SetHandleLightning(t, "light", AddLightningEx(Vine_Whip_LightningEffect(), false, GetUnitX(ctr), GetUnitY(ctr), GetUnitFlyHeight(ctr), GetUnitX(trg), GetUnitY(trg), GetUnitFlyHeight(trg)))
    
    //Throwning the unit
    call SetUnitPathing(trg, false)
    call SetHandleReal(t, "maxDist", dist + Vine_Whip_PlusRange())
    call SetHandleReal(t, "curDist", dist + Vine_Whip_PlusRange())
    call SetHandleReal(t, "angle", ang)    
    call SetHandleReal(t, "maxH", 0)
    call SetHandleInt(t, "level", GetUnitAbilityLevel(ctr, GetSpellAbilityId()))
    call SetHandleInt(t, "times", 0)
    call UnitAddAbility(trg, 'Arav')
    call UnitRemoveAbility(trg, 'Arav')    
    call TimerStart(t, 0.02, true, function Vine_Whip_ThrowUnit)
    
    set ctr = null
    set trg = null
    set t = null    
endfunction

//===========================================================================
function InitTrig_Vine_Whip takes nothing returns nothing
    set gg_trg_Vine_Whip = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Vine_Whip, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Vine_Whip, Condition( function Trig_Vine_Whip_Conditions ) )
    call TriggerAddAction( gg_trg_Vine_Whip, function Trig_Vine_Whip_Actions )
endfunction
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Are you using original world editor?

1.24 contains some hashtable bugs.. 1.24b fixed it.. =_=
 

HahaGetItPEE

New Member
Reaction score
0
Please stay out of my topic if you're not here to help. I'm very aware there is a tutorial.

However, I've followed it twice making changes as I go. I have also updated it as someone who is experienced with JASS's suggestions, and it's still a no go.

So obviously, it's not a quick fix. Stay out of my topic.
 

Karawasa

Element Tower Defense
Reaction score
38
Please stay out of my topic if you're not here to help. I'm very aware there is a tutorial.

However, I've followed it twice making changes as I go. I have also updated it as someone who is experienced with JASS's suggestions, and it's still a no go.

So obviously, it's not a quick fix. Stay out of my topic.

What you don't realize is that no one wants to help your lazy ass. You are importing spells and yet have no idea what to do with them. So you expect people to do the work for you? What the fuck is wrong with you. The bottom line is simple, if you want to use JASS spells then learn some JASS otherwise stay with the GUI.

You're being quite rude for someone who wants the work done for him, hence my scathing post. Oh, and it is a quick fix. No offense to the one guy who tried to help, but he simply doesn't know what he is doing. I've looked at the tutorial that we keep pointing you to, and even a monkey could do it.

You could learn a thing or two from this guy;

http://www.thehelper.net/forums/showthread.php?t=135279
 

HahaGetItPEE

New Member
Reaction score
0
What you don't realize is that no one wants to help your lazy ass. You are importing spells and yet have no idea what to do with them. So you expect people to do the work for you? What the fuck is wrong with you. The bottom line is simple, if you want to use JASS spells then learn some JASS otherwise stay with the GUI.

You're being quite rude for someone who wants the work done for him, hence my scathing post. Oh, and it is a quick fix. No offense to the one guy who tried to help, but he simply doesn't know what he is doing. I've looked at the tutorial that we keep pointing you to, and even a monkey could do it.

You could learn a thing or two from this guy;

http://www.thehelper.net/forums/showthread.php?t=135279

If you'll notice, the title of this forum is "The Helper."
Usually this entails one aiding another. Which is something I requested, and as of last night, something I received.
My map has been fixed thanks to a less ignorant member of the forum than yourself. I hope you feel you've accomplished something by criticizing me for asking for help.
n thx 4 bump nub lol.
 

Karawasa

Element Tower Defense
Reaction score
38
Help does not entail people doing everything for you. Glad you found a sucker to do it all for you though.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top