Blood_Wraith
New Member
- Reaction score
- 2
I need to know how you add a number of charges to an item with a certain class-type, IE:Unit kills a certain unit, the game sets ALL items of purchasable class-type in the hero's inventory to (Their Current Charges + 2). I'm fairly sure if I can even get the entire trigger right, it will probably glitch. Because it tries to calculate the number of charges of class-type "Purchasable", in which if the hero has more than one of that class-type of item, it probably just calculates the top most one, and sets the others/OR just the topmost one (which have different number of charges) to an incorrect amount. Does it calculate for every item of that class-type in the Hero's inventory? If not, how can I get this to work without walls of manual triggering? Because I have this AP system to level up the Hero's materia, and when a certain materia reaches a certain amount of charges, it turns into a stronger version of the item, which I got that part down right. For my system so far I have to do large amounts of code like this:
That's JUST for the materia I have so far, I'm most likely gonna add more. And not only that, I have to do this for EVERY type of enemy that gives the same amount of AP. IE these 2 enemies give 3 AP, make a trigger for that, these 3 enemies give 8 AP, make a trigger for that, this enemy gives 210 AP, make a trigger for that. You get the point, large amounts of work. I suspect I'm going to have to make at least 30 more or so of these triggers, and if you do the math, every little line of code uses map space. And ALL those lines times 30 (or more) most likely takes a fair amount of space. Help would be much appreciated .
If it requires custom code, at least give me an example.
Trigger:
- Events
- Events
- Unit - A unit owned by Player 2 (Blue) Dies
- Conditions
- Conditions
- Or - Any (Conditions) are true
- Conditions
- (Unit-type of (Triggering unit)) Equal to MP
- (Unit-type of (Triggering unit)) Equal to Grashstrike
- (Unit-type of (Triggering unit)) Equal to Blugu
- (Unit-type of (Triggering unit)) Equal to Sample: H0512-opt
- Conditions
- Or - Any (Conditions) are true
- Actions
- Unit Group - Pick every unit in (Units within 3000.00 of (Position of (Triggering unit))) and do (Actions)
- Loop - Actions
- Item - Set charges remaining in (Item carried by (Picked unit) of type Lightning Materia [|cffffcc00Level 1|r]) to ((Charges remaining in (Item carried by (Picked unit) of type Lightning Materia [|cffffcc00Level 1|r])) + 2)
- Item - Set charges remaining in (Item carried by (Picked unit) of type Lightning Materia [|cffffcc00Level 2|r]) to ((Charges remaining in (Item carried by (Picked unit) of type Lightning Materia [|cffffcc00Level 2|r])) + 2)
- Item - Set charges remaining in (Item carried by (Picked unit) of type Fire Materia [|cffffcc00Level 1|r]) to ((Charges remaining in (Item carried by (Picked unit) of type Fire Materia [|cffffcc00Level 1|r])) + 2)
- Item - Set charges remaining in (Item carried by (Picked unit) of type Fire Materia [|cffffcc00Level 2|r]) to ((Charges remaining in (Item carried by (Picked unit) of type Fire Materia [|cffffcc00Level 2|r])) + 2)
- Item - Set charges remaining in (Item carried by (Picked unit) of type Ice Materia [|cffffcc00Level 1|r]) to ((Charges remaining in (Item carried by (Picked unit) of type Ice Materia [|cffffcc00Level 1|r])) + 2)
- Item - Set charges remaining in (Item carried by (Picked unit) of type Ice Materia [|cffffcc00Level 2|r]) to ((Charges remaining in (Item carried by (Picked unit) of type Ice Materia [|cffffcc00Level 2|r])) + 2)
- Item - Set charges remaining in (Item carried by (Picked unit) of type Poison Materia [|cffffcc00Level 1|r]) to ((Charges remaining in (Item carried by (Picked unit) of type Poison Materia [|cffffcc00Level 1|r])) + 2)
- Item - Set charges remaining in (Item carried by (Picked unit) of type Poison Materia [|cffffcc00Level 2|r]) to ((Charges remaining in (Item carried by (Picked unit) of type Poison Materia [|cffffcc00Level 2|r])) + 2)
- Item - Set charges remaining in (Item carried by (Picked unit) of type Cure Materia [|cffffcc00Level 1|r]) to ((Charges remaining in (Item carried by (Picked unit) of type Cure Materia [|cffffcc00Level 1|r])) + 2)
- Item - Set charges remaining in (Item carried by (Picked unit) of type Cure Materia [|cffffcc00Level 2|r]) to ((Charges remaining in (Item carried by (Picked unit) of type Cure Materia [|cffffcc00Level 2|r])) + 2)
- Item - Set charges remaining in (Item carried by (Picked unit) of type Cure Materia [|cffffcc00Level 3|r]) to ((Charges remaining in (Item carried by (Picked unit) of type Cure Materia [|cffffcc00Level 3|r])) + 2)
- Item - Set charges remaining in (Item carried by (Picked unit) of type Steal Materia [|cffffcc00Level 1|r]) to ((Charges remaining in (Item carried by (Picked unit) of type Steal Materia [|cffffcc00Level 1|r])) + 2)
- Item - Set charges remaining in (Item carried by (Picked unit) of type Earth Materia [|cffffcc00Level 1|r]) to ((Charges remaining in (Item carried by (Picked unit) of type Earth Materia [|cffffcc00Level 1|r])) + 2)
- Item - Set charges remaining in (Item carried by (Picked unit) of type Earth Materia [|cffffcc00Level 2|r]) to ((Charges remaining in (Item carried by (Picked unit) of type Earth Materia [|cffffcc00Level 2|r])) + 2)
- Item - Set charges remaining in (Item carried by (Picked unit) of type Double Cut Materia [|cffffcc00Level 1|r]) to ((Charges remaining in (Item carried by (Picked unit) of type Double Cut Materia [|cffffcc00Level 1|r])) + 2)
- Loop - Actions
- Events
That's JUST for the materia I have so far, I'm most likely gonna add more. And not only that, I have to do this for EVERY type of enemy that gives the same amount of AP. IE these 2 enemies give 3 AP, make a trigger for that, these 3 enemies give 8 AP, make a trigger for that, this enemy gives 210 AP, make a trigger for that. You get the point, large amounts of work. I suspect I'm going to have to make at least 30 more or so of these triggers, and if you do the math, every little line of code uses map space. And ALL those lines times 30 (or more) most likely takes a fair amount of space. Help would be much appreciated .
If it requires custom code, at least give me an example.