View Full Version : Give Item to Unit/Hero
Zunariel
08-15-2012, 11:46 PM
I created a trigger where I simply want to give an item to a dummyunit, but it doesnt work
I create a random item (it works)
Then give Last Created Item to Last Created Unit
And it doesnt work
Can anyone tell me when the "Give Item to Hero" Action doesn´t work.
Mouse1234
08-16-2012, 12:05 AM
Can I see whats ur Event because I think its the Last Created Unit the error here...
The_blood
08-16-2012, 12:35 AM
show the whole trigger u made
claptomanic
08-16-2012, 12:46 AM
just wondering why you wanna give a dummy an item Oo would be nice if you would say why ^^
baassee
08-16-2012, 01:47 AM
I wonder if the dummy even have an inventory ^^
defskull
08-16-2012, 07:18 AM
just wondering why you wanna give a dummy an item Oo would be nice if you would say why ^^
Some abilities cannot be directly accessed by GUI functions, such as Wand of Illusion ability.
There's a big chance that the thread starter wants to give the item to the dummy and order it to use that item to a unit.
There is a function directly for that, call IssueTargetOrderById(whichUnit, integerOrder, whichTarget)
Which if he wants to order the dummy to use Wand of Illusion base ability, the integerOrder would be '852274'
I wonder if the dummy even have an inventory ^^
Haha this could be the problem too !
But we as claptomaniac stated, why do you need to give item to dummy in the first place ?
If you tell us what you want to achieve, there could be simpler ways
edo494
08-16-2012, 08:22 AM
to not be confused, its 852274, '852274' is damn big in Jass(would calculated that but im not on computer)
defskull
08-16-2012, 10:08 AM
Ah sorry about the ' '.
Yes, it should be just 852274, no ' ' involve.
' ' exist when the ID is converted to letter, such as Aloc, Abun, Avul, etc.
Like if you want to add ability to a unit;
call UnitAddAbility(udg_Caster, 'Aloc')
You cannot write just Aloc, it will return as null value.
Zunariel
08-16-2012, 10:57 AM
NPC Loot Death
Events
Unit - A unit Dies
Conditions
And - All (Conditions) are true
Conditions
((Owner of (Killing unit)) is an enemy of (Owner of (Dying unit))) Equal to True
Or - Any (Conditions) are true
Conditions
(Owner of (Triggering unit)) Equal to Player 11 (Dark Green)
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
Actions
Set NPCDeadUnitType = (Unit-type of (Triggering unit))
Set NPCDeathFacing = (Facing of (Triggering unit))
Set TempPoint = (Position of (Triggering unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) is A Hero) Equal to True
Then - Actions
Set TempInteg = (Hero level of (Triggering unit))
Else - Actions
Set TempInteg = (Level of (Triggering unit))
Unit - Create 1 Loot for Player 10 (Light Blue) at TempPoint facing NPCDeathFacing degrees
Unit - Turn collision for (Last created unit) Off
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Killing unit)) is in PlayerGroupAlliance) Equal to True
Then - Actions
Unit - Change ownership of (Last created unit) to Player 9 (Gray) and Change color
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Killing unit)) is in PlayerGroupHorde) Equal to True
Then - Actions
Unit - Change ownership of (Last created unit) to Player 10 (Light Blue) and Change color
Else - Actions
Unit Group - Add (Last created unit) to NPCLootDeathGroup
Unit - Add a 60.00 second Generic expiration timer to (Last created unit)
Set LootUnit = (Last created unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Dying unit) is A Hero) Equal to False
Then - Actions
Set LootEvent = 1.00
Set LootEvent = 0.00
Else - Actions
Set LootEvent = 10.00
Set LootEvent = 0.00
NPC LootEvent
Events
Game - LootEvent becomes Equal to 1.00
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
TempInteg Greater than 0
TempInteg Less than or equal to 4
Then - Actions
Set LootLevel = 1
Else - Actions
Set LootEvent = 2.00
Set LootEvent = 0.00
Game - LootEvent becomes Equal to 2.00
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
Set NPCLootSearcher = (Random real number between 0.00 and 200.00)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
NPCLootSearcher Less than or equal to 200.00
Then - Actions
Item - Create (Item-type of (Random item in ItemsNormalRect[LootLevel])) at (Center of (Playable map area))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
NPCLootSearcher Greater than 20.00
NPCLootSearcher Less than or equal to 30.00
Then - Actions
Item - Create (Item-type of (Random item in ItemsRareRect[LootLevel])) at (Center of (Playable map area))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
NPCLootSearcher Greater than 30.00
NPCLootSearcher Less than or equal to 35.00
Then - Actions
Item - Create (Item-type of (Random item in ItemsSuperRareRect[LootLevel])) at (Center of (Playable map area))
Else - Actions
Hero - Give (Last created item) to LootUnit
Else - Actions
Ok I am creating an ORPG and I created a system where, when you kill a NPC unit at its Corpse a chest appears this is the "LootUnit", this LootUnit has an inventory with 6 spaces.
When the Lootunit appeared you can use a lootability on the unit, then a Multiboard pops up and shows the Items in it again, with the arrow keys up and down you can switch your selection between the items and with the right arrow key you can confirm your decision.
My problem is that the Item is created but the Lootunit doesnt get it.
The unit is unable to move, not invulnerable and cannot attack.
Zunariel
08-17-2012, 09:16 AM
Ha I know what my mistake was the items I wanted to transfer where set to "Use when picked up" so they couldnt be picked up by the Dummy unit.
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.
Search Engine Optimization by
vBSEO 3.5.1 PL2