• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Why don't my change work correctly? :(

Status
Not open for further replies.
Level 5
Joined
Jan 6, 2005
Messages
137
Hi, i'm makig a hero who's basec on a good / evil concept and one of his spells is to go from good mode to evil mode, changing his spells to a more destructive side of themselves (giving him new spells).

THe way i do it is that when the spell has been cast, it hides the caster (good) setting all his factors as variables, skills, level of skills, hp, mana, xp, level, angle, unspent skill point, then deleting him and at the same time creating a new hero (evil), adding all the variables to him.
This does work, in same way, however, when changing back and forth, the hero loses his skillpoints, first just a few, then all of them, and the level of the changing skill itself decreases and ends up being completely unlearned, i don't quite understand why this happens.. i'd post up the full trigger, but im afraid i don't quite know how to.
 
Level 5
Joined
Jan 6, 2005
Messages
137
Okay, here is what i've done so far, i've changed the spell to metamophosis, however, allthough, that the mana, xp, lvl hp and angle fixes itself now, the trigger with spells is bugged up.
When i set:
Events:

Unit - A unit start the effect of an ability


Conditions:

(Unit-type of (casting unit)) equal to Good
(Ability being cast) Equal to <spell name>


Actions:

Set goodboltlevel = (Integer((Real((Level of holybolt for (Casting unit)))))
Unit - Remove Holybolt frem (casting unit)
Unit - Add Darkbolt to (Casting unit)
If (All conditions are true) hten do (Then actions) else do (Else actions)
If - Conditions
goodboltlevel greater than or equal to 1

Then - Actions
Hero - Learn skill for (casting unit): Darkbolt
Unit - Set level of Darkbolt for (casting unit) to goodboltlevel

Else - Actions
Do nothing




What happens is that even if the Holtbolt spell is not yet learned, it still adds a level one LEARNED Darkbolt to the hero, however, when trying to learn a spell, it's STILL Holyboly that you can learn, meaning you end up with both spells. :(
 
Status
Not open for further replies.
Top