The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Probability
Author Message
larmc20
Journeyman
*

Posts: 67
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: May 2013
Reputation: 0



Post: #1
Probability
Hello Guys.

I'd like to know how to add a probability for an iten to appear on a loot.

For Example:

I've got Balron Loot

PHP Code:
[TEMPLATE loot_BALRON]
CATEGORY=Item Templates
SUBSECTION
=Monster Loot Templates
DESCRIPTION
=Balron
CONTAINER
=i_backpack
ITEM
=random_potion,{ 2 3 }
ITEM=random_potion,{ 2 3 }
ITEM=ttm_lvl5,R99
ITEM
=random_scroll,{ 2 3 }
ITEM=random_reagent,{ 4 6 }
ITEM=random_reagent,{ 4 6 }
ITEM=random_magic_wands
ITEM
=random_magic_wands
ITEM
=i_scroll_blank,{ 1 2 }
ITEM=random_magic_sword
ITEM
=i_gold,{800 1200

If I want to add an iten with 10% of chance to appear I know it making an spawn with 9 normal balrons and 1 with the iten. So in the game I make a respawn with this spawn spanwing one balron at time...

Is there a Easier way to do that working on the loot script?
12-22-2013 08:02 AM
Find all posts by this user Like Post Quote this message in a reply
Crusader
Master
**

Posts: 254
Likes Given: 7
Likes Received: 19 in 12 posts
Joined: Apr 2012
Reputation: 6

Erehwon New Hera

Post: #2
RE: Probability
ITEM=id_of_the_item,R90 // as far as i know should mean that 10% of time it will drop id_of_the_item
12-22-2013 08:35 AM
Find all posts by this user Like Post Quote this message in a reply
amonvangrell
Banned

Posts: 337
Likes Given: 17
Likes Received: 32 in 20 posts
Joined: Aug 2012

britannia shard

Post: #3
RE: Probability
You should read the tutorial it has what you are asking well explained.
http://wiki.sphere.torfo.org/index.php/Chapter_1

Code:
There are two types of random selectors: weighted random and ranged random. Weighted random makes a statement like this: "Ok, 1 out of 10 times pick Number A, 3 out of 10 times pick Number B, and 6 out of 10 times pick number C". Ranged random makes a statement like this: "Pick any number between the two numbers I give you".

then
Code:
{ random_food 1 0 3} - This tells SPHERE, "Ok, 1 out of four times, I want you to pick random_food, and 3 out of four times, I want you to pick zero." You can even have random sets within random sets.

or
Code:
ITEM=i_sword_long,R11 - R11 means "one out of 11 chance of finding this item

better read the tutorial.

cya
12-22-2013 08:43 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
larmc20
Journeyman
*

Posts: 67
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: May 2013
Reputation: 0



Post: #4
RE: Probability
Thank so much
12-23-2013 01:12 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)