I tried to modify Chippers Rockets but it seems that i just can't get it working.
What i want it to be like:
- 1 level of the spell only (done)
- No manacost (done)
- start with 3 rockets (done)
- start recharging after you shoot one (....)
Problem : If you have 3 charges, chipper wont reload as long as he has atleast 1 charge. If you shoot your last charge, he will reload that LAST Charge. So basically it stays at 1 charge all the time.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<ability
name="Ability_Chipper1"
icon="icon.tga"
anim=""
casttime="0"
castactiontime="0"
maxlevel="1"
requiredlevel="1"
actiontype="target_position"
targetradius="070"
casteffecttype="Magic"
targetscheme="nonneutral_organic_enemy_units"
casteffect="effects/cast.effect"
manacost="0"
cooldowntime="0"
frontqueue="true"
noninterrupting="true"
inheritmovement="true"
range="3000"
forcerange="3000"
allowoutofboundscast="true"
maxcharges="3"
initialcharges="3"
>
<onlearn>
<setcharges a="3" />
<setaccumulator value="1" />
</onlearn>
<onupgrade>
<addcharges count="1" />
</onupgrade>
<onimpact>
<spawnunit name="Gadget_Chipper_Ability1_Reveal" count="1" target="source_position" pushentity="true" />
<spawnprojectile name="Projectile_Chipper_Ability1" source="source_entity" target="target_position" bind="stack_entity" proxy="stack_entity" offset="0 0 120" />
</onimpact>
<onlearn>
<setcharges a="1" />
<setaccumulator value="1" />
</onlearn>
<onupgrade>
<addcharges count="1" />
</onupgrade>
<onimpact>
<setvar0 a="0" />
<spawnunit name="Gadget_Chipper_Ability1_Reveal" count="1" target="source_position" pushentity="true" />
<spawnprojectile name="Projectile_Chipper_Ability1" source="source_entity" target="target_position" bind="stack_entity" proxy="stack_entity" offset="0 0 120" />
<condition test="accumulator eq 3">
<setaccumulator value="4" />
</condition>
<condition test="accumulator eq 2">
<setaccumulator value="3" />
</condition>
<condition test="accumulator eq 1">
<setaccumulator value="2" />
</condition>
<condition test="accumulator eq 0">
<setaccumulator value="1" />
</condition>
<applystate name="State_Chipper_Ability1_Charges" target="source_entity" duration="4000" proxy="this_entity" pushentity="true" />
<addcharges entity="stack_entity" count="1" />
<removecharge />
<condition test="charges eq 0">
<setactivemodifierkey name="chipperrocketdisabled" />
</condition>
</onimpact>
<ondeath>
<setcharges a="3" />
</ondeath>
<modifier key="chipperrocketdisabled" modpriority="100"
disabled="true"
>
<onframe>
<compare a="charges" b="0" op="gt">
<setactivemodifierkey name="" />
</compare>
</onframe>
</modifier>
</ability>
Could anyone help please ? I think its somewhere on <onimpact>