Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Scripting for item drops?


Valecrier
 Share

Recommended Posts

Alright, so I've started my RPG, made some NPC's, maps, classes, etc…

But I've run into a kind of problem ><

Here's what I'm looking for:

Let's say you kill a monster, and he drops a level 1 sword.

Is there any way to make it so that sword has a random chance of spawning different stats?

For example, it could have:

+1 Strength
+10 Health

or like:

+5 Strength
+10 MP

That kind of thing...I would like it to be randomized...Both the value of each stat and the number of stats on the item would be awesome :D...Haven't seen a help topic yet that shows how to do it...

Also, if this is possible, is it also possible to make higher stats less likely to "spawn" on the item?

For example:

+1 Strength = 50% chance
+2 Strength = 10% chance
+5 Strength = 1% chance

That type of thing.

ALSO!

Is it possible to have multiple items drop from only 1 monster?

Thanks in advance...If there is a thread that answers either or both of these questions, lmk :D

Any info on either or both of these questions is greatly appreciated :)

I was told to check out scripting section for help with this...Thanks again in advance guys :)
Link to comment
Share on other sites

  • 3 months later...
I'm definiately no expert in Sadscript but I'd say that's hard since items needs to be created. I'd say you need to do a source edit. An idea that might get your mind going is that all you create are "blank" item, iow items with no bonuses.

You need to go to the Item creation form in VB and see how an item is created and how it is read, then you need to check the GameLogic(I think gamelogic, wouldn't fit anywhere else ;)) and see what happens on NPC drop. You could then add an If statement under NPCdrop saying like If "RANDOM = 1 Then" Then you make a new clickbox in NPC creations that, if it's checked sets "RANDOM = 1". That way you can decide if you want to have the drops generate random stats.

Btw when you check the Itemcreation you will see how it adds stats to an item.

And finally you need the NPCdrop function to make the variable in an order. Let's say you decide that items 500-5000 are random items, then you need to tell the NPC drop to create a new item over 500 and after the last item created. And this is the complicated part, you also want it to check if a copy has been created before. Let's say player 1 get a magical chicken adding + 1 STR, then player 542 comes and get the exact same item you don't want that item to be created on the same spot you want it to check if the item has been created before.

This is no tutorial, resource or anything like it, just ideas on how you could fix it.

/ Elen
Link to comment
Share on other sites

Am I A idiot or am I AN idiot? Which do you prefer?

When calling someone an idiot you imply that they're stupid.

I do not like being called an idiot, or stupid, when it's uncalled for. If you'd like you can also try and explain just how my previous post makes me an idiot and how it is necroposting. If you can explain it well I might admit that my post was necro or even stupid, I'll gladly admit that I'm wrong if someone can explain why.

If you can't explain that or provide valid grounds for that statement I suggest that you ponder it for awhile, come back with something meaningful to say and then call me an idiot.

/ Elen
Link to comment
Share on other sites

Elen, I think you should [read the rules](http://www.touchofdeathforums.com/smf/index.php/topic,12941.0.html).

If you were able to comprehend the rules, you would have understood the concept of necroposting, and your intelligence would not have been questioned.

But since you do not understand the concept of necroposting (seeing as it needs to be explained to you), allow me to point you in the right direction:
@Godlordess:

> 9\. No necroposting
>
> Necro posting is not allowed. Leave old topics alone. Necroposting is posting in a topic which is older than 1 month.

If you look under the Title of the post, you will see a date; if you do not know what dates are, I'd suggest you google them.

The date on the OP's post, says: April 02, 2009, 08:55:38 PM

If you do the math, this topic is almost **4 months old** since it's last reply, hence a **necropost**.

Your intelligence was questioned, because it was assumed you could not grasp the concept of necroposting – your recent post proved this, as you asked how your post was a necropost -- or even worse, you weren't able to understand the Gregorian calendar system!

I hope I was able to accurately explain this to you as you requested.

Tipsta, please note that there was no need to flame.
Link to comment
Share on other sites

it's actually… an interesting concept for people who like to script to do... depending on whether or not you want the item to drop on the ground, or appear in the person's inventory... either way, you don't need to source it, so long as you actually create them manually(/edititem)... either way, i could do it and share it with the community, although it's not really all that needed as most of the people that would use know how to do it.

PS- Yes i know this topic was created in April. However, if you guys are just going to call out NECRO!! when someone does something like this: NEWS FLASH!!!!! You don't need to post, just report the post to a moderator.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...