Can someone make a spell for me please? Transfer unit to inventory.

Astal

New Member
Reaction score
1
Can someone make a spell for me please? Transfer unit to inventory. Or Atleast Help!

What i need is a spell when cast which will take an enemy unit and convert it in to an item in the casting units inventory for X amount of time or until the player dies.

Im making a map called the Hunt for gollum so i need the human rangers and the orc trackers to be able to capture gollem and take him back to their base.

Gollum will also be a player.

If possible i would also like to be able to give gollum an ability to kick the carrying player for a chance to get loose.

I really dunno how i could do this but would appreciate if someone could make it for me or help me atleast.
 

Astal

New Member
Reaction score
1
This is all i have so far I have no idea how to make it follow the capturing player or give the captured player aka gollum an ability so he can try to kick free of the sack.

Trigger:
  • Capture
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Capture
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target unit of ability being cast) Equal to Gollum_Unit
        • Then - Actions
          • Unit - Hide (Target unit of ability being cast)
          • Unit - Create 1 dummy for Player 11 (Dark Green) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
          • Hero - Create Gollum and give it to (Triggering unit)
        • Else - Actions
 

Gummi_Bears

New Member
Reaction score
5
Whats the dummy for? And what is the 'Create Gollum and give to player' item based on? I think if you refer to points it leaks. should set it to a variable and remove it later
 

Moridin

Snow Leopard
Reaction score
144
I don't mind making this ability for you, but I have a few questions:

1) Is there any cooldown / mana cost on that kick ability? Will the gollum be able to spam the kick? Can he only cast it a certain number of times?

2) There is only one gollum right? Will you have more than 1 capturable unit (gollum)?

3) Is there a cast range for the capture ability?
 

Astal

New Member
Reaction score
1
I don't mind making this ability for you, but I have a few questions:

1) Is there any cooldown / mana cost on that kick ability? Will the gollum be able to spam the kick? Can he only cast it a certain number of times?

2) There is only one gollum right? Will you have more than 1 capturable unit (gollum)?

3) Is there a cast range for the capture ability?

1. cool down like 20 seconds, no mana cost.
2. Only 1 gollum, no it will need to be custom in the spell that only gollum can have the spell cast on him. Unlimited times just limited by cooldown.
3. Yah 250 should be the range.

Not sure if you would have to do this part for me or not. But when a unit who has captured gollum reaches their base, he is killed and respawns in a random region. If the unit carrying gollum is killed gollum gets freed from the sack, gollum item is destroyed and he appears where the dead unit is.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
here it is, with attached demo map.

consists of 3 triggers, 2 abilities and 1 item.

i used 3 variables, Gollum, a Gollum_Dummy <- this unit is needed for the kick ability, and Captor_Of_Gollum. i believe these unit variables are kind of self explanatory.

now how it works,
the ability "GetGollum" can only be cast on suicidal units, this way you cannot cast it on any other unit but gollum if you set gollum to be the only suicidal unit. of course you can change this to any other filter condition.
if the get gollum ability is casted we move gollum outside the map, yes, outside of the entire map. now we select a dummy gollum for the owner of gollum. this dummy gollum is needed to make gollum able to use his "kick" ability. one problem of this is if the owner of gollum selects some other unit, you most likely have to either force the player to re-select the dummy if he does so or have the dummy be a hero unit thus showing an interface icon on the left side of the screen, up to you.
the captor will be given a "Gollum" item and saved inside a variable.

if gollum uses his "kick" ability we calculate the chance that his kick is successful (set this to anything you like) and if it is we move gollum to the position of the captor unit, remove the item from the captor and deselect the dummy.

if the item "Gollum" is dropped we remove it, move the "Gollum" unit instantly to the position of the dropped item and deselect the dummy as well.

if you are curious why i used "SetUnitX/Y" instead of moving the unit via GUI there is a simple explanation, setUnitX does not check for pathing. moving a unit outside the map is not possible because the area outside the map is not pathable but with setUnitX it works pretty damn well.

