summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-09-11 00:17:40 -0300
committerJesusaves <cpntb1@ymail.com>2019-09-11 00:17:40 -0300
commitec10da4eeb5256abe0cd9864ffd2241b4035915a (patch)
tree22ea758cecd7ff5c4811c0e4f9a2d438d4e02c07
parent884d6f1121a6b75a79882a47cfdb743f36ab005e (diff)
downloadserverdata-ec10da4eeb5256abe0cd9864ffd2241b4035915a.tar.gz
serverdata-ec10da4eeb5256abe0cd9864ffd2241b4035915a.tar.bz2
serverdata-ec10da4eeb5256abe0cd9864ffd2241b4035915a.tar.xz
serverdata-ec10da4eeb5256abe0cd9864ffd2241b4035915a.zip
Allow @shroom command without arguments
The GM gotoing looks a bit broken
-rw-r--r--npc/commands/shroom.txt18
1 files changed, 12 insertions, 6 deletions
diff --git a/npc/commands/shroom.txt b/npc/commands/shroom.txt
index 79bab470d..4b19ed907 100644
--- a/npc/commands/shroom.txt
+++ b/npc/commands/shroom.txt
@@ -7,13 +7,16 @@
end;
OnShroom:
- .@mobId=atoi(array_shift(.@atcmd_parameters$));
- .@mobAm=atoi(array_shift(.@atcmd_parameters$));
- .@mobName$=implode(.@atcmd_parameters$, " ");
+ if (.@atcmd_parameters$[0] != "")
+ .@mobId=atoi(array_shift(.@atcmd_parameters$));
+ if (.@atcmd_parameters$[1] != "")
+ .@mobAm=atoi(array_shift(.@atcmd_parameters$));
+ if (.@atcmd_parameters$[2] != "")
+ .@mobName$=implode(.@atcmd_parameters$, " ");
// Checks
if (!.@mobId)
- .@mobId=Plushroom;
+ .@mobId=PlushroomField;
if (!.@mobAm)
.@mobAm=1;
@@ -28,19 +31,22 @@ OnShroom:
// Max 40 connected players for this to work
.@c = getunits(BL_PC, .@players, 40);
for (.@i = 0; .@i < .@c; .@i++) {
+ debugmes "Attach account %d to spawn %d %s (%d)", .@players[.@i], .@mobAm, .@mobName$, .@mobId;
attachrid(.@players[.@i]);
getmapxy(.@m$, .@x, .@y, 0);
unitwarp(.@gmId, .@m$, .@x, .@y);
+ sleep2(20);
unitwalk(.@gmId, .@x-1, .@y-1);
sleep2(200);
unitemote(.@gmId, any(E_HAPPY, E_HAPPY, E_ANGEL, E_EVILCROC));
sleep2(150);
// Adjust amount based on player level
- .@Ammo=limit(1, BaseLevel/10*.@mobAm, 60);
+ .@Ammo=limit(1, BaseLevel/15*.@mobAm, 60);
+ debugmes "Spawn %d mobs", .@Ammo;
areamonster(.@m$, .@x-3, .@y-3, .@x+3, .@y+3, .@mobName$, .@mobId, .@Ammo);
- sleep2(120);
+ sleep2(320);
detachrid();
}