summaryrefslogtreecommitdiff
path: root/npc/commands/kami.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/commands/kami.txt')
-rw-r--r--npc/commands/kami.txt86
1 files changed, 86 insertions, 0 deletions
diff --git a/npc/commands/kami.txt b/npc/commands/kami.txt
new file mode 100644
index 00000000..1211fae0
--- /dev/null
+++ b/npc/commands/kami.txt
@@ -0,0 +1,86 @@
+// TMW2 Script
+//
+// @k <message>
+// Broadcast, and broadcast to #world too
+//
+// @servmsg <message>
+// Experimental, uses servicemessage() - requires up to date server
+
+- script @k 32767,{
+ end;
+
+OnCall:
+ .@request$ = strcharinfo(0)+": ";
+ .@request$ += implode(.@atcmd_parameters$, " ");
+ channelmes("#world", .@request$);
+ announce l(.@request$), bc_all|bc_npc;
+ end;
+
+OnServMsg:
+ .@request$ = strcharinfo(0)+": ";
+ .@request$ += implode(.@atcmd_parameters$, " ");
+ // This can be slow, beware
+ .@c = getunits(BL_PC, .@players, MAX_CYCLE_PC);
+ for (.@i = 0; .@i < .@c; .@i++) {
+ message(.@players[.@i], .@request$);
+ }
+ end;
+
+OnBuff:
+ // Disabled command, used for debug purposes
+ .@c = getunits(BL_PC, .@players, MAX_CYCLE_PC);
+ for (.@i = 0; .@i < .@c; .@i++) {
+ attachrid(.@players[.@i]);
+ sc_start SC_INCMHPRATE, 300000, 100;
+ sc_start SC_INCMSPRATE, 300000, 100;
+ sc_start SC_INCFLEERATE, 300000, 100;
+ sc_start SC_INCHITRATE, 300000, 100;
+ sc_start SC_WALKSPEED, 300000, 150;
+ sc_start SC_ATTHASTE_POTION3, 300000, 50;
+ percentheal 100, 100;
+ dispbottom l("YOU WERE BLESSED BY JESUSALVA");
+ dispbottom l("YOU CAN FEEL THE POWER FLOWING TROUGH YOU.");
+ detachrid();
+ }
+ end;
+
+OnInstDestroy:
+ .@request = implode(.@atcmd_parameters$, " ");
+ if (.@request != 0)
+ instance_destroy(.@request);
+ end;
+
+OnInstCheck:
+ .@request$ = implode(.@atcmd_parameters$, " ");
+ dispbottom has_instance2(.@request$);
+ end;
+
+OnInit:
+ bindatcmd "k", "@k::OnCall", 60, 80, 1;
+ bindatcmd "servmsg", "@k::OnServMsg", 80, 99, 1;
+
+ bindatcmd "blessing", "@k::OnBuff", 99, 100, 1;
+ bindatcmd "instcheck", "@k::OnInstCheck", 99, 100, 1;
+ bindatcmd "instdestr", "@k::OnInstDestroy", 99, 100, 1;
+ end;
+}
+
+// kamibroadcast( message{, sender} )
+function script kamibroadcast {
+ .@msg$=getarg(0);
+ .@snd$=getarg(1, "");
+
+ // Send to #world
+ if (.@snd$ == "")
+ channelmes("#world", " "+.@msg$);
+ else
+ channelmes("#world", "[ "+.@snd$+" ] : "+.@msg$);
+
+ // Make an announce
+ if (.@snd$ == "")
+ announce .@msg$, bc_all|bc_npc;
+ else
+ announce .@snd$+" : "+.@msg$, bc_all|bc_npc;
+
+ return;
+}