Jump to content

[guide]Making Neutral Creeps Dropping Certain Items


Recommended Posts

You can do it in triggers:

 

Create 2 variables:

1.) Item-Type Variable Array

2.) Integer Variable Array

 

Create 2 triggers:

1.) Initialization

2,) Drop Item

 

The trigger for the initialization:

 

Hostile Drop Item Initialization
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        -------- Items --------
        Set Item[1] = (Random level 1 Any Class item-type)
        Set Item[2] = (Random level 3 Any Class item-type)
        Set Item[6] = (Random level 8 Any Class item-type)
        -------- Creep Level --------
        Set Creep_Level[1] = 2
        Set Creep_Level[2] = 3
        Set Creep_Level[1] = 6

 

 

Set Item[1] = (Random level 1 Any Class item-type)

 

As you can see, I chose Random Level 1, Any Class Item-Type so it drops any level 1 item. (Permanent,charged,etc.)

 

Set Creep_Level[1] = 2

 

That's the creep level, I assigned it to level 2.

 

For the Drop Item Trigger now:

 

Hostile Drop Item
    Events
        Unit - A unit Dies
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of (Dying unit)) Equal to Creep_Level[1]
                (Random integer number between 1 and 100) Equal to 80
            Then - Actions
                Item - Create Item[1] at (Position of (Dying unit))
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of (Dying unit)) Equal to Creep_Level[2]
                        (Random integer number between 1 and 100) Equal to 55
                    Then - Actions
                        Item - Create Item[2] at (Position of (Dying unit))
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Level of (Dying unit)) Equal to Creep_Level[3]
                                (Random integer number between 1 and 100) Equal to 25
                            Then - Actions
                                Item - Create Item[3] at (Position of (Dying unit))
                            Else - Actions

 

 

(Level of (Dying unit)) Equal to Creep_Level[1]

 

That's the level of the creep.

 

(Random integer number between 1 and 100) Equal to 25

 

It's the item drop percentage. I assigned it to 25%.

 

Item - Create Item[3] at (Position of (Dying unit))

 

That's the create Item.

 

Hope this helps.

 

 

Credits to : Atreyu

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...