2015-03-24 01:27 am
TRIGGER TO FIX MAPPING ROOMS - Place as a trigger under the map itself in your DEF
1. Adjusts Colors
2. Updates flags
3. updates coordinates
4. Updates VNUM
5. Updates COST to 1 (could by dynamic based on room size but not there yet)
TRIGGER PATTERN: room.info
TRIGGER TYPE: GMCP 201
#IF (%maplocked=0) {
;; Adjust the room name to ensure its correct
#CALL %roomname(%roomkey(%gmcp.room.info.num),%gmcp.room.info.name)
;; add room info coordinates to the flag for each room as you create it
#CALL %roomflags(%roomkey(%gmcp.room.info.num),%gmcp.room.info.flags)
;; Add the room.info information to the notes for each room to be queried by using %json
#CALL %roomnote(%roomkey(%gmcp.room.info.num),%gmcp.room.info)
;; Room Cost Default 1 eventually figure out cost by size
#CALL %roomcost(%roomkey(%gmcp.room.info.num),1)
;; translate the colors to room colors
#IF (%gmcp.room.info.coord.color != "") {
#LOCAL $color
#SWITCH (%ascii(%replace(%gmcp.room.info.coord.color,"|","")))
(%ascii("B")) {$color="Blue"}
(%ascii("R")) {$color="Red"}
(%ascii("C")) {$color="Cyan"}
(%ascii("M")) {$color="Magenta"}
(%ascii("Y")) {$color="Yellow"}
(%ascii("W")) {$color="White"}
(%ascii("G")) {$color="Green"}
(%ascii("D")) {$color="Grey"}
(%ascii("b")) {$color="darkBlue"}
(%ascii("r")) {$color="darkRed"}
(%ascii("c")) {$color="darkCyan"}
(%ascii("m")) {$color="darkMagenta"}
(%ascii("y")) {$color="wheat"}
(%ascii("w")) {$color="darkWhite"}
(%ascii("g")) {$color="lawnGreen"}
(%ascii("D")) {$color="dimgray"}
{$color="Orange"}
#IF (%gmcp.room.info.flags ~= "safe") {$color="White"}
#CALL %roomcol(%roomkey(%gmcp.room.info.num),$color)
}} {#NOOP}
TRIGGER TO COLOR NPK/CPK/LPK Rooms
TRIGGER: ^ WARNING: You are in a (*) room.
#IF (%maplocked=0) {
#SWITCH (%-1)
("NEUTRAL PLAYER KILLING") {#CALL %roomcol(%roomkey(%gmcp.room.info.num),"Yellow")}
("CHAOTIC PLAYER KILLING") {#CALL %roomcol(%roomkey(%gmcp.room.info.num),"RED")}
("LAWFUL PLAYER KILLING") { #CALL %roomcol(%roomkey(%gmcp.room.info.num),"GREEN")}
{#CALL %roomcol(%roomkey(%gmcp.room.info.num),"ORANGE")}
} {#NOOP}
Edited by Tamlin on Tue, 24 Mar 2015 01:35:18 +0000 |