- script zombacolypse -1,{
OnInit:
set .weapon,1203; //ItemID of the weapon to make them never miss
setarray .prize[0],501,1,1000,3; // [0] = Item ID | [1] = Amount | [2] = Zeny | [3] = Setting ( 0 = Disabled | 1 = Item Prize | 2 = Zeny Prize | 3 = Item+Zeny Prize )
set .auto_zombie,60; //Seconds before someone is auto-zombiefied.
set .survival_time,5; //Minutes need to survive to win the event.
setarray .mapxy$[0],"5@tower","81","84"; //Yes, use the " " marks when specifying X & Y. Because I'm too lazy to make new variables/array for x&y coorinates.
/* [0] is the Zombie King virus (will only appear once).
* [0] = Type-1C.3 Living-dead-blood virus ' in latin ').
* [1] = Type-X2 Dead Blood Plague virus ' in latin ').
* [2] = Type-7MA0 Star Tart Plague virus ' in latin ').
* [3] = Type-9R.1 Jelly Brain Vernacular Vein virus ' in latin '
*/
setarray .virus$[0],"Type-1C.3 Victus Mortuus Sanguis","Type-X2 Mortuus Sanguinis Pestis","Type-7MA0 Lumen Acerbus Pestis","Type-9R.1 Gelata Cerebrum Vulgari Vena";
set .zombie_kill,5; //How many players must a zombie kill before being revived as a human. *Note - will not affect Zombie King*
set .zombie_king,10; //How many players must a zombie king kill before being revived as a human.
setarray .zombie_skin[0],1015,1036,1197,1298,1864,1865,1875; //1015 = Zombie | 1036 = Ghoul | 1197 = Zombie Prioner | 1298 = Zombie Master | 1864 = Ragged Zombie | 1865 = Zombie Slaughter | 1875 = Zombie King
end;
OnClock0000: //Midnight, so fitting
OnClock2100:
//Add more times as needed.
setcell $@map$,98,100,66,100,cell_walkable,0;
setcell $@map$,98,100,98,68,cell_walkable,0;
while(!.@warp)
{query_sql"SELECT `name` FROM `char` WHERE `online`='1' LIMIT 128",.@name$;
for(set .@i,0; .@i<getarraysize(.@name$); set .@i,.@i+1)
{warpchar .mapxy$[0],atoi(.mapxy$[1]),atoi(.mapxy$[2]),getcharid(0,.@name$[.@i]);
setd ".name"+.loop+"$["+.@i+"]",.@name$[.@i];}
set .loop,.loop+1;
if( getarraysize(.@name$) < 128){set .@warp,1;}}
set .playercount, getarraysize( getd(".name"+(.loop - 1)+"$") );
if(.loop>1){set .playercount, ((.loop - 2) * 128) + getarraysize( getd(".name"+(.loop - 1)+"$") );}
mapannounce .mapxy$[0],"The Zombacolypse event will begin in '"+.auto_zombie+"' seconds. Get ready to fight for your life!!",bc_map,"0x0000FF";
sleep (.auto_zombie * 1000);
set .@a,rand( (.loop - 1) );
attachrid( getcharid(3, getd(".name"+.@a+"$["+( rand( getarraysize( getd(".name"+.@a+"$") ) ) )+"]") ) );
disguise .zombie_skin[6]; set zombie,2; set .playercount,.playercount-1;
mapannounce .maxy$[0],strcharinfo(0)+" has become infected with the deadly "+ strtoupper(.virus$[0]) +" virus!! Don't get infected help is on the way!!",bc_map,"0x0000FF";
detachrid;
pvpon .mapxy$[0];
set .zombacolypse,1;
sleep (.survival_time * 60000);
pvpoff .mapxy$[0];
while(.loop>=0)
{for(set .@i,0; .@i<getarraysize( getd(".name"+.loop+"$") ); set .@i,.@i+1)
{if(attachrid( getcharid(3, getd(".name"+.loop+"$["+.@i+"]")) ) ){
undisguise; percentheal 100,100;
if(!zombie && .prize[3])
{if(.prize[3]==1){getitem .prize[0],.prize[1];}
if(.prize[3]==2){set zeny,zeny+.prize[2];}
if(.prize[3]==3){getitem .prize[0],.prize[1]; set zeny,zeny+.prize[2];}}
set zombie,0;
if(countitem(.weapon)){delitem .weapon,1;}
warp "SavePoint",0,0;}}
set .loop,.loop-1;}
set .loop,0;
setcell $@map$,98,100,66,100,cell_walkable,1;
setcell $@map$,98,100,98,68,cell_walkable,1;
end;
OnPCKillEvent:
if(!.zombacolypse){end;}
if(zombie){end;}
attachrid(killerrid);
if(!zombie){end;}
set @zkill,@zkill+1;
if(@zkill>=.zombie_kill && zombie == 1 || @zkill>=.zombie_king && zombie == 2){set @zkill,0; set zombie,0; undisguise; delitem .weapon,1; set .playercount,.playercount+1;}
attachrid(killedrid);
atcommand "@alive";
warp .mapxy$[0],atoi(.mapxy$[1]),atoi(.mapxy$[2]);
set zombie,1;
set .playercount,.playercount-1;
if(.playercount<=1){awake "zombacolypse"; end;}
disguise .zombie_skin[rand(6)];
monster .mapxy$[0],atoi(.mapxy$[1]),atoi(.mapxy$[2]),strcharinfo(0),.zombie_skin[rand(6)],1;
mapannounce .mapxy$[0],strcharinfo(0)+" has become infected with the deadly "+ strtoupper(.virus$[ ( rand(1,getarraysize(.virus$)) ) ]) +" virus!! Don't get infected, help is on the way!!",bc_map,"0x0000FF";
getitem .weapon,1; equip .weapon;
OnPCLogoutEvent:
set zombie,0;
if(countitem(.weapon)){delitem .weapon,1;}
}
5@tower mapflag nomemo
5@tower mapflag noteleport
5@tower mapflag nosave
5@tower mapflag nowarp
5@tower mapflag nocommand
5@tower mapflag noicewall
5@tower mapflag nobranch
5@tower mapflag nightenabled
5@tower mapflag nomobloot
Actually this script was made by GM Ocean.. But no one seem comment on this script..
So im decide to test it... And found error... The error was look like this...
All player already been warp into 5@tower then after 1 minutes it start.. then all player dc... At time zombie appear... all DC...
Question
Checkmate
Actually this script was made by GM Ocean.. But no one seem comment on this script..
So im decide to test it... And found error... The error was look like this...
All player already been warp into 5@tower then after 1 minutes it start.. then all player dc... At time zombie appear... all DC...
Why was that?..?
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.