| 11-06-2003, 10:01 PM | #1 |
I made a dummy spell that targets a hero. Does nothing except target the hero and use the artwork/cooldown/icon/etc... that I want. Now, I want the spell, when it targets an enemy hero, to lower his/her attributes (agility, intell, strength). I set the conditions, saying that the "specified ability has to be cast" and so on and so fourth. I used the advanced - function - get last targeted unit of targeted unit (or whatever) to get the target of my dummy spell. But It won't work unless I can specify a hero that hasn't been created yet... (I have my hero's in a tavern at map start.) Even if I create the hero, apply a variable, then kill it (using triggers) it won't let me use the variable... I'm just stuck... need help plz :) |
| 11-06-2003, 10:10 PM | #2 |
post the trigger, then maybe some1 will help |
| 11-06-2003, 10:54 PM | #3 |
// Trigger: Reprimand //=========================================================================== function Trig_Reprimand_Conditions takes nothing returns boolean if ( not ( GetTriggerUnit() == udg_Hero1 ) ) then return false endif if ( not ( GetSpellAbilityId() == 'A00Z' ) ) then return false endif if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then return false endif if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) == false ) ) then return false endif return true endfunction function Trig_Reprimand_Actions takes nothing returns nothing call ModifyHeroStat( bj_HEROSTAT_AGI, GetXTargetUnit(udg_Hero1), bj_MODIFYMETHOD_SUB, 4 ) // Trigger: Reprimand //=========================================================================== function Trig_Reprimand_Conditions takes nothing returns boolean if ( not ( GetTriggerUnit() == udg_Hero1 ) ) then return false endif if ( not ( GetSpellAbilityId() == 'A00Z' ) ) then return false endif if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then return false endif if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) == false ) ) then return false endif return true endfunction function Trig_Reprimand_Actions takes nothing returns nothing call ModifyHeroStat( bj_HEROSTAT_AGI, GetXTargetUnit(udg_Hero1), bj_MODIFYMETHOD_SUB, 4 )<---Here's the issue call ModifyHeroStat( bj_HEROSTAT_INT, GetXTargetUnit(udg_Hero1), bj_MODIFYMETHOD_SUB, 4 )<---Here's the issue call ModifyHeroStat( bj_HEROSTAT_STR, GetXTargetUnit(udg_Hero1), bj_MODIFYMETHOD_SUB, 4 )<---Here's the issue endfunction //=========================================================================== |
| 11-06-2003, 10:59 PM | #4 |
dude, you [glow=color=red,strength=2]DON'T NEED JASS[/glow]! But if you dopnt have TFT i cant help you there. |
| 11-07-2003, 03:00 AM | #5 |
I have TFT and don't know what JASS is, I pulled the trigger from the error page I got when I tried to save the map with the trigger that wouldn't work. |
| 11-07-2003, 03:09 AM | #6 |
Try this trigger. E - A Unit Is Issued an Order targeting an Object C - (Issued order) Equal to (Order(Your Spell Order String )) A - Hero - Modify (Stat) of (Target Unit of Issued Order): (Subtract/Add/Set To) |
| 11-07-2003, 01:52 PM | #7 |
How do I find out (myspellorderstring?) Also, E - Requires me to pick a unit so I said (getdetectedunit) is issued an order targeting object. C - Issued order equalto(howdoIfindmyorderstring???) A - Modify attribs. I know this doesn't seem like a question but it is, I assure you :) |
| 11-07-2003, 02:45 PM | #8 | |
Quote:
Found your problem you have the Trig_Reprimand_Actions Appear twice, you need to close the first trig_Reprimand_Actions with an endfunction....Also if you are using Jass I suggest not using the stupid bs function like ModifyHeroStat and use something like SetHeroStr(Udg_Hero1,GetHeroStr(Udg_Hero1)-4) Its just much easier without those ugly constants.. |
| 11-07-2003, 02:49 PM | #9 | |
Quote:
JASS is what you apparently wrote the trigger in. |
| 11-07-2003, 03:05 PM | #10 |
I don't have any idea what JASS is. I use the WEU editor. I only got the code from the error window when it came up. My trigger is as posted before... but I'm having trouble because the only thing that seems to come close is the (get detected unit) function in the (is issued an order targeting object) E. This compiles yet does nothing to any unit because I believe that (get detected unit) isn't getting the hero casting the spell. I need a way to get the caster, the hero being cast on, without picking a specific unit because none of them are placed in the map yet, they are in taverns. |
| 11-07-2003, 03:09 PM | #11 |
Reprimand Events Unit - (Get detected unit) Is issued an order targeting an object Conditions (Issued order) Equal to (Order(Reprimand)) ((Triggering unit) is A Hero) Equal to True ((Triggering unit) is A structure) Equal to False Actions Hero - Modify Agility of (Target unit of issued order): Subtract 4 Hero - Modify Strength of (Target unit of issued order): Subtract 4 Hero - Modify Intelligence of (Target unit of issued order): Subtract 4 this is my trigger. I believe the problem lies in the (get detected unit) function. Hope this helps. |
| 11-07-2003, 04:29 PM | #12 |
This is what I did before I learned how to create variables, though you could create a variable for (GetDetectedUnit) for the specific unit that is casting the spell if you know how. Reprimand Events Unit - A unit owned by Player 1 (Red) Is issued an order targeting an object Conditions (Unit-type of (Triggering unit)) Equal to YourUnitType <-- Easier than creating new variable (Issued order) Equal to (Order(Reprimand)) Actions Hero - Modify Agility of (Target unit of issued order): Subtract 4 Hero - Modify Strength of (Target unit of issued order): Subtract 4 Hero - Modify Intelligence of (Target unit of issued order): Subtract 4 |
| 11-08-2003, 05:23 PM | #13 |
Ok, now, the spell works, exactly the way it's supposed too.... except.... if you keep hotkeying it and targeting the unit and keep clicking, the spell is never cast and the targeted unit's stats go up like CRAZY. It's kinda funny actually... But I don't want this to happen... for the moment, I'm going to take away the hotkey function for the dummy spell causing the trigger. But if anyone could figure out a way to stop this from happening in the trigger I would greatly appreciate it. Trigger Ascension Events Unit - A unit owned by Player 2 (Blue) Is issued an order targeting an object Unit - A unit owned by Player 3 (Teal) Is issued an order targeting an object Unit - A unit owned by Player 4 (Purple) Is issued an order targeting an object Unit - A unit owned by Player 5 (Yellow) Is issued an order targeting an object Unit - A unit owned by Player 6 (Orange) Is issued an order targeting an object Conditions (Issued order) Equal to (Order(purge)) (Unit-type of (Triggering unit)) Equal to Arthas Actions Hero - Modify Strength of (Target unit of issued order): Add 2 Hero - Modify Agility of (Target unit of issued order): Add 2 Hero - Modify Intelligence of (Target unit of issued order): Add 2 |
| 11-08-2003, 10:05 PM | #14 |
"Hero - Modify Strength of (Target unit of issued order): Add 2 Hero - Modify Agility of (Target unit of issued order): Add 2 Hero - Modify Intelligence of (Target unit of issued order): Add 2" There's your problem. This is trying to give the object that was targetted +2 stats, which isnt possible because 1) it's an item ( I assume) 2) it's not a hero. It should say Modify intelligence etc of ARTHAS. |
| 11-08-2003, 10:05 PM | #15 |
"Hero - Modify Strength of (Target unit of issued order): Add 2 Hero - Modify Agility of (Target unit of issued order): Add 2 Hero - Modify Intelligence of (Target unit of issued order): Add 2" There's your problem. This is trying to give the object that was targetted +2 stats, which isnt possible because 1) it's an item ( I assume) 2) it's not a hero. It should say Modify intelligence etc of ARTHAS. |
