• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] Item Removal System

Status
Not open for further replies.
Level 23
Joined
Apr 16, 2012
Messages
4,041
JASS:
library CleanItems initializer onInit
    globals
        private constant real TIMEOUT = 1800
        //time for the system to clean up every TIMEOUT seconds from the map start
    endglobals

    private function enum takes nothing returns nothing
        call RemoveItem(GetEnumItem())
    endfunction

    private function cleanItems takes nothing returns boolean
        call EnumItemsInRect(GetWorldBounds(), null, function enum)
        return false
    endfunction

    private function onInit takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterTimerEvent(t, TIMEOUT, true)
        call TriggerAddCondition(t, Condition(function cleanItems))
        set  t = null
    endfunction
endlibrary
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
If you apply something like this and if the map has item drops on the ground, it might sometimes remove the loot dropped by a mob.

You could run a timer everytime an item is dropped and save the item as a variable. Then simply use a periodic trigger which loops through all timers and checks if any has ended and then remove the item if so.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Hey I have looked on google and all over this site but in curse of time ORPG they have an item removal system that every 30 minutes it cleans the map of all items how could I add that to my map without millions of actions in a few triggers?

i guess its a bad idea if u want do this way because then same time will be removed the fresh droped item and the 29min old item
 
Level 7
Joined
Aug 15, 2012
Messages
318
i guess its a bad idea if u want do this way because then same time will be removed the fresh droped item and the 29min old item

I realize it could be an inconvenience but I could add a timer so that people know when the items will be removed so they dont kill the boss that drops good items till timer is down or they dont drop items they need
 
Status
Not open for further replies.
Top