• 🏆 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!

pls help me with a nidalee like spear gui

Status
Not open for further replies.
Level 1
Joined
Dec 11, 2014
Messages
1
Just a spear that travels as 1200 mx range damage increasing as distance increase as 600 max dmg non target ability and damages first contact with enemy unit, goes threw friendly unit, I know the dmg trigger is gonna have damage enemy unit equal to 50 percent of distance between....etc. pls help me
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You need a missile system to do that.
This one (GUI) is the one that I use for my maps and works fine.
When you get the on-hit-effect, you get something like (Damage = 50% of distance, etc. like you already said)
The on-hit-effect though is not implemented in the system and so I made a few adjustments to the one that I use:
1. You add an integer to the missile. This integer represents the spell, so it must be unique for every spell type. Make sure that you also remove this integer properly.
2. Search for the action that sais "Damage unit dealing ... damage etc etc etc". Replace that with "Run trigger" and let it run a trigger called "Missile System Effects" or something like that.
3. The Missile System Effects trigger should check the integer (spell type) of the missile and deals damage like you want.

There are a few flaws in the system (which I haven't figured out yet) so I give you an example of how your Missile System Effects trigger should look like (in JASS though):
JASS:
function Missile_Effects takes nothing returns nothing
    local unit missile = udg_TempUnit
    local unit attacker = udg_MS_dmg_source_ex[udg_MS_index[3]]
    local unit target = udg_TempUnitTarget
    local integer effectId = udg_MS_effect_type_ex[udg_MS_index[3]]
    local integer i
    local real r
    local location l1
    local location l2
    
    if (GetUnitTypeId(missile) != 'e000' and GetUnitTypeId(missile) != 'e001') then
        //call DisplayTextToForce(GetPlayersAll(), "Missile is bugged!")
        //Either the missile is destroyed or the missile variable refers to a different unit.
        return//Stop running.
    endif
    if (GetUnitName(attacker) == "") then
        //call DisplayTextToForce(GetPlayersAll(), "No attacker!")
        //Attacker is either a dummy (which has no name according to the dummy rules) or the attacker doesn't refer to an existing unit.
        //If the attacker is dead, it still has a name.
        return//Stop running.
    endif
    if (GetUnitName(target) == "") then
        //call DisplayTextToForce(GetPlayersAll(), "No target!")
        //Target is either a dummy (which has no name according to the dummy rules) or the target doesn't refer to an existing unit.
        return//Stop running.
    endif
    if (GetUnitState(target, UNIT_STATE_LIFE) == 0) then
        //The target has no health so it is dead
        //This system also collides with dead units (in my map) so... yea you can figure.
        //In my map I deal with dead units differently because I want to use dead units as well.
        return//Stop running.
    endif
    
    if (effectId == 0) then
        //Do nothing
        return//Stop running.
    elseif (effectId == 1) then//Nidalee's Javelin Toss
        set i = GetUnitAbilityLevel(attacker, 'A000')//Level of the ability A000 (Javelin Toss)
        set l1 = GetUnitLoc(attacker)
        set l2 = GetUnitLoc(target)
        set r = DistanceBetweenPoints(l1, l2)
        call RemoveLocation(l1)
        call RemoveLocation(l2)
        //This part is the calculation of the current Javelin Toss according to the LoL Wiki
        if (r > 1300) then
            set r = 1300
        endif
        set r = r - 525
        if (r < 0) then
            set r = 0
        endif
        set r = 1 + 0.02 * (r/7.75)
        //End of the calculations
        //The AP scaling is removed though.
        call UnitDamageTarget(attacker, target, (25 + 25*i) * r, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS) 
        call RemoveUnit(missile)//Removes the missile. This defines the difference between Nidalee's Javelin Toss and Ezreal's Ult for example
        return//Stop running.
    elseif (effectId == 2) then//Another Spell
        set i = GetUnitAbilityLevel(attacker, 'A001')//Level of the ability A000 (Another Spell)
        call DealDamage(attacker, target, 200 + 75*i, 0.8, 1)
        return//Stop running.
    endif
endfunction

//===========================================================================
function InitTrig_Missile_Effects takes nothing returns nothing
    set gg_trg_Missile_Effects = CreateTrigger()
    call TriggerAddAction(gg_trg_Missile_Effects, function Missile_Effects)
endfunction

If you know how to use JASS it will be much easier to get spells like this.
 
Status
Not open for further replies.
Top