• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

need help with changing the raw code

Status
Not open for further replies.
Level 12
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