Expelliarmus
Where to change the sig?
- Reaction score
- 48
Solved
Ok, I read Cohadar's PUI tutorial and the spells that uses it, and decided to make a spell in a similiar way to Cohadar's spells.
I know this isn't the most efficient way, but this is just to practise PUI or whatever.
The spell works normal, except only when the spell is level one.
At level two onwards, I deal no damage at all.
I take no damage at all from the creep at Hero Level 1
Normal?
- Increase Str
- Flesh Heap struct created.. calls on first use
- set data.PUI[index].level = GetUnitAbilityLevel(whichUnit, AbilityID ) debug msg comes (showing I2S .level) and increases as the skill does
The map has imported 80% of the triggers from Pyramidal Sandbox (disabled the ORBEngine, removed Demos)
I'll attach the map, if the problem isn't in the code
Thanks!
Ok, I read Cohadar's PUI tutorial and the spells that uses it, and decided to make a spell in a similiar way to Cohadar's spells.
Flesh Heap!
Pudge is made of innumerable rotting corpses, giving him extra protection against spells as well as the chance to add more to his bulk.
|cffffcc00Level 1|r - 4% magic reduction, 0.03 Str bonus per unit kill, 0.3 for hero kill.
|cffffcc00Level 2|r - 8% magic reduction, 0.06 Str bonus per unit kill, 0.6 per hero kill.
|cffffcc00Level 3|r - 12% magic reduction, 0.09 Str bonus per unit kill, 0.9 per hero kill.
|cffffcc00Level 4|r - 16% magic reduction, 0.12 Str bonus per unit kill, 1.2 per hero kill.Pudge can gain strength by killing allied units.
|cffffcc00Mana Cost|r: N/A
|cffffcc00Cooldown|r: N/A
JASS:
scope FleshHeap initializer InitTrig
globals
private constant integer AbilityID = 039;A000039;
private constant integer Hero = 30
private constant integer Unit = 3
endglobals
private struct data
integer level
unit pudge
real str
static data array PUI
private static method create takes unit whichUnit returns data
local data c = data.allocate()
set c.pudge = whichUnit
set c.level = GetUnitAbilityLevel(whichUnit, AbilityID )
set data.PUI[GetUnitIndex(c.pudge)] = c
return c
endmethod
static method Get takes unit whichUnit returns data
local integer index = GetUnitIndex(whichUnit)
if data.PUI[index] == 0 then
debug call BJDebugMsg("|c00FFCC00"+"Flesh Heap struct created on first use for hero: " + GetHeroProperName(whichUnit))
return data.create(whichUnit)
endif
set data.PUI[index].level = GetUnitAbilityLevel(whichUnit, AbilityID )
return data.PUI[index]
endmethod
method heap takes nothing returns nothing
local unit dy = GetTriggerUnit()
if IsUnitType( dy, UNIT_TYPE_HERO) == true then
set .str = .str + 0.01 * Hero * .level
else
set .str = .str + 0.01 * Unit * .level
endif
if .str >= 1 then
call SetHeroStr( .pudge, GetHeroStr( .pudge, false ) +1 , true)
set.str = .str - 1
endif
set dy = null
endmethod
endstruct
private function Actions takes nothing returns nothing
call data.Get(GetKillingUnit()).heap()
endfunction
private function Act takes nothing returns nothing
local data d = data.Get(GetTriggerUnit())
endfunction
private function Conditions takes nothing returns boolean
return GetLearnedSkill() == AbilityID
endfunction
private function Cond takes nothing returns boolean
return GetUnitAbilityLevel(GetKillingUnit(), AbilityID ) > 0
endfunction
//===========================================================================
private function InitTrig takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_HERO_SKILL )
call TriggerAddCondition( trig, Condition( function Conditions ) )
call TriggerAddAction( trig, function Act )
set trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( trig, Condition( function Cond ) )
call TriggerAddAction( trig, function Actions )
endfunction
endscope
I know this isn't the most efficient way, but this is just to practise PUI or whatever.
The spell works normal, except only when the spell is level one.
At level two onwards, I deal no damage at all.
I take no damage at all from the creep at Hero Level 1
Normal?
- Increase Str
- Flesh Heap struct created.. calls on first use
- set data.PUI[index].level = GetUnitAbilityLevel(whichUnit, AbilityID ) debug msg comes (showing I2S .level) and increases as the skill does
The map has imported 80% of the triggers from Pyramidal Sandbox (disabled the ORBEngine, removed Demos)
I'll attach the map, if the problem isn't in the code
Thanks!