Item Groups... Is this possible?

Rad

...
Reaction score
224
Ok for my RPG Im going to use the WoW item settings, where a wolf drops a wolf pelt that can be used to sell or make a fur coat or something (Kind of like Dark Lineage) The only problem I have with that, is I want units to respawn. Is it possible to add an item group to a unit when u create it like a creep? Also would Player 12 (Brown) be able to drop items when his units die? (Hes the hostile player) If you cant add item systems im going to revert to triggers, I can do it without item groups but if i could it would be MUCH easier on me :D
 
I don't know what krakka was talking about but, you can't edit spoils from the object editor.
 
I didnt think so... Though that would be very nice if they had that option in stats or an ability like Items Dropped on Death that use an item set from item tables :)
 
Create a trigger for every kind of item-pool that you want the unit to drop
Something like this
Code:
Wolf item on dying
Event
    None
Condition
    None
Actions
    Set iRand = (Random integer number between 1 and 100)
    If (iRand Less than 10) Then
            Skip remaining actions
    If (iRand Less than 25) Then
            Item - Create "Spoiled wolf pelt" at (Position of (Dying unit))
        Else - Actions
            Item - Create "Wolf pelt" at (Position of (Dying unit))
Then whenever you create a wolf add this code
Code:
Create 1 Wolf fr blah blah
Trigger - Add to (Wolf item on dying) the event (Unit - (Last created unit) Dies)
I'm sure it can be done easier with Itempools, but I don't know how to use it
I hope this helps
 
I sorta scanned thru this one, but are you trying to be able to hold like 5 rings in a slot? So you could basically have an assassin set in one slot and have free inventory slots for other things? well i have a map that lets you do just that, its called enfos hero builder TS or something. its pretty fun, you should give it a whirl. :D

for some reason i couldnt attatch it, so maybe theres a different way i could get it to you?
 
If you want to use the item tables you've set up with Advanced > Item Tables with units you've created via triggers, you can do that, but you need some Jass. Specifically, this needs to go in your custom script section:
Code:
function AddItemDropTable takes code aFunction returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterUnitEvent( t, bj_lastCreatedUnit, EVENT_UNIT_DEATH )
    call TriggerRegisterUnitEvent( t, bj_lastCreatedUnit, EVENT_UNIT_CHANGE_OWNER )
    call TriggerAddAction( t, aFunction )
    set t = null
endfunction
Before you can use that you need to find the function names of the item groups. You can do that by going into the terrain editor and choosing File > Export Script. In the resulting file, look for the "Map Item Tables" section and see if you can find the function for that item table (it will be something like "ItemTable000000_DropItems"). When you have it, you'll do something like this in triggers:
Code:
Actions
    Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
    Custom script:   call AddItemDropTable( function ItemTable000000_DropItems )
This won't work if you make more than one unit at a time.
 
Why are you guys making it as complex as possible?


No need of adding events or creating one new trigger per every new unit.
If some units not should drop Items (even if there type is represented) I suggest adding a condition that when there custom vaule is something else than 0 the do not drop items and then change there custom vaule when the are no drop creeps.
Code:
    Events
        Unit - A unit Dies
    Conditions
        // Some conditions may be quit great to have
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Dying unit)) Equal to Green Drake
                // If it is a Green Drake then it is...
            Then - 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 51
                        // ...50 % chanse to create one Health Stone 
                    Then - Actions
                        Item - Create Health Stone at (Position of (Dying unit))
                        Skip remaining actions
                    Else - 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 51
                        // ...25 % chanse to create one Crown of Kings, but it can never create both 
                    Then - Actions
                        Item - Create Crown of Kings +5 at (Position of (Dying unit))
                        Skip remaining actions
                    Else - Actions
                Skip remaining actions
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Dying unit)) Equal to Red Dragon
                // If it is a Red Dragon then it is...
            Then - 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 51
                        // ...50 % chanse to create one Mana Stone 
                    Then - Actions
                        Item - Create Mana Stone at (Position of (Dying unit))
                    Else - 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 51
                        // ...50 % chanse to create two Red Drake Eggs, and it can create both different items (25%) 
                    Then - Actions
                        Item - Create Red Drake Egg at (Position of (Dying unit))
                        Item - Create Red Drake Egg at (Position of (Dying unit))
                        Skip remaining actions
                    Else - Actions
                Skip remaining actions
            Else - Actions

I suggesting using a single variable insteed of a those (Random integer number between 1 and 100) as xPheRe does.

Eeh I know that that trigger may look horrible advanced for someone ^^ but it isnt, it is just that I have repeted the same lines some times.

And I have no idea how item drops is in WoW but this works like this:
(If you havnt figured out)

A unit dies, the triggers rusn until it finds that the unit-type is represented, and there is a percent chance that an item is created. Different chanse and items for different unit-types
 
