HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help with Hp Recovery

02-03-2004, 09:19 PM#1
ZiiNeT
The skill i want to do is supposed to give the unit 5xskill level hp every 10 sec but i cant figure out how to do it. I want it to be 10 levels and there is a possibility that 2 or more of the hero type will be in the game.

Can someone please help me with this?
02-03-2004, 09:25 PM#2
Shark
well, first trigger would be:

E:unit learns skill
C:skill elarned equal to HPregen
A:set HPRegenMan[playerindex] equal to learning unit
A:set LevelSkill[playeriondex] equal to learned skill level
A:if level of learned skill equal to 1 then enable trigger HPlev1, else do nothing
A:if level of learned skill equal to 2 then do disable trigger HPlev1 and enable HPlev2, else do nothing

etc....i hope u get the drift...
for the HPlev1 trigger initialy off
E:every 10sec of game
C:none
A:set life of HPRegenMan[1-12] to life of current unit + 5xLevelskill[1-12]

that should do it, ofcourse with minor adjustments....
EDIT, instead of A:if level of learned skill equal to 1 then enable trigger HPlev1, else do nothing
A:if level of learned skill equal to 2 then do disable trigger HPlev1 and enable HPlev2, else do nothing
, use enable trigger HPRegen

cuz, if the unit has no skill, or the variable isn't set, its life won't change, and the life will change only for players who has the skill and the HPregen man...at least i think so :)))
02-03-2004, 09:29 PM#3
Vexorian
Isn't there a troll regenaration ability or some aura you could edit?
02-03-2004, 09:31 PM#4
Shark
Quote:
Originally posted by Lord Vexorian
Isn't there a troll regenaration ability or some aura you could edit?


that just gives the unit increased HP regen rate....he needs healing per 10 sec
02-03-2004, 09:37 PM#5
Vexorian
Then Use an Item life regeneration or something, my point is that triggers doesn't seem to be the best solution here
02-03-2004, 09:42 PM#6
Shark
i realised that as soon i started writing triggers, but....the man wanted exact triggers and i just gave him directions :))))
02-04-2004, 02:54 PM#7
ZiiNeT
Please Lord Vexorian if you can give me an easier way then i would be happy.

But for now ill use Sharks thing. But im a complete variable n00b so gould you please tell me what kinds of variables HPRegenMan and LevelSkill should be and how do i get that playerindex thing and where can i find "current unit"?
02-04-2004, 04:51 PM#8
Arohk
Make the "healing ointment" to hero ability, (the potion you can buy in the orc shop) change its duration and the life it heal, dont know why you need triggers for that?
02-04-2004, 05:11 PM#9
ZiiNeT
Quote:
Make the "healing ointment" to hero ability, (the potion you can buy in the orc shop) change its duration and the life it heal, dont know why you need triggers for that?


You mean Healing Salve? i cant make that heal hp every 10 seconds it heals all the time...i think

edit: i checked if i could make it. I didnt work because you have to active it i need it to have autocast that isnt possible to cancel
02-04-2004, 05:40 PM#10
Shark
Levelskill is an integer array with max size of 12 (for 12 players)
HPRegenman is a unit integer array with max size of 12 (for 12 players)

for player index, try owner of unit learning skill, or search for index
as for current unit, there is not such a thing, but u will use the same as u used in the trigger...example:
set HPRegenMan[1]'s life to (HPRegenMan[1]'s life + 5 x SkillLevel[1])

u could generalise this trigger using "advanced functions" but since u're not familiar with advanced triggering, u should copy/paste this for every integer...or do something like this

for each Integer A from 1 to 12 do loop actions
set HPRegenMan[Integer A]'s life to (HPRegenMan[Integer A]'s life + 5x SkillLevel[Integer A])

so he will do it with values 1,2,3,4,5...12...since skill level is memorized as the same number of the HPregenman, u can try it that way....
hope it helps :)
02-04-2004, 06:08 PM#11
ZiiNeT
ok thx Shark i understand the variables now.
but is this right

T:hplev1
E:Every 10sec of game time
C:none
A:Set Life of HPRegenMan[1] to ((Life of HPRegenMan[1]) + (5x(Real(Levelskill[1]))))

T:hplev2
E:Every 10sec of game time
C:none
A:Set Life of HPRegenMan[2] to ((Life of HPRegenMan[2]) + (5x(Real(Levelskill[2]))))

no that cant be right...or?

it should be like this right?

T:hplev1
E:Every 10sec of game time
C:none
A:Set Life of HPRegenMan[1] to ((Life of HPRegenMan[1]) + (5x(Real(Levelskill[1]))))
A:Set Life of HPRegenMan[2] to ((Life of HPRegenMan[2]) + (5x(Real(Levelskill[1]))))
etc etc.
T:hplev2
E:Every 10sec of game time
C:none
A:Set Life of HPRegenMan[1] to ((Life of HPRegenMan[1]) + (5x(Real(Levelskill[2]))))
A:Set Life of HPRegenMan[2] to ((Life of HPRegenMan[2]) + (5x(Real(Levelskill[2]))))
etc etc.
02-04-2004, 06:15 PM#12
chemo
If i was u, i would make an custom aura... an then detect the buff and skill level every 10 seconds.. this way u are sure to get the exact level and unit at the same time..

just my 2 cents :D