Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Random Spawn (new map)
Author Message
cele_35
Apprentice
*

Posts: 3
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: May 2019
Reputation: 0



Post: #1
Random Spawn (new map)
hi im write new quest system but I could not.. Random coordinate spawner and after 1 day will be delete.. how do i write ?

[function f_golden_monster]
local.x <Rxxx> //// ???
local.y <Rxxx> //// ???

serv.newnpc c_golden
new.p xxxx ///////////////// this problem ?
ref1=<new>
new.timerf 86400,remove
06-03-2019 07:53 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 860
Likes Given: 4
Likes Received: 202 in 166 posts
Joined: Jul 2012
Reputation: 6

Dimension Shard

Post: #2
RE: Random Spawn (new map)
try using this, I didn't tested it but it should work

Code:
[FUNCTION f_golden_monster]
SERV.NEWNPC c_golden
NEW.MoveToRandomLocation
NEW.TIMERF 86400,REMOVE

[FUNCTION MoveToRandomLocation]
FOR 1000
  ARGS=<R5000>,<R4000>,0,<P.M>
  IF (<SERV.MAP(<ARGS>).REGION>)
    P=<ARGS>
    IF !(<REGION.FLAGS> & region_flag_ship|region_flag_nobuilding|region_flag_underground|region_flag_safe​|region_flag_guarded)
      FIX    // move char to ground Z level
      return 1
    ENDIF
  ENDIF
ENDFOR
you just need to create the NPC and then call MoveToRandomLocation
06-03-2019 11:22 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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

This forum uses Lukasz Tkacz MyBB addons.