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-nmm7 (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-nmm7 (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-nmm7 (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
Random Rares
Author Message
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #1
Random Rares
Inspiration for this one came from this thread : Weird Timer Issue

This script will:

Periodically place rare NPCs in random locations on the map.
Periodically place locked loot chests in random locations on the map. (Players will have to pick the locks)

No gembits used so issues with sector sleep preventing generation of rares.
Completely random map locations (or as random as it can be)
Will not spawn on water, in town, on rock or underground (dungeons, indoors)

NPCs will remain in the wild until they are killed/die or in the case of animals and mounts, are tamed.

Chests will remain in the world for a minimum of 3 days and not longer than the period set for the next chest to spawn. (through natural decay)
Chests can be made non moveable so players must pick them at their location, alternatively players can be allowed to move the chests which will negate their timers allowing them to pick the lock at their leisure.

Both the NPCs and the chests/templates used by this system are fully configurable to suit your server.

It's actually stupidly simple.

Random Rares

[Image: 2nis46r.jpg]
(This post was last modified: 09-02-2013 12:05 PM by Mordaunt.)
09-02-2013 11:53 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
dagger4k
Journeyman
*

Posts: 194
Likes Given: 1
Likes Received: 12 in 12 posts
Joined: Mar 2012
Reputation: 0



Post: #2
RE: Random Rares
Very nice and simple Smile Any chance you can incorporate a ## of chests / npcs to spawn in the world? I'm saying this as I played a server where chests would randomly appear around the map containing items. This would actually encourage players to run around the map and not just sit in britain etc.
09-03-2013 12:51 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #3
RE: Random Rares
Yes I can, and yes I just did. version 1.1 now available.
Also fixed chest more2 values.

[Image: 2nis46r.jpg]
(This post was last modified: 09-03-2013 04:34 AM by Mordaunt.)
09-03-2013 03:44 AM
Visit this user's website 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: #4
RE: Random Rares
this is amazing, its the type of thing that are always welcome. thank you chief! ;]
09-03-2013 06:51 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
dagger4k
Journeyman
*

Posts: 194
Likes Given: 1
Likes Received: 12 in 12 posts
Joined: Mar 2012
Reputation: 0



Post: #5
RE: Random Rares
very nice Smile
09-03-2013 05:26 PM
Find all posts by this user Like Post Quote this message in a reply
Rattlehead
Master
**

Posts: 290
Likes Given: 3
Likes Received: 8 in 6 posts
Joined: Jun 2012
Reputation: 8



Post: #6
RE: Random Rares
how about this:

PHP Code:
[Function f_rare_npcspawn//special mounts or special mobs to kill are all good in here.
DORAND 10   //add your NPCs after this and change the number to match how many lines are inside the DORAND
    
serv.newnpc c_a_mustang_black
    serv
.newnpc c_a_mustang_roan
    serv
.newnpc c_a_mustang_crimson
    serv
.newnpc c_a_mustang_grey
    serv
.newnpc c_a_mustang_chocolate
    serv
.newnpc c_a_mustang_redroan
    serv
.newnpc c_a_mustang_pamamino
    serv
.newnpc c_a_mustang_sky
    serv
.newnpc c_a_mustang_skygray
    serv
.newnpc c_a_mustang_wimmimate
ENDDO
NEW.timerf <somereallylongnumberhere>,f_ridspawn
NEW.<dlocal.x>, <dlocal.y>
NEW.
FIX
serv
.log Rare <new.nameSpawned @ <dlocal.x>,<dlocal.y>


[FUNCTION 
f_ridspawn]
if (
0<findlayer.30.link> == 0)
REMOVE
endif 
clear any spawns out that didnt have a master yet Wink better than nothing lol

[Image: matts_siggy.gif]
09-03-2013 06:20 PM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #7
RE: Random Rares
Well sure, I could've done that, but I was assuming people would put rare mobs to kill and stuff in there too, which would never get a master. So I didn't bother with a remove thing on purpose. Mustangs were put in there just for testing. Tongue

[Image: 2nis46r.jpg]
09-03-2013 08:39 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #8
RE: Random Rares
v1.2: Because Rattlehead got me second guessing my decision not to remove NPCs spawned with a timer. Damn you Rattlehead! lol

ADDED: Timer to remove "untamed" rares NPC between 3 and <npc_spawn>+1 days after spawning with def to enable this new option.

You can still put any NPC you want in here, the check will prevent any mounts or animals from being removed if they have been tamed. Anything not tamed or special monsters that were added for players to kill will despawn when their timer expires, if this option is enabled. Should keep things interesting at any rate.

ADJUSTED: Decay timer for chests to allow upper limit of <chest_spawn>+1 to allow a little overlap, reducing chance of zero chests remaining in the world.

[Image: 2nis46r.jpg]
09-03-2013 11:51 PM
Visit this user's website 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: #9
RE: Random Rares
and its getting better and better! thx!
09-04-2013 06:51 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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