Combine items and gain spells

Status
Not open for further replies.
Level 5
Joined
Jun 4, 2016
Messages
62
1. I've seen on any maps of the same items that the charges have evolved in one slot. (Instead of 2 to 3 items in charge of the inventory is 1 to 6 charges.) How is this done?

2. I saw that on some maps magic damage depends on the parameters of the hero. (For example the spell hits 40 three times the mind.) How to make such a system?
 
Item charges:
JASS:
native          GetItemCharges  takes item whichItem returns integer

native          SetItemCharges  takes item whichItem, integer charges returns nothing

Hero attributes:
JASS:
native          GetHeroStr          takes unit whichHero, boolean includeBonuses returns integer

native          GetHeroAgi          takes unit whichHero, boolean includeBonuses returns integer

native          GetHeroInt          takes unit whichHero, boolean includeBonuses returns integer

native          SetHeroStr          takes unit whichHero, integer newStr, boolean permanent returns nothing

native          SetHeroAgi          takes unit whichHero, integer newAgi, boolean permanent returns nothing

native          SetHeroInt          takes unit whichHero, integer newInt, boolean permanent returns nothing
 
1. When a unit picks up an item that has charges (check if its a charged item in the trigger conditions), check the item type of all 6 of its inventory slots. If any of them match the item type of the picked up item, then use the action "Set <ITEM> charges to X" to combine them. Something like this, but in a loop through all 6 item slots.
  • Item - Set charges remaining in (Item carried by (Triggering Unit) in slot 1) to ((Charges remaining in (Item carried by (Triggering Unit) in slot 1)) + (Charges remaining in (Item carried by (Triggering Unit) in slot 4)))
2. You will also have to trigger the damage/duration/whatever of any spell you want to base on an attribute. There are equivalent GUI actions for the JASS natives jondrean posted above.
 
Item charges:
JASS:
native          GetItemCharges  takes item whichItem returns integer

native          SetItemCharges  takes item whichItem, integer charges returns nothing

Hero attributes:
JASS:
native          GetHeroStr          takes unit whichHero, boolean includeBonuses returns integer

native          GetHeroAgi          takes unit whichHero, boolean includeBonuses returns integer

native          GetHeroInt          takes unit whichHero, boolean includeBonuses returns integer

native          SetHeroStr          takes unit whichHero, integer newStr, boolean permanent returns nothing

native          SetHeroAgi          takes unit whichHero, integer newAgi, boolean permanent returns nothing

native          SetHeroInt          takes unit whichHero, integer newInt, boolean permanent returns nothing
Where it is regulated in triggers? (So far only worked with a conventional editor and planned to use JASS later.) Where it is necessary to enter?
 
Status
Not open for further replies.
Back
Top