dew_dun02 mapflag nobranch
dew_dun02 mapflag nomemo
dew_dun02 mapflag nosave
dew_dun02 mapflag nocommand //wlng storage wlng butterflywing wlng reloadscript wlng @item daig pa na jail
dew_dun02 mapflag noreturn
dew_dun02 mapflag nowarp
dew_dun02 mapflag nowarpto
dew_dun02 mapflag noteleport
dew_dun02 mapflag novending
dew_dun02,305,30,0 warp miningexit 2,2,que_house_s,11,36
que_house_s,10,38,4 script Smuggler 853,{
if (getgmlevel() == 99) {
mes "Hello GM.";
switch (select("Start Event:Settings:Check Event Status:Force Stop Event:StopSalary")) {
case 1:
disablenpc "miningexit";
for (.@e = 0; .@e < getarraysize($@Players); .@e++) {
set $@Players[.@e],0;
}
if (!$MineEvent) {
if (!$mobs) set $mobs,100;
set $p, 0;
set $MineEvent,1;
mes "Event is activated.";
set $Controller,getcharid(3);
goto OnEventStart;
close;
end;
}
mes "Event is currently active.";
close;
case 2:
mes "Input security code: ";
input $secode$;
if ($secode$ != "imkairogm") close;
if (!$MineEvent) {
mes "Input Mob Count";
input $mobs;
if (!$mobs) {
set $mobs, 100;
mes "Can't make it zero!. Defaulting.. mobs = 100.";
}
next;
mes "Type 0 to default. 1 Credits.";
mes "Input Prize item ID num. ";
input $conso;
mes "Input Prize amount.";
input $consoamount;
if ($conso == 0) set $conso,20080;
if ($consoamount == 0) set $consoamount,1;
next;
mes "Input number of Participants to activate.";
input $participants;
if (!$participants) set $participants,10;
close;
}
mes "You can't. Event is active.";
close;
case 3:
mes "Mobs to spawn: ^0066CC"+$mobs;
mes "^000000Current Prize: ^0066CC"+getitemname($conso);
mes "^000000Current Prize Amount: ^0066CC"+$consoamount;
mes "^000000No. of participants to activate: ^0066CC"+$participants;
mes "Current Players inside: ^FF0000"+getmapusers("dew_dun02")+"^000000";
if ($MineEvent) {
mes "^000000Event is currently ^FF0000active.^000000";
close;
}
mes "^000000Event is currently ^FF0000not active.^000000";
close;
case 4:
set $temprid, getcharid(3);
set $OnGoing,0;
if ($MineEvent) {
set $MineEvent,0;
mes "Event is forced stopped!";
mes "Warping out....";
killmonsterall "dew_dun02";
cleanmap "dew_dun02";
announce "Mining Event is forced stopped.",0;
enablenpc "miningexit";
for (.@b = 0; .@b < getarraysize ($@Players); .@b++) {
attachrid $@Players[.@b];
warp "que_house_s",11,36;
detachrid;
}
attachrid $temprid;
for (.@f = 0; .@f < getarraysize($@Players); .@f++) {
set $@Players[.@f],0;
set $@Mobkills[.@f],0;
}
close;
end;
}
mes "Event is not currently active.";
close;
end;
case 5:
mes "Stopping Event..";
detachrid;
for (.@b = 0; .@b < getarraysize ($@Players); .@b++) {
attachrid $@Players[.@b];
warp "que_house_s",11,36;
dispbottom "[Smuggler]: That's right! Here's your pay for participating in the event.";
getitem $conso,$consoamount;
set $tempkills, $@Mobkills[.@b]/5;
if ($tempkills > 0) {
dispbottom "[Smuggler]: Here's your bonus for killing more.";
getitem $conso,$tempkills;
}
set $@Players[.@b],0;
set $@Mobkills[.@b],0;
set $tempkills, 0;
detachrid;
}
set $OnGoing,0;
set $p, 0;
set $MineEvent, 0;
set $mobs,100;
enablenpc "miningexit";
hideoffnpc "Smuggler";
end;
}
}
if ($OnGoing) end;
for (.@c = 0; .@c < getarraysize ($@Players); .@c++) {
if (getcharid(3) == $@Players[.@c]) {
mes "You are already registered. Just wait there.";
mes $pleft+" players more, then we can start.";
close;
end;
}
}
if ($MineEvent) {
mes "[Smuggler]";
mes "Let me check you first for banned items.";
for (set .@a,0; .@a < getarraysize($@usables); set .@a, .@a + 1) {
if (countitem($@usables[.@a]) > 0) {
next;
mes "You are currently holding [^FF0000"+getitemname($@usables[.@a])+"^000000] in your inventory";
set #bannedgoods,1;
}
}
if (#bannedgoods) { next; mes "Store them if you wanna join~."; set #bannedgoods,0; close; }
next;
mes "[Smuggler]";
mes "All Clear.";
mes "Do you want to register for the event?";
if (select("Yes:No") == 1) {
mes "Okay. wait here.";
set $@Players[$p],getcharid(3);
set $p,$p+1;
set $pleft, $participants - $p;
mes "^009933"+$pleft+"^000000 players more, then we can start.";
if ($p%2 == 0) { announce "[Smuggler]: "+$pleft+" more players, then we can start.",0; }
if ($p == $participants) {
for (.@g = 0; .@g < getarraysize($@Players); .@g++) {
attachrid $@Players[.@g];
for (set .@j,0; .@j < getarraysize($@usables); set .@j, .@j + 1) {
if (countitem($@usables[.@j]) > 0) {
dispbottom "[Smuggler]: I TOLD YOU DON'T BRING BANNED ITEMS!!.";
npctalk strcharinfo(0)+" is caught cheating by bringing banned items.";
set $@Players[.@g],0;
set $@Mobkills[.@g],0;
detachrid;
break;
}
}
}
set $OnGoing, 1;
hideonnpc "Smuggler";
goto OnWarpPlayers;
}
close;
}
close;
}
mes "[Smuggler]";
mes "Move Along~~";
mes "Nothing to see here.";
close;
OnEventStart:
announce "Mining Event has started.",0;
announce "[Smuggler]: To those who wanna join come at me in the GM Room.",0;
announce "[Smuggler]: I will help you make some monney~~",0;
announce "[Smuggler]: I need "+$participants+" only for the job. First come first serve.",0;
close;
end;
OnWarpPlayers:
for (.@b = 0; .@b < getarraysize ($@Players); .@b++) {
attachrid $@Players[.@b];
warp "dew_dun02",305,30;
dispbottom "[Smuggler]: Get me alot of money.";
detachrid;
}
monster "dew_dun02",0,0,"--en--",3021,$mobs,"Smuggler::OnSummonDead";
close;
end;
OnSummonDead:
set $mobs, $mobs - 1;
getmapxy @map$,@x,@y,0;
if (@map$ == "dew_dun02") {
for (.@q = 0; .@q < getarraysize($@Players); .@q++) {
if (getcharid(3) == $@Players[.@q]) {
set $@Mobkills[.@q],$@Mobkills[.@q] + 1;
break;
}
}
}
if ($mobs < 1) {
announce "Boss has been summoned.",bc_map,0x9999FF;
monster "dew_dun02",0,0,"--en--",3022,1,"Smuggler::OnBossDead";
}
end;
OnBossDead:
announce rid2name(killerrid) + " has killed the Mining Boss.",0;
attachrid $Controller;
set $OnGoing,0;
set $p, 0;
set $MineEvent, 0;
set $mobs,100;
enablenpc "miningexit";
hideoffnpc "Smuggler";
/*
attachrid killerrid;
getmapxy @map$,@x,@y,0;
if (@map$ == "dew_dun02") {
atcommand "@refresh";
}
*/
announce "Warping players back in 10 seconds, don't logout.",bc_map,0x9999FF;
sleep 10000;
detachrid;
for (.@b = 0; .@b < getarraysize ($@Players); .@b++) {
attachrid $@Players[.@b];
warp "que_house_s",11,36;
dispbottom "[Smuggler]: That's right! Here's your pay for participating in the event.";
getitem $conso,$consoamount;
set $tempkills, $@Mobkills[.@b]/5;
if ($tempkills > 0) {
dispbottom "[Smuggler]: Here's your bonus for killing more.";
getitem $conso,$tempkills;
}
set $@Players[.@b],0;
set $@Mobkills[.@b],0;
set $tempkills, 0;
detachrid;
}
end;
OnPCDieEvent:
getmapxy @map$,@x,@y,0;
if (@map$ == "dew_dun02") {
for (.@d = 0; .@d < getarraysize($@Players); .@d++) {
if (getcharid(3) == $@Players[.@d]) {
set $@Players[.@d], 0;
break;
}
}
warp "SavePoint",0,0;
dispbottom "[Miner]: Better luck next time. Dude";
if (getmapusers("dew_dun02") == 0 && $MineEvent) goto allDied;
}
end;
OnShowSmuggler:
hideoffnpc "Smuggler";
end;
allDied:
announce "All Died. Mining Event ended.",0;
killmonsterall "dew_dun02";
cleanmap "dew_dun02";
for (.@f = 0; .@f < getarraysize($@Players); .@f++) {
set $@Players[.@f],0;
set $@Mobkills[.@f],0;
}
cleararray $@Mobkills[0],0,getarraysize($@Mobkills);
cleararray $@Players[0],0,getarraysize($@Players);
set $OnGoing,0;
set $p, 0;
set $MineEvent, 0;
set $mobs,100;
enablenpc "miningexit";
hideoffnpc "Smuggler";
close;
end;
OnInit:
setarray $@usables[0],607,12028,20130,13517,608,12016,13995,13994,504,505,12530;
disablenpc "miningexit";
hideoffnpc "Smuggler";
set $OnGoing,0;
set $mobs,100;
set $participants, 50;
set $conso,20080;
set $consoamount,1;
set $p, 0;
set $MineEvent, 0;
//set #bannedgoods,0;
end;
}
que_avan01,43,19,5 script Gold Smith 813,{
if (getgmlevel() == 99 && $MineEvent) {
mes "[Gold Smith]";
mes "Show Smuggler NPC?";
if (select("Yes:No") == 1) hideoffnpc "Smuggler";
close;
}
mes "[Gold Smith]";
mes "I can forge your gold ore into gold.";
mes "3 gold ore's for 1 gold. How's that?";
if (select("Yes, Let's Deal!:Not this time.") == 1) {
if (countitem(7231) >= 3) {
set .@goldcount, countitem(7231)/3;
getitem 969,.@goldcount;
delitem 7231,.@goldcount*3;
mes "Nice trading with yah!";
close;
}
mes "Eeekkk!! Your greedy matey, come back when you got gold ores.";
}
close;
}