Mana system?

Status
Not open for further replies.
Level 5
Joined
Feb 6, 2009
Messages
96
Hi everybody... im working on a rpg map and wanted to have diffrent kinds of characters! For example I wanted to make a warrior!

Now here is my problem! I wanted the warrior to have a mana system like in world of warcraft that he gets mana by attacking people and that his mana is nerver ofer 100! Can somebody help me by posting a system or a solution pls?!
(Only GUI pls! :) )

Frozenbrain
 
Level 3
Joined
Oct 9, 2008
Messages
61
Set maximum mana to 100, set that it dont gain int (or set so int gives no mana)
Event - Unit is attacked
Condition - (Attacking Unit) is of type Warrior
Action - Set mana of (Attacking Unit) to (Mana of (Attacking Unit)) + 5

And for int items, use this:
Event - Unit aquire an Item
Conditions - (Item being manipulated) is of type YourIntItem
(Triggering Unit) is of type Warrior
Action - Set maximum mana of (Triggering Unit) to (Maximum Mana of (Triggering Unit)) - Int from item*10
 
Actually, get this:
  • Trigger1
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set Temp_Group = (Units in (Playable Map Area))
    • Unit Group - Pick every unit in (Temp_Group) and do (Actions)
      • Loop - Actions
        • Trigger - Add to (Trigger2) the event (Unit - (Picked unit) takes damage)
    • Custom script: call DestroyGroup (udg_Temp_Group)
  • Trigger3
  • Events
    • Unit - A unit enters (Playable Map area)
  • Conditions
  • Actions
    • Trigger - Add to Trigger2 the event (Unit - (Triggering unit) takes damage)
  • Trigger2
  • Events
  • Conditions
    • (Unit-type of (Damage source)) Equal to ()Warrior
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Mana of (Damage source)) Less than or Equal to 100
      • Then - Actions
        • Unit - Set mana of (Damage source) to (((Mana of (Damage source)) + 5)
      • Else - Actions
If you don't understand, use these references:
[•] http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/variables-5896/
[•] http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
 
Level 3
Joined
Oct 9, 2008
Messages
61
  • Trigger2
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Mana of (Damage source)) Less than or Equal to 100
It should be only less than, not equal to, or else the warrior is going to get 105 mana.
 
Level 5
Joined
Feb 6, 2009
Messages
96
Where can I set that Int doesnt give any mana?


I just found it but it would mean that Inteligenz doesnt give mana at all! And thats not really what 1 want^^
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
You can disable mana regen from int for all units in gameplay constants and then trigger it.

  • Damage Detection
    • Events
    • Conditions
      • (Unit-type of (Damage source)) Equal to Paladin
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Mana of (Damage source)) Less than 95.00
        • Then - Actions
          • Unit - Set mana of (Damage source) to ((Mana of (Damage source)) + 5.00)
        • Else - Actions
          • Unit - Set mana of (Damage source) to 100.00
  • Add Events to Damage Detection 1
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set Temp_Group_1 = (Units in (Playable map area))
      • Unit Group - Pick every unit in Temp_Group_1 and do (Actions)
        • Loop - Actions
          • Trigger - Add to Damage Detection <gen> the event (Unit - (Picked unit) Takes damage)
      • Custom script: call DestroyGroup(udg_Temp_Group_1)
  • Add Events to Damage Detection 2
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to Damage Detection <gen> the event (Unit - (Triggering unit) Takes damage)
  • Add Mana
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Group_1 = (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) is alive) Equal to True)))
      • Unit Group - Pick every unit in Temp_Group_1 and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Not equal to Paladin
            • Then - Actions
              • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + (0.05 x (Real((Intelligence of (Picked unit) (Include bonuses))))))
            • Else - Actions
      • Custom script: call DestroyGroup(udg_Temp_Group_1)
 

Attachments

  • Combat_Regen.w3x
    18.8 KB · Views: 35
Status
Not open for further replies.
Top