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

need help with changing the raw code

Status
Not open for further replies.
Level 11
Joined
Jul 17, 2013
Messages
544
I have downloaded the spell from hive workshop, installed it in my map now i am using it, the problem is i must make it also work for ability with raw code 'A024' ,is there a way? to do it, it is a long story but doing this would be the easiest for me.












//TESH.scrollpos=64
//TESH.alwaysfold=0
scope TestFear
//=============================================================
//=========================SETUP================================
//=============================================================
globals
private constant real DURATION = 7.
private constant real AOE = 150.
private constant integer SPELL_ID = 'A08I'
private constant string PATH = "Abilities\\Spells\\Undead\\Curse\\CurseTarget.mdl"
private constant string PATH_2 = ""
private constant string ATTACH = "overhead"
endglobals

private function Duration takes integer level returns integer
return 5 + 2*level
endfunction

private function Aoe takes integer level returns integer
return 1 + 149*level
endfunction

private function Cond takes nothing returns boolean
local unit FoG
local player p
local real x
local real y
local group g
local integer lvl
local Fear F
if GetSpellAbilityId() == SPELL_ID then
set g = CreateGroup()
set p = GetOwningPlayer(GetTriggerUnit())
set x = GetSpellTargetX()
set y = GetSpellTargetY()
set lvl = GetUnitAbilityLevel(GetTriggerUnit(),SPELL_ID)
call GroupEnumUnitsInRange(g, x, y, Aoe(lvl), null)
call DestroyEffect(AddSpecialEffect(PATH_2,x,y))
loop
set FoG = FirstOfGroup(g)
exitwhen FoG == null
call GroupRemoveUnit(g, FoG)
//I'm using UnitAlive since I declared it in the FearSystem
if not IsUnitAlly(FoG,p) and UnitAlive(FoG)and not IsUnitType(FoG,UNIT_TYPE_GIANT) then
if Fear.isFeared(FoG) then
set F = Fear.get(FoG)
set F.time = Duration(lvl)
else
set F = Fear.create()
set F.targ = FoG
set F.path = PATH
set F.attach = ATTACH
set F.time = Duration(lvl)
call F.start()
call F.destroy()
endif
endif
endloop
call DestroyGroup(g)
set g = null
endif
return false
endfunction

private module Module
private static method onInit takes nothing returns nothing
call init()
endmethod
endmodule

private struct A extends array
private static method init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function Cond))
set bj_lastCreatedUnit = CreateUnit(Player(15),'h000',0,0,0)
call UnitAddAbility(bj_lastCreatedUnit, SPELL_ID)
call KillUnit(bj_lastCreatedUnit)
call Preload(PATH)
call Preload(PATH_2)
set t = null
endmethod
implement Module
endstruct
endscope
 
Status
Not open for further replies.
Top