SphereCommunity
Random Chest and Random Boss - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere X (/Forum-Sphere-X)
+--- Forum: Script Help (/Forum-Script-Help--59)
+--- Thread: Random Chest and Random Boss (/Thread-Random-Chest-and-Random-Boss)



Random Chest and Random Boss - [Nores] - 09-26-2023 03:43 AM

I have two question. How can I see which region this script takes the mount to? Also, how can I make a chest or another item appear randomly instead of a random mount like this? Thank you.

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