• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Help with Entropy Armor :?

Status
Not open for further replies.
Level 1
Joined
Jun 22, 2005
Messages
7
Code:
Ok its 2 triggers, then a script in the custom aera script

Trigger
Entropy Armor On-

Evenets-
Unit is issused a order with no target

Condtions-
(level of entropy armor(ordered unit)) greater then or equal to 1

(issued order) equal to (order(manashieldon))

Events
Custom Scirpt- local trigger tChild = CreateTrigger()

Custom Scirpt- call SetUnitUserData(GetOrderedUnit(), T2I(tChild))

Custom Scirpt- call TriggerRegisterUnitEvent(tChild, GetOrderedUnit(), EVENT_UNIT_DAMAGED)

Custom Scirpt- call TriggerAddCondition(tChild, Condition(function Conditions_EntropyArmor))

Custom Scirpt- call TriggerAddAction(tChild, function Actions_EntropyArmor)

Custom Scirpt- set tChild = null



Ok so thats the first trigger ^  heres the secound one


Trigger
Entropy Armor Off-

Evenets-
Unit is issused a order with no target

Condtions-
(level of entropy armor(ordered unit)) greater then or equal to 1

(issued order) equal to (order(manashieldoff))


Events-

Custom Scirpt- call DestroyTrigger(I2T(GetUnitUserData(GetOrderedUnit())))


Ok so thats the secound trigger  then theres the aera i think its called the custim scirpt aera, when you click the map name in the trogger editor, its there.

Custom Script Code-

function T2I takes trigger tHandle returns integer
    return tHandle
    return 0
endfunction

function I2T takes integer iPointer returns trigger
    return iPointer
    return null
endfunction

function Conditions_EntropyArmor takes nothing returns boolean
    return (UnitHasBuffBJ(GetTriggerUnit(), 'B001') and (GetUnitAbilityLevelSwapped('A016', GetTriggerUnit()) >= 1))
endfunction

function Actions_EntropyArmor takes nothing returns nothing
    local location EntropyAttacker = GetUnitLoc(GetEventDamageSource())
    local location EntropyAttacked = GetUnitLoc(GetTriggerUnit())
    local real EntropyDistance = DistanceBetweenPoints(EntropyAttacker, EntropyAttacked) + 100.0 + (I2R(GetUnitAbilityLevelSwapped('A016', GetTriggerUnit())) * 50.0)
    local real EntropyAngle = AngleBetweenPoints(EntropyAttacked, EntropyAttacker)
    local location EntropyPolar = PolarProjectionBJ(EntropyAttacked, EntropyDistance, EntropyAngle)
    call DestroyEffect(AddSpecialEffectTargetUnitBJ("origin", GetEventDamageSource(), "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl"))
    call DestroyEffect(AddSpecialEffectTargetUnitBJ("overhead", GetTriggerUnit(), "Abilities\\Spells\\Human\\DispelMagic\\DispelMagicTarget.mdl"))
    call SetUnitPositionLoc(GetEventDamageSource(), EntropyPolar)
    if GetUnitStateSwap(UNIT_STATE_MANA, GetTriggerUnit()) <= 0.00 then
        call RemoveLocation(EntropyAttacked)
        call RemoveLocation(EntropyAttacker)
        call RemoveLocation(EntropyPolar)
        set EntropyAttacked = null
        set EntropyAttacker = null
        set EntropyPolar = null
        call DestroyTrigger(GetTriggeringTrigger())
    else
        call RemoveLocation(EntropyAttacked)
        call RemoveLocation(EntropyAttacker)
        call RemoveLocation(EntropyPolar)
        set EntropyAttacked = null
        set EntropyAttacker = null
        set EntropyPolar = null
    endif
endfunction
 
Status
Not open for further replies.
Top