HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Item dropping via triggers

01-29-2003, 10:41 AM#1
Dmonmonk
I need help with this..
How can i make a normal creep that was spawned via a trigger (ie create unit) drop an item (eg tome of experience)
any solution be useful plz don't say oh someone else has already posted this because i can't find it...
if possible be detailed telling me action by action, thnx in advance
01-29-2003, 12:53 PM#2
Krakou
Event:
Unit - A unit owned by Neutral Hostile dies
Cond:
no
Action:
Item Create <item> at (Position of (Triggering unit))
01-29-2003, 07:35 PM#3
Dmonmonk
thnx.
dammit though i forgot to add a few conditions...
firstly i want it to be dropped off a specific unit say an ogre lord
second i want the item to only have a random chance of dropping so 1-20
01-29-2003, 07:44 PM#4
DaKaN
---Moved---

Just a friendly reminder.

Do not post questions in the repository, that section is for working code you wish to share with others.
01-29-2003, 07:49 PM#5
Dmonmonk
sorry for double posting but this is what my trigger is atm
Event-
Unit owned by player 12 dies
Condition-
-NiL-
Action-

If [Units type of dying unit = murloc tiderunner] then do If [Random integer between 1-5 = 1] then create Tome of Exp Else If [Random integer between 1-20 = 20] then create Tome of Greater Exp else Do nothing Else Do nothing
thats basically one long trigger if you think i have to make several smaller triggers then plz break it up for me
thnx in advance
01-30-2003, 12:53 AM#6
Guest
Trigger name: drop item

--Events
----Unit: A unit owned by Player 12 (Brown) Dies
--Conditions
-----
--Actions
----Set random=(Random integer between 1 and 10)
----if (random Equal to 1) then do (Item - Create (Random level 1 item-type) at (Position of (Triggering unit)) else do (Do nothing)
----If ((Item-type of (Last created item)) Equal to Tome of Experience) then do (Item - Remove (Last created item)) else do (Do nothing)

That, from the "9 Blademasters" map, sounds parallel to what you're trying do. Just add under Conditions: "(Unit-type of (Triggering unit)) Equal to Ogre Lord" and I think it will work. Of course you can easily change the monster type from Ogre Lord to whatever and change the item that drops too.

As far as I know, that should get the job done. Let us know if you get it working. :D
01-30-2003, 12:57 AM#7
Guest
By the way, does your current trigger (the one with the Murloc Tiderunner) one work satisfactorially? Just reading through it, it seems like the coding should be working fine, although for simplicity I'd prefer to check the monster type as a condition and not an if() statement - that is, if indeed the way I suggested way works at all. But I have played the 9 Blademasters map, and items appear to be dropping fine, so the code should work...