summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/014-4/kamelot.txt19
-rw-r--r--npc/042-10/ctrl.txt73
2 files changed, 77 insertions, 15 deletions
diff --git a/npc/014-4/kamelot.txt b/npc/014-4/kamelot.txt
index 715a4f981..99d917f51 100644
--- a/npc/014-4/kamelot.txt
+++ b/npc/014-4/kamelot.txt
@@ -26,23 +26,10 @@
// 4 - Treasure C
// 8 - Treasure D
// 16 - Weapon Room Key
- // Do we ever need to store the data below?
- // X,Y door is 2Y below
- // 32 - Cell I 33,135
- // 64 - Cell II 84,127
- // 128 - Cell III 41,119
- // 256 - Cell IV 74,107
- // 512 - Cell V 36,96
- // 1024 - Cell VI 57,84
- // 2048 - Cell VII 79,63
- // 4096 - Cell VIII 43,67
- // 8192 - Cell IX 24,67
- // 16384 - Cell X 86,22
- // 32768 - Cell XI 59,49
- // 65536 - Cell XII 38,27
- // If more than 12 players, loop back
+// $KAMELOT_PASSMASK [ guild_id ] = (bitmask) Switches in 042-10
// $KAMELOT_KEY [ guild_id ] = Which bit was assigned as the key
+// $KAMELOT_PASSCODE [ guild_id ] = A bitmask of passcode to use the key
// $KAMELOT_COOLDOWN [ guild_id ] = Last attempt (weekly attempts)
// KamelotCleanup(guildid)
@@ -55,6 +42,8 @@ function script KamelotCleanup {
$KAMELOT_KEY[.@g]=0;
$KAMELOT_QUEST[.@g]=0;
$KAMELOT_KEYMASK[.@g]=0;
+ $KAMELOT_PASSCODE[.@g]=0;
+ $KAMELOT_PASSMASK[.@g]=0;
return;
}
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;
+}