Advertisement
Guest User

Untitled

a guest
Jul 15th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. //Sets @Players for in-room PCs/Mobs
  2. #VAR Players %gmcp.room.players
  3. //Makes @MOB_TARGETS a DB Var for Mobs in Room
  4. #IF %vartype("MOB_TARGETS")=%null
  5. {#VAR MOB_TARGETS %null %null {GMCP|ROOM}
  6. #CALL %vartype("MOB_TARGETS",5)}
  7. {//Elseif MOB_TARGETS %vartype NOT %null
  8. MOB_TARGETS=%null
  9. }
  10. #IF %vartype("PC_TARGETS")=%null
  11. {#VAR PC_TARGETS %null {GMCP|ROOM}
  12. #CALL %vartype("PC_TARGETS",5)}
  13. {//ElseIf Pc_Targets %vartype NOT %null
  14. PC_TARGETS=%null
  15. }
  16. //Looks for VNUMS (Mobs) with loop. Puts mobs in @MobTargets
  17. #CLASS MOBS
  18. #LOOPDB @Players {
  19. #IF %isnumber(%key) {#ADDKEY Mob_Targets %key %val
  20. //
  21. // Area Name as DB variable for MOB# Logging..
  22. // Gets Zone name from GMCP and replaces spaces with underscores:
  23. // %replace(%copy(@info.zone,18)," ","_")
  24. //
  25. $area_name=%replace(%replace(%copy(@info.zone,18)," ","_"),"'","")
  26. #IF %vartype(%string(%replace(%replace(%copy(@info.zone,18)," ","_"),"'","")))=%null {
  27. //#ECHO DEBUG -- Creating $area_name DB
  28. #VAR %replace(%replace(%copy(@info.zone,18)," ","_"),"'","") %null
  29. #CALL %vartype(%replace(%replace(%copy(@info.zone,18)," ","_"),"'",""),5)}
  30. //
  31. //Check if %key is already in DB?
  32. //
  33. //ADDS Mob to Areaname as DB
  34. #IF %iskey(@%string($area_name),%key) {}
  35. #ADDKEY %replace(%replace(%copy(@info.zone,18)," ","_"),"'","") %key %string(%val)
  36. }
  37. {#ADDKEY Pc_Targets %key %val}
  38. }
  39. #CLASS 0
  40. //BUG FIX! -- Loops to remove cache of room.players to maintain @Players for LIVE tracking (Fix)
  41. #LOOPDB %gmcp.Room.Players {#DELKEY %gmcp.Room.Players %key}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement