Jump to content

MikZ

Members
  • Content Count

    461
  • Joined

  • Last visited

Posts posted by MikZ


  1. On 9/24/2019 at 4:12 PM, bWolfie said:

    https://pastebin.com/H9e2SG9t

    Based on the old exp.txt tables. This only works for base level 999.

    If you want to use a lower level, you need to comment out all entries above that level. E.g. if you want base level 500, you need to comment out entries 500-999.

    The formula for no. of entries you need is [Max Base Level - 1]. So if max level is 400, you need 399 entries; 250 needs 249, and so on.

    Let me know if there are any issues with it.



    Good day! Do you have for Job level 120 or formula for this. thank you!


  2. Good day!

    Can someone help me to make this script work with Hercules. thank you!

     

    -	script	WoE_Reward	FAKE_NPC,{
    OnAgitEnd: callsub S_AgitEnd, 0, 20;
    OnAgitEnd2: callsub S_AgitEnd, 21, 30;
    S_AgitEnd:
    	.@start = getarg(0);
    	.@end = getarg(1);
    	for ( .@i = .@start; .@i < .@end; ++.@i ) {
    		.@guild_id = getcastledata( .castle$[.@i], 1 );
    		if ( .@guild_id ) {
    			deletearray .@unique_id;
    			getguildmember .@guild_id, 1;
    			getguildmember .@guild_id, 2;
    			for ( .@j = 0; .@j < $@guildmembercount; ++.@j ) {
    				if ( isloggedin( $@guildmemberaid[.@j], $@guildmembercid[.@j] ) ) {
    					attachrid $@guildmemberaid[.@j];
    					if (setarray(.@unique_id, get_unique_id() ) == 0 ) {
    						dispbottom "Reward given for conquered "+ getcastlename(.castle$[.@i]) +"("+ .castle$[.@i] +")";
    						//getitem 31509, 1;
    						//getitem 12103, 1;
    						//getitem 16770, 1;
    						//getitem 6380, 15;
    						getitem 11504, 100;
    						getitem 11503, 250;
    						getitem 25046, 10;
    						.@unique_id[ getarraysize(.@unique_id) ] = get_unique_id();
    					}
    				}
    			}
    		}
    	}
    	end;
    OnInit:
    	setarray .castle$[0],
    		"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05",
    		"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05",
    		"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05",
    		"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05",
    		"arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05",
    		"schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05";
    	end;
    }

     


  3. Good day!

    May I request please.
    whats the equivalent of addrid to hercules and how to add to this script. thank you!

    function	script	getcharid2	{
    	.@size = query_sql("select char_id, party_id, guild_id, account_id, clan_id from `char` where name = '"+getarg(1)+"'",.@charid,.@pid,.@gid,.@aid,.@cid);
    	if(.@size < 0) return 0;
    	if(getarg(0)==0) return .@charid;
    	else if(getarg(0)==1) return .@pid;
    	else if(getarg(0)==2) return .@gid;
    	else if(getarg(0)==3) return .@aid;
    	else if(getarg(0)==4) return .@cid;
    	return 0;
    }
    
    -	script	woerewards	-1,{ 
    
    function	AddPlayer	{ //player name , npc name
    	for (.@i = 0 ; .@i < getvariableofnpc(.player_amount,getarg(1)) ; .@i += 3)
    		if (getvariableofnpc(.players$[.@i],getarg(1)) == getarg(0)) return;
    	setarray getvariableofnpc(.players$[getvariableofnpc(.player_amount,getarg(1))],getarg(1)) , getarg(0) , strcharinfo(3) , "0";
    	set getvariableofnpc(.player_amount,getarg(1)) , getvariableofnpc(.player_amount,getarg(1)) + 3;
    	return;
    }
    
    OnInit:
    	setarray .maps$ ,"schg_cas03", "prtg_cas01"; //maps where the system is active
        .points_per_minute = 1; //number of points earned for each minute you spend in the castle
        for (.@i = 0 ; .@i < getarraysize(.maps$) ; .@i++)
            if (!getmapflag(.maps$[.@i],mf_loadevent)) setmapflag .maps$[.@i],mf_loadevent;
    
        .s_idle_time = 180; // time before player is considered idle (in seconds)
        .rewardId = 909;    // ID of the reward item
        .announce = 0;  // Announce kills (0 = no announcement, 1 = map announcement, 2 = global announcement)
        .color_defenders$ = "0xffff00"; // Announcement color when a defending player kills an attacking player
        .color_attackers$ = "0x99ccff"; // Announcement color when an attacking player kills a member of the castle's owner
        .kill_reward = 1;   // Amount of points earned for every kill, set to 0 to disable it
        setarray .class_modifier[0],4063,3,4076,2;  // Modifier for certain classes [Id, Modifier, Id, Modifier....]
    	if(agitcheck() || agitcheck2()) initnpctimer;
    	end;
    
    OnAgitStart:
    	.@sql$ = "DELETE from `char_reg_num` WHERE `key` = 'woepoints' OR `key` = 'woedeaths' OR `key` = 'woekills' OR `key` = 'woedamage' OR `key` = 'woeempbreak'";
    	query_sql(.@sql$);
    	addrid(0);
    	woepoints = 0;
    	detachrid();
    	initnpctimer;
    	end;
    
    OnPCLoadMapEvent:
    	if(!agitcheck() || !getcharid(2)) end;
    	for (.@i = 0 ; .@i < getarraysize(.maps$) ; .@i++) {
    		if (.maps$[.@i] == strcharinfo(3)) {
    			if(!woepoints) {
    				dispbottom "You've entered a WoE castle map, you will gain rewards for each minute you spend in this castle.";
    			}
    			AddPlayer(strcharinfo(0),strnpcinfo(0));
    		}
    	}
    	end;
    
    OnTimer10000: //will check every ten seconds if player is still on the map
    	freeloop (1);
    	for (.@i = 0 ; .@i < .player_amount ; .@i += 3) {
    		if (!attachrid(getcharid2(3,.players$[.@i]))) { deletearray .players$[.@i],3 ; .player_amount -= 3; }
    		else if(strcharinfo(3) != .players$[.@i+1]) { deletearray .players$[.@i],3 ; .player_amount -= 3; }
    	}
    	for (.@i = 0 ; .@i < .player_amount ; .@i += 3) {
    		if(checkidle() < .s_idle_time) {    // no points for idle players
                setarray .players$[.@i+2] , ""+(atoi(.players$[.@i+2]) + 1)+"";
                if (atoi(.players$[.@i+2]) >= 6) {
                    if(attachrid(getcharid2(3,.players$[.@i]))) {
                        woepoints += .points_per_minute;
                        dispbottom "You've spent one minute in WoE and gained a WoE point."
                        dispbottom "Total points earned: "+woepoints;
                        setarray .players$[.@i+2] , "0";
                    }
                }
            }
    	}
    	initnpctimer;
    	freeloop(0);
    	end;
    
    OnPCKillEvent:
    	if(!agitcheck() || !getcharid(2) || !.kill_reward) end;
    	if(inarray(.maps$,strcharinfo(3)) == -1) end;
    	dispbottom "You've recieved "+.kill_reward+" Points for killing "+rid2name(killedrid);
    	woepoints += .kill_reward;
        .@color$ = getcharid(2) == getcastledata(strcharinfo(3),CD_GUILD_ID) ? .color_defenders$ :  .color_attackers$;
        if(.announce == 1) 
            announce "[WoE]: "+strcharinfo(0)+" Has Killed "+rid2name(killedrid),bc_all,.@color$;
        if(.announce == 2)
            mapannounce strcharinfo(3),"[WoE]: "+strcharinfo(0)+" Has Killed "+rid2name(killedrid),bc_map,.@color$;
    	end;
    	
    OnPCDieEvent:
    	if(!agitcheck() || !getcharid(2)) end;
    	if(inarray(.maps$,strcharinfo(3)) == -1) end;
    	dispbottom "You've been killed by "+rid2name(killerrid);
    	end;
    
    OnPCLogoutEvent:
    	if(!agitcheck() && !agitcheck2()) 
    		woepoints = 0;
    	end;
    
    OnAgitEnd:
    	stopnpctimer;
    	//participation rewards.
    	.@sql$ = "SELECT `char_id`, `value` FROM `char_reg_num` WHERE `key` = 'woepoints'";
    	query_sql(.@sql$,.@ids, .@points);
    	for(.@i = 0; .@i < getarraysize(.@ids); .@i++) {
            .@modifier = inarray(.class_modifier, Class) > -1 ? .class_modifier[inarray(.class_modifier, Class)+1] : 1;
    		.@charid = .@ids[.@i];
    		.@sender$ = "[WoE Rewards]";
    		.@title$ = "Rewards";
    		.@body$ = "You've recieved a reward for participating in war of emperium.\nTotal Participation Time:";
    		setarray .@itemarray[0],.coinid;
    		setarray .@itemamtarray[0], .@points[.@i] * .@modifier;
    		mail .@charid,.@sender$,.@title$,.@body$,.@zeny,.@itemarray,.@itemamtarray;
    	}
    	end;
    
    }

     


  4. On 11/10/2020 at 4:31 AM, AnnieRuru said:

    I found this in src\map\packet_struct.h

    struct PACKET_ZC_USE_ITEM_ACK { int16 packetType; int16 index; #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 uint32 itemId; uint32 AID; #elif PACKETVER >= 3 uint16 itemId; uint32 AID; #endif int16 amount; uint8 result; } __attribute__((packed));

    
    struct PACKET_ZC_USE_ITEM_ACK {
    	int16 packetType;
    	int16 index;
    #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
    	uint32 itemId;
    	uint32 AID;
    #elif PACKETVER >= 3
    	uint16 itemId;
    	uint32 AID;
    #endif
    	int16 amount;
    	uint8 result;
    } __attribute__((packed));

    so client version 20181121 below uses `RBUFL(buf, 6)`, anything above use `RBUFL(buf, 8)`

     

    1.0 - plugin

    - introduce type [D], direction packet, and existing Dance/songs move to type `[M]usic`

    - no longer use nested IF-ELSE, use switch statement on the packet header for faster read speed

    - fix [I.]tem type throw nullpo error on 2018 client

    - add Caution as a warning that certain packet filter wont work correctly

     

    and I guess this is finally over

    time to mention everyone that has PM me about this project

    @raPalooza~

    @Azhura

    @freezing1

    @xJhay

    @Kuroyama

    @fiction

    @Skyzone

    @cusco ? <-- from discord

     

     

    On 11/10/2020 at 12:57 PM, 4144 said:

    if you want change some fields in packet, better use pointer to struct

    PACKET_ZC_USE_ITEM_ACK

    
    PACKET_ZC_USE_ITEM_ACK

     

     

    @AnnieRuru @4144

    Is it possible to include the announcements. map announce and global announce?


  5. Good day!

    May I request someone to make this compatible with hercules?. thank you!

     

    /*==========================================
     *
     *------------------------------------------*/
    ACMD_FUNC(monster)
    {
    	char name[NAME_LENGTH];
    	char monster[NAME_LENGTH];
    	char eventname[EVENT_NAME_LENGTH] = "";
    	int mob_id;
    	int number = 0;
    	int count;
    	int i, range;
    	short mx, my;
    	unsigned int size;
    	nullpo_retr(-1, sd);
    
    	memset(name, '\0', sizeof(name));
    	memset(monster, '\0', sizeof(monster));
    	memset(atcmd_output, '\0', sizeof(atcmd_output));
    
    	if (!message || !*message) {
    			clif_displaymessage(fd, msg_txt(sd,80)); // Give the display name or monster name/id please.
    			return -1;
    	}
    	if (sscanf(message, "\"%23[^\"]\" %23s %11d", name, monster, &number) > 1 ||
    		sscanf(message, "%23s \"%23[^\"]\" %11d", monster, name, &number) > 1) {
    		//All data can be left as it is.
    	} else if ((count=sscanf(message, "%23s %11d %23s", monster, &number, name)) > 1) {
    		//Here, it is possible name was not given and we are using monster for it.
    		if (count < 3) //Blank mob's name.
    			name[0] = '\0';
    	} else if (sscanf(message, "%23s %23s %11d", name, monster, &number) > 1) {
    		//All data can be left as it is.
    	} else if (sscanf(message, "%23s", monster) > 0) {
    		//As before, name may be already filled.
    		name[0] = '\0';
    	} else {
    		clif_displaymessage(fd, msg_txt(sd,80)); // Give a display name and monster name/id please.
    		return -1;
    	}
    
    	if ((mob_id = mobdb_searchname(monster)) == 0) // check name first (to avoid possible name begining by a number)
    		mob_id = mobdb_checkid(atoi(monster));
    
    	if (mob_id == 0) {
    		clif_displaymessage(fd, msg_txt(sd,40)); // Invalid monster ID or name.
    		return -1;
    	}
    
    	if (mob_id == MOBID_EMPERIUM) {
    		clif_displaymessage(fd, msg_txt(sd,83)); // Monster 'Emperium' cannot be spawned.
    		return -1;
    	}
    
    	if (number <= 0)
    		number = 1;
    
    	if( !name[0] )
    		strcpy(name, "--ja--");
    
    	// If value of atcommand_spawn_quantity_limit directive is greater than or equal to 1 and quantity of monsters is greater than value of the directive
    	if (battle_config.atc_spawn_quantity_limit && number > battle_config.atc_spawn_quantity_limit)
    		number = battle_config.atc_spawn_quantity_limit;
    
    	parent_cmd = atcommand_alias_db.checkAlias(command+1);
    
    	if (strcmp(parent_cmd, "monstersmall") == 0)
    		size = SZ_MEDIUM; // This is just gorgeous [mkbu95]
    	else if (strcmp(parent_cmd, "monsterbig") == 0)
    		size = SZ_BIG;
    	else
    		size = SZ_SMALL;
    
    	if (battle_config.etc_log)
    		ShowInfo("%s monster='%s' name='%s' id=%d count=%d (%d,%d)\n", command, monster, name, mob_id, number, sd->bl.x, sd->bl.y);
    
    	count = 0;
    	range = (int)sqrt((float)number) +2; // calculation of an odd number (+ 4 area around)
    	for (i = 0; i < number; i++) {
    		int k;
    		map_search_freecell(&sd->bl, 0, &mx,  &my, range, range, 0);
    		k = mob_once_spawn(sd, sd->bl.m, mx, my, name, mob_id, 1, eventname, size, AI_NONE);
    		if(k) {
    			//mapreg_setreg(reference_uid(add_str("$@mobid"), i),k); //retain created mobid in array uncomment if needed
    			count ++;
    		}
    	}
    
    	if (count != 0)
    		if (number == count){
    		if(pc_get_group_level(sd)==99){ // Checks if the GM level is below 99 Announcement is made [Vengeance]
    			clif_displaymessage(fd, msg_txt(sd,39)); // All monster summoned!
    		}
    		else {
    			sprintf(atcmd_output, "%s summoned %d %s in %s,%d,%d", sd->status.name,number, monster, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y);
    			//sprintf(atcmd_output, msg_txt(sd,240), count); // %d monster(s) summoned! // <-- ORIG CODE
    			//clif_displaymessage(fd, atcmd_output);
    			intif_broadcast(atcmd_output, strlen(atcmd_output) + 1, 0);
    			clif_displaymessage(fd, msg_txt(sd,39)); // All monster summoned!		
    	}
    }
    	else {
    		sprintf(atcmd_output, "%s summoned %d %s in %s,%d,%d", sd->status.name,number, monster, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y);
    		intif_broadcast(atcmd_output, strlen(atcmd_output) + 1, 0);
    		sprintf(atcmd_output, msg_txt(sd,240), count); // %d monster(s) summoned!
    		//clif_displaymessage(fd, atcmd_output);
    	}
    	else {
    		clif_displaymessage(fd, msg_txt(sd,40)); // Invalid monster ID or name.
    		return -1;
    	}
    	return 0;
    }

     


  6. 1 minute ago, 4144 said:

    error because you using not same versions of plugin and hercules.

     

    @4144 what do you mean not same version of plugin and hercules? I did git clone https://github.com/HerculesWS/Hercules.git ~/Hercules then get the lates version of plugin from Dastgir github. Does this mean the lates git of EBG is not compatible with the latest version of git?


  7. On 10/20/2020 at 5:39 PM, AnnieRuru said:

    select * from item_db where type = 5 and equip_locations & 4 and view_sprite > 0;

    
    select * from item_db where type = 5 and equip_locations & 4 and view_sprite > 0;

    yeah my RO knowledge is again outdated, never thought robes can show sprite change

     

    3.6 - script

    - fix a missing sprite change from LOOK_ROBE

     

     

    PS: why the wings on my character is being chop off but the statue is display correctly ? WTF ??

    screen2020Hercules006.jpg



    Hi @AnnieRuru, can you add reward system weekly and monthly ?

    player need to talk to npc to redeem the prize.
    I know i already made this request in other post. thanks!


  8. On 10/16/2020 at 9:11 AM, AnnieRuru said:

    @MikZ still need ?

    I just wrote a blog about how to send weekly rewards
    https://annieruru.blogspot.com/2020/10/how-to-send-weekly-rewards-to-players.html

    might as well do this

    based on this topic, I assumed you are using hercules ?

     

    and reset the ladder weekly and sent rewards ?
    the ladder never stay forever ?

     

    reward sent as mail or a custom SQL table ?



    Hi @AnnieRuru,  just like your MVP ladder 

    • Reset ladder weekly
    • Also total for the month (if possible)
    • I think its via SQL table, players will be the one to redeem from NPC.
    OnInit:
    	// set reward here ... 1st place won 10 red pot, 2nd place won 9 orange pot ... etc ...
    	setarray .reward, 7227, 7227, 7227, 7227, 7227, 25047, 25047, 25047, 25047, 25047;
    	setarray .amount, 10, 8, 7, 6, 5, 10, 8, 7, 6, 5;
    	
    	if ( !$mvp_rank_1st_sunday )
    		query_sql "select curdate() - dayofweek( curdate() ) +1", $mvp_rank_1st_sunday; // TRICK !! how to save the 1st sunday once the script installed
    OnSun0000:
    	query_sql "select datediff( curdate(), '"+ $mvp_rank_1st_sunday +"' ) /7", .this_week_index;
    	if ( .this_week_index == $mvp_rank_week_index ) end;
    	.@query$  = "SELECT char_id, `name`, IF(@d=t.`mvp_kills`, @r, @r:=@i), @d:=t.`mvp_kills`, @i:=@i+1 ";
    	.@query$ += "FROM `mvp_rank` t, (SELECT @d:=0, @r:=0, @i:=1)q ";
    	.@query$ += "ORDER BY `mvp_kills` DESC LIMIT 10";
    	.@nb = query_sql(.@query$, .@cid, .@name$, .@rank, .@kills, .@dummy);
    	if ( .@nb ) {
    		for ( .@i = 0; .@i < .@nb; ++.@i ) {
    			.@reward_query$[.@i] = "( "+ .@cid[.@i] +", "+ $mvp_rank_week_index +", "+ .@rank[.@i] +" )";
    			.@archive_query$[.@i] = "( "+ $mvp_rank_week_index +", "+ .@rank[.@i] +", "+ .@cid[.@i] +", '"+ escape_sql(.@name$[.@i]) +"', "+ .@kills[.@i] +" )";
    		}
    	//	query_sql "truncate table mvp_rank_archive"; // uncomment this line if you love to periodically clean your data
    		query_sql "insert into mvp_rank_reward values "+ implode( .@reward_query$, ", " );
    		query_sql "insert into mvp_rank_archive values "+ implode( .@archive_query$, ", " );
    		query_sql "truncate table mvp_rank";
    	}
    	$mvp_rank_week_index = .this_week_index;
    	end;

     


  9. Good day Master Scripters

    May I request your help please.
    To convert this script compatible to hercules.

    // Basic Event Manager
    // By Mabuhay
    /*-=-=-=-=-=-=-=-=-=-=-=-=-=-
     Currently added are the ff :
     {#} NAME - "NPC_NAME" 
     [1] Bombring - "Event_Bombring"
     [2] Dice - "Event_Dice"
     [3] Last Man Standing - "Event_LMS"
     [4] Novice V Zombie - "Event_NvZ"
     [5] Poring Catcher - "Poring_Catcher"
     [6] Poring Hunter - "Poring_Hunter" (Added 12-15-2019)
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
    // For easier management of Event NPCs
    /////////////////////////////////////
    //            NOTE:                //
    /////////////////////////////////////
    // I don't support any modifications unless I want to.
    // But if you want to change things especially the rewards,
    // Please refer to my F_Reward Functions
    // https://rathena.org/board/files/file/4068-itemvariablepoints-reward-function-for-beginners-or-lazy/
    // You should be able to easily change the rewards
    // If you have basic scripting knowledge
    
    -	script	Event_Manager	FAKE_NPC,{
    OnInit:
    	// 1 = item reward
    	// 2 = variable/cashpoints reward
    	// If you want to set item and variable/cashpoints rewards, do 1|2.
    	// If you only want 1, just choose between 1 or 2
    	$event_options = 1;
    	
    	// If item reward enabled
    	// What items will be rewarded
    	setarray $event_item_reward,
    		501, 10,
    		502, 5;
    		
    	// If variable reward.. set to your variable.
    	// If cashpoints.. set to #CASHPOINTS / #KAFRAPOINTS (Free Cash Points)
    	$event_var$ = "#EVENTVARIABLE";
    	
    	// Variable name?
    	// If cash points, set to Cash Points
    	// If your custom var, set to the name of that thing.
    	$event_var_name$ = "Custom Points";
    	
    	// How much points gain if #VAR / #CASHPOINTS / #KAFRAPOINTS?
    	$event_var_gain = 1;
    	
    	$event_item_arr = getarraysize($event_item_reward);
    	
    	// @eventstart for GM
    	bindatcmd "eventstart", strnpcinfo(0)+"::OnStart",60,60;
    	
    	// @eventjoin
    	bindatcmd "eventjoin", strnpcinfo(0)+"::OnJoinEvent";
    	end;
    	
    OnStart:
    	mes "Select what event to start:";
    	next;
    	switch(select("~ Bombring","~ Dice","~ LMS","~ Poring Catcher","~ NvZ","~ Poring Hunter")) {
    	case 1: .@npc$ = "Event_Bombring"; break;
    	case 2: .@npc$ = "Event_Dice"; break;
    	case 3: .@npc$ = "Event_LMS"; break;
    	case 4: .@npc$ = "Poring_Catcher"; break;
    	case 5: .@npc$ = "Event_NvZ"; break;
    	case 6: .@npc$ = "Poring_Hunter"; break;
    	}
    	donpcevent .@npc$+"::OnStart";
    	end;
    
    OnJoinEvent:
    	mes "[ Event Status ]";
    	mes "Event are as follows : ";
    	next;
    	switch(select(
    		"Bombring Event - "+ ((getvariableofnpc(.start,"Event_Bombring") == 1) ? "^0000ffJoin Event":((getvariableofnpc(.start,"Event_Bombring") == 2) ? "^0000ffEvent On-Going":"^ff0000Not Available"))+"^000000",
    		"Dice Event - "+ ((getvariableofnpc(.start,"Event_Dice") == 1) ? "^0000ffJoin Event":((getvariableofnpc(.start,"Event_Dice") == 2) ? "^0000ffEvent On-Going":"^ff0000Not Available"))+"^000000",
    		"Last Man Standing - "+ ((getvariableofnpc(.start,"Event_LMS") == 1) ? "^0000ffJoin Event":((getvariableofnpc(.start,"Event_LMS") == 2) ? "^0000ffEvent On-Going":"^ff0000Not Available"))+"^000000",
    		"Poring Catcher - "+ ((getvariableofnpc(.start,"Poring_Catcher") == 1) ? "^0000ffJoin Event":((getvariableofnpc(.start,"Poring_Catcher") == 2) ? "^0000ffEvent On-Going":"^ff0000Not Available"))+"^000000",
    		"Novice v Zombie Event - "+ ((getvariableofnpc(.start,"Event_NvZ") == 1) ? "^0000ffJoin Event":((getvariableofnpc(.start,"Event_NvZ") == 2) ? "^0000ffEvent On-Going":"^ff0000Not Available"))+"^000000", 
    		"Poring Hunter Event - "+ ((getvariableofnpc(.start,"Poring_Hunter") == 1) ? "^0000ffJoin Event":((getvariableofnpc(.start,"Poring_Hunter") == 2) ? "^0000ffEvent On-Going":"^ff0000Not Available"))+"^000000" 
    	)) {
    	case 1:
    		.@start = getvariableofnpc(.start,"Event_Bombring");
    		.@map$ = "quiz_02"; .@x = 59; .@y = 345;
    		break;
    		
    	case 2:
    		.@start = getvariableofnpc(.start,"Event_Dice");
    		.@map$ = "quiz_02"; .@x = 55; .@y = 87;
    		break;
    		
    	case 3:
    		.@start = getvariableofnpc(.start,"Event_LMS");
    		.@map$ = "06guild_01"; .@x = 0; .@y = 0;
    		break;
    		
    	case 4:
    		.@start = getvariableofnpc(.start,"Poring_Catcher");
    		.@map$ = "poring_w01"; .@x = 100; .@y = 100;
    		break;
    		
    	case 5:
    		.@start = getvariableofnpc(.start,"Event_NvZ");
    		if ( BaseLevel > 1 || Class != 0 ) {
    			mes "Only Lv 1 Novice can enter.";
    			close;
    		}
    		getinventorylist;
    		if ( @inventorylist_amount ) {
    			mes "You store all your items first.";
    			close2;
    			@inventorylist_amount = false;
    			end;
    		}
    		sc_start SC_DECREASEAGI,600000,10;
    		.@map$ = "quiz_01"; .@x = 42; .@y = 369;
    		break;
    		
    	case 6:
    		.@start = getvariableofnpc(.start,"Poring_Hunter");
    		getinventorylist;
    		if ( @inventorylist_count ) {
    			mes "Make sure you dont have anything in your inventory.";
    			close;
    		}
    		.@map$ = "pvp_n_1-2"; .@x = 0; .@y = 0;
    		@phunter_points = 0;
    		break;
    	}
    	if ( !.@start ) {
    		mes "Event is not available.";
    		close;
    	} else if ( .@start == 2 ) {
    		mes "Event is on-going";
    		close;
    	}
    	sc_end SC_ALL;
    	percentheal 100,100;
    	warp .@map$, .@x, .@y;
    	end;
    
    	// OnClock<hour><minute>: donpcevent "<npc_name>::OnStart";
    	OnClock0000: donpcevent "Event_Bombring::OnStart"; end; //----- 12 mn
    	OnClock0100: donpcevent "Event_Dice::OnStart"; end;
    	OnClock0200: donpcevent "Event_LMS::OnStart"; end;
    	OnClock0300: donpcevent "Poring_Catcher::OnStart"; end;
    	OnClock0400: donpcevent "Event_NvZ::OnStart"; end;
    	OnClock0500: donpcevent "Poring_Hunter::OnStart"; end;
    	OnClock0600: donpcevent "Event_Bombring::OnStart"; end; //----- 6 am
    	OnClock0700: donpcevent "Event_Dice::OnStart"; end;
    	OnClock0800: donpcevent "Event_LMS::OnStart"; end;
    	OnClock0900: donpcevent "Poring_Catcher::OnStart"; end;
    	OnClock1000: donpcevent "Event_NvZ::OnStart"; end;
    	OnClock1100: donpcevent "Poring_Hunter::OnStart"; end;
    	OnClock1200: donpcevent "Event_Bombring::OnStart"; end; //----- 12 nn
    	OnClock1300: donpcevent "Event_Dice::OnStart"; end;
    	OnClock1400: donpcevent "Event_LMS::OnStart"; end;
    	OnClock1500: donpcevent "Poring_Catcher::OnStart"; end;
    	OnClock1600: donpcevent "Event_NvZ::OnStart"; end;
    	OnClock1700: donpcevent "Poring_Hunter::OnStart"; end;
    	OnClock1800: donpcevent "Event_Bombring::OnStart"; end; //----- 6 pm
    	OnClock1900: donpcevent "Event_Dice::OnStart"; end;
    	OnClock2000: donpcevent "Event_LMS::OnStart"; end;
    	OnClock2100: donpcevent "Poring_Catcher::OnStart"; end;
    	OnClock2200: donpcevent "Event_NvZ::OnStart"; end;
    	OnClock2300: donpcevent "Poring_Hunter::OnStart"; end; //----- 11 pm
    }
    
    // Bombring Event
    
    -	script	Event_Bombring	-1,{
    OnInit:
    	// Mapflags
    	setarray .@mapflag,
    		MF_NOWARP,
    		MF_NOWARPTO,
    		MF_NOSKILL,
    		MF_NOTELEPORT,
    		MF_NOMEMO,
    		MF_NOSAVE,
    		MF_NOICEWALL,
    		MF_NOBRANCH,
    		MF_NORETURN,
    		MF_NOCOMMAND;
    		
    	for ( .@i = 0; .@i < getarraysize(.@mapflag); .@i++)
    		setmapflag "quiz_02", .@mapflag[.@i];
    	end;
    
    OnStart:
    	if ( .start ) end;
    	.round = 0;
    	.start = 1;
    	killmonsterall "quiz_02";
    	announce "Bombring: We are going to have a Bombring event.",0;
    	sleep 10000;
    	announce "Bombring: For those who wants to join, use @eventjoin",0;
    	sleep 10000;
    	announce "Bombring: After 1 Minute Event will close.",0;
    	sleep 10000;
    	announce "Bombring: So please if you want to join. use @eventjoin",0;
    	sleep 60000;
    	announce "Bombring: The entry to the event is now closed.",bc_all,0x0ceedb;
    	if ( getmapusers("quiz_02") < 1 ) {
    		announce "Bombring: Not enough participants.",bc_all,0x0ceedb;
    		.start = false;
    		mapwarp "quiz_02", "prontera", 150, 180; // warp out.
    		end;
    	}
    	.start = 2;
    	sleep 3500;
    	mapannounce "quiz_02","We're about to begin the event.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "quiz_02","The rules are simple.",bc_map,0x0ceedb;
    	sleep 2000;
    	mapannounce "quiz_02","Event will run for 30 seconds for 5 total rounds.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "quiz_02","All you have to do is avoid Bombrings and stay alive for 30 seconds.",bc_map,0x0ceedb;
    	sleep 2000;
    	mapannounce "quiz_02","That's all. Let's begin.",bc_map,0x0ceedb;
    	sleep 3000;
    	while ( .round < 5 ) {
    		.@count = getmapusers("quiz_02");
    		.round++;
    		mapannounce "quiz_02","Round "+.round,bc_map,0x0ceedb;
    		areamonster "quiz_02",48,334,71,357,"Run for you life!",1904, 5 * .@count * .round;
    		sleep 10000 - ( 1000*.round );
    	}
    	.@count = getmapusers("quiz_02");
    	if ( !.@count )
    		announce "Bombring: No one survived the bombrings.",bc_all,0x0ceedb;
    	else if ( .@count ) {
    		.@size = getunits(BL_PC,"quiz_02",.@aid);
    		if ( .@size > 1 ) announce "A lot players has won the Bombring Event.",bc_all,0x0ceedb;
    		for ( .@i = 0; .@i < getarraysize(.@aid); .@i++) {
    			attachrid .@aid[.@i];
    			if ( .@size == 1 ) announce strcharinfo(0)+" has won the Bombring Event.",bc_all,0x0ceedb;
    			if ( $event_options&1 ) {
    				for ( .@j = 0; .@j < $event_item_arr; .@j += 2 )
    					getitem $event_item_reward[.@j], $event_item_reward[.@j+1];
    			}
    			if ( $event_options&2 ) {
    				setd $event_var$, getd($event_var$)+$event_var_gain;
    				dispbottom "You gained "+$event_var_gain+" "+$event_var_name$+". You now have "+getd($event_var$)+" "+$event_var_name$+".";
    			}
    		}
    		detachrid;
    	}
    	.start = false;
    	sleep 5000;
    	mapwarp "quiz_02","prontera",rand(148,163),rand(167,186);
    	end;
    	
    OnPCDieEvent:
    	if ( .start && strcharinfo(3) == "quiz_02" )
    		warp "prontera",rand(148,163),rand(167,186);
    	end;
    }
    
    // Dice Event
    
    -	script	Event_Dice	-1,{
    OnInit:		
    	// Mapflags
    	setarray .@mapflag,
    		MF_NOWARP,
    		MF_NOWARPTO,
    		MF_NOSKILL,
    		MF_NOTELEPORT,
    		MF_NOMEMO,
    		MF_NOSAVE,
    		MF_NOICEWALL,
    		MF_NOBRANCH,
    		MF_NORETURN;
    		
    	for ( .@i = 0; .@i < getarraysize(.@mapflag); .@i++)
    		setmapflag "quiz_02", .@mapflag[.@i];
    	end;
    
    OnStart:
    	if ( .start ) end;
    	.start = 1;
    	for(.@i = 1;.@i <= 4;.@i++) {
    		disablenpc "Back#"+.@i;
    		disablenpc "Box "+.@i;
    	}
    	announce "Dice: We are going to have a Dice event.",0;
    	sleep 10000;
    	announce "Dice: For those who wants to join, use @eventjoin",0;
    	sleep 10000;
    	announce "Dice: After 1 Minute Event will close.",0;
    	sleep 10000;
    	announce "Dice: So please if you want to join. use @eventjoin",0;
    	sleep 60000;
    	announce "Dice: The entry to the event is now closed.",bc_all,0x0ceedb;
    	if ( !getmapusers("quiz_02") ) {
    		announce "Dice: Not enough participants.",bc_all,0x0ceedb;
    		.start = false;
    		end;
    	}
    	.start = 2;
    	sleep 3500;
    	mapannounce "quiz_02","We're about to begin the event.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "quiz_02","The rules are simple.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "quiz_02","You'll have to enter one of the 4 avaiaible boxes.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "quiz_02","Then a four sides dice will be thrown. The number it shows will be the saved number.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "quiz_02","Remember to enter the boxes!",bc_map,0x0ceedb;
    	sleep 2000;
    	mapannounce "quiz_02","That's all. Let's begin.",bc_map,0x0ceedb;
    	sleep 3000;
    	while(!.@end && .start && .@rounds < 5) {
    		for(.@i = 1;.@i <= 4;.@i++) {
    			enablenpc "Back#"+.@i;
    			enablenpc "Box "+.@i;
    		}
    		sleep 1500;
    		mapannounce "quiz_02","The dice will soon be thrown. Enter the desired box clicking the metalic number inside them.",bc_map,0x0ceedb;
    		sleep 20000;
    		for(.@i = 5;.@i > 0;.@i--) {
    			mapannounce "quiz_02",.@i+"...",bc_map,0x0ceedb;
    			sleep 990;
    		}
    		for(.@i = 1;.@i <= 4;.@i++) {
    			disablenpc "Back#"+.@i;
    			disablenpc "Box "+.@i;
    		}
    		areawarp "quiz_02",32,95,79,76,"prontera",rand(148,163),rand(167,186);
    		areawarp "quiz_02",80,85,80,76,"prontera",rand(148,163),rand(167,186);
    		areawarp "quiz_02",31,85,31,76,"prontera",rand(148,163),rand(167,186);
    		.@n = rand(1,4);
    		mapannounce "quiz_02","Time! The dice shows the number "+.@n+".",bc_map,0x0ceedb;
    		setarray .@cords1[0],33,41;
    		setarray .@cords2[0],45,53;
    		setarray .@cords3[0],57,65;
    		setarray .@cords4[0],69,77;
    		for(.@i = 1;.@i <= 4;.@i++) {
    			if(.@i != .@n)
    				areawarp "quiz_02",getd(".@cords"+.@i+"[0]"),52,getd(".@cords"+.@i+"[1]"),73,"prontera",rand(148,163),rand(167,186);
    		}
    		sleep 3000;
    		.@players = getmapusers("quiz_02");
    		if(.@players <= 3 && .start && .@players) {
    			mapannounce "quiz_02","The event is now over! Winners, enjoy your prizes!",bc_map,0x0ceedb;
    			.@size = getunits(BL_PC,"quiz_02",.@players);
    			.start = false;
    			for(.@i = 0;.@i < .@size;.@i++) {
    				attachrid .@players[.@i];
    				announce strcharinfo(0)+" has won the Dice Event.",bc_all,0x0ceedb;
    				if ( $event_options&1 ) {
    					for ( .@j = 0; .@j < $event_item_arr; .@j += 2 )
    						getitem $event_item_reward[.@j], $event_item_reward[.@j+1];
    				}
    				if ( $event_options&2 ) {
    					setd $event_var$, getd($event_var$)+$event_var_gain;
    					dispbottom "You gained "+$event_var_gain+" "+$event_var_name$+". You now have "+getd($event_var$)+" "+$event_var_name$+".";
    				}			
    				warp "prontera",rand(148,163),rand(167,186);
    			}
    		} else if( !.@players ) {
    			.@end = true;
    			.start = false;
    			announce "There was no winner on the Dice Event.",bc_all,0x0ceedb;
    		} else {
    			mapannounce "quiz_02","There's no clear winners yet, let's roll the dice again.",bc_map,0x0ceedb;
    		}
    		.@rounds++;
    	}
    	if(.@rounds >= 5) {
    		mapannounce "quiz_02","There were no winner clear in all of the event. The event is now over.",bc_map,0x0ceedb;
    		.start = false;
    	}
    	end;
    
    }
    
    quiz_02,37,80,3	script	Box 1	HIDDEN_NPC,{
    	warp "quiz_02",rand(33,41),rand(52,73);
    	end;
    
    }
    
    quiz_02,49,80,3	script	Box 2	HIDDEN_NPC,{
    	warp "quiz_02",rand(45,53),rand(52,73);
    	end;
    }
    
    quiz_02,61,80,3	script	Box 3	HIDDEN_NPC,{
    	warp "quiz_02",rand(57,65),rand(52,73);
    	end;
    }
    
    quiz_02,73,80,3	script	Box 4	HIDDEN_NPC,{
    	warp "quiz_02",rand(69,77),rand(52,73);
    	end;
    }
    
    quiz_02,55,90,3	script	Back to Prontera#dice	4_BULLETIN_BOARD2,{
    	warp "prontera",rand(148,163),rand(167,186);
    	end;
    }
    
    quiz_02,37,64,3	script	Back#1	4_BULLETIN_BOARD2,{
    	warp "quiz_02",55,76;
    	end;
    }
    
    quiz_02,49,64,3	duplicate(Back#1)	Back#2	4_BULLETIN_BOARD2
    quiz_02,61,64,3	duplicate(Back#1)	Back#3	4_BULLETIN_BOARD2
    quiz_02,73,64,3	duplicate(Back#1)	Back#4	4_BULLETIN_BOARD2
    
    // Last Man Standing
    
    -	script	Event_LMS	-1,{
    OnInit:	
    	// Mapflags
    	setarray .@mapflag,
    		MF_NOWARP,
    		MF_NOWARPTO,
    		MF_NOSKILL,
    		MF_NOTELEPORT,
    		MF_NOMEMO,
    		MF_NOSAVE,
    		MF_NOICEWALL,
    		MF_NOBRANCH,
    		MF_NORETURN;
    		
    	for ( .@i = 0; .@i < getarraysize(.@mapflag); .@i++)
    		setmapflag "06guild_01", .@mapflag[.@i];
    		
    	end;
    
    OnStart:
    	if ( .start ) end;
    	.start = 1;
    	pvpoff "06guild_01";
    	announce "LMS: We are going to have a Last Man Standing event.",0;
    	sleep 10000;
    	announce "LMS: For those who wants to join, use @eventjoin",0;
    	sleep 10000;
    	announce "LMS: After 1 Minute Event will close.",0;
    	sleep 10000;
    	announce "LMS: So please if you want to join. use @eventjoin",0;
    	sleep 60000;
    	announce "LMS: The entry to the event is now closed.",bc_all,0x0ceedb;
    	if ( getmapusers("06guild_01") < 2 ) {
    		announce "LMS: Not enough participants.",bc_all,0x0ceedb;
    		.start = false;
    		end;
    	}
    	.start = 2;
    	sleep 3500;
    	mapannounce "06guild_01","We're about to begin the event.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "06guild_01","The rules are simple.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "06guild_01","Kill everyone in the map.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "06guild_01","Last Man Standing wins!",bc_map,0x0ceedb;
    	sleep 2000;
    	mapannounce "06guild_01","That's all. Let's begin.",bc_map,0x0ceedb;
    	sleep 3000;
    	for (.@i = 10; .@i > 0; .@i--) {
    		mapannounce "06guild_01", "LMS: -- "+.@i+" --",bc_map,0x0ceedb;
    		sleep 1000;
    	}
    	mapannounce "06guild_01", "LMS: Fight! ",bc_map,0x0ceedb;
    	pvpon "06guild_01";
    	.timer = 0;
    	initnpctimer;
    	end;
    	
    OnTimer5000: // check every 5 secs..
    	.timer++;
    	.@size = getmapusers("06guild_01");
    	if ( .@size > 1 && .timer == 6 ) {
    		.timer = 0;
    		mapannounce "06guild_01", "LMS: "+ .@size +" players left..", bc_blue;
    	} 
    	else if ( .@size <= 1 )
    		donpcevent strnpcinfo(3)+"::OnEndEvent";
    	setnpctimer 0;
    	end;
    	
    OnEndEvent:
    	stopnpctimer;
    	.start = false;
    	pvpoff "06guild_01";
    	mapannounce "06guild_01", "LMS: Event ended!",bc_map,0x0ceedb;
    	sleep 5000;
    	.@size = getunits(BL_PC,"06guild_01",.@aid);
    	if ( .@size == 0 ) {
    		announce "LMS: No winners.",0;
    		end;
    	}
    	attachrid .@aid;
    	announce strcharinfo(0)+" has won the Last Man Standing Event.",bc_all,0x0ceedb;
    	if ( $event_options&1 ) {
    		for ( .@j = 0; .@j < $event_item_arr; .@j += 2 )
    			getitem $event_item_reward[.@j], $event_item_reward[.@j+1];
    	}
    	if ( $event_options&2 ) {
    		setd $event_var$, getd($event_var$)+$event_var_gain;
    		dispbottom "You gained "+$event_var_gain+" "+$event_var_name$+". You now have "+getd($event_var$)+" "+$event_var_name$+".";
    	}				
    	warp "prontera",rand(148,163),rand(167,186);
    	end;
    	
    OnPCDieEvent:
    	if ( .start && strcharinfo(3) == "06guild_01" ) {
    		warp "prontera",rand(148,163),rand(167,186);
    		.@size = getmapusers("06guild_01");
    		if ( .@size > 1 )
    			mapannounce "06guild_01", "LMS: "+ .@size +" players left..", bc_blue;
    		else if ( .@size <= 1 )
    			donpcevent strnpcinfo(3)+"::OnEndEvent";
    	}
    	end;
    	
    }
    
    // Novice V Zombie
    
    -	script	Event_NvZ	-1,{
    OnInit:	
    	// Mapflags
    	setarray .@mapflag,
    		MF_NOWARP,
    		MF_NOWARPTO,
    		MF_NOSKILL,
    		MF_NOTELEPORT,
    		MF_NOMEMO,
    		MF_NOSAVE,
    		MF_NOICEWALL,
    		MF_NOBRANCH,
    		MF_NORETURN,
    		MF_NOCOMMAND;
    		
    	for ( .@i = 0; .@i < getarraysize(.@mapflag); .@i++)
    		setmapflag "quiz_01", .@mapflag[.@i];
    	end;
    
    OnStart:
    	if ( .start ) end;
    	.start = 1;
    	killmonsterall "quiz_01";
    	announce "NvZ: We are going to have a Novice Vs. Zombie event.",0;
    	sleep 10000;
    	announce "NvZ: For those who wants to join, use @eventjoin",0;
    	sleep 10000;
    	announce "NvZ: After 1 Minute Event will close.",0;
    	sleep 10000;
    	announce "NvZ: So please if you want to join. use @eventjoin",0;
    	sleep 60000;
    	announce "NvZ: The entry to the event is now closed.",bc_all,0x0ceedb;
    	if ( getmapusers("quiz_01") <= 1 ) {
    		announce "NvZ: Not enough participants.",bc_all,0x0ceedb;
    		.start = false;
    		mapwarp "quiz_01", "prontera", 150, 180; // warp out.
    		end;
    	}
    	.start = 2;
    	sleep 3500;
    	mapannounce "quiz_01","We're about to begin the event.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "quiz_01","The rules are simple.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "quiz_01","Zombies will be spawned in the map.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "quiz_01","and will apear every 20 seconds.",bc_map,0x0ceedb;
    	sleep 2000;
    	mapannounce "quiz_01","Last man surviving wins.",bc_map,0x0ceedb;
    	sleep 2000;
    	mapannounce "quiz_01","That's all. Let's begin.",bc_map,0x0ceedb;
    	sleep 3000;
    	monster "quiz_01",42,369,"Zombie",1036,4;
    	initnpctimer;
    	end;
    	
    OnTimer20000: // 20 seconds timer and also player check on how many left in map
    	monster "quiz_01",42,369,"Zombie",1036,10;
    	setnpctimer 0;
    	end;
    	
    OnPCDieEvent:
    	if ( .start && strcharinfo(3) == "quiz_01" ) {
    		warp "prontera",rand(148,163),rand(167,186);
    		if ( getmapusers("quiz_01") == 1 ) {
    			stopnpctimer;
    			killmonsterall "quiz_01";
    			.@size = getunits(BL_PC,"quiz_01",.@aid);
    			.start = false;
    			attachrid .@aid;
    			announce strcharinfo(0)+" has won the Novice v Zombie Event.",bc_all,0x0ceedb;
    			if ( $event_options&1 ) {
    				for ( .@j = 0; .@j < $event_item_arr; .@j += 2 )
    					getitem $event_item_reward[.@j], $event_item_reward[.@j+1];
    			}
    			if ( $event_options&2 ) {
    				setd $event_var$, getd($event_var$)+$event_var_gain;
    				dispbottom "You gained "+$event_var_gain+" "+$event_var_name$+". You now have "+getd($event_var$)+" "+$event_var_name$+".";
    			}				
    			warp "prontera",rand(148,163),rand(167,186);
    			end;
    		}
    	}
    	end;
    }
    
    // Poring Catcher
    
    -	script	Poring_Catcher	-1,{
    OnInit:	
    	// Mapflags
    	setarray .@mapflag,
    		MF_NOWARP,
    		MF_NOWARPTO,
    		MF_NOSKILL,
    		MF_NOLOOT,
    		MF_NOTELEPORT,
    		MF_NOMEMO,
    		MF_NOSAVE,
    		MF_NOICEWALL,
    		MF_NOBRANCH,
    		MF_NORETURN;
    		
    	for ( .@i = 0; .@i < getarraysize(.@mapflag); .@i++)
    		setmapflag "poring_w01", .@mapflag[.@i];
    	end;
    
    OnStart:
    	if ( .start ) end;
    	.start = 1;
    	announce "Poring Catcher: We are going to have a Poring Catcher event.",0;
    	sleep 10000;
    	announce "Poring Catcher: For those who wants to join, use @eventjoin",0;
    	sleep 10000;
    	announce "Poring Catcher: After 1 Minute Event will close.",0;
    	sleep 10000;
    	announce "Poring Catcher: So please if you want to join. use @eventjoin",0;
    	sleep 60000;
    	announce "Poring Catcher: The entry to the event is now closed.",bc_all,0x0ceedb;
    	.start = 2;
    	sleep 3500;
    	if( !getmapusers("poring_w01") ) {
    		announce "Poring Catcher: Not enough participants in the Event.",bc_all,0x0ceedb;
    		sleep 2500;
    		announce "Poring Catcher: Event will be halted.",bc_all,0x0ceedb;
    		.start = false;
    		end;
    	}
    	mapannounce "poring_w01","We're about to begin the event.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "poring_w01","The rules are simple.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "poring_w01","In a few seconds I'm going to spawn tons of porings..",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "poring_w01","..All you need to do is kill the Poring with the right name..",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "poring_w01","..Which would be Poring.",bc_map,0x0ceedb;
    	sleep 2000;
    	mapannounce "poring_w01","If you kill the wrong one, you're out!",bc_map,0x0ceedb;
    	sleep 2000;
    	mapannounce "poring_w01","That's all. Let's begin.",bc_map,0x0ceedb;
    	sleep 3000;
    	areamonster "poring_w01",84,119,124,90,"Poring",1002,1,strnpcinfo(0)+"::OnMobKilledWin";
    	areamonster "poring_w01",84,119,124,90,"Poking",1002,3*getmapusers("poring_w01"),strnpcinfo(0)+"::OnMobKilled";
    	areamonster "poring_w01",84,119,124,90,"Poiring",1002,3*getmapusers("poring_w01"),strnpcinfo(0)+"::OnMobKilled";
    	areamonster "poring_w01",84,119,124,90,"Poling",1002,3*getmapusers("poring_w01"),strnpcinfo(0)+"::OnMobKilled";
    	areamonster "poring_w01",84,119,124,90,"Porng",1002,3*getmapusers("poring_w01"),strnpcinfo(0)+"::OnMobKilled";
    	areamonster "poring_w01",84,119,124,90,"pH0ur1n6",1002,3*getmapusers("poring_w01"),strnpcinfo(0)+"::OnMobKilled";
    	areamonster "poring_w01",84,119,124,90,"P0ring",1002,3*getmapusers("poring_w01"),strnpcinfo(0)+"::OnMobKilled";
    	areamonster "poring_w01",84,119,124,90,"Porong",1002,3*getmapusers("poring_w01"),strnpcinfo(0)+"::OnMobKilled";
    	areamonster "poring_w01",84,119,124,90,"Powing",1002,3*getmapusers("poring_w01"),strnpcinfo(0)+"::OnMobKilled";
    	areamonster "poring_w01",84,119,124,90,"Poriing",1002,3*getmapusers("poring_w01"),strnpcinfo(0)+"::OnMobKilled";
    	areamonster "poring_w01",84,119,124,90,"Boring",1002,3*getmapusers("poring_w01"),strnpcinfo(0)+"::OnMobKilled";
    	areamonster "poring_w01",84,119,124,90,"Lolwut!?",1002,3*getmapusers("poring_w01"),"::OnMobKilled";
    	areamonster "poring_w01",84,119,124,90,"Kill me to win!",1002,3*getmapusers("poring_w01"),strnpcinfo(0)+"::OnMobKilled";
    	end;
    
    OnMobKilled:
    	dispbottom "You killed the wrong Poring! Yerrrrrrrrrrrr out!";
    	warp "prontera",rand(148,163),rand(167,186);
    	sleep 5000;
    	if ( !getmapusers("poring_w01") ) {
    		.start = false;
    		killmonsterall "poring_w01";
    		announce "Poring Catcher: No one won the Poring Catcher Event!.",bc_all,0x0ceedb;
    	}
    	end;
    	
    OnMobKilledWin:
    	announce strcharinfo(0)+" won the Poring Catcher Event!",bc_all,0xFF7F50;
    	if ( $event_options&1 ) {
    		for ( .@j = 0; .@j < $event_item_arr; .@j += 2 )
    			getitem $event_item_reward[.@j], $event_item_reward[.@j+1];
    	}
    	if ( $event_options&2 ) {
    		setd $event_var$, getd($event_var$)+$event_var_gain;
    		dispbottom "You gained "+$event_var_gain+" "+$event_var_name$+". You now have "+getd($event_var$)+" "+$event_var_name$+".";
    	}
    	killmonsterall "poring_w01";
    	sleep 5000;
    	mapwarp "poring_w01","prontera",rand(148,163),rand(167,186);
    	.start = false;
    	end;	
    }
    
    poring_w01,105,123,3	script	Back to Prontera	4_BULLETIN_BOARD2,{
    	warp "prontera",rand(148,163),rand(167,186);
    	end;
    }
    
    // Poring Hunter https://rathena.org/board/topic/121969-rporing-hunter-event/#comment-370418
    
    -	script	Poring_Hunter	FAKE_NPC,{
    OnInit:
    	// Event duration default: 3 mins.
    	.duration = 3;
    
    	// Note : spawn counts would be multiplied by number of participants. ( count * player count )
    	// if you dont want it, remove the calculation below.
    	.count[0] = 20; // poring count
    	.count[1] = 10; // drops count
    	.count[2] = 15; // poporing count
    	
    	// Mapflags
    	setarray .@mapflag,
    		MF_NOWARP,
    		MF_NOWARPTO,
    		MF_NOSKILL,
    		MF_NOLOOT,
    		MF_NOTELEPORT,
    		MF_NOMEMO,
    		MF_NOSAVE,
    		MF_NOICEWALL,
    		MF_NOBRANCH,
    		MF_NORETURN,
    		MF_NOCOMMAND;
    		
    	for ( .@i = 0; .@i < getarraysize(.@mapflag); .@i++)
    		setmapflag "quiz_02", .@mapflag[.@i];
    	end;
    
    OnStart:
    	if ( .start ) end;
    	pvpoff "pvp_n_1-2";
    	killmonsterall "pvp_n_1-2";
    	.start = 1;
    	.cur_time = 0;
    	announce "Poring Hunter: We are going to have a Poring Hunter event.",0;
    	sleep 10000;
    	announce "Poring Hunter: For those who wants to join, use @eventjoin",0;
    	sleep 10000;
    	announce "Poring Hunter: After 1 Minute Event will close.",0;
    	sleep 10000;
    	announce "Poring Hunter: So please if you want to join. use @eventjoin",0;
    	sleep 60000;
    	announce "Poring Hunter: The entry to the event is now closed.",bc_all,0x0ceedb;
    	.@player = getmapusers("pvp_n_1-2");
    	if ( .@player < 2 ) {
    		announce "Poring Hunter : Not enough participants.", bc_all,0x0ceedb;
    		goto OnEnd;
    		end;
    	}
    	announce "Poring Hunter : The portal for the event has been closed, the event has started, good luck to all players!", bc_all;
    	.start = 2;
    	mapannounce "pvp_n_1-2","We're about to begin the event.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "pvp_n_1-2","Porings grant 1 point when killed, Drops 5 points, Poporings -10 points.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "pvp_n_1-2","You will have "+.duration+" minutes to get as many points as possible.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "pvp_n_1-2","The Player who gets the most points within the time alloted will be the winner of the event.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "pvp_n_1-2","That's all. Let's begin.",bc_map,0x0ceedb;
    	sleep 2000;
    	// NOTE : if you wish not to multiply the spawn to participants, remove < *.@player > on all mob spawns.
    	monster "pvp_n_1-2", 0, 0, "Poring", 1002, .count[0]*.@player, strnpcinfo(0)+"::OnKillPoring";
    	monster "pvp_n_1-2", 0, 0, "Drops", 1113, .count[1]*.@player, strnpcinfo(0)+"::OnKillDrops";
    	monster "pvp_n_1-2", 0, 0, "Poporing", 1031, .count[2]*.@player, strnpcinfo(0)+"::OnKillPoporing";
    	initnpctimer;
    	end;
    	
    OnKillPoring: callsub OnKillMob, 1002, "Poring", "OnKillPoring", 1;
    OnKillDrops: callsub OnKillMob, 1113, "Drops", "OnKillDrops", 5;
    OnKillPoporing: callsub OnKillMob, 1031, "Poporing", "OnKillPoporing", -10;
    OnKillMob:
    	.@mobid = getarg(0);
    	.@name$ = getarg(1);
    	.@event$ = getarg(2);
    	.@val = getarg(3);
    	@phunter_points += .@val;
    	monster "pvp_n_1-2",0,0,.@name$,.@mobid,1,strnpcinfo(0)+"::"+.@event$;
    	dispbottom "You have "+ @phunter_points +" Point(s).";
    	end;	
    
    OnTimer60000:
    	.cur_time++;
    	if ( .cur_time < .duration ) {
    		mapannounce "pvp_n_1-2", "You have "+( .duration - .cur_time )+" min(s) left.", bc_blue|bc_map;
    		setnpctimer 0;
    		end;
    	}
    	stopnpctimer;
    	killmonsterall "pvp_n_1-2";
    	.@count = getunits(BL_PC,"pvp_n_1-2",.@aid[0]);
    	freeloop(true);
    	for ( .@i = 0; .@i < .@count; .@i++ ) {
    		attachrid(.@aid[.@i]);
    		if ( @phunter_points > .most_points ) {
    			.most_points = @phunter_points;
    			.win_aid[0] = getcharid(3);
    			.win_name$[0] = strcharinfo(0);
    		} else if ( @phunter_points == .most_points && @phunter_points > 0 ) {
    			.win_aid[getarraysize(.win_aid)] = getcharid(3);
    			.win_name$[getarraysize(.win_name$)] = strcharinfo(0);
    		}
    		detachrid;
    	}
    	freeloop(false);
    	.@size = getarraysize(.win_aid);
    	if ( .@size > 1 )
    		announce "Poring Hunter : The event is over, and we have "+.@size+" winners having "+.most_points+" points each! Congratulations!", bc_all,0xFF7F50;
    	else if ( .@size == 1 )
    		announce "Poring Hunter : The event is over, and the winner is ["+.win_name$+"] with "+.most_points+" points! Congratulations!", bc_all,0xFF7F50;
    	else 
    		announce "Poring Hunter : The event is over, and there are no winners.", bc_all,0x0ceedb;
    	if ( .@size ) { 
    		for ( .@i = 0; .@i < .@size; .@i++ ) { 
    			attachrid(.win_aid[.@i]);
    			if ( $event_options&1 ) {
    				for ( .@j = 0; .@j < $event_item_arr; .@j += 2 )
    					getitem $event_item_reward[.@j], $event_item_reward[.@j+1];
    			}
    			if ( $event_options&2 ) {
    				setd $event_var$, getd($event_var$)+$event_var_gain;
    				dispbottom "You gained "+$event_var_gain+" "+$event_var_name$+". You now have "+getd($event_var$)+" "+$event_var_name$+".";
    			}
    			dispbottom "Here is your reward from Poring Hunter event.";
    			detachrid;
    		}
    	}
    	OnEnd:
    	mapannounce "pvp_n_1-2", "Warping out in few sec..", bc_blue|bc_map;
    	.most_points = .start = false;
    	deletearray .win_aid;
    	deletearray .win_name$;
    	sleep 5000;
    	mapwarp "pvp_n_1-2","prontera",rand(148,163),rand(167,186);
    	pvpon "pvp_n_1-2";
    	end;
    }

    Thank you!

×
×
  • Create New...

Important Information

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