Jump to content

- Mariel

Members
  • Content Count

    80
  • Joined

  • Last visited

Posts posted by - Mariel


  1. @- Mariel thanks really appreciate ! waiting for you. hehe

    Here !

     

    //===== EinherjarRO Scripts ==================================

    //= Auto-Event System

    //===== By: ==================================================

    //= Stolao

    //===== Current Version: =====================================

    //= 1.5C

    //===== Compatible With: =====================================

    //= rAthena SVN

    //===== Description: =========================================

    //= Will Automatically pick one event from the events in its

    //= list every hour and run it. Giving out an Item and

    //= Announcing the Winner.

    //=

    //= Manhunt event origionally a release by stydianx

    //= from http://rathena.org/board/topic/83791-man-hunt-event/

    //===== Uses: ================================================

    //= The Maze event is held on a custom map, you will need to install

    //===== Comments: ============================================

    //= [stolao]

    //= Optimize

    //= Add more events

    //= Spell Check

    //= Make customisable in game by gm

    //= Make "Zeny" changable for Points

    //= Add a Shop

    //= Add a vote for event option

    //= Add Events Lucky Pick, DB Event, MVP Arena, Invasion, Ragnarok Training

    //===== Additional Comments: =================================

    //= 1.00 -> 1.4B See Chagelogs on forums

    //= 1.4C Fixed an extra '{' added by mistake

    //= 1.4D Condenced @$MobsUsed + @$MobsRate -> @$Mobs

    //= 1.4E Removed Unessisare stopnpctimer (from pre 1.0F)

    //= 1.4F Added Poring Event

    //= 1.50 Optimized PVP and Maze a little

    //= 1.51 Added $@SpecialConditions Check for all events on initiation (future in game gm config)

    //= 1.52 Fixed Time Remaining Countdown, was dispalying +1 min off

    //= 1.53 Replace 99_pvp for pvp_n_1-5, bug on my client

    //= 1.54 Replaced areawards with mapwarp when suitable

    //= 1.55 Added mapwarp to initiation of scripts

    //= 1.56 Fixed a bug in Poring, not summoning wrong Poring

    //= 1.57 Changed $@CurrentEvent -1 -> -1*$@CurrentEvent after start of event

    //= 1.58 Added $@Conditions&2 (precentheal 100,100) to PvPEvent

    //= 1.59 Added Manhunt Event

    //= 1.5A Fixed bug with Manhunt Target being killable after event still

    //= 1.5B Fixed a bug with storeall and item check -[Thanks Digos]

    //= 1.5C Fixed a hang screen in ( $@Cost[0] && $@Cost[1] ) -[Thanks Digos]

    //===== Contact Ifo: =========================================

    //= [stolao]

    //= Email: [email protected]

    //============================================================

     

    - script Event_Management -1,{

    OnWhisperGlobal:

    mes "[Event Management]";

    if(getgroupid() >= 60) {

    mes "What would you like to do?";

    menu "Join Event",-,"RunEvent",OnRunEvent;

    } else {

    mes "Would you like to try and Join the event?";

    if(select("Yes:No") > 1) close;

    }

    next;

    OnJoinEvent:

    mes "[Event Management]";

    if($@CurrentEvent <= 0 ){ mes "No events to join at the moment."; close;

    } else {

    mes "This is a "+$@Eventname$+" Event for "+(($@ReqJob >= 0)?jobname($@ReqJob):"Players")+" between Levels "+$@LvReq[0]+"/"+$@LvReq[1]+" and "+$@LvReq[2]+"/"+$@LvReq[3]+"";

    if($@Players[0]) mes "Must be at least "+$@Players[0]+" players for event to take place";

    if($@Cost[0] > 0 && $@Cost[1] > 0) mes "You will also need "+$@Cost[1]+" "+getitemname($@Cost[0])+" to join.";

    if($@Cost[2] > 0) mes "You will also need "+$@Cost[2]+"z to join.";

    mes "Would you like to Join?";

    if(select("No:Yes") == 1){

    mes "Ok come back later";

    close;

    } else if(BaseLevel < $@LvReq[0] || JobLevel < $@LvReq[1] || BaseLevel > $@LvReq[2] || JobLevel > $@LvReq[3] || ($@ReqJob >= 0 && BaseClass != $@ReqJob)){

    mes "Sorry this is an Event for "+(($@ReqJob >= 0)?jobname($@ReqJob):"Players")+" between Levels "+$@LvReq[0]+"/"+$@LvReq[1]+" and "+$@LvReq[2]+"/"+$@LvReq[3]+"";

    close;

    } else if ( $@Cost[0] && $@Cost[1] && (countitem($@Cost[0]) < $@Cost[1]) ) {

    if(countitem($@Cost[0]) < $@Cost[1]){

    mes "Sorry but, You will need "+$@Cost[1]+" "+getitemname($@Cost[0])+" to join.";

    close;

    }

    } else if($@Cost[2] > Zeny){

    mes "Sorry but, You will need "+$@Cost[2]+"z to join.";

    close;

    } else if($@Players[1] && getmapusers($@Map$) >= $@Players[1]){

    mes "Sorry event is full, try again next time.";

    close;

    } else {

    if($@Conditions & 1) sc_end SC_ALL;

    if($@Conditions & 2) percentheal 100,100;

    if($@Conditions & 4) sc_start SC_DECREASEAGI,300000+$@MaxTime*60000,10;

    if(($@Conditions & 16) && getarraysize($@PlayerIDList) < $@Players[1]){

    set $@PlayerNameList$[$@SaveChars[1]],strcharinfo(0);

    set $@SaveChars[1],$@SaveChars[1]+1;

    }

    if($@Cost[0] && $@Cost[1]){ delitem $@Cost[0],$@Cost[1]; set $@Pool[0],$@Pool[0]+$@Cost[1]; }

    if($@Cost[2]){ set Zeny,Zeny-$@Cost[2]; set $@Pool[1],$@Pool[1]+$@Cost[2]; }

    if($@Conditions & 8) atcommand "@storeall";

    warp $@Map$,$@XY[0],$@XY[1];

    }

    }

    end;

    OnRunEvent:

    mes "[Event Management]";

    if($@CurrentEvent){ mes "Sorry an event is already running"; close;

    } else if(agitcheck()||agitcheck2()){ mes "Sorry cannot run event during woe"; end;

    } else {

    mes "Ok boss what event should we run today?";

    switch(select("PVP:Zombie:Dice:Maze::Poring::::Man-Hunt")){

    case 1:

    if(getgroupid()<60) delitem 26504,1;

    close2;

    detachrid;

    callfunc("CleanEvents");

    callfunc("PvpEventRUN");

    break;

    case 2:

    if(getgroupid()<60) delitem 26504,1;

    close2;

    detachrid;

    callfunc("CleanEvents");

    callfunc("ZombieRUN");

    break;

    case 3:

    if(getgroupid()<60) delitem 26504,1;

    close2;

    detachrid;

    callfunc("CleanEvents");

    callfunc("1234RUN");

    break;

    case 4:

    if(getgroupid()<60) delitem 26504,1;

    close2;

    detachrid;

    callfunc("CleanEvents");

    callfunc("MazeRUN");

    break;

    case 6:

    if(getgroupid()<60) delitem 26504,1;

    close2;

    detachrid;

    callfunc("CleanEvents");

    callfunc("PoringRUN");

    break;

    case 10:

    if(getgroupid()<60) delitem 26504,1;

    close2;

    detachrid;

    callfunc("CleanEvents");

    callfunc("ManHuntRUN");

    break;

    default: break;

    }

    }

    end;

    OnMinute55:

    if(agitcheck()||agitcheck2()) end;

    callfunc("CleanEvents");

    switch(rand(1,4)){

    case 1: callfunc("1234RUN"); break;

    case 2: callfunc("ZombieRUN"); break;

    case 3: callfunc("PvpEventRUN"); break;

    case 4: callfunc("MazeRUN"); break;

    case 5: //Invasion break; //save old_morocc from satan morroc

    case 6: callfunc("PoringRUN"); break;

    case 7: //Mvp Arena break; //Summons a random mvps and turns pvp on

    case 8: //Rag-narok training break; //Summons a random mvps (no drops) from list continuesly with pvp on, res and gives buffs to all after and prize last man standing

    case 9: //X-O quiz_01 140 277 break; //like 1234 but just 2 squares

    case 10://Manhunt break; //Someone elses event

    case 11://lucky Pick break; //pick one person who enters map and gives them a prize

    case 12://DB event break: //Auto summons monsters from dead branches (pvp on)

    }

    end;

    OnInit:

    bindatcmd("joinevent","Event_Management::OnJoinEvent",0,99);

    bindatcmd("runevent","Event_Management::OnRunEvent",60,99);

    set $@CurrentEvent,0;

    end;

    }

     

    function script CleanEvents {

    set $@ReturnMap$[0],"invek";

    setarray $@ReturnXY[0],146,166;

    set $@SpecialConditions,0;

    set $@Eventname$,"";

    setarray $@Map$,"invek";

    setarray $@XY[0],146,166;

    setarray $@LvReq[0],0,0,5000,5000;

    set $@ReqJob,-1;

    setarray $@Prizes[0],0,0,0;

    setarray $@Cost[0],0,0,0;

    setarray $@PrizePool[0],0,0;

    setarray $@Pool[0],0,0;

    setarray $@PrizeMap$,"";

    set $@JobGroup,0;

    setarray $@PrizeXY[0],0,0;

    set $@Conditions,0;

    setarray $@Players[0],0,0;

    set $@MaxTime,0;

    set $@Winers,0;

    setarray $@OOB[0],0,0,0,0;

    setarray $@StairsX[0],0,0,0,0,0,0,0,0;

    setarray $@StairsY[0],0,0;

    setarray $@Box1[0],0,0;

    setarray $@Box2[0],0,0;

    setarray $@Box3[0],0,0;

    setarray $@Box4[0],0,0;

    setarray $@BoxY[0],0,0;

    cleararray $@Mobs[0],0,127;

    setarray $@SaveChars,0,0;

    set $@Target,-1;

    cleararray $@PlayerNameList$[0],0,127;

    set $@CurrentEvent,0;

    set $@ReturnMap$[0],"invek"; //Map Warped to after Events

    setarray $@ReturnXY[0],146,166; //X, Y Warped to after Events

    return;

    }

     

    //========================= Running Event ===============================

     

    function script ZombieRUN {

    if($@CurrentEvent||agitcheck()||agitcheck2()){ end; }

    if(!$@SpecialConditions){

    set $@Eventname$,"Zombie Survival";

    set $@CurrentEvent,1;

    setarray $@Map$,"1@zombie"; //Zombie Event Map

    setarray $@Players[0],2,0; //Min,Max Players

    setarray $@XY[0],0,0; //Zombie Event X, Y

    setarray $@LvReq[0],0,0,10,10; //Max Base,Job Levels for Zombies

    set $@ReqJob,0; //Base Job Required to Play

    set $@MaxTime,10; //Zombie Waves Times (Suggest Less then 50)

    setarray $@Mobs,1394,50,1423,30,1298,10; //MobID,Amount Per Wave

    setarray $@PrizeMap$,"1@zombie"; //Zombie Prize Map

    setarray $@PrizeXY,175,120; //Zombie Prize X, Y

    setarray $@Prizes,14001,10,50000; //Prize - Item, Amount, Zeny

    setarray $@Cost,0,0,1000; //Join Cost - Item, Amount, Zeny

    setarray $@PrizePool,0,0; //100 = 1% Prizes pooled from players - Items, Zeny

    set $@Conditions,1|2|8; //Bitwise

    //1 sc_end SC_ALL;

    //2 percentheal 100,100;

    //4 sc_start SC_DECREASEAGI,300000+$@MaxTime*60000,10;

    //8 atcommand "@storeall";

    }

    mapwarp $@Map$,$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    disablenpc "ZombiePrize";

    for(set .@i,2; .@i > 0; set .@i,.@i-1){

    announce ""+$@Eventname$+" Event Will begin in "+.@i+" Mins!",8;

    announce "Please type @joinevent to join",8;

    sleep 60000;

    }

    announce ""+$@Eventname$+" Event Has Begun!",8;

    set $@CurrentEvent,$@CurrentEvent*-1;

    if(getmapusers($@Map$)<$@Players[0]){

    mapannounce $@Map$,"Sorry there are not enough players for this event to take place",8;

    mapwarp $@Map$,$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    set $@CurrentEvent,0;

    end;

    } else {

    sleep 25000;

    monster $@Map$,$@PrizeXY[0],$@PrizeXY[1],"--ja--",1394,10,"ZombiePrize::OnKillZombie";

    for(set .@@Wave,0; .@@Wave < $@MaxTime; set .@@Wave,.@@Wave+1){

    if(.@@Wave < $@MaxTime){ mapannounce $@Map$,"Wave "+.@@Wave+"!",8;

    } else { mapannounce $@Map$,"FIANL WAVE!",8; }

    sleep 1000;

    for(set .@i,5; .@i > 0; set .@i,.@i-1){

    mapannounce $@Map$,""+.@i+"...",8;

    sleep 1000;

    }

    mapannounce $@Map$,"Begin Wave!",8;

    for(set .@i,0; (.@i < getarraysize($@Mobs)); set .@i,.@i+2){

    monster $@Map$,0,0,"--ja--",$@Mobs[.@i],.@@Wave*$@Mob[.@i+1],"ZombiePrize::OnKillZombie";

    }

    if(!getmapusers($@Map$)){ set .@@Wave,$@MaxTime+.@@Wave;

    } else {

    mapannounce $@Map$,"There are "+getmapusers($@Map$)+" Players",8;

    sleep 56000;

    }

    }

    mapannounce $@Map$,"Zombie Survival is now over!",8;

    mapwarp $@Map$,$@PrizeMap$,$@PrizeXY[0],$@PrizeXY[1];

    enablenpc "ZombiePrize";

    killmonster $@Map$,"ZombieRUN::OnKillZombie";

    set $@CurrentEvent,0;

    end;

    }

    end;

    }

     

    function script 1234RUN {

    if($@CurrentEvent||agitcheck()||agitcheck2()){ end; }

    if(!$@SpecialConditions){

    set $@Eventname$,"Dice";

    set $@CurrentEvent,2;

    setarray $@Map$,"quiz_01"; //1234 Event Map

    setarray $@XY,205,92; //1234 X, Y

    setarray $@Players[0],1,0; //Min,Max Players

    set $@Winers,1; //Number of Winers

    set $@MaxTime,100; //Max rolls before tie (suggest 100 max)

    setarray $@OOB[0],182,94,228,88; //Out of bounds upper area x1, y1, x2, y2

    setarray $@StairsX[0],185,188,197,200,209,212,221,224; //Area stairs x1, x2, x3, x4, x5, x6, x7, x8

    setarray $@StairsY[0],87,82; //Out of bounds area stairs y1, y2

    setarray $@Box1[0],183,191; //Box 1 x1, x2

    setarray $@Box2[0],195,203; //Box 2 x1, x2

    setarray $@Box3[0],207,215; //Box 3 x1, x2

    setarray $@Box4[0],219,227; //Box 4 x1, x2

    setarray $@BoxY[0],81,59; //Boxs y1, y2

    setarray $@Prizes[0],0,0,3000000; //Prize - Item, Amount, Zeny

    setarray $@Cost[0],0,0,0; //Join Cost - Item, Amount, Zeny

    setarray $@PrizePool[0],0,0; //100 = 1% Prizes pooled from players - Items,Zeny

    }

    mapwarp $@Map$,$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    disablenpc "1234-Prize";

    for(set .@i,2; .@i > 0; set .@i,.@i-1){

    announce ""+$@Eventname$+" Event Will begin in "+.@i+" Mins!",8;

    announce "Please type @joinevent to join",8;

    sleep 60000;

    }

    announce ""+$@Eventname$+" Event Has Begun!",8;

    set $@CurrentEvent,$@CurrentEvent*-1;

    sleep 9000;

    if(getmapusers($@Map$)<$@Players[0]){

    mapannounce $@Map$,"Sorry there are not enough players for this event to take place",8;

    mapwarp $@Map$,$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    set $@CurrentEvent,0;

    end;

    } else {

    mapannounce $@Map$,"Ok the rules of this "+$@Eventname$+" Event are as follows",8;

    sleep 5000;

    mapannounce $@Map$,"Each player picks a box 1, 2, 3 or 4",8;

    sleep 5000;

    mapannounce $@Map$,"There will be a count down from 10 to 0",8;

    sleep 5000;

    mapannounce $@Map$,"at 0 a four sided die will be rolled",8;

    sleep 5000;

    mapannounce $@Map$,"Anyone in the box of the number rolled will be warped to town",8;

    sleep 5000;

    mapannounce $@Map$,"as well as anyone on the stairs or outside the box",8;

    sleep 5000;

    mapannounce $@Map$,"the number of players remaining will be announced",8;

    sleep 5000;

    mapannounce $@Map$,"this prosses will repeat till only one player remains",8;

    sleep 5000;

    mapannounce $@Map$,"take a few moments to fnd a box",8;

    sleep 15000;

    mapannounce $@Map$,"we will now begin, please find a box",8;

    sleep 6000;

    for(set .@1234,0; .@1234 < $@MaxTime; set .@1234,.@1234+1){

    for(set .@i,10; .@i > 0; set .@i,.@i-1){

    mapannounce $@Map$,""+.@i+"...",8;

    sleep 1000;

    }

    set .@i,rand(1,4);

    mapannounce $@Map$,"0... Good Bye Box "+.@i+"",8;

    switch(.@i){

    case 1: areawarp $@Map$,$@Box1[0],$@BoxY[0],$@Box1[1],$@BoxY[1],$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1]; break;

    case 2: areawarp $@Map$,$@Box2[0],$@BoxY[0],$@Box2[1],$@BoxY[1],$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1]; break;

    case 3: areawarp $@Map$,$@Box3[0],$@BoxY[0],$@Box3[1],$@BoxY[1],$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1]; break;

    case 4: areawarp $@Map$,$@Box4[0],$@BoxY[0],$@Box4[1],$@BoxY[1],$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1]; break;

    }

    areawarp $@Map$,$@OOB[0],$@OOB[1],$@OOB[2],$@OOB[3],$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1]; //Upper Area

    areawarp $@Map$,$@StairsX[0],$@StairsY[0],$@StairsX[1],$@StairsY[1],$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1]; //Stairs 1

    areawarp $@Map$,$@StairsX[2],$@StairsY[0],$@StairsX[3],$@StairsY[1],$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1]; //Stairs 2

    areawarp $@Map$,$@StairsX[4],$@StairsY[0],$@StairsX[5],$@StairsY[1],$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1]; //Stairs 3

    areawarp $@Map$,$@StairsX[6],$@StairsY[0],$@StairsX[7],$@StairsY[1],$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1]; //Stairs 4

    if(getmapusers($@Map$)<=$@Winers){ set .@1234,$@MaxTime+1;

    } else {

    mapannounce $@Map$,"There are "+getmapusers($@Map$)+" Players Remaining.",8;

    mapannounce $@Map$,"Take a few moments if you want to change boxes.",8;

    sleep 20000;

    }

    }

    mapannounce $@Map$,"Event is over",8;

    mapannounce $@Map$,"Walk up the stairs and speak with the Npc in the center to collect your prize",8;

    enablenpc "1234-Prize";

    set $@CurrentEvent,0;

    end;

    }

    }

     

    function script PvpEventRUN {

    if($@CurrentEvent||agitcheck()||agitcheck2()){ end; }

    if(!$@SpecialConditions){

    set $@Eventname$,"Last Man Standing";

    set $@CurrentEvent,3;

    setarray $@Map$,"pvp_n_1-5"; //PVP Event Map

    setarray $@XY[0],0,0; //PVP Event X, Y

    setarray $@Players[0],2,0; //Min,Max Players

    setarray $@LvReq[0],70,1,150,150; //Min Base, Job, Max Base, Job Levels for PVP

    set $@MaxTime,20; //PVP Times in Mins (Suggest Less then 50)

    set $@JobGroup,7; //Jobs Groups Allowed Bitwise

    //[1] Novice, [2] 1st, [4] 2nd, [8] 3rd

    set $@Conditions,2; //Bitwise

    //1 sc_end SC_ALL;

    //2 percentheal 100,100;

    //4 sc_start SC_DECREASEAGI,300000+$@MaxTime*60000,10;

    //8 atcommand "@storeall";

    setarray $@Prizes[0],0,0,1000000; //Prize - Item, Amount, Zeny

    setarray $@Cost[0],0,0,2500; //Join Cost - Item, Amount, Zeny

    setarray $@PrizePool[0],0,10000; //100 = 1% Prizes pooled from players - Items, Zeny

    if(rand(100) < 10 && $@JobGroup){

    switch(rand(1,$@JobGroup)){

    case 1:

    set .i,0;

    set $@ReqJob,.i;

    set $@Eventname$,"Novice Last Man Standing";

    break;

    default:

    case 2: case 3:

    set .i,rand(1,6);

    if(rand(7) == 7) set .i,4046;

    set $@ReqJob,.i;

    set $@Eventname$,""+jobname(.i)+" Class Last Man Standing";

    break;

    case 4: case 5: case 6: case 7:

    set .i,rand(7,12) + rand(1)*7;

    if(rand(17) > 14) set .i,rand(23,25);

    if(rand(19) > 16) set .i,4047+rand(1)*2;

    set $@ReqJob,.i;

    set $@Eventname$,""+jobname(.i)+" Class Last Man Standing";

    break;

    case 8: case 9: case 10: case 11:

    case 12: case 13: case 14: case 15:

    set .i,rand(4054,4059)+rand(1)*(12+rand(1));

    set $@ReqJob,.i;

    set $@Eventname$,""+jobname(.i)+" Class Last Man Standing";

    break;

    }

    }

    }

    mapwarp $@Map$,$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    disablenpc "PvpEventPrize";

    for(set .@i,2; .@i > 0; set .@i,.@i-1){

    announce ""+$@Eventname$+" Event Will begin in "+.@i+" Mins!",8;

    announce "Please type @joinevent to join",8;

    sleep 60000;

    }

    announce ""+$@Eventname$+" Event Has Begun!",8;

    set $@CurrentEvent,$@CurrentEvent*-1;

    sleep 9000;

    if(getmapusers($@Map$)<$@Players[0]){

    mapannounce $@Map$,"Sorry there are not enough players for this event to take place",8;

    } else {

    mapannounce $@Map$,"The Rules of this event are as follows",8;

    sleep 5000;

    mapannounce $@Map$,"This is a Free for all Last man Standing",8;

    sleep 5000;

    mapannounce $@Map$,"there is a "+$@MaxTime+" min time limit in place if there is no clear winner within "+$@MaxTime+" mins the Event ends",8;

    sleep 5000;

    mapannounce $@Map$,"Everyone has 1 Life so Res, Ygg Leafs and Kazail dont work",8;

    sleep 5000;

    mapannounce $@Map$,"Spread out PVP will begin in 10...",8;

    sleep 1000;

    for(set .@i,9; .@i > 0; set .@i,.@i-1){

    mapannounce $@Map$,""+.@i+"...",8;

    sleep 1000;

    }

    gvgon $@Map$;

    mapannounce $@Map$,"Begin",8;

    sleep 5000;

    for(set .@@pvp,0; .@@pvp < $@MaxTime; set .@@pvp,.@@pvp+1){

    if(getmapusers($@Map$)<2){ set .@@pvp,.@@pvp+$@MaxTime;

    } else { mapannounce $@Map$,"There are "+getmapusers($@Map$)+" Players Remaining",8; }

    sleep 60000;

    }

    if(getmapusers($@Map$)<2){

    mapannounce $@Map$,"We have a winner",8;

    pvpoff $@Map$;

    enablenpc "PvpEventPrize";

    mapannounce $@Map$,"Talk to the Npc in the center of the map for a prize",8;

    set $@CurrentEvent,0;

    end;

    } else { mapannounce $@Map$,"Time Is up",8; }

    }

    sleep 5000;

    gvgoff $@Map$;

    set $@CurrentEvent,"0";

    mapwarp $@Map$,$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    end;

    }

     

    function script MazeRUN {

    if($@CurrentEvent||agitcheck()||agitcheck2()){ end; }

    if(!$@SpecialConditions){

    set $@CurrentEvent,4;

    set $@Eventname$,"Maze";

    setarray $@Map$,"maze";

    setarray $@XY,371,143;

    setarray $@LvReq[0],0,0,5000,5000;

    set $@ReqJob,-1;

    setarray $@Prizes[0],7227,25,10000;

    setarray $@Cost[0],0,0,1000;

    setarray $@PrizePool[0],0,10000;

    setarray $@Players[0],1,0;

    set $@MaxTime,30; //Number of Mins to complete maze

    }

    mapwarp $@Map$,$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    enablenpc "mazeroadblock";

    disablenpc "MazePrize";

    for(set .@i,2; .@i > 0; set .@i,.@i-1){

    announce ""+$@Eventname$+" Event Will begin in "+.@i+" Mins!",8;

    announce "Please type @joinevent to join",8;

    sleep 60000;

    }

    announce ""+$@Eventname$+" Event Has Begun!",8;

    set $@CurrentEvent,$@CurrentEvent*-1;

    sleep 9000;

    if(getmapusers($@Map$)<$@Players[0]){ mapannounce $@Map$,"Sorry there are not enough players for this event to take place",8;

    } else {

    mapannounce $@Map$,"Rules are simple first to get to end of maze wins, so begin~",8;

    disablenpc "mazeroadblock";

    enablenpc "MazePrize";

    for(set .@maze,0; .@maze < $@MaxTime; set .@maze,.@maze+1){

    if(getmapusers($@Map$)<1) set .@maze,.@maze+$@MaxTime;

    mapannounce $@Map$,"There are "+($@MaxTime-.@maze)+" Minuets Remaining",8;

    sleep 60000;

    }

    mapannounce $@Map$,"Time Is up",8;

    }

    disablenpc "MazePrize";

    sleep 5000;

    mapwarp $@Map$,$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    set $@CurrentEvent,0;

    end;

    }

     

    function script PoringRUN {

    if($@CurrentEvent||agitcheck()||agitcheck2()){ end; }

    if(!$@SpecialConditions){

    set $@Eventname$,"Poring";

    set $@CurrentEvent,6;

    setarray $@Map$,"pvp_n_1-5"; //Poring Event Map

    setarray $@XY[0],0,0; //Poring Event X, Y

    setarray $@Players[0],1,0; //Min,Max Players

    setarray $@LvReq[0],0,0,1000,1000; //Min Base, Job, Max Base, Job Levels for PVP

    set $@MaxTime,30; //Poring Time in Mins (Suggest Less then 50)

    set $@Winers,2; //Number of Winers

    setarray $@Mobs,1725,$@Winers,1725,15,1725,15,1725,15,1725,15,1725,15,1725,15,1725,15,1725,15,1725,15,1725,15,1725,15,1725,15,1725,15,1725,15,1725,15,1725,15,1725,15,1725,15;

    setarray $@MobNames$,"Poring","P0ring","Porlng","Porimg","Porinq","Poporing","This One","Right","Kill Me","Poning","qoring","Pooring","Pouring","Polling","~Poring~","Winner","Prize","Porirg","Paring";

    setarray $@Prizes[0],7227,25,100000; //Prize - Item, Amount, Zeny

    setarray $@Cost[0],0,0,2500; //Join Cost - Item, Amount, Zeny

    setarray $@PrizePool[0],0,10000; //100 = 1% Prizes pooled from players - Items, Zeny

    }

    mapwarp $@Map$,$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    pvpoff $@Map$;

    for(set .@i,2; .@i > 0; set .@i,.@i-1){

    announce ""+$@Eventname$+" Event Will begin in "+.@i+" Mins!",8;

    announce "Please type @joinevent to join",8;

    sleep 60000;

    }

    announce ""+$@Eventname$+" Event Has Begun!",8;

    set $@CurrentEvent,$@CurrentEvent*-1;

    if(getmapusers($@Map$)<$@Players[0]){ mapannounce $@Map$,"Sorry there are not enough players for this event to take place",8;

    } else {

    mapannounce $@Map$,"Rules are simple",8;

    sleep 3000;

    mapannounce $@Map$,"Kill the 'Poring' with the correct name, and get a warped to town with a prize.",8;

    sleep 3000;

    mapannounce $@Map$,"Kill the wrong one and get warped to town with nothing.",8;

    sleep 3000;

    mapannounce $@Map$,"There "+(($@Winers>1)?"are":"is")+" "+$@Winers+" right poring"+(($@Winers>1)?"s":"")+" and a "+$@MaxTime+" min timer.",8;

    sleep 3000;

    mapannounce $@Map$,"Event will now Begin~",8;

    sleep 3000;

    for(set .@i,2; .@i < getarraysize($@Mobs); set .@i,.@i+2){

    monster $@Map$,0,0,$@MobNames$[.@i/2],$@Mobs[.@i],$@Mobs[.@i+1],"PoringPrize::OnKillWrong";

    }

    monster $@Map$,0,0,"--ja--",$@Mobs[0],$@Mobs[1],"PoringPrize::OnKillRight";

    for(set .@poring,0; .@poring < $@MaxTime; set .@poring,.@poring+1){

    if(getmapusers($@Map$)<1) set .@poring,.@poring+$@MaxTime;

    mapannounce $@Map$,"There are "+($@MaxTime-.@poring)+" Minuets Remaining",8;

    sleep 60000;

    }

    }

    mapannounce $@Map$,"Time Is up",8;

    killmonsterall $@Map$;

    sleep 5000;

    mapwarp $@Map$,$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    end;

    }

     

    function script ManHuntRUN {

    if($@CurrentEvent||agitcheck()||agitcheck2()){ end; }

    if(!$@SpecialConditions){

    set $@CurrentEvent,10;

    set $@Conditions,19; //Bitwise

    //1 sc_end SC_ALL;

    //2 percentheal 100,100;

    //4 sc_start SC_DECREASEAGI,300000+$@MaxTime*60000,10;

    //8 atcommand "@storeall";

    //16 save player name in array (must be on for manhunt event)

    set $@Eventname$,"Man-Hunt";

    setarray $@Map$,"pvp_n_1-5"; //Poring Event Map

    setarray $@XY,0,0; //Poring Event X, Y

    setarray $@Prizes,7227,25,50000; //Prize - Item, Amount, Zeny

    setarray $@Cost,0,0,2500; //Join Cost - Item, Amount, Zeny

    setarray $@PrizePool[0],0,10000; //100 = 1% Prizes pooled from players - Items, Zeny

    setarray $@Players,2,100; // Min,Max PLayers, keep max players no more than 125

    set $@MaxTime,10; //Number of Rounds, each round is a 1 min with a 10 second breather suggest under 45

    }

    mapwarp $@Map$,$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    enablenpc "ManhuntPrize";

    for(set .@i,2; .@i > 0; set .@i,.@i-1){

    announce ""+$@Eventname$+" Event Will begin in "+.@i+" Mins!",8;

    announce "Please type @joinevent to join",8;

    sleep 60000;

    }

    set $@CurrentEvent,$@CurrentEvent*-1;

    if(getmapusers($@Map$)<$@Players[0]){ mapannounce $@Map$,"Sorry there are not enough players for this event to take place",8;

    } else {

    setarray $@Pool,$@Pool[0]/$@MaxTime,$@Pool[1]/$@MaxTime;

    mapannounce $@Map$,"The goal is this event is to kill the target within 60 seconds.",8;

    sleep 5000;

    mapannounce $@Map$,"The one who managed to kill the target will gain a prize",8;

    sleep 5000;

    mapannounce $@Map$,"But if the target surivived, the target will gain the prize",8;

    sleep 5000;

    mapannounce $@Map$,"Man-Hunt Event start!",8;

    for(set .@round,1; .@round < $@MaxTime; set .@round,.@round+1){

    if(getmapusers($@Map$)<$@Players[0]){ mapannounce $@Map$,"Sorry there are not enough players for this event to take place anymore",8;

    } else {

    if(.@round > 1){ mapannounce $@Map$,"Next Round will begin in 10 seconds!",8; sleep 10000; }

    while(attachrid(getcharid(0,$@PlayerNameList$[$@Target])) && strcharinfo(3)!= $@Map$){

    set $@Target,rand(getarraysize($@PlayerNameList$));

    }

    mapannounce $@Map$,"[Round "+.@round+"] Our target is "+$@PlayerNameList$[$@Target]+"!",8;

    atcommand "killable "+$@PlayerNameList$[$@Target];

    atcommand "size "+$@PlayerNameList$[$@Target]+" 2";

    sleep 60000;

    if($@Target != -1){

    if(attachrid(getcharid(0,$@PlayerNameList$[$@Target])) && strcharinfo(3)== $@Map$){

    announce "Congrats to, "+strcharinfo(0)+" a winner in the "+$@Eventname$+" event!",bc_blue|bc_all;

    if($@Prizes[0])getitem $@Prizes[0],$@Prizes[1];

    if($@PrizePool[0])getitem $@Cost[0],($@Pool[0]*$@PrizePool[0]/10000);

    if($@Prizes[2]||$@PrizePool[1])set Zeny,Zeny+$@Prizes[2]+($@Pool[1]*$@PrizePool[1]/10000);

    }

    }

    atcommand "alive "+$@PlayerNameList$[$@Target]+"";

    atcommand "killable "+$@PlayerNameList$[$@Target]+"";

    atcommand "size "+$@PlayerNameList$[$@Target]+" 0";

    }

    }

    }

    disablenpc "ManhuntPrize";

    mapannounce $@Map$,"Event is Over",8;

    sleep 5000;

    mapwarp $@Map$,$@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    }

    //========================= Prizes ======================================

     

    1@zombie,175,120,4 script ZombiePrize 425,{

    mes "[Event Agent]";

    mes "So you mangaed to live";

    next;

    mes "[Event Agent]";

    mes "Here is your prize and goodbye";

    close2;

    announce "Congrats to, "+strcharinfo(0)+" a winner in the "+$@Eventname$+" event!",bc_blue|bc_all;

    if($@Prizes[0])getitem $@Prizes[0],$@Prizes[1];

    if($@PrizePool[0])getitem $@Cost[0],($@Pool[0]*$@PrizePool[0]/10000);

    if($@Prizes[2]||$@PrizePool[1])set Zeny,Zeny+$@Prizes[2]+($@Pool[1]*$@PrizePool[1]/10000);

    setarray $@Pool[0],0,0;

    warp $@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    end;

    OnKillZombie:

    getmapxy(.@pc_map$, .@pc_x, .@pc_y, 0);

    set .@i,rand(getarraysize($@Mob)/2)*2;

    monster $@Map$,.@pc_x+rand(-5,5),.@pc_y+rand(-5,5),"--ja--",$@Mobs[.@i],.@@Wave*$@Mob[.@i+1],"ZombiePrize::OnKillZombie";

    dispbottom "Don't do that";

    sc_start SC_DECREASEAGI,SC_DECREASEAGI,300000+$@MaxTime*60000,10;

    percentheal -20,-100;

    end;

    }

     

    quiz_01,205,92,4 script 1234-Prize 456,{

    mes "[Event Agent]";

    mes "Your a lucky one";

    next;

    mes "[Event Agent]";

    mes "I guess you get a prize";

    close2;

    announce "Congrats to, "+strcharinfo(0)+" a winner of the "+$@Eventname$+" event!",bc_blue|bc_all;

    if($@Prizes[0])getitem $@Prizes[0],$@Prizes[1];

    if($@PrizePool[0])getitem $@Cost[0],($@Pool[0]*$@PrizePool[0]/10000);

    if($@Prizes[2]||$@PrizePool[1])set Zeny,Zeny+$@Prizes[2]+($@Pool[1]*$@PrizePool[1]/10000);

    setarray $@Pool[0],0,0;

    warp $@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    end;

    }

     

    pvp_n_1-5,99,100,4 script PvpEventPrize 405,{

    mes "[Event Agent]";

    mes "So your the last one standing";

    next;

    mes "[Event Agent]";

    mes "Your reward";

    close2;

    announce "Congrats to, "+strcharinfo(0)+" the winner in the "+$@Eventname$+" event!",bc_blue|bc_all;

    if($@Prizes[0])getitem $@Prizes[0],$@Prizes[1];

    if($@PrizePool[0])getitem $@Cost[0],($@Pool[0]*$@PrizePool[0]/10000);

    if($@Prizes[2]||$@PrizePool[1])set Zeny,Zeny+$@Prizes[2]+($@Pool[1]*$@PrizePool[1]/10000);

    setarray $@Pool[0],0,0;

    warp $@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    disablenpc "PvpEventPrize";

    end;

    }

     

    maze,369,162,4 script MazePrize 405,4,4,{

    mes "[Event Agent]";

    mes "Walk up to me to claim prize~";

    close;

    OnTouch:

    mes "[Event Agent]";

    mes "So you mangaed to reach me";

    next;

    mes "[Event Agent]";

    mes "Here is your prize~";

    close2;

    announce "Congrats to, "+strcharinfo(0)+" a winner in the "+$@Eventname$+" event!",bc_blue|bc_all;

    if($@Prizes[0])getitem $@Prizes[0],$@Prizes[1];

    if($@PrizePool[0])getitem $@Cost[0],($@Pool[0]*$@PrizePool[0]/10000);

    if($@Prizes[2]||$@PrizePool[1])set Zeny,Zeny+$@Prizes[2]+($@Pool[1]*$@PrizePool[1]/10000);

    setarray $@Pool[0],0,0;

    warp $@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    end;

    }

     

    - script PoringPrize -1,{

    OnKillWrong:

    set .@i,rand(1,(getarraysize($@Mobs)/2))*2;

    monster $@Map$,0,0,$@MobNames$[.@i/2],$@Mobs[.@i],$@Mobs[.@i+1],"PoringPrize::OnKillWrong";

    warp $@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    end;

    OnKillRight:

    announce "Congrats to, "+strcharinfo(0)+" a winner in the "+$@Eventname$+" event!",bc_blue|bc_all;

    if($@Prizes[0])getitem $@Prizes[0],$@Prizes[1];

    if($@PrizePool[0])getitem $@Cost[0],($@Pool[0]*$@PrizePool[0]/10000);

    if($@Prizes[2]||$@PrizePool[1])set Zeny,Zeny+$@Prizes[2]+($@Pool[1]*$@PrizePool[1]/10000);

    setarray $@Pool[0],0,0;

    sleep2 1000;

    warp $@ReturnMap$[0],$@ReturnXY[0],$@ReturnXY[1];

    end;

    }

     

    - script ManhuntPrize -1,{

    OnPCDieEvent:

    if ($@CurrentEvent == -10 && strcharinfo(0) == $@PlayerNameList$[$@Target] ){

    if(attachrid(killerrid)) {

    announce "Congrats to, "+strcharinfo(0)+" a winner in the "+$@Eventname$+" event!",bc_blue|bc_all;

    if($@Prizes[0])getitem $@Prizes[0],$@Prizes[1];

    if($@PrizePool[0])getitem $@Cost[0],($@Pool[0]*$@PrizePool[0]/10000);

    if($@Prizes[2]||$@PrizePool[1])set Zeny,Zeny+$@Prizes[2]+($@Pool[1]*$@PrizePool[1]/10000);

    set $@Target,-1;

    }

    }

    end;

    OnPCLogOutEvent:

    if($@CurrentEvent == -10 && strcharinfo(0) == $@PlayerNameList$[$@Target]){

    mapannounce $@Map$,"The target has logged out of this game. This round will be nulled.",0;

    set $@Target,-1;

    }

    end;

    }

    //========================= Other =======================================

     

    maze,358,148,0 warp mazeroadblock 2,2,maze,371,149

     

    1@zombie mapflag gvg

    maze mapflag gvg

     

     


  2. Well if they take their time to review. Something should be given in my opinion. Maybe make it so they need to list pros and cons of the server with legitimate information as well as their player name to get the vote points. Otherwise if its like "nice server very nice gm great community" with their player name they would not receive the points. Detailing the pros and cons and their player name would be a sufficient review to give them the points. Glad you made this post because that's how I'll handle my v4p system. Thanks for the idea @@Mysterious :)

    Yeah. Not just a crappy review about the server. Those who will take their time in reviewing the server will get an incentive. Example, a 500 word essay about pros and cons of the server ? Lol. 


  3.  

    1110,DOKEBI,Dokebi,Dokebi,33,2697,0,889,455,1,197,249,0,10,50,50,40,35,69,40,10,12,0,6,27,0x191,250,1156,456,384,0,0,0,0,0,0,0,1021,9000,757,150,1517,2,1613,1,969,1,1501,300,1005,5,0,0,0,0,4098,1

    to
     

    1110,DOKEBI,Dokebi,Dokebi,33,2697,0,889,455,1,197,249,0,10,50,50,40,35,69,40,10,12,0,6,27,0x191,250,1156,456,384,0,0,0,0,0,0,0,1021,9000,757,150,1517,2,1613,1,969,0,1501,300,1005,5,0,0,0,0,4098,1

    Don't erase the drops, just set the drop rate to 0%
     
    Example. Removing gold drop from dokebi


  4. Nag switch ako from rA to Herc. Why ?

    1st - Plugin System

    2nd - Map Zone DB

    3rd - DBs especially item db is easier to understand

    4th - LOW USAGE OF RAM

     

    Downside of Hercules is that it lack of support. The number of good scripters is low. 


  5. Solved by Dastgir. sscan_f can't be recognized by the OS.

     

    #include <stdio.h>

    #include <stdlib.h>
    #include <string.h>

    #include "../common/HPMi.h"
    #include "../common/timer.h"
    #include "../map/script.h"
    #include "../map/pc.h"
    #include "../map/map.h"
    #include "../map/unit.h"
    #include "../map/atcommand.h"
    #include "../map/itemdb.h"

    #include "../common/HPMDataCheck.h"/* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) */

    #define OPTION_AUTOPOTS 0x40000000


    /*
    3.1 Plugins Release [Mhalicot]
    3.2 Update to Latest Revision [Mhalicot]
    4.0 Added autohp, autosp command Rev. 137* [Mhalicot]
    4.1 Fixed Compilation error. Rev. 145*** [Mhalicot]
    -----------------------------------------------------
    Documentation
    @autopots
    @autohp
    @autosp // Change autopots/hp/sp timer by replacing +500 in milisec
    timer->add(timer->gettick()+500,autoatpots_timer,sd->bl.id,0);
    */
    HPExport struct hplugin_info pinfo = {
    "autopots", // Plugin name
    SERVER_TYPE_MAP, // Which server types this plugin works with?
    "4.0", // Plugin version
    HPM_VERSION, // HPM Version (don't change, macro is automatically updated)
    };
    struct autopots {
    unsigned int hp_rate, sp_rate, hp_nameid, sp_nameid;
    };
    struct autopots autopots;
    void autoatpots_clean(struct map_session_data *sd)
    {
    if( sd )
    {
    sd->sc.option &= ~OPTION_AUTOPOTS;
    autopots.hp_nameid = 0;
    autopots.hp_rate = 0;
    autopots.sp_nameid = 0;
    autopots.sp_rate = 0;
    clif->changeoption(&sd->bl);
    }
    return;
    }
    void autoathp_clean(struct map_session_data *sd)
    {
    if( sd )
    {
    sd->sc.option &= ~OPTION_AUTOPOTS;
    autopots.hp_nameid = 0;
    autopots.hp_rate = 0;
    clif->changeoption(&sd->bl);
    }
    return;
    }
    void autoatsp_clean(struct map_session_data *sd)
    {
    if( sd )
    {
    sd->sc.option &= ~OPTION_AUTOPOTS;
    autopots.sp_nameid = 0;
    autopots.sp_rate = 0;
    clif->changeoption(&sd->bl);
    }
    return;
    }
    int autoatpots_timer(int tid, int64 tick, int id, intptr_t data)
    {
    struct map_session_data *sd=NULL;
    struct item_data* item = NULL;
    int index;
    sd=map->id2sd(id);
    if( sd == NULL )
    return 0;
    if(sd->sc.option & OPTION_AUTOPOTS)
    {
    unsigned int hp_rate = autopots.hp_rate;
    unsigned int sp_rate = autopots.sp_rate;
    unsigned int hp_nameid = autopots.hp_nameid;
    unsigned int sp_nameid = autopots.sp_nameid;
    if( ( !sp_rate && !hp_rate ) || pc_isdead(sd) )
    {
    if( !hp_rate )
    {
    clif->message(sd->fd, "Auto-SP : OFF_");
    autoatsp_clean(sd);
    return 0;
    }else
    if( !sp_rate )
    {
    clif->message(sd->fd, "Auto-HP : OFF_");
    autoathp_clean(sd);
    return 0;
    }
    else{
    clif->message(sd->fd, "Auto-pots : OFF_");
    autoatpots_clean(sd);
    return 0;
    }
    }

    if( ( sd->battle_status.hp*100/sd->battle_status.max_hp ) < hp_rate && hp_nameid && hp_rate )
    {
    ARR_FIND(0, MAX_INVENTORY, index, sd->status.inventory[index].nameid == hp_nameid);
    if( sd->status.inventory[index].nameid == hp_nameid )
    pc->useitem(sd,index);
    }
    if( ( sd->battle_status.sp*100/sd->battle_status.max_sp ) < sp_rate && sp_nameid && sp_rate )
    {
    ARR_FIND(0, MAX_INVENTORY, index, sd->status.inventory[index].nameid == sp_nameid);
    if( sd->status.inventory[index].nameid == sp_nameid )
    pc->useitem(sd,index);
    }
    timer->add(timer->gettick()+100,autoatpots_timer,sd->bl.id,0);
    }
    return 0;
    }
    ACMD(autopots)
    {
    int hp_rate=0, hp_nameid=0, sp_rate=0, sp_nameid=0;
    if( !sd ) return 0;

    if ( !message || !*message || (
    sscanf(message, "%d %d %d %d ", &hp_rate, &hp_nameid, &sp_rate, &sp_nameid) < 4) ||
    ( hp_rate < 0 || hp_rate > 99 ) ||
    ( sp_rate < 0 || sp_rate > 99 ) )
    {
    if ( sscanf(message, "%d %d %d %d ", &hp_rate, &hp_nameid, &sp_rate, &sp_nameid) < 4 &&
    sscanf(message, "%d %d %d %d ", &hp_rate, &hp_nameid, &sp_rate, &sp_nameid) > 0)
    {
    clif->message(fd, "@autopots ");
    return false;
    }
    clif->message(fd, "Auto-pots : OFF");
    autoatpots_clean(sd);
    return true;
    }

    if (sd->sc.option & OPTION_AUTOPOTS)
    {
    autoatpots_clean(sd);
    }
    if( hp_rate == 0 ) hp_nameid = 0;
    if( sp_rate == 0 ) sp_nameid = 0;
    if( hp_nameid == 0 ) hp_rate = 0;
    if( sp_nameid == 0 ) sp_rate = 0;
    if( itemdb->exists(hp_nameid) == NULL && hp_nameid )
    {
    hp_nameid = 0;
    hp_rate = 0;
    clif->message(fd, "Auto-pots : Invalid item for HP");
    }
    if( itemdb->exists(sp_nameid) == NULL && sp_nameid )
    {
    sp_nameid = 0;
    sp_rate = 0;
    clif->message(fd, "Auto-pots : Invalid item for SP");
    return true;
    }
    clif->message(fd, "Auto-pots : ON");
    sd->sc.option |= OPTION_AUTOPOTS;
    autopots.hp_nameid = hp_nameid;
    autopots.hp_rate = hp_rate;
    autopots.sp_nameid = sp_nameid;
    autopots.sp_rate = sp_rate;
    timer->add(timer->gettick()+200,autoatpots_timer,sd->bl.id,0);

    clif->changeoption(&sd->bl);
    return true;
    }
    ACMD(autohp)
    {
    int hp_rate=0, hp_nameid=0;
    if( !sd ) return 0;

    if (!message || !*message || (
    sscanf(message, "%d %d ", &hp_rate, &hp_nameid) < 2) ||
    ( hp_rate < 0 || hp_rate > 99 ) )
    {
    if ( sscanf(message, "%d %d ", &hp_rate, &hp_nameid) < 2 &&
    sscanf(message, "%d %d ", &hp_rate, &hp_nameid) > 0)
    {
    clif->message(fd, "@autohp ");
    return true;
    }
    clif->message(fd, "Auto-HP : OFF");
    autoathp_clean(sd);
    return true;
    }

    if (sd->sc.option & OPTION_AUTOPOTS)
    {
    autoathp_clean(sd);
    }
    if( hp_rate == 0 ) hp_nameid = 0;
    if( hp_nameid == 0 ) hp_rate = 0;
    if( itemdb->exists(hp_nameid) == NULL && hp_nameid )
    {
    hp_nameid = 0;
    hp_rate = 0;
    clif->message(fd, "Auto-HP : Invalid item for HP");
    return true;
    }
    clif->message(fd, "Auto-HP : ON");
    sd->sc.option |= OPTION_AUTOPOTS;
    autopots.hp_nameid = hp_nameid;
    autopots.hp_rate = hp_rate;
    timer->add(timer->gettick()+200,autoatpots_timer,sd->bl.id,0);

    clif->changeoption(&sd->bl);
    return true;
    }
    ACMD(autosp)
    {
    int sp_rate=0, sp_nameid=0;
    if( !sd ) return 0;

    if (!message || !*message || (
    sscanf(message, "%d %d ", &sp_rate, &sp_nameid) < 2) ||
    ( sp_rate < 0 || sp_rate > 99 ) )
    {
    if ( sscanf(message, "%d %d ", &sp_rate, &sp_nameid) < 2 &&
    sscanf(message, "%d %d ", &sp_rate, &sp_nameid) > 0)
    {
    clif->message(fd, "@autosp ");
    return true;
    }
    clif->message(fd, "Auto-SP : OFF");
    autoatsp_clean(sd);
    return true;
    }

    if (sd->sc.option & OPTION_AUTOPOTS)
    {
    autoatsp_clean(sd);
    }
    if( sp_rate == 0 ) sp_nameid = 0;
    if( sp_nameid == 0 ) sp_rate = 0;
    if( itemdb->exists(sp_nameid) == NULL && sp_nameid )
    {
    sp_nameid = 0;
    sp_rate = 0;
    clif->message(fd, "Auto-SP : Invalid item for SP");
    return true;
    }
    clif->message(fd, "Auto-SP : ON");
    sd->sc.option |= OPTION_AUTOPOTS;
    autopots.sp_nameid = sp_nameid;
    autopots.sp_rate = sp_rate;
    timer->add(timer->gettick()+200,autoatpots_timer,sd->bl.id,0);

    clif->changeoption(&sd->bl);
    return true;
    }
    /* Server Startup */
    HPExport void plugin_init (void)
    {
    clif = GET_SYMBOL("clif");
    script = GET_SYMBOL("script");
    pc = GET_SYMBOL("pc");
    atcommand = GET_SYMBOL("atcommand");
    map = GET_SYMBOL("map");
    unit = GET_SYMBOL("unit");
    timer = GET_SYMBOL("timer");
    itemdb = GET_SYMBOL("itemdb");

    addAtcommand("autopots",autopots);//link our '@autopots' command
    addAtcommand("autohp",autohp);//link our '@autohp' command
    addAtcommand("autosp",autosp);//link our '@autosp' command
    }

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.