summaryrefslogtreecommitdiff
path: root/npc/042-10
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-05-01 06:30:33 -0300
committerJesusaves <cpntb1@ymail.com>2020-05-01 06:30:33 -0300
commit5409f2f899a685425757932c13154bc6340463d1 (patch)
treee82637c42669677ae68cfbef6527ca308f8fa79a /npc/042-10
parent903c1ffa430d9ca8933059e84ae8cd91a0c510b9 (diff)
downloadserverdata-5409f2f899a685425757932c13154bc6340463d1.tar.gz
serverdata-5409f2f899a685425757932c13154bc6340463d1.tar.bz2
serverdata-5409f2f899a685425757932c13154bc6340463d1.tar.xz
serverdata-5409f2f899a685425757932c13154bc6340463d1.zip
Sketch about the keys to open the gate
Diffstat (limited to 'npc/042-10')
-rw-r--r--npc/042-10/ctrl.txt73
1 files changed, 73 insertions, 0 deletions
diff --git a/npc/042-10/ctrl.txt b/npc/042-10/ctrl.txt
index 6b595d7d5..2915c0b4a 100644
--- a/npc/042-10/ctrl.txt
+++ b/npc/042-10/ctrl.txt
@@ -110,4 +110,77 @@ OnTouch:
end;
}
+////////////////////////////////////////////////////////////////////
+// TODO: Catazuli spots
+// TODO: Door Mechanism
+// TODO: Spawn monsters
+// KamelotSwitch( SWITCH ID )
+function script KamelotSwitch {
+ .@id=getarg(0);
+ .@g=getcharid(2);
+ if (!($KAMELOT_KEYMASK[.@g] & $KAMELOT_KEY[.@g])) end; // Don't care
+ .@st=($KAMELOT_PASSMASK[.@g] & .@id);
+ mes l("Status: %s", (.@st ? l("Active") : l("Inactive") ));
+ if (!countitem(KamelotKey))
+ close;
+ mes "Change switch status?";
+ next;
+ if (askyesno() == ASK_YES) {
+ $KAMELOT_PASSMASK[.@g]=$KAMELOT_PASSMASK[.@g]^.@id;
+ // The meaning of st is now mixed
+ if (.@st)
+ setnpcdisplay instance_npcname(.name$), NPC_SWITCH_OFFLINE;
+ else
+ setnpcdisplay instance_npcname(.name$), NPC_SWITCH_ONLINE;
+ }
+ // Check password and delete key
+ if ($KAMELOT_PASSMASK[.@g] == $KAMELOT_PASSCODE[.@g]) {
+ delitem KamelotKey, 1;
+ $KAMELOT_QUEST=$KAMELOT_QUEST|32;
+ mesc l("Your hear a clink, and the key breaks."), 2;
+ // Player Reward for completing this stage
+ getitem GuildCoin, 1;
+ getexp $KAMELOT_MX[.@g]*50, $KAMELOT_MX[.@g]*10;
+ // Guild Reward for completing this stage
+ .@ggp=1200+$KAMELOT_MX[.@g]*5;
+ .@gxp=$KAMELOT_MX[.@g]*25;
+ $GUILD_BANK[.@g]+=.@ggp;
+ guildgetexp(.@gxp); // 25xp per player average level (max 2500/3750)
+ // Announce
+ mapannounce getmap(), strcharinfo(0)+" has opened the gate!", 0;
+ // Guild Master Notification
+ .@gm$=getguildmaster(.@g);
+ if (!getcharid(3, .@gm$)) return;
+ .@gma=getcharid(3, .@gm$);
+ .@gmb=getcharid(0, .@gm$);
+ if (!isloggedin(.@gma, .@gmb)) return;
+ message .@gm$, strcharinfo(0)+" opened the gate: Guild GP +"+.@ggp+" Guild XP +"+.@gxp;
+
+ }
+ return;
+}
+
+042-10,128,85,0 script #K4210Note01 NPC_NO_SPRITE,{
+ .@g=getcharid(2);
+ if (!($KAMELOT_KEYMASK[.@g] & $KAMELOT_KEY[.@g])) end; // Don't care
+ if ($KAMELOT_PASSCODE[.@g] & 1)
+ dispbottom l("Active");
+ else
+ dispbottom l("Inactive");
+ end;
+
+OnInit:
+ .distance=2;
+ end;
+}
+
+042-10,128,85,0 script #K4210Switch01 NPC_SWITCH_OFFLINE,{
+ KamelotSwitch(1);
+ close;
+
+OnInit:
+ .distance=2;
+ .id=1;
+ end;
+}