the triggers work as following:
Trigger:
  • GetGollumAbility
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to #Get Gollum
    • Actions
      • Custom script: call SetUnitX(udg_Gollum, 9000)
      • Custom script: call SetUnitY(udg_Gollum, 9000)
      • Selection - Select Gollum_Dummy for (Owner of Gollum)
      • Set Captor_Of_Gollum = (Triggering unit)
      • Hero - Create Gollum and give it to Captor_Of_Gollum

Trigger:
  • KickAbility
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to #Kick
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 50
        • Then - Actions
          • Set Temp_Point = (Position of Captor_Of_Gollum)
          • Custom script: call SetUnitX( udg_Gollum , GetLocationX( udg_Temp_Point ) )
          • Custom script: call SetUnitY( udg_Gollum , GetLocationY( udg_Temp_Point ) )
          • Custom script: call RemoveLocation (udg_Temp_Point)
          • Selection - Select Gollum for (Owner of Gollum)
          • Item - Remove (Item carried by Captor_Of_Gollum of type Gollum)
          • Set Captor_Of_Gollum = No unit
        • Else - Actions

Trigger:
  • DropGollum
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Gollum
    • Actions
      • Wait 0.00 seconds
      • Set Temp_Point = (Position of (Item being manipulated))
      • Custom script: call SetUnitX( udg_Gollum , GetLocationX( udg_Temp_Point ) )
      • Custom script: call SetUnitY( udg_Gollum , GetLocationY( udg_Temp_Point ) )
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Selection - Select Gollum for (Owner of Gollum)
      • Item - Remove (Item being manipulated)
      • Set Captor_Of_Gollum = No unit


here you go, good luck.
 

Attachments

  • [Z]GollumKickingHisCaptor.w3x
    14.6 KB · Views: 207

decored

New Member
Reaction score
3
I think this can be done.
1. Store the hp,mp,and necessary attributes when you capture the golem
2.Remove the golem when the spell CAPTURE triggers using Remove Unit
3.Give the triggering heroo an item
4.On activating the item trigger it using
create 1 golem for triggering unit at position og triggering unit
set attributes of golem to the values stored
 

Astal

New Member
Reaction score
1
here it is, with attached demo map.

consists of 3 triggers, 2 abilities and 1 item.

i used 3 variables, Gollum, a Gollum_Dummy <- this unit is needed for the kick ability, and Captor_Of_Gollum. i believe these unit variables are kind of self explanatory.

now how it works,
the ability "GetGollum" can only be cast on suicidal units, this way you cannot cast it on any other unit but gollum if you set gollum to be the only suicidal unit. of course you can change this to any other filter condition.
if the get gollum ability is casted we move gollum outside the map, yes, outside of the entire map. now we select a dummy gollum for the owner of gollum. this dummy gollum is needed to make gollum able to use his "kick" ability. one problem of this is if the owner of gollum selects some other unit, you most likely have to either force the player to re-select the dummy if he does so or have the dummy be a hero unit thus showing an interface icon on the left side of the screen, up to you.
the captor will be given a "Gollum" item and saved inside a variable.

if gollum uses his "kick" ability we calculate the chance that his kick is successful (set this to anything you like) and if it is we move gollum to the position of the captor unit, remove the item from the captor and deselect the dummy.

if the item "Gollum" is dropped we remove it, move the "Gollum" unit instantly to the position of the dropped item and deselect the dummy as well.

if you are curious why i used "SetUnitX/Y" instead of moving the unit via GUI there is a simple explanation, setUnitX does not check for pathing. moving a unit outside the map is not possible because the area outside the map is not pathable but with setUnitX it works pretty damn well.

the triggers work as following:
Trigger:
  • GetGollumAbility
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to #Get Gollum
    • Actions
      • Custom script: call SetUnitX(udg_Gollum, 9000)
      • Custom script: call SetUnitY(udg_Gollum, 9000)
      • Selection - Select Gollum_Dummy for (Owner of Gollum)
      • Set Captor_Of_Gollum = (Triggering unit)
      • Hero - Create Gollum and give it to Captor_Of_Gollum

