So I am making wow spells into wc3 but none of the actions seem executing;
My Guess is that the GetSpellID is wrong (its a custom spell based on channel) = A004:ANcl
So how do I solve this problem any1 has an idea/tips for me? (i am pretty new to jass)
oyeah ignore the globals they are for other spells.
thx
My Guess is that the GetSpellID is wrong (its a custom spell based on channel) = A004:ANcl
So how do I solve this problem any1 has an idea/tips for me? (i am pretty new to jass)
oyeah ignore the globals they are for other spells.
thx
JASS:
globals
integer Integer_C = 1
texttag Spell_Text
integer array AttackPower
integer damage
unit dummy
string spelleffect
location spellpoint
integer array Crit_Chance
integer randomint
endglobals
function Earth_Shock_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 039;A004039; ) ) then
return false
endif
return true
endfunction
function EarthShock_Actions takes nothing returns nothing
local effect array EarthShock_Effect
set spelleffect = "Earthshock.mdx"
set damage = 157
loop
exitwhen Integer_C > 6
set AttackPower[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = GetItemUserData( UnitItemInSlot(GetTriggerUnit(), Integer_C))
set Integer_C = Integer_C + 1
endloop
set Integer_C = 1
set damage = (damage + AttackPower[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] )
set randomint = GetRandomInt(1,100)
if randomint < Crit_Chance[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] then
set damage = damage * 2
endif
call UnitDamageTarget(GetTriggerUnit(), GetSpellTargetUnit(), I2R(damage), false, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
set spellpoint = GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc( 1, 039;hspt039;, Player(PLAYER_NEUTRAL_PASSIVE), spellpoint, 0.00)
set spellpoint = null
set dummy = GetLastCreatedUnit()
call ShowUnitHide(dummy)
call UnitApplyTimedLife(dummy, 039;BTLF039;, 2.00)
call UnitAddAbility(dummy,039;A002039;)
call IssueTargetOrder( dummy, "a002", GetSpellTargetUnit() )
call AddSpecialEffectTarget(spelleffect, GetSpellTargetUnit(), "origin")
set EarthShock_Effect[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = GetLastCreatedEffectBJ()
call TriggerSleepAction(1.00)
call DestroyEffect(EarthShock_Effect[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
endfunction
//==== Init Trigger NewTrigger ====
function InitEarthShock takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerAddCondition(t, Condition(function Earth_Shock_Conditions))
call TriggerAddAction(t, function EarthShock_Actions)
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
endfunction