HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trying to make a Custom - Hero Ability Lean system - Why doesnt this work?

03-28-2006, 02:24 PM#1
Fulla
EDIT: Title should be - Hero Ability LEARN system :-(

If a hero Gains a level I give him a Spellbook.
With booleans I detect whether he already has that spellbook, for if he hasnt spent his previous levels skillpoint.

Trigger:
Level
Collapse Events
Unit - A unit Gains a level
Conditions
Collapse Actions
Set PlayerSkillPoints[PlayerSkillPoints[(Player number of (Owner of (Leveling Hero)))]] = ((Player number of (Owner of (Leveling Hero))) + 1)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
PlayerSkill[(Player number of (Owner of (Leveling Hero)))] Equal to False
(Unit-type of (Leveling Hero)) Equal to Razia
Collapse Then - Actions
Unit - Add White Spells [Razia] to (Leveling Hero)
Set PlayerSkill[(Player number of (Owner of (Leveling Hero)))] = True
Collapse Else - Actions
Do nothing

A dummy ability in the Spellbook allows him to gain an ability and remove the spellbook.
With each level he gains a skillpoint (integer).
If he still has skillpoints left it shouldnt dissapear, until he has spent them all.

Trigger:
Learn Gilded Light
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Gilded Light [Mana Shield]
Collapse Actions
Set PlayerSkillPoints[(Player number of (Owner of (Casting unit)))] = ((Player number of (Owner of (Casting unit))) - 1)
Wait 0.20 seconds
Unit - Order (Casting unit) to Neutral Naga Sea Witch - Deactivate Mana Shield
Unit - Add Gilded Light [AntiMagicShell] to (Casting unit)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
PlayerSkillPoints[(Player number of (Owner of (Casting unit)))] Equal to 0
Collapse Then - Actions
Set PlayerSkill[(Player number of (Owner of (Casting unit)))] = False
Unit - Remove White Spells [Razia] from (Casting unit)
Selection - Select (Casting unit) for (Owner of (Casting unit))
Collapse Else - Actions
Do nothing

It works fine except it ALWAYS removes the spellbook?

Edited by Blade.dk. Reason: Please use trigger tags!
03-28-2006, 04:40 PM#2
BertTheJasser
Trigger:
Set PlayerSkillPoints[(Player number of (Owner of (Casting unit)))] = ((Player number of (Owner of (Casting unit))) - 1)

What the hell is this for? It absolute nonsenes.
It means that the number of unspent skillpoints is always your PlayerId - 1.
So In GUI the Id of Player 1 is 1 and so your unspend skillpoints are always sero and your spellbook will always get removed. I think that's it. ;)

Hope I could help.
03-28-2006, 04:46 PM#3
Fulla
Yup I was just about to post my correction, that was the problem.
I fixed that and I set the defualt value = 1, as heroes being with an unspent skillpoint :-).

Trigger:
Set PlayerSkillPoints[(Player number of (Owner of (Leveling Hero)))] = (PlayerSkillPoints[(Player number of (Owner of (Leveling Hero)))] + 1)
Trigger:
Set PlayerSkillPoints[(Player number of (Owner of (Casting unit)))] = (PlayerSkillPoints[(Player number of (Owner of (Casting unit)))] - 1)

Now I have a really strange problem. It works fine BUT

Mana Shield Deactivation only works after the hero has 0 skillpoints left i.e. when the spellbook is removed?
03-28-2006, 04:59 PM#4
Captain Griffen
What order string does the spell book have?

I'm willing to bet on what it might be, OR you used mana shield as a dummy ability in the spell book.
03-28-2006, 05:18 PM#5
Fulla
Yea Mana shield is a dummy ability which with triggers when used adds a differnet ability to hero.

I need it to auto deactivate. It does auto deactivate but only
Quote:
Mana Shield Deactivation only works after the hero has 0 skillpoints left i.e. when the spellbook is removed?
03-28-2006, 05:41 PM#6
Captain Griffen
It makes a poor dummy ability. Use roar/channel/some item heal abilities, etc.
03-28-2006, 06:09 PM#7
Fulla
Yea the best ones are divine shield + windwalk as they dont make the caster stop.

I was just hoping to get Mana Shield to work, then I could use Immolation as well as im not sure how many dummy spells I can use.
03-28-2006, 06:17 PM#8
Captain Griffen
Loads of item ones you can use (for healing, armour, etc.). Berserk is a good one.
04-18-2006, 09:34 AM#9
BertTheJasser
Berserk is BEST.