Jump to content

Yami

Members
  • Posts

    111
  • Joined

  • Last visited

Posts posted by Yami

  1. 1 minute ago, Patskie said:

    Change

    
    case 1:
    	callsub S_CheckPVPRoom,@mapcount_1,"guild_vs1";
    	break;
    case 2:
    	callsub S_CheckPVPRoom,@mapcount_2,"guild_vs3";
    	break;
    case 3:
    	callsub S_CheckPVPRoom,@mapcount_3,"pvp_n_8-1";
    	break;
    case 4:
    	callsub S_CheckPVPRoom,@mapcount_4,"pvp_y_1-1";
    	break;

    To 

    
    case 1:
    	callsub S_CheckPVPRoom,@mapcount_1,"guild_vs1",15;
    	break;
    case 2:
    	callsub S_CheckPVPRoom,@mapcount_2,"guild_vs3",20;
    	break;
    case 3:
    	callsub S_CheckPVPRoom,@mapcount_3,"pvp_n_8-1",30;
    	break;
    case 4:
    	callsub S_CheckPVPRoom,@mapcount_4,"pvp_y_1-1",60;
    	break;

    and then change

    
    if (getarg(0) >= 25) {

    to 

    
    if (getarg(0) >= getarg(2)) {

     

    Thank you! will try this!

  2. Hi, I need a little help for my PVP warper script. I added couple more maps and they have different room player limits. I would like to have them not able to warp on the map when limit is reached. I have a limit working right now, but it's for ALL of them, I want it to be Map specific please.

     

    Here's the script im using:

    -	script	PVP Warper#01::pvp	946,{
    	set .@mapcount_1,getmapusers("guild_vs1");
    	set .@mapcount_2,getmapusers("guild_vs3");
    	set .@mapcount_3,getmapusers("pvp_n_8-1");
    	set .@mapcount_4,getmapusers("pvp_y_1-1");
    
    	while(1) {
    		switch(select("Epsilon Arena [ "+.@mapcount_1+" / 15 ]:Square Arena [ "+.@mapcount_2+" / 20 ]:Sandwich Arena [ "+.@mapcount_3+" / 30 ]:Prontera Arena [ "+.@mapcount_4+" / 60 ]")) {
    		case 1:
    			callsub S_CheckPVPRoom,@mapcount_1,"guild_vs1";
    			break;
    		case 2:
    			callsub S_CheckPVPRoom,@mapcount_2,"guild_vs3";
    			break;
    		case 3:
    			callsub S_CheckPVPRoom,@mapcount_3,"pvp_n_8-1";
    			break;
    		case 4:
    			callsub S_CheckPVPRoom,@mapcount_4,"pvp_y_1-1";
    			break;
    
    		}
    	}
    
    S_CheckPVPRoom:
    	if (getarg(0) >= 25) {
    		mes "[PVP Warper]";
    		mes "This map is currently full.";
    		next;
    		return;
    	}
    	else {
    		warp getarg(1),0,0; 
    		//if(getarg(1) == pvp_y_1-2) announce ""+strcharinfo(0)+" has Entered Izlude Arena",bc_all,0xFF0000;
    		//if(getarg(1) == guild_vs3) announce ""+strcharinfo(0)+" has Entered Square Arena",bc_all,0xFF0000;
    		//announce ""+strcharinfo(0)+" has Entered the PVP Arena",bc_all,0xFF0000;
    		end;
    	}

     

    As you can see on the script, I had 1st Map to be 15/15max, 2nd 20/20max, 3rd 30/30max and 4th 60/60max.

    But my script only works for 25/25 in general. Thank you in advance!

  3. 11 hours ago, BeWan said:

    replace 0; to this BL_PC;

    Do you mean like this?

    getmapxy .map_self$, .x_self, .y_self, BL_PC;

     

    11 hours ago, BeWan said:
    
    getmapxy .map_self$, .x_self, .y_self, 0;

    replace 0; to this BL_PC;

     

    for item map much better to use this

     

     

    Worked like a charm. Thank you so much!

  4. Hey hi, I used some scripts in the past that checks for players on a map. ie; map shower, maprecall custom script. It was working before, but for some reason it's not working anymore. It would output "0 players detected" even if there are players on the map.

    Can someone please help me make these scripts work again please?

     

    maprecall script :
     

    -	script	atcmd_examplere	-1,{
    OnInit:
    	bindatcmd "recallmap",strnpcinfo(3)+"::OnAtcommand",60,60;
    	end;
    OnAtcommand:
    	getmapxy .map_self$, .x_self, .y_self, 0;
    	.myname$ = strcharinfo(0);
    	.count = 0;
    	addrid 0;
    	if ( strcharinfo(3) == .map_self$ && strcharinfo(0) != .myname$ ) {
    		message strcharinfo(0), "You have been recalled by "+ .myname$ +".";
    		warp .map_self$, .x_self, .y_self;
    		.count++;
    	}
    	if ( strcharinfo(0) != .myname$ ) end;
    	sleep2 10;
    	if ( .count == 0 )
    		message strcharinfo(0), "There's no player on this map except you.";
    	else
    		message strcharinfo(0), .count +" player(s) recalled.";
    	end;
    }

     

    and my shower script only the map option is not working:

    // usage :
    // [npc:Sample]map#512#10
    // [npc:Sample]all#512#123
    
    -	script	shower	-1,{
    OnWhisperGlobal:
    if( getgmlevel() >= 99 ){
    	// check map
    	if( @whispervar0$ == "all" ) set .@type$,"";
    	else if( @whispervar0$ == "map" ) set .@type$,strcharinfo(3);
    	else {
    		dispbottom "Error: all#512#123";
    		end;
    	}
    	
    	// check item
    	set .@itemid,atoi( @whispervar1$ );
    	set .@amount,atoi( @whispervar2$ );
    	if( getitemname( .@itemid ) == "null" || .@amount < 1 ){
    		dispbottom "Enter valid item id and amount.";
    	}
    	
    	set .@self_id,getcharid(3);
    	query_sql( "SELECT COUNT(`account_id`) FROM `char` WHERE `online` = 1 ", .@total );
    	while( .@count < .@total ){
    		query_sql( "SELECT `account_id`,`name` FROM `char` WHERE `online` = 1 ORDER BY `account_id` LIMIT 128 OFFSET "+.@offset, .@aid,.@name$ );
    		set .@i,0;
    		set .@size,getarraysize( .@aid );
    		while( .@i < .@size ){
    			if( .@aid[.@i] != .@self_id ){
    				if( .@type$ != "" ){
    					getmapxy( .@map$,.@x,.@y,0,.@name$[.@i] );
    					if( .@map$ == .@type$ ){
    						getitem .@itemid,.@amount,.@aid[.@i];
    						set .@gave,.@gave + 1;
    					}
    				}else{
    					getitem .@itemid,.@amount,.@aid[.@i];
    					set .@gave,.@gave + 1;
    				}
    			}
    			set .@count,.@count + 1;
    			set .@i,.@i + 1;
    		}
    		set .@offset,.@offset + .@size;
    		deletearray .@aid,.@size;
    		deletearray .@name$,.@size;
    	}
    	dispbottom "Gave "+.@amount+" x "+getitemname( .@itemid )+" to "+.@gave+" Player(s).";
    }
    end;
    }

     

    Both scripts was working back then but doesn't work anymore. Thank you for the help.

  5. Recently found out that Dragon Breath on my server has Racial modifiers affect the damage. ie; Hydra, AK card.

    Did some tests on mob and character as well.

    Tao Gunka - (8,567) NO AK card |  (10,735) 1 AK card

    Player - (4556) NO hydra card | (5719) 1 hydra card

     

    Searched about the issue, and found some skill.db changes as answers but nothing worked.

    Tried:
     

    2008,9,6,2,3,0x42,1:1:1:2:2:2:3:3:4:4,10,1,no,0,0x40000,0,weapon,0,0x0,	RK_DRAGONBREATH,Dragon Breath

    to

    2008,9,6,2,3,0x50,1:1:1:2:2:2:3:3:4:4,10,1,no,0,0x40000,0,weapon,0,0x0,	RK_DRAGONBREATH,Dragon Breath

    also to

    2008,9,6,2,3,0x70,1:1:1:2:2:2:3:3:4:4,10,1,no,0,0x40000,0,weapon,0,0x0,	RK_DRAGONBREATH,Dragon Breath

    All changes did no effect to damage output. I'm in desperate need of help. I'm not very familiar with src changes regarding these kind of stuff.  Just want to remove that racial modifier in the formula/settings. Thank you!

  6. Hi, I need help with one of my SQL script that's linked to my server's website. It grabs Peak Players from SQL then send the info to my website. I used it way back around 2+ years ago but it seems that it's not working anymore the SQL query is not getting created by the script . Can anyone help me to get this script to work again?

     

    Here's the script

    //Highest Peak
    -	script	Highest Peak	-,{
    
    OnPCLoginEvent:
    	
    
    	set .currentUsersOL,getusers(1); //Current Online Users
    	
    	//Query for the highest peak in the database
    	query_sql("SELECT `num_users` FROM `cp_highest_peak` ORDER BY `num_users` LIMIT 1",.@numUsers);
    	//Get the date
    	set .date$,gettime(7)+"-"+gettime(6)+"-"+gettime(5);	
    	
    	set .highestPeak,.@numUsers[0]; //Highest Peak
    	if(getarraysize(.@numUsers) == 0)
    	{
    		//If not data found Insert statement
    		set .highestPeak,.currentUsersOL;
    		query_sql("INSERT INTO `cp_highest_peak`(num_users,peak_date) VALUES("+.highestPeak+",'"+.date$+"')"); //Insert new highest Peak
    	}
    	else
    	{
    		if(.currentUsersOL>.highestPeak)
    		{
    			set .highestPeak,.currentUsersOL;		
    			query_sql("UPDATE `cp_highest_peak`SET num_users='"+.highestPeak+"',peak_date='"+.date$+"'"); //Insert new highest Peak
    		}
    	}
    end;
    
    }

     

    Thank you in advance!

  7. Hi there, I was using this old script from way back. It used to work on the previous server (until May 2016) that I was hired.

    But it's not working on this new server I've been working on.

     

    It doesn't show an error when the script is loaded. But when I tested it, I got the first enchantment. On the 2nd enchantment, the script fails.

    And with this error on my console:
    mSYWTA7.png

     

    This is my script, can someone help me make this work please? Thank you!!!

    //===== rAthena Script =======================================
    //= Unofficial Fallen Angel Wing (FAW) Enchants
    //===== By: ==================================================
    //= Nerfwood
    //===== Current Version: =====================================
    //= 1.0
    //===== Compatible With: =====================================
    //= rAthena Project
    //===== Description: =========================================
    //= Enchants FAW as per iROWiki's information
    //= Dialogue are unofficial
    //===== Additional Comments: =================================
    //= 1.0 First Version
    //============================================================
    
    //Decreasing Chance of Enchantment
    // 60% low, 30% mid, 10% high for 1st & 2nd enchant slot
    //40% low, 30% mid, 20% high, 10% special for 3rd enchant slot
    function	script	EnchantStat_1	{
    
    	.chance = rand(1,10);
    	
    	if(@card2 && @card3) { //For 4th Slot aka 3rd Enchant Slot
    		
    		if(.chance<5) .x=0; 
    		else if(.chance<7) .x=1; 
    		else if(.chance<9) .x=2; 
    		else .x=3;
    		
    	}
    	else {	//For 2nd and 3rd card slot aka 1st and 2nd Enchant Slot
    
    		if(.chance<7) .x=0; 
    		else if(.chance<10) .x=1; 
    		else .x=2; 
    	}
    	return getelementofarray(getvariableofnpc( getd(".enc" + getarg(0) )  , "The Fallen#faw"), .x );
    	
    }
    
    
    
    	
    //Equal Chance of Enchanting	
    function	script	EnchantStat_0	{
    	if(@card2 && @card3)
    		return  getelementofarray(getvariableofnpc( getd(".enc" + getarg(0) )  , "The Fallen#faw"), rand(0,3) );
    	else
    		return  getelementofarray(getvariableofnpc( getd(".enc" + getarg(0) )  , "The Fallen#faw"), rand(0,2) );
    		
    }
    
    
    //=======MAIN NPC
    
    mellina,62,155,3	script	The Fallen#faw	621,{
    	mes .npc$;
    	mes "I am here to enchant the",
    		"magnificent ^000099Fallen Angel Wing^000000.",
    		"Would you like to enchant yours?";
    	if(countitem(2589)) {
    		set .@menu$, "Enchant Fallen Angel Wing";
    	}
    	else .@menu$="";
    	next;
    	switch(select("Information:" + .@menu$ + ":Reset Enchantment"))
    	{
    		case 1: goto OnInformation;
    		case 2: goto OnEnchantNow;
    		case 3: goto OnResetEnchant;
    		default: close;
    	}
    
    OnInformation:
    	mes .npc$,
    		"I can enchant your",
    		"^000099Fallen Angel Wing^000000 for",
    		(.cost?callfunc("F_InsertComma",.cost)+"z":"free")+" to give it various.", 
    		"effects. In fact, I can do it",
    		"twice if its refinement level is",
    		"+7 ~ +8, and thrice if its",
    		"+9 and above.";
    	next;
    	mes .npc$,
    		"The 3rd enchantment has a",
    		"chance to be more powerful",
    		"than the first two.";
    	next;
    	mes .npc$,
    		"There is no chance to",
    		"fail, so enchant away",
    		"as much as you like.";
    	next;	
    	mes .npc$,
    		"But if you're not happy",
    		"with the results, you can",
    		"reset the enchantments",
    		"for ^009900"+ callfunc("F_InsertComma",.cost2) + "z^000000.";
    	next;
    	mes .npc$,
    		"That's about everything.";
    		close;
    		
    OnEnchantNow:	
    	mes .npc$;
    	if( (getequipid(EQI_GARMENT)!=2589) ) {
    		mes "Please equip your",
    			"^000099Fallen Angel Wing^000000 if",
    			"you want to have it enchanted.";
    		if(!.autoequip) close;	
    		next;
    		if(select("Equip:Don't Equip")==2) close;
    		equip 2589;
    		mes .npc$;
    	}
    	.@refeq = getequiprefinerycnt(EQI_GARMENT);
    	if(.@refeq<7) .@refeq2 = 1;
    	else if(.@refeq>8) .@refeq2 = 3;
    	else .@refeq2 = 2;
    	
    	mes "You have a ^000099+" +.@refeq + " Fallen Angel Wing^000000.",
    		"It can have a total of " + .@refeq2 + " enchantment"  +( .@refeq2>1?"s.":".")+" Please";
    	mes "select your preferred","enchantment.";
    	next;
    	setd ".@enc$", select("Fighting Enchant:Magic Enchant:Archer Enchant:Critical/Fatal Enchant:Max HP Enchant:Max SP Enchant:ASPD Enchant:STR Enchant:AGI Enchant:DEX Enchant:VIT Enchant:INT Enchant:LUK Enchant");
    	if(.cost) callsub OnCostlyEnchant;
    	
    	@card1 = getequipcardid(5,0);
    	@card2 = getequipcardid(5,1);
    	@card3 = getequipcardid(5,2);
    	@card4 = getequipcardid(5,3);
    	
    	if( @card2 && @card3 && @card4) {
    		mes .npc$,
    		"Hmm.. it seems that all", 
    		"slots have already been enchanted.";
    		close;
    	}
    	
    	.@EnStat =   callfunc( (.chancetype?"EnchantStat_1":"EnchantStat_0"), .@enc$) ;
    	
    	if(!@card2) callsub OnFawEnchant , .@EnStat , @card3 , @card4 , .@refeq;	
    	else if(!@card3 && .@refeq>6) callsub OnFawEnchant , @card2 , .@EnStat , @card4 , .@refeq;
    	else if(!@card4 && .@refeq>8) callsub OnFawEnchant , @card2 , @card3 , .@EnStat , .@refeq;
    	else {
    		mes .npc$,
    		"Sorry, but your",
    		"^000099Fallen Angel Wing^000000's",
    		"refinement level is too", 
    		"low to continue";
    		close;
    	}
    	
    	mes .npc$,
    		"Your ^000099Fallen Angel Wing^000000 has",
    		"been enchanted with ^000099"+getitemname(.@EnStat)+"^000000.";
    	close;
    
    OnFawEnChant:
    	delitem2 2589, 1, 1, getarg(3), 0, @card1, @card2, @card3, @card4;
    	getitem2 2589, 1, 1, getarg(3) , 0, @card1, getarg(0), getarg(1), getarg(2);
    	equip 2589;
    	specialeffect2 1019;
    	specialeffect2 98;
    	return;
    
    	
    OnResetEnchant:
    	mes .npc$,
    		"This will cost " + callfunc("F_InsertComma",.cost2) + "z.",
    		"Are you sure?";
    	next;
    	if(select("Yes:No")==2) close;
    	mes .npc$;
    	if(Zeny<100000000) {
    		mes "You don't have enough zeny.";
    		close;
    	}
    	Zeny -= 100000000;
    	mes "Your ^000099Fallen Angel Wing^000000's",
    		"enchantments have been reset.";
    	.@refeq = getequiprefinerycnt(EQI_GARMENT);
    	@card1 = getequipcardid(5,0);
    	@card2 = getequipcardid(5,1);
    	@card3 = getequipcardid(5,2);
    	@card4 = getequipcardid(5,3);
    	delitem2 2589, 1, 1, .@refeq, 0, @card1, @card2, @card3, @card4;
    	getitem2 2589, 1, 1, .@refeq, 0, @card1, 0, 0, 0;
    	equip 2589;
    	specialeffect2 261;
    	specialeffect2 119;
    	close;
    	
    //Only called when .cost is defined	
    OnCostlyEnchant:	
    	if(Zeny<.cost) {
    		
    		mes .npc$,
    			"You don't have enough zeny.";
    		close;
    	}
    	Zeny -= .cost;
    	return;
    	
    	
    	
    	
    OnInit:
    	.npc$ = "[^AA0000The Fallen^000000]";
    	setarray .enc1[0], 4809,4808,4820, 4821;	//Fighting 3~5
    	setarray .enc2[0], 4812,4826,4827, 4828;	//Magic 4~6
    	setarray .enc3[0], 4832,4833,4834, 4835;	//Expert Arc 1~3
    	setarray .enc4[0], 4863,4864,4865, 4866;	//Fatal 1~3
    	setarray .enc5[0], 4861,4862,4867, 4868;	//MHPP 1~3%
    	setarray .enc6[0], 4870,4800,4871, 4801;	//MaxSP 25,50,75
    	setarray .enc7[0], 4869,4872,4873, 4807;	//ASPD 1~3
    //	setarray .enc7[0], 4869,4872,4873, 4881;	//ASPD 1~3
    	setarray .enc8[0], 4702,4703,4704, 4853;	//STR 3~5 | Special Str
    	setarray .enc9[0], 4731,4732,4733, 4854;	//AGI 2~4
    	setarray .enc10[0], 4722,4723,4724, 4857;	//DEX 3~5
    	setarray .enc11[0], 4742,4743,4744, 4855;	//VIT 3~5
    	setarray .enc12[0], 4712,4713,4714, 4856;	//INT 3~5
    	setarray .enc13[0], 4752,4753,4754, 4858;	//LUK 3~5
    	// 1 = 60% low, 30% mid, 10% high for 1st & 2nd enchant slot && 40% low, 30% mid, 20% high, 10% special for 3rd enchant slot
    	// 0 = Equal Chance
    	.chancetype = 1;
    	//Turn on Equip Selection if garment is unequipped? 1 = Yes
    	.autoequip =1;
    	//Cost for Enchanting. It's free in iRO
    	.cost=5000000;
    	//Cost to reset | Costs 1Mz in iRO
    	.cost2 = 10000000;
    }
    
    

    Ooopss. NVM, fixed it. Sorry guys.

  8. @tepek you can configure how high or low the proc chance is on your item script.

     

    ie;

    4876,Runaway_Magic,Runaway Magic,6,20,,10,,,,,,,,,,,,,{ autobonus "{ bonus bInt,200; bonus2 bSPLossRate,200,1000; }",1,5000,BF_MAGIC,"{ specialeffect2 EF_LAMADAN; }"; },{},{ heal 0,-2000; }
    
  9. Oh thank you emistry! Is there any way that I can intergate this into rA stylist instead of using this default NP?


    Oh these are hair styles.  I only need Clothes dyes @emistry


    I would only want to use official clothes dye if possible on stylist. I don't know what dye # they are.

  10. Does anyone here know where to get a Stylist that only allows players to use Official cloth colors like what they use in pRO,kRO or iRO.

     

    I believe it's only an option for 3 or 4 colors. Please help. I've been searching for about 2 hours now, I can't seem to find it :(

     

    Thank you in advance!

  11. Hi there, I have this Costume maker script. The script works but it can't detect the correct Items on the correct Location.

    In example, It should only make a menu for Upper, Middle, Lower headgears. But what's happening is, the script only detects right hand equipment.

     

    maybe somebody can help me with this issue, I had about the same issue for my card remover script but was then fixed when I grabbed the updated one in rathena github. But unfortunately cannot find anything regarding this issue.

     

    I will provide some of the script for you to see.

     

    Here:

    	setarray .@Position$[1],"Top","Mid","Low";
    	setarray .@Position[1],1,9,10;
    
    	set .@Menu$,"";
    	for( set .@i, 1; .@i < 10; set .@i, .@i + 1 ) {
    		if( getequipisequiped(.@Position[.@i]) )
    			set .@Menu$, .@Menu$ + .@Position$[.@i] + "-" + "[" + getequipname(.@Position[.@i]) + "]";
    
    		set .@Menu$, .@Menu$ + ":";
    	}
    
    	set .@Part, .@Position[ select(.@Menu$) ];
    	if( !getequipisequiped(.@Part) ) {
    		mes "[Costumizer]";
    		mes "Your not wearing anything there...";
    		close;
    	}
    
    	mes "[Costumizer]";
    	mes "You want to Costume your " + getitemname(getequipid(.@Part)) + "?";
    	next;
    	if( select("Yes, proceed:No, I am sorry.") == 2 ) {
    		mes "[Costumizer]";
    		mes "Need some time to think about it, huh?";
    		mes "Alright, I understand.";
    		close;
    		}
    
    

    Thank you in advanced!!

  12. Hi ragno, thanks for the help. But I actually know where I'd put this script.

    The thing is, that "+.@Guillaume+"/5 Red Side | "+.@Croix+"/5 doesn't belong in this script. This is from the official BG script I had. I wanted to know what's the correct variable to use that's why I provided the whole script for ppl to see.

  13. Hi there, I would like to add an announcement when players join the custom battleground waiting room.

    Script is the one provided @ npc/custom/battleground with just a little modification to my setup.

     

    I would like to add this announcement everytime a player joins in. Thank you in advance!!

    announce "Battleground 5v5 : "+.@Guillaume+"/5 Red Side | "+.@Croix+"/5 Blue Side",16;

    And here's the script:

    //===== rAthena Script =======================================
    //= Battleground: PVP
    //===== By: ==================================================
    //= AnnieRuru
    //===== Current Version: =====================================
    //= 1.0
    //===== Compatible With: =====================================
    //= rAthena Project
    //===== Description: =========================================
    //= A simple battleground script:
    //= Kill players from the other team.
    //===== Additional Comments: =================================
    //= 1.0 First version, edited. [Euphy]
    //============================================================
    
    -	script	bg_pvp1#control1	-1,{
    OnInit:
    	.minplayer2start = 5;      // minimum players to start (ex. if 3vs3, set to 3)
    	.eventlasting    = 15*60;  // event duration before auto-reset (20 minutes * seconds)
    	setarray .rewarditem[0],   // rewards for the winning team: <item>,<amount>,...
    		7773, 15;
    	end;
    OnStart:
    	if ( getwaitingroomstate( 0, .rednpcname$ ) < .minplayer2start || getwaitingroomstate( 0, .bluenpcname$ ) < .minplayer2start )
    		end;
    
    	// create Battleground and teams
    	.red = waitingroom2bg( "guild_vs1", 5,50, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead", .rednpcname$ );
    	copyarray .team1aid, $@arenamembers, $@arenamembersnum;
    	.team1count = .minplayer2start;
    	.blue = waitingroom2bg( "guild_vs1", 95,50, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead", .bluenpcname$ );
    	copyarray .team2aid, $@arenamembers, $@arenamembersnum;
    	.team2count = .minplayer2start;
    	delwaitingroom .rednpcname$;
    	delwaitingroom .bluenpcname$;
    	bg_warp .red, "guild_vs1", 5,50;
    	bg_warp .blue, "guild_vs1", 95,50;
    	.score[1] = .score[2] = .minplayer2start;
    	bg_updatescore "guild_vs1", .score[1], .score[2];
    
    	// match duration
    	sleep .eventlasting * 1000;
    
    	// end match, destroy Battleground, reset NPCs
    	if ( .score[1] > .score[2] ) {
    		mapannounce "guild_vs1", "- Red Team is victorious! -", bc_map;
    		callsub L_Reward, 1;
    	}
    	else if ( .score[1] < .score[2] ) {
    		mapannounce "guild_vs1", "- Blue Team is victorious! -", bc_map;
    		callsub L_Reward, 2;
    	}
    	else
    		mapannounce "guild_vs1", "- The match has ended in a draw! -", bc_map;
    	bg_warp .red, "prontera",156,182;
    	bg_warp .blue, "prontera",156,182;
    	bg_destroy .red;
    	bg_destroy .blue;
    	donpcevent .rednpcname$ +"::OnStart";
    	donpcevent .bluenpcname$ +"::OnStart";
    	end;
    
    L_Reward:
    	for ( .@i = 0; .@i < getd(".team"+ getarg(0) +"count"); .@i++ )
    		getitem .rewarditem[0], .rewarditem[1], getd(".team"+ getarg(0) +"aid["+ .@i +"]" );
    	return;
    
    // "OnDeath" event
    OnRedDead:  callsub L_Dead, 1;
    OnBlueDead: callsub L_Dead, 2;
    L_Dead:
    	.score[ getarg(0) ]--;
    	bg_updatescore "guild_vs1", .score[1], .score[2];
    	while ( getd( ".team"+ getarg(0) +"aid["+ .@i +"]" ) != getcharid(3) && .@i < getd(".team"+ getarg(0) +"count") ) .@i++;
    	deletearray getd( ".team"+ getarg(0) +"aid["+ .@i +"]" ), 1;
    	setd ".team"+ getarg(0) +"count", getd(".team"+ getarg(0) +"count") -1;
    	bg_leave;
    	if ( !.score[ getarg(0) ] )
    		awake strnpcinfo(0);
    	sleep2 1250;
    	percentheal 100,100;
    	end;
    
    // "OnQuit" event
    OnRedQuit:  callsub L_Quit, 1;
    OnBlueQuit: callsub L_Quit, 2;
    L_Quit:
    	.score[ getarg(0) ]--;
    	bg_updatescore "guild_vs1", .score[1], .score[2];
    	percentheal 100, 100;
    	while ( getd( ".team"+ getarg(0) +"aid["+ .@i +"]" ) != getcharid(3) && .@i < getd(".team"+ getarg(0) +"count") ) .@i++;
    	deletearray getd( ".team"+ getarg(0) +"aid["+ .@i +"]" ), 1;
    	setd ".team"+ getarg(0) +"count", getd(".team"+ getarg(0) +"count") -1;
    	if ( !.score[ getarg(0) ] )
    		awake strnpcinfo(0);
    	end;
    }
    
    prontera,147,162,5	script	Red Team#bg_pvp1	413,{
    	mes "5v5 Battleground";
    	mes "Time Limit : 15 minutes";
    	mes "Cooldown : 0 minute";
    	mes "Rewards";
    	mes "Winner : 15";
    	mes "Loser : 0";
    	end;
    OnInit:
    	sleep 1;
    	set getvariableofnpc( .rednpcname$, "bg_pvp1#control1" ), strnpcinfo(0);
    OnStart:
    	waitingroom "Battleground - 5v5", getvariableofnpc( .minplayer2start, "bg_pvp1#control1" ) +1, "bg_pvp1#control1::OnStart", getvariableofnpc( .minplayer2start, "bg_pvp1#control1" );
    	end;
    }
    
    prontera,164,162,3	script	Blue Team#bg_pvp1	413,{
    	mes "5v5 Battleground";
    	mes "Time Limit : 15 minutes";
    	mes "Cooldown : 0 minute";
    	mes "Rewards";
    	mes "Winner : 15";
    	mes "Loser : 0";
    	end;
    OnInit:
    	sleep 1;
    	set getvariableofnpc( .bluenpcname$, "bg_pvp1#control1" ), strnpcinfo(0);
    OnStart:
    	waitingroom "Battleground - 5v5", getvariableofnpc( .minplayer2start, "bg_pvp1#control1" ) +1, "bg_pvp1#control1::OnStart", getvariableofnpc( .minplayer2start, "bg_pvp1#control1" );
    	end;
    }
    
    guild_vs1	mapflag	battleground	2
    guild_vs1	mapflag	nosave	SavePoint
    guild_vs1	mapflag	nowarp
    guild_vs1	mapflag	nowarpto
    guild_vs1	mapflag	noteleport
    guild_vs1	mapflag	nomemo
    guild_vs1	mapflag	nopenalty
    guild_vs1	mapflag	nobranch
    guild_vs1	mapflag	noicewall
    
    
×
×
  • Create New...