ID:261633
 
mob verb Summon_Dragon() set category="DragonBall" switch(input("Summon Dragon", "What is your wish?", text) in list ("Wealth", "Power", "Trip to GM land", "Z Sword")) if("Wealth") if(usr.db>=6) usr<<"So be it, Money is what you may have..." usr.zenni+=650000 usr.db=0

now, if the db=7, i want all of there INVENTORY dragonballs to dissappear.
so, once you use the command, it deletes all of those dragonballs.
for(var/obj/dragonball/db in usr.contents)
del(db)
In response to Foomer
Wait, sorry, never mind.
I was thinking out of my ass :P
Thanks Foomer!
In response to Tamaka-san
">=6" will allow you to use it even with only 6.
In response to Garthor
Garthor wrote:
">=6" will allow you to use it even with only 6.

more then 6, 6+

RaeKwon
In response to RaeKwon
Greater than or equal to 6, ie: 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30.........
Here's the code my game uses for picking up DBs...

Get_Dragonball()
var/dbcount = 0
set category = "Misc"
set src in oview(1)
if (src.owner in usr.finishedquests || src.pickedup == 1)
usr.contents += src
src.pickedup = 1
usr << "<font color = blue><B>You have found a Dragon Ball!</font><P>"
for (var/obj/o in usr.contents)
if (istype(o,/obj/DBs))
dbcount += 1
if (dbcount == 7)
usr << "<font color = blue><B>You have found all 7 Dragon Balls! You can now summon the Eternal Dragon, Shenlong, to make your wish!</B></font><P>"
for (var/obj/DBs/o in usr.contents)
o.loc = null
usr.contents += new /obj/DBs/All_7
else
usr << "[src.deny]"


What this does is first check to see if you've completed the "owner" of that DB's task... If you have, then they let you pick it up... If not, then you can't get it and they give you a deny message...

If you are able to pick it up, it checks your inventory to count how many DBs you have... If it's 7, then all of them are taken away (not deleted, they're moved to null loc because if someone holding a DB logs out, that DB is moved back to its original location... so I wanted to keep them in the world instead of having to create new ones when a player logs out), and you're given a new object that represents all 7 of them (this object is what contains the verb that summons the Dragon)...

I have the verb perform this count fresh every time you pick a new DB up because if it were a var, it would be possible to pick up, drop, pick up, drop, etc the same ball until it reached 7 and that would fool it into thinking you actually got all 7... (I could override the Drop() command to decrement the variable, and that would take care of that, but there are other ways of losing a DB, and I didn't feel like adding "dbcount--" to every one of them... it just seemed easier to have the pick up proc perform the check every time it's called...)

Anyways, there's how I do it... But I doubt my code will fit into your game without some editing...