Ok, so I have a problem with Hippogryph Riders.
I have 3 custom units, a hero Archer with a 2 slot inventory, a Hippogryph Hero with no inventory and a Hippogryph Rider with a 2 slot inventory.
I had everything working as I want it, except when I mount I want any items from the Archer to transfer the the Hippogryph Rider and vice versa when I dismount. At the moment both items simply drop to the floor. I did have it working briefly but I changed something and now it isn't.
I originally wanted to have the items transfer from inventory to inventory properly, but I lack the technical knowhow to accomplish that atm, so I was trying to simply grab them off the ground around the Archer (or Rider) and put them back into the inventory straight away.
If someone can fix my triggers (or find a much nicer way than my hacky version, JASS accepted, but I don't really know much about it) then that would be totally awesome
I have 3 custom units, a hero Archer with a 2 slot inventory, a Hippogryph Hero with no inventory and a Hippogryph Rider with a 2 slot inventory.
I had everything working as I want it, except when I mount I want any items from the Archer to transfer the the Hippogryph Rider and vice versa when I dismount. At the moment both items simply drop to the floor. I did have it working briefly but I changed something and now it isn't.
I originally wanted to have the items transfer from inventory to inventory properly, but I lack the technical knowhow to accomplish that atm, so I was trying to simply grab them off the ground around the Archer (or Rider) and put them back into the inventory straight away.
If someone can fix my triggers (or find a much nicer way than my hacky version, JASS accepted, but I don't really know much about it) then that would be totally awesome
-
Mount
-
Events
- Unit - A unit Stops casting an ability
-
Conditions
- ((Unit-type of (Casting unit)) Equal to Archer (new)) or ((Unit-type of (Casting unit)) Equal to Hippogryph (new))
-
Actions
- Set Player = (Owner of (Casting unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Player controller) Equal to User
- ((Ability being cast) Equal to Mount Hippogryph (new)) or ((Ability being cast) Equal to Pick up Archer (new))
-
Then - Actions
- Set Hippogryph = (Region centered at (Position of (Casting unit)) with size (256.00, 256.00))
- Unit Group - Add all units of (Units in Hippogryph owned by Player) to TempGroup
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
- Set TempUnit = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of TempUnit) Equal to Hippogryph Rider (new)
- (Hero experience of TempUnit) Equal to 0
-
Then - Actions
- Hero - Set TempUnit experience to (((Hero experience of (Casting unit)) + (Hero experience of (Target unit of ability being cast))) / 2), Hide level-up graphics
-
Item - Pick every item in Hippogryph and do (Actions)
-
Loop - Actions
- Hero - Create (Item-type of (Picked item)) and give it to TempUnit
- Item - Remove (Picked item)
-
Loop - Actions
- Else - Actions
-
If - Conditions
-
Loop - Actions
- Else - Actions
-
If - Conditions
-
Events
-
Dismount
-
Events
- Unit - A unit Stops casting an ability
-
Conditions
- (Unit-type of (Casting unit)) Equal to Hippogryph Rider (new)
-
Actions
- Set Player = (Owner of (Casting unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Player controller) Equal to User
- (Ability being cast) Equal to Dismount (new)
-
Then - Actions
- Set Hippogryph = (Region centered at (Position of (Casting unit)) with size (256.00, 256.00))
- Unit Group - Add all units of (Units in Hippogryph owned by Player) to TempGroup
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
- Set TempUnit = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Unit-type of TempUnit) Equal to Archer (new)) or ((Unit-type of TempUnit) Equal to Hippogryph (new))
- (Hero experience of TempUnit) Equal to 0
-
Then - Actions
- Hero - Set (Picked unit) experience to (Hero experience of (Casting unit)), Hide level-up graphics
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of TempUnit) Equal to Archer (new)
-
Then - Actions
-
Item - Pick every item in Hippogryph and do (Actions)
-
Loop - Actions
- Hero - Create (Item-type of (Picked item)) and give it to TempUnit
- Item - Remove (Picked item)
-
Loop - Actions
-
Item - Pick every item in Hippogryph and do (Actions)
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
-
Loop - Actions
- Else - Actions
-
If - Conditions
-
Events