phyrex1an said:
Why are you guys making it as complex as possible?
If Blizzard internally does item-tables this way is for something
Anyhow, your trigger looks good too. ;)
Easier but not as customizable as Blizzard's one
 
Hmm, yea actualy I had no idea about those Item tables functions before :( .
I looked at them now and the seem fine for me. With that I meen that I only can se two problems ^^

1. Many persons have a fear for using jass, dunno why. It is both easier and better.

2. I may missunderstand the script but do u realy want a item to drop if a neutral hostile unit changes owner? Easy fixed for those who knows jass but for those who doenst :confused: .

Also if you have alot of units on the map the same time that should drop items, is it good to have one trigger for each? Never tested so I dont know the answer.

Last note if you are using Heptameron's function:
Code:
local t = CreateTrigger()
Code:
local trigger t = CreateTrigger()
^^


My suggestion is to use the jass version and scrap mine if you arnt afraid of jass.
 
Lol guys I already know how to do triggers but if I cant add an item table to a spawn then I would have to make so many if/then/else, which isnt a problem. I dont know JASS so I'm not even gonna try that but I got an easy way to do random drops... Its just really long :(
 
phyrex1an said:
2. I may missunderstand the script but do u realy want a item to drop if a neutral hostile unit changes owner? Easy fixed for those who knows jass but for those who doenst :confused: .
If you look at the code generated for these drop functions, they have special code that takes care of the "changes owner" event. I'm not totally sure why it's there... probably for taking over things like not dropping if the unit is Charmed, say. You wouldn't want to have to kill it to get the item. ;)

phyrex1an said:
Also if you have alot of units on the map the same time that should drop items, is it good to have one trigger for each? Never tested so I dont know the answer.
It would probably work with only one trigger per table, but that's a bit more complicated for a Jass newbie. ;)

phyrex1an said:
Last note if you are using Heptameron's function:
Code:
local t = CreateTrigger()
Code:
local trigger t = CreateTrigger()
^^
Good catch. ;)
 
Probably for taking over things like not dropping if the unit is Charmed, say. You wouldn't want to have to kill it to get the item.

Omg thanks for reminding me the Marksman is able to tame a creature (Kind of like WoW and about every other MMORPG (probrably guild wars to)) and if you tame a creature but you needed the item it drops the game would be screwed :s So you just gave me a great idea! I give every creep a 1 slot inventory, then i edit the preset ones and make them drop all the items on death, then on respawn randomly generate an item :). Only thing i gotta do is edit the game constants to see enemy inventories so thanks for giving me an idea unintentionaly :rolleyes:
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Bot readable, not human usable.
  • The Helper The Helper:
    got it
  • The Helper The Helper:
    Happy Thursday!
  • The Helper The Helper:
    Check out the new Featured Content feature we apparently got with the forum software upgrade! https://www.thehelper.net/featured/
  • The Helper The Helper:
    Also on the bottom right side bar we now have a Trending Content Box!
    +1
  • The Helper The Helper:
    Not on the Headline News page just on the Forums page can we get that Featured and Trending on the home page?
  • Ghan Ghan:
    Since the home page is technically a forum, it now shows on all forum views. Still in the sidebar.
    +1
  • The Helper The Helper:
    Happy Friday! Hope everyone has a fantastic day and an even better weekend!
  • The Helper The Helper:
    Happy Sunday!
  • The Helper The Helper:
    I lovc that I can post webp and X links now! :)
  • The Helper The Helper:
    Happy Thursday!
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    we were down for a minute - think a log file or something got too big
    +1
  • Ghan Ghan:
    The alerts say it was down for a while unfortunately.
  • Ghan Ghan:
    Didn't know what was going on while I was at work.
  • Ghan Ghan:
    Disk filled up with logs. Fixed now.
    +1
  • The Helper The Helper:
    not a problem at all thanks for getting us back up
  • The Helper The Helper:
    I think the bots are finding a way to get through the anubis
  • The Helper The Helper:
    Happy Wednesday Everyone! Hope everyone has a Fantastic Day!
    +1
  • The Helper The Helper:
    Yeah, stats are showing big bot influx like 12k page views.
  • Wizard Wizard:
    :wave:
    +1
  • Ghan Ghan:
    TH changed his avatar again. 6 more weeks of summer.
    +3
  • Wizard Wizard:
    lol
    +1
  • The Helper The Helper:
    Guys just a heads up I am going to be shutting the site down soon. I am just waiting on the NUON people to decide whether they want to transfer forum data and keep the discord. My email is [email protected] for anyone that wants to keep in touch and I have a facebook too. I will make an official post later. Love you guys and will miss everyone!
    +1
  • V-SNES V-SNES:
    Sent a pm @The Helper

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top