Jump to content
  • 0

how to make this automated event


jpnazar

Question


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   1
  • Joined:  03/26/13
  • Last Seen:  

how to make this automatic event every 1hr&30minute and broadcast when starting in 3mins

turbo_room,128,97,5    script    Counting Game    437,{
mes "This is a Monsters Counting Game";
mes "I will summon some Monsters here, and you have to count the Correct Amount of Monsters i summoned.";
mes "^FF0000Only Count for the Monsters i mentioned^000000";
next;
switch( select( "Information",
                ( getgmlevel() < .GMLevel || .Event )?"":"^FF0000[GM]^000000 Start Game",
                ( getgmlevel() < .GMLevel || !.Event )?"":"^FF0000[GM]^000000 End Game" )){
                
Case 1:
    mes "When the Event Start, i will summon some Monsters at a small area, and players have to count the amount of the flowers.";
    mes "Whoever tell me the correct amount of Monsters i mentioned, he/she win the game.";
    break;
    
Case 2:
    mes "Event will begin right now.";
    close2;
    donpcevent strnpcinfo(0)+"::OnStartGame";
    end;
Case 3:
    set .Event,0;
    set .Round,0;
    deletepset 1;
    delwaitingroom;
    set .Winner[0],0;
    set .Winner[1],0;
    npctalk "Counting Game Cancelled.";
    killmonster .Map$,"All";
    mes "Game Cancelled.";
    break;
}
close;
OnSpammed:
    set @Spam,0;
    end;
    
iSpam:
    if( getgmlevel() > 90 ) end;
    set @Spam,@Spam + 1;
    if( @Spam >= .Spam ){    // 3 Continuos Answer will trigger...
        set @SpamDelay,gettimetick(2) + .Spam;
        dispbottom "SPAM Detected, your answer within next "+.Spam+" Seconds will be Ignored.";
    }
    deltimer strnpcinfo(0)+"::OnSpammed";
    addtimer ( .Spam * 1000 ),strnpcinfo(0)+"::OnSpammed";
    end;
    
iRight:
set @Spam,0;
deltimer strnpcinfo(0)+"::OnSpammed";
if( !.Event ){
    message strcharinfo(0),"Sorry, there is no Event right now.";
}else if( @SpamDelay > gettimetick(2) ){
    message strcharinfo(0),"SPAM Protection : Remain "+( @SpamDelay - gettimetick(2) )+" seconds.";
}else if( getcharid(0) == .Winner[0] && gettimetick(2) < .Winner[1] ){
    message strcharinfo(0),"Sorry, Winner Time Penalty : Remain "+( .Winner[1] - gettimetick(2) )+" seconds.";
}else{
    delwaitingroom;
    set .Event,0;
    set .Round,.Round - 1;
    set .Winner[0],getcharid(0);
    set .Winner[1],gettimetick(2) + .Delay;
    npctalk "[ "+strcharinfo(0)+" ] , You're Correct.";
    killmonster .Map$,"All";
    deletepset 1;
    if( getarraysize( .Reward$ ) > 1 )
        for( set .@i,0; .@i < getarraysize( .Reward$ ) - 1; set .@i,.@i + 2 )
            if( getitemname( atoi( .Reward$[.@i] ) ) == "null" ){
                set getd( .Reward$[.@i] ),getd( .Reward$[.@i] ) + atoi( .Reward$[.@i+1] );
                dispbottom "Reward : "+.Reward$[.@i]+" + "+.Reward$[.@i+1];
            }else{
                getitem atoi( .Reward$[.@i] ),atoi( .Reward$[.@i+1] );
                dispbottom "Reward : "+getitemname( atoi( .Reward$[.@i] ) )+" x "+.Reward$[.@i+1];
            }
if( .Round ) donpcevent strnpcinfo(0)+"::OnStartGame";
}
end;
OnInit:
//    Min. GM Level to access GM Panel
set .GMLevel,80;
//    Game Location
set .Map$,"turbo_room";
//    Monster ID Lists
setarray .MonsterList[0],1084,1085;
//    Winners Answer Delay ( Not advised for High Value )
set .Delay,10;
//    Spam Prevention ( Not advised for High Value )
set .Spam,3;
//    How many rounds
set .MaxRound,10;
//    Area Coordination    <x1>,<y1>,<x2>,<y2>;
setarray .Coordinate,125,88,131,95;
//    Rewards ...
setarray .Reward$[0],
            "Zeny","5000000",
            "7227","10",
            "7539","100";
end;
OnMinute30:
for( set .@i,60; .@i > 0; set .@i,.@i - 10 ){
    announce "Flower Counting Game : start within "+.@i+" Seconds in "+.Map$,0;
    sleep 10000;
}    
OnStartGame:
    if( !.Round ) set .Round,.MaxRound;
    announce "Counting Game has started in "+.Map$,0;
    deletearray .MobCount[0],getarraysize( .MobCount );
    for( set .@x,.Coordinate[0]; .@x <= .Coordinate[2]; set .@x,.@x + 1 )
        for( set .@y,.Coordinate[1]; .@y <= .Coordinate[3]; set .@y,.@y + 1 ){
            set .@Summon,rand( getarraysize( .MonsterList ) );
            monster .Map$,.@x,.@y,"Count Me",.MonsterList[.@Summon],1,strnpcinfo(0)+"::OnKilled";
            set .MobCount[.@Summon],.MobCount[.@Summon] + 1;
            sleep2 1;
        }
    set .@Target,rand( getarraysize( .MonsterList ) );
    deletepset 1;
    defpattern 1, "([^:]+): (\\|\\d{2})?"+.MobCount[.@Target]+ ".$", "iRight";
    // defpattern 1,"([^:]+): "+.MobCount[.@Target], "iRight";
    defpattern 1,"([^:]+):.*.*", "iSpam";
    activatepset 1;
    delwaitingroom;
    waitingroom getmonsterinfo( .MonsterList[.@Target],0 ),0;
    npctalk "Count for the Targeted Monster's Amount to Win the Game.";
    set .Event,1;
    end;
    
OnKilled:
    mes "You will be punished upon killing these Monsters and interupt the Game.";
    set @Spam,30;
    close2;
    npctalk "Round Restarted due to interruption.";
    donpcevent strnpcinfo(0)+"::OnStartGame";
    end;
}
Edited by Capuche
Change Quote to Code
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  353
  • Reputation:   70
  • Joined:  07/14/12
  • Last Seen:  

replace OnMinute with
OnClock
 
anyway your on the wrong section

you should have posted it here http://rathena.org/board/forum/35-source-support/
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   1
  • Joined:  03/26/13
  • Last Seen:  

okay sir thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...