Trigger:
  • KickAbility
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to #Kick
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 50
        • Then - Actions
          • Set Temp_Point = (Position of Captor_Of_Gollum)
          • Custom script: call SetUnitX( udg_Gollum , GetLocationX( udg_Temp_Point ) )
          • Custom script: call SetUnitY( udg_Gollum , GetLocationY( udg_Temp_Point ) )
          • Custom script: call RemoveLocation (udg_Temp_Point)
          • Selection - Select Gollum for (Owner of Gollum)
          • Item - Remove (Item carried by Captor_Of_Gollum of type Gollum)
          • Set Captor_Of_Gollum = No unit
        • Else - Actions

Trigger:
  • DropGollum
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Gollum
    • Actions
      • Wait 0.00 seconds
      • Set Temp_Point = (Position of (Item being manipulated))
      • Custom script: call SetUnitX( udg_Gollum , GetLocationX( udg_Temp_Point ) )
      • Custom script: call SetUnitY( udg_Gollum , GetLocationY( udg_Temp_Point ) )
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Selection - Select Gollum for (Owner of Gollum)
      • Item - Remove (Item being manipulated)
      • Set Captor_Of_Gollum = No unit


here you go, good luck.

Thank you friend. I cant get it working :( in my map


When i capture gollum it spawns another one across the map

ok i removed
Trigger:
  • Custom script: call SetUnitX(udg_Gollum, 9000)
    • Custom script: call SetUnitY(udg_Gollum, 9000)


and the 2nd gollum no longer spawns but he doesnt disappear when i capture him
 

Moridin

Snow Leopard
Reaction score
144
Accname what about the timing? :S The person doesn't capture the gollum forever does he?

...which will take an enemy unit and convert it in to an item in the casting units inventory for X amount of time or until the player dies.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
i cant believe that will be this hard. create a timer and when it expires force the captor either to drop the item (this way my trigger would do the rest) or just do it the way i did in the other triggers.

i am not trying to make the map for him but to show him a way how to make it. he is still doing all the details.
 

Astal

New Member
Reaction score
1
i cant believe that will be this hard. create a timer and when it expires force the captor either to drop the item (this way my trigger would do the rest) or just do it the way i did in the other triggers.

i am not trying to make the map for him but to show him a way how to make it. he is still doing all the details.

i figured it out, u store gollum in a non accessable area of the map while hes captured right?

Yes he captures gollum until he is killed or gollum kicks out.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
yes, its stored outside the entire map. i used the location (9000/9000) a point far beyond the map bounds.
 

Astal

New Member
Reaction score
1
yes, its stored outside the entire map. i used the location (9000/9000) a point far beyond the map bounds.

k thats why it put it in my map area lol mine is bigger.

Hey since your helping me, could you help me with 1-2 more things.

My revive timer windows dont go away

Trigger:
  • Revive Hero Timer
    • Events
      • Time - ReviveTimers[1] expires
      • Time - ReviveTimers[2] expires
      • Time - ReviveTimers[3] expires
      • Time - ReviveTimers[4] expires
      • Time - ReviveTimers[5] expires
      • Time - ReviveTimers[6] expires
      • Time - ReviveTimers[8] expires
      • Time - ReviveTimers[9] expires
      • Time - ReviveTimers[10] expires
      • Time - ReviveTimers[11] expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in RevivableHeroes and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Remaining time for ReviveTimers[(Player number of (Owner of (Picked unit)))]) Less than 1.00
            • Then - Actions
              • Countdown Timer - Destroy Game_TimeLimit_Timer_Window
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) is in PlayersRangers) Equal to True
                • Then - Actions
                  • Hero - Instantly revive (Picked unit) at (Center of Rangers Spawn &lt;gen&gt;), Show revival graphics
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Owner of (Picked unit)) is in PlayersOrcs) Equal to True
                    • Then - Actions
                      • Hero - Instantly revive (Picked unit) at (Center of Orc Trackers Spawn &lt;gen&gt;), Show revival graphics
                    • Else - Actions
                      • Hero - Instantly revive (Picked unit) at (Center of Gollum Spawn 1 &lt;gen&gt;), Show revival graphics
            • Else - Actions



That is the code

There is no destroy the window code there i know. How can i make it destroy the window when its in an array. It should be

Trigger:
  • Countdown Timer - Destroy RevivableTimersWindows[Index]


I dont know how to get it to destroy the respective timer for each player.


Or do i have to do an If for each player?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top