• 🏆 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!

Spell learning thing, plz help

Status
Not open for further replies.
Level 25
Joined
Mar 23, 2008
Messages
1,813
I have a special system when picking spells, each round you be able to pick (or upgrade) a skill/ability/spell. (comes a list of spells) It looks like this in-game:

Frenzy(-frenzy): When using this spell, you attackspeed increase enormously for a short time. Three levels.
Attackspeed bonus-60%
Duration-15 seconds

Frost Nova(-fnova): Blast your target with damage, plus nova damage and slow movement in aoe. Three Levels.
Targetdamage-90
Novadamage-60
Movement slowed-15%

Blabla: blabalablbalaa.etc.etc.etc.etc.you get it

It comes up a list of chooseable skills, and you write the command that is in the parantesis to learn it, but the problem is when i need to upgrade the spell, because when you got level 1 on the skill and write for example
-frenzy, to upgrade it to level 2, i have no idea to make that work. Is it any like condition so when a player writes -frenzy, -unit has frenzy level 1, remove frenzy level 1, learn unit frenzy level 2?

2.And another question that belongs to that too, how do i give the right player the skill to the right unit, for example: Player 1 writes -frenzy. Learn frenzy to (?)..unit? I have one hero (Footman hero, same unit type for every player). So when player 1 writes the command, i want player 1´s Footman to get the skill.

Thanks, fagge
 
Level 12
Joined
Aug 18, 2006
Messages
1,193
its quite easy, here is what you need to do

  • Set Footmen
  • Events
    • Unit - A unit Enters (Playable map area <gen>)
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Footman
  • Actions
    • Set Footman[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
Footman is a Unit Variable with Arrays. This trigger is made to have each Player their own Footman inside a variable
  • Pick Frensy
  • Events
    • Player - Player 1 (Red) types a message containing -Frensy as an Exact match(or something like this, i dont have to world editor infront of me :P)
    • Player - Player 2 (Blue) types a message
    • and so on
  • Conditions
  • Actions
    • If (All Conditions) are True then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of Frensy for Footman[(Player number of (Triggering player))] Equal to 0
      • Then - Actions
        • Unit - Add Frensy for Footman[(Player number of (Triggering player))]
      • Else - Actions
        • Unit - Set level of Frensy to ((Level of Frensy for Footman[(Player number of (Triggering player))]) + 1) for Footman[(Player number of (Triggering player))]
    • Your other actions if you have any
to make things easier, you can make a Integer Variable named PlayerNumber and set it to (Player number of (Triggering unit)) so you dont have to look it up in the functions every time you want it :p

I assume you have other actions aswell, since else a player could just type in all spells and get all of them :p
 
Status
Not open for further replies.
Top