• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

ability with item requied

Status
Not open for further replies.
Level 4
Joined
Dec 12, 2008
Messages
98
hello, im making an "camp fire" ability but i want that you need an item first to cast it and that the item disapear from your inventory.
 
Level 4
Joined
Jan 9, 2010
Messages
89
If this is about making a campfire (building) show up, then you could use the tiny- building items and just change the building that appears.
 
  • Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Camp Fire
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has (Item carried by (Triggering unit) of type Orb of Frost)) Equal to True //Boolean comparison > Hero - Hero has an item of type
        • Then - Actions
          • Hero - Drop (Item carried by (Triggering unit) of type Orb of Frost) from (Triggering unit)
          • Item - Remove (Last dropped item)
          • Set Point1 = (Target point of ability being cast)
          • Unit - Create 1 Camp Fire for (Owner of (Triggering unit)) at Point facing Default building facing degrees
          • Custom script: call RemoveLocation (udg_Point)
        • Else - Actions
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 4
Joined
Dec 12, 2008
Messages
98
thank you very much, the only thing, i set the casting time in lvl 1 to 8 sec. lvl 2 6 sec. and lvl 3 4 sec. but when i use the spell without the lumber he is still using the casting time but no fire. so is there a way i can set that?
 
Level 11
Joined
Jan 25, 2009
Messages
572
thank you very much, the only thing, i set the casting time in lvl 1 to 8 sec. lvl 2 6 sec. and lvl 3 4 sec. but when i use the spell without the lumber he is still using the casting time but no fire. so is there a way i can set that?

If you're going to fix that, you need to trigger the whole spell with an if/then/else and the pause the unit IF the unit has the lumber and then after 8/6/4 seconds, unpause it. :)
 
Level 11
Joined
Jan 25, 2009
Messages
572
Here is the actions, i did not copy the things Pharaoh_ did so just add this under the if/then/else in you'r trigger. And one more thing, i've added one more tirgger, that is the one that checks when the time has gone, the unit will be unpaused.
You need to create 3 new variables for it.
CF_Cstr = Unit, Array = 0
Timer = Timer, Array = 0
Dur = Real, Array = 1

Anyways, add this to the trigger Pharaoh_ made for you (Under the if/then/else (Under the Then - Actions)) :
  • Actions
    • Set CF_Cstr = (Triggering unit)
    • Unit - Pause CF_Cstr
    • Set Dur[1] = 8.00
    • Set Dur[2] = 6.00
    • Set Dur[3] = 4.00
    • Countdown Timer - Start Timer as a One-shot timer that will expire in Dur[(Level of Animate Dead for CF_Cstr)] seconds
    • Set Timer = (Last started timer)
Here is the new trigger that i made.
  • Timer
    • Events
      • Time - Timer expires
    • Conditions
    • Actions
      • Unit - Unpause CF_Cstr
I don't know if it's MUI but i don't think that's a big deal. I think "Maker" or "Pharaoh_" will fix that for u then cuz they're really pro in triggering =)
 
Level 4
Joined
Dec 12, 2008
Messages
98
thx

thx but i did an other way, i send you the file, oh and Pharao can you help me with some other custom spells?
 

Attachments

  • hungergames.w3x
    31 KB · Views: 51
Level 4
Joined
Dec 12, 2008
Messages
98
well thx, i need on this moment 2 spells, a cookable meat and a hide in tree ability.

Cookable meat:
you get a raw meat from critters, you can eat it and get 15 health but have a 55% chance to get a disease (just over time damage or slow) if you make a fire you can cook it and than you get an cooked meat. The cooked meat health 50 and have a 5% chance for a disease. Hope you can make it (if you want)

Hide in tree:
like an shadowmelt ability but now u select a tree. you can also do it on day, but than you have more chance players see you.

sorry if i want to much :)

ps. how can i make that thingy under every post where you have that pharao picture?
 
Well, here is a Cook System: http://www.hiveworkshop.com/forums/spells-569/cook-system-v1-1-a-135183/
Just add a condition in it, like this
  • Actions
  • If (All conditions are true) then do (Actions) else do (Actions)
    • If - Conditions
      • (Random integer number between 1 and 100) Less than or Equal to 55 //Integer Comparison)
    • Then - Actions
      • Set Point1 = (Position of (Triggering unit)) - This "triggering unit" will respond to the event "Unit - A unit uses an item".
      • Unit - Create 1 dummy unit for (Neutral Hostile) at (Point1) facing default building degrees
      • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Triggering unit)
      • Unit - Add a 2.00 seconds generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Point1)
For the hide in tree, explain more please.

For the signature, go to "User CP" and in the "Control Panel" column, go to "Edit Signature", in the "Settings and Options" section.
 
Level 4
Joined
Dec 12, 2008
Messages
98
thx, but when i use your camp fire trigger i get on "spell 1" and "spell 2" this error:
attempt to index a non-array variable.

The hide in tree ability:
the spell in real life is that you climb in a tree and that people can't see you. So my ability is the same as shadowmelt but now you need to target a tree :)

i need to go now so i can't comment for 4 hours :)
 
Level 4
Joined
Dec 12, 2008
Messages
98
i need to use the jassnewgen WE to use the cook system but i when i try to test the map with that newgen WE he gives a send/not send error. and the camp fire trigger error is working now :)
 
Status
Not open for further replies.
Top