Jump to content

celeron0134

Members
  • Posts

    194
  • Joined

  • Last visited

Posts posted by celeron0134

  1. -	script	bg_pvp_round#control	-1,{
    OnInit:
    	.minplayer2start = 1; // minimum player to start
    	.winningscore = 2; // how many rounds to win
    	.eventlasting = 20*60; // event last 20 minutes or the system abort itself
    	setarray .rewarditem,
    		501, 5, // reward to the winning team
    		501, 1; // reward to the losing team
    	end;
    OnStart:
    	if ( getwaitingroomstate( 0, .rednpcname$ ) < .minplayer2start || getwaitingroomstate( 0, .bluenpcname$ ) < .minplayer2start ) {
    		announce "[ Battle Ground DeathMatch System ]  Blue Team : "+ getwaitingroomstate( 0, .bluenpcname$ ) + "/" + .minplayer2start + ". Red Team : "+ getwaitingroomstate( 0, .rednpcname$ ) + "/" + .minplayer2start,bc_all,0x00CED1;
    		end;
    	}
    	announce "[ Battle Ground DeathMatch System ]  Battleground has started", bc_all, 0x00CED1;
    	.red = waitingroom2bg( "bat_b01", 61,150, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead", .rednpcname$ );
    	copyarray .team1aid, $@arenamembers, $@arenamembersnum;
    	.team1count = .minplayer2start;
    	.blue = waitingroom2bg( "bat_b01", 327,150, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead", .bluenpcname$ );
    	copyarray .team2aid, $@arenamembers, $@arenamembersnum;
    	.team2count = .minplayer2start;
    	.life[1] = .life[2] = .minplayer2start;
    	delwaitingroom .rednpcname$;
    	delwaitingroom .bluenpcname$;
    	disablenpc .rednpcname$;
    	disablenpc .bluenpcname$;
    	callsub L_setwall;
    	bg_updatescore "bat_b01", 0, 0;
    	bg_warp .red, "bat_b01", 61,150;
    	bg_warp .blue, "bat_b01", 327,150;
    	sleep 4000 * !.skip;
    	mapannounce "bat_b01", "Kill all opponent team to gain 1 point, score "+ .winningscore +" points to win !", 0;
    	sleep 2000 * !.skip;
    	while (1) {
    		for ( .@i = 5; .@i > 0; .@i-- ) {
    			mapannounce "bat_b01", "["+ .@i +"]", 0;
    			sleep 1000 * !.skip;
    		}
    		if ( .score[1] == .winningscore -1 && .score[2] == .winningscore -1 )
    			mapannounce "bat_b01", "Final Round start!", 0;
    		else
    			mapannounce "bat_b01", "Round "+ .round++ +" start!", 0;
    		callsub L_delwall;
    		.life[1] = .team1count;
    		.life[2] = .team2count;
    		sleep .eventlasting * 1000 * !.skip;
    		bg_updatescore "bat_b01", .score[1], .score[2];
    		if ( .score[1] == .winningscore || .score[2] == .winningscore || !.winside ) break;
    		sleep 5000 * !.skip;
    		callsub L_make_player_move;
    		bg_warp .red, "bat_b01", 61,150;
    		bg_warp .blue, "bat_b01", 327,150;
    		callsub L_setwall;
    		sleep 1000 * !.skip;
    		.winside = 0;
    	}
    	if ( .winside ) {
    		mapannounce "bat_b01", " "+ ( ( .winside == 1 )? "Red" : "Blue" ) +" side wins !", 0;
    		callsub L_reward, .winside, 0;
    		callsub L_reward, ( .winside == 1 )? 2:1, 2;
    	} else
    		mapannounce "bat_b01", "Time Out. Aborting the match.", 0;
    	sleep 5000;
    	callsub L_make_player_move;
    	bg_warp .red, "prontera", 155,182;
    	bg_warp .blue, "prontera", 158,182;
    	bg_destroy .red;
    	bg_destroy .blue;
    	callsub L_delwall;
    	deletearray .team1aid;
    	deletearray .team2aid;
    	.round = .winside = .skip = .score[1] = .score[2] = .team1count = .team2count = .life[1] = .life[2] = 0;
    	enablenpc .rednpcname$;
    	enablenpc .bluenpcname$;
    	donpcevent .rednpcname$ +"::OnStart";
    	donpcevent .bluenpcname$ +"::OnStart";
    	end;
    L_reward:
    	.@size = getarraysize( getd(".team"+ getarg(0) +"aid") );
    	for ( .@i = 0; .@i < .@size; .@i++ )
    		getitem .rewarditem[ getarg(1) ], .rewarditem[ getarg(1) +1 ], getd(".team"+ getarg(0) +"aid["+ .@i +"]" );
    	return;
    L_setwall:
    	setwall "bat_b01", 58,153, 6, 6, 0, "bg_pvp_round_red_1";
    	setwall "bat_b01", 64,153, 6, 4, 0, "bg_pvp_round_red_2";
    	setwall "bat_b01", 64,147, 6, 2, 0, "bg_pvp_round_red_3";
    	setwall "bat_b01", 58,147, 6, 0, 0, "bg_pvp_round_red_4";
    	setwall "bat_b01", 324,153, 6, 6, 0, "bg_pvp_round_blue_1";
    	setwall "bat_b01", 330,153, 6, 4, 0, "bg_pvp_round_blue_2";
    	setwall "bat_b01", 330,147, 6, 2, 0, "bg_pvp_round_blue_3";
    	setwall "bat_b01", 324,147, 6, 0, 0, "bg_pvp_round_blue_4";
    	return;
    L_delwall:
    	delwall "bg_pvp_round_red_1";
    	delwall "bg_pvp_round_red_2";
    	delwall "bg_pvp_round_red_3";
    	delwall "bg_pvp_round_red_4";
    	delwall "bg_pvp_round_blue_1";
    	delwall "bg_pvp_round_blue_2";
    	delwall "bg_pvp_round_blue_3";
    	delwall "bg_pvp_round_blue_4";
    	return;
    L_make_player_move:
    	for ( .@j = 1; .@j <= 2; .@j++ ) {
    		for ( .@i = 0; .@i < getd(".team"+ .@j +"count"); .@i++ ) {
    			attachrid getd(".team"+ .@j +"aid["+ .@i +"]" );
    			setoption 0x40, 0;
    			pcblockmove getcharid(3), 0;
    		}
    	}
    	return;
    OnRedQuit: callsub L_quit, 1, "Red", 2, "Blue";
    OnBlueQuit: callsub L_quit, 2, "Blue", 1, "Red";
    L_quit:
    	percentheal 100, 100;
    	setoption 0x40, 0;
    	pcblockmove getcharid(3), 0;
    	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;
    	.life[ getarg(0) ]--;
    	if ( !getd(".team"+ getarg(0) +"count") ) {
    		mapannounce "bat_b01", "All "+ getarg(1) +" team members has Quit !", 0, 0xff3333; // purposely use different color
    		.score[ getarg(2) ] = .winningscore;
    		.winside = getarg(2);
    		.skip = 1;
    		awake strnpcinfo(0);
    	}
    	else if ( !.life[ getarg(0) ] ) {
    		.winside = getarg(2);
    		mapannounce "bat_b01", " "+ getarg(3) +" team has defeated the opponent team, "+ getarg(3) +" team score a point !", 0;
    		.score[ getarg(2) ]++;
    		awake strnpcinfo(0);
    	}
    	end;
    OnRedDead: callsub L_dead, 1, 2, "Blue";
    OnBlueDead: callsub L_dead, 2, 1, "Red";
    L_dead:
    	.life[ getarg(0) ]--;
    	if ( !.life[ getarg(0) ] ) {
    		.winside = getarg(1);
    		mapannounce "bat_b01", " "+ getarg(2) +" team has defeated the opponent team, "+ getarg(2) +" team score a point !", 0;
    		.score[ getarg(1) ]++;
    		awake strnpcinfo(0);
    	}
    	sleep2 1250;
    	percentheal 100,100;
    	setoption 0x40, 1;
    	pcblockmove getcharid(3), 1;
    	end;
    }
    
    prontera,155,177,5	script	Red side#bg_pvp_r	100,{
    	end;
    OnInit:
    	sleep 1;
    	set getvariableofnpc( .rednpcname$, "bg_pvp_round#control" ), strnpcinfo(0);
    OnStart:
    	waitingroom "Red side", getvariableofnpc( .minplayer2start, "bg_pvp_round#control" ) +1, "bg_pvp_round#control::OnStart", 1;
    	end;
    }
    
    prontera,158,177,5	script	Blue side#bg_pvp_r	100,{
    	end;
    OnInit:
    	sleep 1;
    	set getvariableofnpc( .bluenpcname$, "bg_pvp_round#control" ), strnpcinfo(0);
    OnStart:
    	waitingroom "Blue side", getvariableofnpc( .minplayer2start, "bg_pvp_round#control" ) +1, "bg_pvp_round#control::OnStart", 1;
    	end;
    }
    
    bat_b01	mapflag	battleground	2
    bat_b01	mapflag	nosave	SavePoint
    bat_b01	mapflag	nowarp
    bat_b01	mapflag	nowarpto
    bat_b01	mapflag	noteleport
    bat_b01	mapflag	nomemo
    bat_b01	mapflag	nopenalty
    bat_b01	mapflag	nobranch
    bat_b01	mapflag	noicewall

    Hello Good day rathena.. How can i change this BG script to .winningpoints = 100; where 1 point = 1 enemy kill

    and to respawn??

    bump please

  2. 17 hours ago, Emistry said:

    remove the comment in your SQL file

    
    /*    <--- REMOVE
    ...
    ...
    */    <--- REMOVE

     

    did it.. copied the whole txt and removed what you said.. and saved it as .sql then opened phpmyadmin, clicked ragnarok then import then chosed the file.. then pressed go.. it says executed 4 queries.. but when i clicked pvp_ranking and woe_ranking this is the result

    2nd sql.PNG

     

    //===== rAthena Script =======================================
    //= Ranking List
    //===== By: ==================================================
    //= BeWan
    //https://rathena.org/board/profile/62232-bewan/
    //===== Current Version: =====================================
    //= 1.2
    //===== Description: =========================================
    //= PvP/GvG/Emperium Breaker Ranking List
    //= Top 10 Kills, Deaths and Break Emp
    //= PvP/GvG/Emp Break Shop Added
    //============================================================
    
    /*
    DROP TABLE IF EXISTS `pvp_ranking`;
    
    CREATE TABLE IF NOT EXISTS `pvp_ranking` (
    `Char_ID` int(11) unsigned NOT NULL DEFAULT '0',
    `PlayerName` varchar(255) NULL DEFAULT '',
    `Kills` varchar(255) NULL DEFAULT '',
    `Deaths` varchar(255) NULL DEFAULT '',
    PRIMARY KEY (`Char_ID`)
    ) ENGINE=MyISAM;
    
    DROP TABLE IF EXISTS `woe_ranking`;
    
    CREATE TABLE IF NOT EXISTS `woe_ranking` (
    `Char_ID` int(11) unsigned NOT NULL DEFAULT '0',
    `PlayerName` varchar(255) NULL DEFAULT '',
    `Kills` varchar(255) NULL DEFAULT '',
    `Deaths` varchar(255) NULL DEFAULT '',
    `EmpBreak` varchar(255) NULL DEFAULT '',
    PRIMARY KEY (`Char_ID`)
    ) ENGINE=MyISAM;
    */
    
    prontera,153,190,4	script	Krane The Ranker	417,{
    
    	set .@menu$, "PvP Rank:GvG Rank:Guild Rank:Points Shop:";
    	if (getgmlevel() == 99) { set .@menu$, .@menu$ + "Reset Data"; }
    	switch(select(.@menu$)) {
    	case 1:
    	mes "[Master Krane]";
    	mes "Hi, "+strcharinfo(0)+"";
    	mes "If you want to I can show you";
    	mes "PVP Top "+.top+" Strongest and the Weakest.";
    	next;
    	menu "Top "+.top+" Kills",PvPKills,"Top "+.top+" Weakest",PvPDeaths,"Nope",PvPNope;
    
    	PvPKills:
    	query_sql "CREATE TABLE IF NOT EXISTS `pvp_ranking` ( `Char_ID` int(11) unsigned NOT NULL DEFAULT '0', `PlayerName` varchar(255) NULL DEFAULT '', `Kills` varchar(255) NULL DEFAULT '', `Deaths` varchar(255) NULL DEFAULT '', PRIMARY KEY (`Char_ID`) ) ENGINE=MyISAM";
    	query_sql( "DELETE FROM `pvp_ranking` WHERE `PlayerName` NOT IN ( SELECT `name` FROM `char` )" ); 
    	set .@size, query_sql( "SELECT * FROM pvp_ranking WHERE Kills > 0 ORDER BY Kills DESC limit "+ .top, .@CharID, .@name$, .@Kills, .@Deaths);
    	
    	mes "[^FF0000PvP ^0000FFRank ^996600Top ^FF0000" + .top +"^000000]";
    	for (set .@c, 0; .@c < .@size; set .@c, .@c + 1)
    		mes "Top ^FF0000" +(.@c + 1) +"^000000: ^0000FF" + .@name$[.@c] +"^000000 | ^FF0000" + .@Kills[.@c] +"^000000 Kills | ^FF0000" + .@Deaths[.@c] +"^000000 Deaths";
    	close;
    	
    	PvPDeaths:
    	query_sql "CREATE TABLE IF NOT EXISTS `pvp_ranking` ( `Char_ID` int(11) unsigned NOT NULL DEFAULT '0', `PlayerName` varchar(255) NULL DEFAULT '', `Kills` varchar(255) NULL DEFAULT '', `Deaths` varchar(255) NULL DEFAULT '', PRIMARY KEY (`Char_ID`) ) ENGINE=MyISAM";
    	query_sql( "DELETE FROM `woe_ranking` WHERE `PlayerName` NOT IN ( SELECT `name` FROM `char` )" ); 
    	set .@size, query_sql( "SELECT * FROM pvp_ranking WHERE Deaths > 0 ORDER BY Deaths DESC limit "+ .top, .@CharID, .@name$, .@Kills, .@Deaths);
    	
    	mes "[^FF0000WoE ^0000FFRank ^996600Top ^FF0000" + .top +"^000000]";
    	for (set .@c, 0; .@c < .@size; set .@c, .@c + 1)
    		mes "Top ^FF0000" +(.@c + 1) +"^000000: ^0000FF" + .@name$[.@c] +"^000000 | ^FF0000" + .@Kills[.@c] +"^000000 Kills | ^FF0000" + .@Deaths[.@c] +"^000000 Deaths ";
    	close;
    	
    	PvPNope:
    	mes "[Master Krane]";
    	mes "Well Okay";
    	close;
    	
    	case 2:
    	mes "[Master Krane]";
    	mes "Hi, "+strcharinfo(0)+"";
    	mes "If you want to I can show you";
    	mes "GVG Top "+.top+" Strongest/Weakest and the Emperium Breaker.";
    	next;
    	menu "Top "+.top+" Kills",GvGKills,"Top "+.top+" Weakest",GvGDeaths,"Top "+.top+" Breaker",EmpBreak,"Nope",GvGNope;
    	
    	GvGKills:
    	query_sql "CREATE TABLE IF NOT EXISTS `woe_ranking` ( `Char_ID` int(11) unsigned NOT NULL DEFAULT '0', `PlayerName` varchar(255) NULL DEFAULT '', `Kills` varchar(255) NULL DEFAULT '', `Deaths` varchar(255) NULL DEFAULT '', `EmpBreak` varchar(255) NULL DEFAULT '', PRIMARY KEY (`Char_ID`) ) ENGINE=MyISAM";
    	query_sql( "DELETE FROM `woe_ranking` WHERE `PlayerName` NOT IN ( SELECT `name` FROM `char` )" ); 
    	set .@size, query_sql( "SELECT * FROM woe_ranking WHERE Kills > 0 ORDER BY Kills DESC limit "+ .top, .@CharID, .@name$, .@Kills, .@Deaths, .@EmpBreak);
    	
    	mes "[^FF0000WoE ^0000FFRank ^996600Top ^FF0000" + .top +"^000000]";
    	for (set .@c, 0; .@c < .@size; set .@c, .@c + 1)
    		mes "Top ^FF0000" +(.@c + 1) +"^000000: ^0000FF" + .@name$[.@c] +"^000000 | ^FF0000" + .@Kills[.@c] +"^000000 Kills | ^FF0000" + .@Deaths[.@c] +"^000000 Deaths | ^FF0000" + .@EmpBreak[.@c] +"^000000 Emp Break ";
    	close;
    	
    	GvGDeaths:
    	query_sql "CREATE TABLE IF NOT EXISTS `woe_ranking` ( `Char_ID` int(11) unsigned NOT NULL DEFAULT '0', `PlayerName` varchar(255) NULL DEFAULT '', `Kills` varchar(255) NULL DEFAULT '', `Deaths` varchar(255) NULL DEFAULT '', `EmpBreak` varchar(255) NULL DEFAULT '', PRIMARY KEY (`Char_ID`) ) ENGINE=MyISAM";
    	query_sql( "DELETE FROM `woe_ranking` WHERE `PlayerName` NOT IN ( SELECT `name` FROM `char` )" ); 
    	set .@size, query_sql( "SELECT * FROM woe_ranking WHERE Deaths > 0 ORDER BY Deaths DESC limit "+ .top, .@CharID, .@name$, .@Kills, .@Deaths, .@EmpBreak);
    	
    	mes "[^FF0000WoE ^0000FFRank ^996600Top ^FF0000" + .top +"^000000]";
    	for (set .@c, 0; .@c < .@size; set .@c, .@c + 1)
    		mes "Top ^FF0000" +(.@c + 1) +"^000000: ^0000FF" + .@name$[.@c] +"^000000 | ^FF0000" + .@Kills[.@c] +"^000000 Kills | ^FF0000" + .@Deaths[.@c] +"^000000 Deaths | ^FF0000" + .@EmpBreak[.@c] +"^000000 Emp Break";
    	close;
    	
    	EmpBreak:
    	query_sql "CREATE TABLE IF NOT EXISTS `woe_ranking` ( `Char_ID` int(11) unsigned NOT NULL DEFAULT '0', `PlayerName` varchar(255) NULL DEFAULT '', `Kills` varchar(255) NULL DEFAULT '', `Deaths` varchar(255) NULL DEFAULT '', `EmpBreak` varchar(255) NULL DEFAULT '', PRIMARY KEY (`Char_ID`) ) ENGINE=MyISAM";
    	query_sql( "DELETE FROM `woe_ranking` WHERE `PlayerName` NOT IN ( SELECT `name` FROM `char` )" ); 
    	set .@size, query_sql( "SELECT * FROM woe_ranking WHERE EmpBreak > 0 ORDER BY EmpBreak DESC limit "+ .top, .@CharID, .@name$, .@Kills, .@Deaths, .@EmpBreak);
    	query_sql "SELECT `name`, `guild_id` FROM `char` WHERE `name` = '"+.@name$+"'", .@CName$, .@Gid;
    	
    	mes "[^FF0000WoE ^0000FFRank ^996600Top ^FF0000" + .top +"^000000]";
    	for (set .@c, 0; .@c < .@size; set .@c, .@c + 1)
    		mes "Top ^FF0000" +(.@c + 1) +"^000000: ^0000FF" + .@name$[.@c] +"^000000 | ^FF0000" + .@Kills[.@c] +"^000000 Kills | ^FF0000" + .@Deaths[.@c] +"^000000 Deaths | ^FF0000" + .@EmpBreak[.@c] +"^000000 Emp Break";
    	close;
    	
    	GvGNope:
    	mes "[Master Krane]";
    	mes "Well Okay";
    	close;
    	
    	case 3:
    	for (set .@x,0; .@x < .top; set .@x,.@x + 1) {
    		if (.@x) mes "- - - - - - - - - - - - - - -";
    		mes "# ^ff0000" + (.@x + 1) + "^000000: ^0000ff" + ( (.GuildName$[.@x])? .GuildName$[.@x]:"None" ) + "^000000";
    		mes " - Guild Master: ^0000ff" + ( (.GuildMaster$[.@x])? .GuildMaster$[.@x]:"None" ) + "^000000";
    		mes " - Territories: ^ff0000" + .NumCastles[.@x] + "^000000";
    		mes " - Members: ^ff0000" + .NumMembers[.@x] + "^000000";
    	}
    	end;
    	
    	case 4:
    	mes "[Master Krane]";
    	mes "Hi, "+strcharinfo(0)+"";
    	mes "Want to go shopping?";
    	next;
    	menu "PvP Shop",PvPShop,"GvG Shop",GvGShop,"Emp Break Shop",BreakShop,"Nope",ShopNope;
    	
    	PvPShop:
    	callshop "PvP_Points_Shop",1;
    	end;
    	
    	GvGShop:
    	callshop "GvG_Points_Shop",1;
    	end;
    	
    	BreakShop:
    	callshop "EmpBreak_Points_Shop",1;
    	end;
    	
    	ShopNope:
    	mes "[Master Krane]";
    	mes "Well Okay";
    	close;
    	
    	case 5:
    	mes "[Master Krane]";
    	mes "Good Day!";
    	next;
    	menu "PvP Ranking Reset",PvPReset,"GvG Ranking Reset",GvGReset,"Nope",No;
    	
    	PvPReset:
    	mes "[Master Krane]";
    	mes "PvP Ranking Reset?";
    	menu "Are you sure?",PvPYes,"Nope",PvPNo;
    	
    	PvPYes:
    	query_sql("TRUNCATE TABLE `ragnarok`.`pvp_ranking`;");
    	mes "PvP Rank Reset Success";
    	close;
    	
    	PvPNo:
    	mes "[Master Krane]";
    	mes "Well Okay";
    	close;
    	
    	GvGReset:
    	mes "[Master Krane]";
    	mes "GvG Ranking Reset?";
    	menu "Are you sure?",GvGYes,"Nope",GvGNo;
    	
    	GvGYes:
    	query_sql("TRUNCATE TABLE `ragnarok`.`woe_ranking`;");
    	mes "GvG Rank Reset Success";
    	close;
    	
    	GvGNo:
    	mes "[Master Krane]";
    	mes "Well Okay";
    	close;
    	
    	No:
    	mes "[Master Krane]";
    	mes "Well Okay";
    	close;
    
    	}
    
    OnInit: // Script Configuration
    	set .Cnt, query_sql("SELECT (SELECT count(c.castle_id) FROM guild_castle c WHERE c.guild_id = g.guild_id) castles, CONCAT(g.name, ' (LV. ',g.guild_lv,')') guild, count(g.char_id) members, g.master FROM guild g LEFT JOIN guild_member m ON g.guild_id = m.guild_id GROUP BY g.guild_id HAVING castles > 0 ORDER BY castles DESC, guild_lv DESC, members DESC", .NumCastles,.GuildName$,.NumMembers,.GuildMaster$);
    	set .PvP_Point, 1;    //PvP Points to add when kill
    	set .PvP_Deductpoint, 1; //PvP Points to deduct when died
    	set .WoePoints, 1;      //WoE points to add in database/player when kill
    	set .WoeDeduct, 1;      //Woe points to add in database
    	set .diedeductpoint, 1; //Woe points to deduct when died
    	set .top, 5;
    	waitingroom "PvP/GvG Rank List",0;
    	end;
    
    OnPCKillEvent:
    	if (killerrid != getcharid(3)) {
    	if (( agitcheck() || agitcheck2() ) && compare(strcharinfo(3),"g_cas")) {
    		set points, points+.WoePoints;
    		query_sql( "SELECT * FROM woe_ranking WHERE `Char_ID` = '"+getcharid(0)+"'", .@CharID, .@Name$, .@Kills, .@Deaths, .@EmpBreak);
    		set ToTalP , .@Kills + .WoePoints;
    		
    	if(getcharid(0) == .@CharID){
    		query_sql("UPDATE `woe_ranking` SET `Kills` = '"+ToTalP+"' WHERE `Char_ID` = '"+getcharid(0)+"'");
    	}else{	
    		query_sql("INSERT INTO `woe_ranking` (`Char_ID`,`PlayerName`,`Kills`,`Deaths`,`EmpBreak`) VALUES ('"+getcharid(0)+"', '"+strcharinfo(0)+"', '"+.WoePoints+"', '"+.@Deaths+"', '"+.@EmpBreak+"')"); 
    	}
    	////////query for the deaths
    		query_sql( "SELECT `char_id`, `account_id` FROM `char` WHERE `account_id` =  '"+killedrid+"' ", .@Cchar_id, .@Aid);
    		query_sql( "SELECT * FROM woe_ranking WHERE `Char_ID` = '"+.@Cchar_id+"'", .@CharID, .@Name$, .@Kills, .@Deaths, .@EmpBreak);
    		set TotalD , .@Deaths + .WoeDeduct;
    	
    	if(.@CharID != .@Cchar_id){
    		query_sql("INSERT INTO `woe_ranking` (`Char_ID`,`PlayerName`,`Kills`,`Deaths`,`EmpBreak`) VALUES ('"+.@Cchar_id+"', '"+strcharinfo(0)+"', '0', '"+TotalD+"', '"+.@EmpBreak+"')");
    	}else{
    		query_sql("UPDATE woe_ranking SET Deaths = '"+TotalD+"' WHERE `Char_ID` = '"+.@Cchar_id+"'");
    	}	
    	
    	//This is the point system on the player, you can disable this anytime by adding comment " // "
    		dispbottom "You killed "+rid2name(killedrid)+" you gained "+.WoePoints+" point and You now have "+Points+" Woe Points.";
    		attachrid(killedrid);
    		set points, points-.diedeductpoint;
    		dispbottom "You are killed by "+rid2name(killerrid)+" you lost "+.diedeductpoint+" points and You now have "+Points+" Woe Points.";
    
    	end;
    	///////
    	}else if(strcharinfo(3) == "guild_vs3"){ // This is PVP MAP restriction
    	if(getcharid(3)==killedrid) end;
    		set PvPpoints, PvPpoints+.PvP_Point;
    		query_sql( "SELECT * FROM pvp_ranking WHERE `Char_ID` = '"+getcharid(0)+"'", .@CharID, .@Name$, .@Kills, .@Deaths);
    		set ToTalPvPoints , .@Kills + .PvP_Point;
    		
    	if(getcharid(0) == .@CharID){
    		query_sql("UPDATE `pvp_ranking` SET `Kills` = '"+ToTalPvPoints+"' WHERE `Char_ID` = '"+getcharid(0)+"'");
    	}else{	
    		query_sql("INSERT INTO `pvp_ranking` (`Char_ID`,`PlayerName`,`Kills`,`Deaths`) VALUES ('"+getcharid(0)+"', '"+strcharinfo(0)+"', '"+.PvP_Point+"', '"+.@Deaths+"')"); 
    	}
    		
    		//This is the point system on the player, you can disable this anytime by adding comment " // "
    		dispbottom "You killed "+rid2name(killedrid)+" you gained "+.PvP_Point+" point and You now have "+PvPpoints+" PVP Points.";
    		attachrid(killedrid);
    		set PvPpoints, PvPpoints-.PvP_Deductpoint;
    		dispbottom "You are killed by "+rid2name(killerrid)+" you lost "+.PvP_Deductpoint+" Points and You now have "+PvPpoints+" PVP Points.";
    		
    		////////query for the deaths
    		query_sql( "SELECT `char_id`, `account_id` FROM `char` WHERE `account_id` =  '"+getcharid(3)+"' ", .@Cchar_id, .@Aid);
    		query_sql( "SELECT * FROM pvp_ranking WHERE `Char_ID` = '"+.@Cchar_id+"'", .@CharID, .@Name$, .@Kills, .@Deaths);
    		set ToTalDeathPvPoints , .@Deaths + .PvP_Deductpoint;
    		
    	if(.@CharID != .@Cchar_id){
    		query_sql("INSERT INTO `pvp_ranking` (`Char_ID`,`PlayerName`,`Kills`,`Deaths`) VALUES ('"+.@Cchar_id+"', '"+strcharinfo(0)+"', '0', '"+ToTalDeathPvPoints+"')");
    	}else{
    		query_sql("UPDATE pvp_ranking SET Deaths = '"+ToTalDeathPvPoints+"' WHERE `Char_ID` = '"+.@Cchar_id+"'");
    	}
    		end;
    	}
        }
    	end;
    }
    
    -	pointshop	PvP_Points_Shop	-1,PvPpoints,607:5,608:10
    -	pointshop	GvG_Points_Shop	-1,points,1202:5;
    -	pointshop	EmpBreak_Points_Shop	-1,ToTalB,2311:10

    this is the whole script by @BeWan

  3. good day rathena.. i tried this

    /*
    DROP TABLE IF EXISTS `pvp_ranking`;
    
    CREATE TABLE IF NOT EXISTS `pvp_ranking` (
    `Char_ID` int(11) unsigned NOT NULL DEFAULT '0',
    `PlayerName` varchar(255) NULL DEFAULT '',
    `Kills` varchar(255) NULL DEFAULT '',
    `Deaths` varchar(255) NULL DEFAULT '',
    PRIMARY KEY (`Char_ID`)
    ) ENGINE=MyISAM;
    
    DROP TABLE IF EXISTS `woe_ranking`;
    
    CREATE TABLE IF NOT EXISTS `woe_ranking` (
    `Char_ID` int(11) unsigned NOT NULL DEFAULT '0',
    `PlayerName` varchar(255) NULL DEFAULT '',
    `Kills` varchar(255) NULL DEFAULT '',
    `Deaths` varchar(255) NULL DEFAULT '',
    `EmpBreak` varchar(255) NULL DEFAULT '',
    PRIMARY KEY (`Char_ID`)
    ) ENGINE=MyISAM;
    */

    i copied and saved it as .sql, then open my phpmyadmin, clicked on ragnarok then clicked import.. i chose the file.sql then pressed go.. and i just see this

    sqlll.PNG

  4. //===== rAthena Script =======================================
    //= Battleground: PVP
    //===== By: ==================================================
    //= AnnieRuru
    //===== Current Version: =====================================
    //= 1.1
    //===== Compatible With: =====================================
    //= rAthena Project
    //===== Description: =========================================
    //= A simple battleground script:
    //= Kill players from the other team.
    //===== Additional Comments: =================================
    //= 1.0 First version, edited. [Euphy]
    //= 1.1 Use up to date battleground script commands [AnnieRuru]
    //============================================================
    
    -	script	bg_pvp#control	-1,{
    OnInit:
    	.minplayer2start = 1;      // minimum players to start (ex. if 3vs3, set to 3)
    	.eventlasting    = 20*60;  // event duration before auto-reset (20 minutes * seconds)
    	setarray .rewarditem[0],   // rewards for the winning team: <item>,<amount>,...
    		501, 10;
    	end;
    OnStart:
    	if ( getwaitingroomstate( 0, .rednpcname$ ) < .minplayer2start || getwaitingroomstate( 0, .bluenpcname$ ) < .minplayer2start )
    		end;
    
    	// create Battleground and teams
    	.red = waitingroom2bg( "guild_vs3", 13,50, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead", .rednpcname$ );
    	.blue = waitingroom2bg( "guild_vs3", 86,50, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead", .bluenpcname$ );
    	delwaitingroom .rednpcname$;
    	delwaitingroom .bluenpcname$;
    	bg_warp .red, "guild_vs3", 13,50;
    	bg_warp .blue, "guild_vs3", 86,50;
    	.red_score = .blue_score = .minplayer2start;
    	bg_updatescore "guild_vs3", .red_score, .blue_score;
    
    	// match duration
    	sleep .eventlasting * 1000;
    
    	// end match, destroy Battleground, reset NPCs
    	if ( .red_score > .blue_score ) {
    		mapannounce "guild_vs3", "- Red Team is victorious! -", bc_map;
    		callsub L_Reward, .red;
    	}
    	else if ( .blue_score > .red_score ) {
    		mapannounce "guild_vs3", "- Blue Team is victorious! -", bc_map;
    		callsub L_Reward, .blue;
    	}
    	else
    		mapannounce "guild_vs3", "- The match has ended in a draw! -", bc_map;
    	bg_warp .red, "turbo_room",69,98;
    	bg_warp .blue, "turbo_room",69,95;
    	bg_destroy .red;
    	bg_destroy .blue;
    	donpcevent .rednpcname$ +"::OnStart";
    	donpcevent .bluenpcname$ +"::OnStart";
    	end;
    
    L_Reward:
    	bg_get_data getarg(0), 1;
    	for ( .@i = 0; .@i < $@arenamemberscount; ++.@i )
    		getitem .rewarditem[0], .rewarditem[1], $@arenamembers[.@i];
    	return;
    
    // "OnDeath" event
    OnRedDead:  callsub LR_Dead, .red_score;
    OnBlueDead: callsub LB_Dead, .blue_score;
    LR_Dead:
    	set getarg(0), getarg(0) -1;
    	bg_updatescore "guild_vs3", .red_score, .blue_score;
    	bg_warp .red, "guild_vs3", 13,50;
    	if ( !getarg(0) )
    		awake strnpcinfo(0);
    	sleep2 1250;
    	percentheal 100,100;
    	end;
    LB_Dead:
    	set getarg(0), getarg(0) -1;
    	bg_updatescore "guild_vs3", .red_score, .blue_score;
    	bg_warp .blue, "guild_vs3", 86,50;
    	if ( !getarg(0) )
    		awake strnpcinfo(0);
    	sleep2 1250;
    	percentheal 100,100;
    	end;
    
    // "OnQuit" event
    OnRedQuit:  callsub L_Quit, .red_score;
    OnBlueQuit: callsub L_Quit, .blue_score;
    L_Quit:
    	set getarg(0), getarg(0) -1;
    	bg_updatescore "guild_vs3", .red_score, .blue_score;
    	percentheal 100, 100;
    	if ( !getarg(0) )
    		awake strnpcinfo(0);
    	end;
    }
    
    turbo_room,63,98,5	script	Red Team#bg_pvp	733,{
    	end;
    OnInit:
    	sleep 1;
    	set getvariableofnpc( .rednpcname$, "bg_pvp#control" ), strnpcinfo(0);
    OnStart:
    	waitingroom "Red Team", getvariableofnpc( .minplayer2start, "bg_pvp#control" ) +1, "bg_pvp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_pvp#control" );
    	end;
    }
    
    turbo_room,63,95,5	script	Blue Team#bg_pvp	734,{
    	end;
    OnInit:
    	sleep 1;
    	set getvariableofnpc( .bluenpcname$, "bg_pvp#control" ), strnpcinfo(0);
    OnStart:
    	waitingroom "Blue Team", getvariableofnpc( .minplayer2start, "bg_pvp#control" ) +1, "bg_pvp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_pvp#control" );
    	end;
    }
    
    guild_vs3	mapflag	gvg	off
    guild_vs3	mapflag	battleground	2
    guild_vs3	mapflag	nosave	SavePoint
    guild_vs3	mapflag	nowarp
    guild_vs3	mapflag	nowarpto
    guild_vs3	mapflag	noteleport
    guild_vs3	mapflag	nomemo
    guild_vs3	mapflag	nopenalty
    guild_vs3	mapflag	nobranch
    guild_vs3	mapflag	noicewall
    guild_vs3	mapflag	hidemobhpbar

    hi good day .. kindly help me with this bg script made by @AnnieRuru

    1. kill points needed to win -  (100points 2 win)- 1 point = 1 kill)

    2. id like the player that dies respawn to the map.. (red team - guild_vs3 13 59)(Blue team guild_vs3 86 50)

    3. if no team reached 100points on eventlasting.. the highest point wins

    4. on event end. warp blue team (turbo_room 68,95) red team (turbo_room 68 98)

    5. FakeGuild for Red Team and Blue Team so players can knows who the enemy is.. (with colors of red for red team and blue for blue team)

    sorry i know it is too much to ask.. but please for those who have a kind heart please help me..

    i really need BG scripts

    thanks

  5. Hi good day im currently using this KOE

    -	script	KoE	-1,{
    OnInit:
    	disablenpc "The King#KoE";
    	disablenpc "Exit#KoE";
    	bindatcmd "koe", strnpcinfo(0)+"::Oncommand", 99,99;
    	end;
    Oncommand:
    	if ( compare( .@atcmd_parameters$, "on" ) ) goto L_start;
    	else if ( compare( .@atcmd_parameters$, "off" ) ) goto L_end;
    	else {
    		dispbottom "type - '@koe on' to start the event";
    		dispbottom "type - '@koe off' to end the event";
    	}
    	end;
    L_start:
    	gvgon "guild_vs1";
    	announce "The King of Emperium Hill has begun!", bc_all;
    	.start = 1;
    	enablenpc "The King#KoE";
    	disablenpc "Exit#KoE";
    	$koegid = 0;
    	donpcevent "::OnRevKoE";
    	maprespawnguildid "guild_vs1", $koegid, 7;
    	monster "guild_vs1",49,49,"EMPERIUM",1288,1,"KoE::OnEmpDead";
    	end;		
    L_end:
    	gvgoff "guild_vs1";
    	announce "The King of Emperium Hill is over!", bc_all;
    	.start = 0;
    	enablenpc "Exit#KoE";
    	disablenpc "The King#KoE";
    	killmonsterall "guild_vs1";
    //	maprespawnguildid "guild_vs1", $koegid, 6;
    	end;
    OnEmpDead:
    	$koegid = getcharid(2);
    	announce "The current King of Emperium Hill is the ["+ strcharinfo(2) +"] guild.", bc_all;
    	donpcevent "::OnRevKoE";
    //	maprespawnguildid "guild_vs1", $koegid, 6;
    	sleep 500;
    	if ( .start )
    		monster "guild_vs1",49,49,"EMPERIUM",1288,1,"KoE::OnEmpDead";
    	end;
    }
    
    // KoE Entrance
    prontera,155,191,4	script	The King#KoE	58,{
        mes "[The King]";
    	if ( !getcharid(2) ) {
    		mes "You must have a guild to participate in the ^FF0000King of Emperium Hill Tournament^000000.";
    		close;
    	}
        mes "Hello.";
        mes "Would you like to participate in the ^FF0000King of Emperium Hill Tournament^000000?";
    	if ( select ( "Yes", "No" ) == 2 ) close;
        switch( rand(1,4) ){
            case 1:	warp "guild_vs1", 50, 88; end;
            case 2:	warp "guild_vs1", 88, 50; end;
            case 3:	warp "guild_vs1", 50, 11; end;
            case 4:	warp "guild_vs1", 11, 50; end;
    	}
    }
    
    // KoE Exit
    guild_vs1,49,56,5	script	Exit#KoE	51,{
    	mes "[Exit]";
    	mes "See ya.";
    	if ( getcharid(2) == $koegid )
    		getitem 501, 1; // configure prize here
    	close2;
    	warp "Save",0,0;
    	end;
    }
    
    // Flags
    guild_vs1,49,38,4	script	King of Emperium Hill#1::koe_flag	722,{
    	if ( !$koegid ) end;
    	mes "[King of Emperium Hill]";
    	mes "The Current King of Emperium Hill is the ["+ getguildname($koegid) +"] guild.";
    	close;
    OnRevKoE:
    	flagemblem $koegid;
    	end;
    }
    guild_vs1,61,49,6	duplicate(koe_flag)	King of Emperium Hill#2	722
    guild_vs1,38,49,2	duplicate(koe_flag)	King of Emperium Hill#3	722
    guild_vs1,49,61,0	duplicate(koe_flag)	King of Emperium Hill#4	722
    
    guild_vs1	mapflag	nobranch
    guild_vs1	mapflag	nomemo
    guild_vs1	mapflag	nopenalty
    guild_vs1	mapflag	noreturn
    guild_vs1	mapflag	nosave	SavePoint
    guild_vs1	mapflag	noteleport
    guild_vs1	mapflag	gvg_noparty
    guild_vs1	mapflag	nowarp
    guild_vs1	mapflag	nowarpto
    guild_vs1	mapflag	guildlock

    Problems

    1: Guild Members and the Owner of the KOE can hit the Emperium again and again(SOLVED)

    2 @go Functions still works (SOLVED)

    3: it doesn't warp other guilds outside the KOE room after emp destroyed(SOLVED)

    Requests

    When  a Guild destroys the Emperium. warp all other guilds outside then you can only speak on the NPC to warp again after 15secs like saying dispbottom : wait for 15 secs to enter

    When a guild destroys the emp.. warp all guild members on the emperium.. so they can set up for defence

    Point System - for every 5mins you hold the emperium gain 1 points for all guild members and +2 points for guild leader

    Point shop

    thankyou so much in advance

     

    EDIT: i managed to fixed for other guilds warping outside after breaking the emperium

    hope you can help me on the other problems

    EDIT 2: managed to disable @go commands

     

     

  6. 12 hours ago, HD Scripts said:

    maybe command "additem2" ?

    ill try this one thanks

    On 2/15/2020 at 5:22 PM, Litro Endemic said:

    short answer: no, because client limitation!, or you can make mod by using vending system, google this word "Selling Refined Item by NPC as Vending List"

    tried but didn't work open_vending i think this script is not supported on rathena

  7. got some part of it..

    but is there a way to see the +10 sword on the opened shop?

    also.. can you join +10 and +8 or +7 in this shop? like +10 sword +8 axe +7 club + 5 rod

    like

      setarray .itemid,+7(1101),+8(1201),+9(1301),+10(1501),1601

    refine shop.PNG

  8. prontera,156,181,5    script    jfhdksfjhs    100,{
       mes "select an item to buy";
       next;
       .@s = select( .menu$ ) -1;
       if ( countitem( .itemuse ) < .sellcost[.@s] ) {
           mes "not enough "+ getitemname( .itemuse );
           close;
       }
       delitem .itemuse, .sellcost[.@s];
       getitem2 .sellitem[.@s], 1,1,10,0, 0,0,0,0;
       close;
    OnInit:
       setarray .sellitem, 1101, 1201, 1301;
       setarray .sellcost, 10, 20, 30;
       set .itemuse, 674;
       .@size = getarraysize( .sellitem );
       for ( .@i = 0; .@i < .@size; .@i++ )
        .menu$ = .menu$ + getitemname( .sellitem[.@i] )+" +10 [Cost -> "+ .sellcost[.@i] +"]:";
       end;
    }
    prontera,156,172,5    script    market    100,{
       dispbottom "You currently have "+ countitem(.itemuse) +" "+ getitemname(.itemuse);
       callshop "market2#hidden", 1;
       end;
    OnBuyItem:
       if ( !@bought_quantity ) end;
       .@size = getarraysize( @bought_nameid );
       while ( .@i < .@size ) {
           .@j = 0;
           while ( @bought_nameid[.@i] != .itemid[.@j] && .@j < .shop_size ) .@j++;
           .@itemcost = .@itemcost + .itemcost[.@j] * @bought_quantity[.@i];
           .@i++;
       }
       if ( .@itemcost > countitem(.itemuse) ) {
           mes "you don't have enough "+ getitemname(.itemuse);
           close;
       }
       delitem .itemuse, .@itemcost;
       for ( set .@i,0; .@i < .@size; set .@i, .@i +1 )
           getitem @bought_nameid[.@i], @bought_quantity[.@i];
       deletearray @bought_nameid;
       deletearray @bought_quantity;
       end;
    OnInit:
       setarray .itemid,1101,1201,1301,1501,1601;
       setarray .itemcost,10,20,30,40,50;
       set .itemuse, 674;
    
       .shop_size = getarraysize(.itemid);
       npcshopdelitem "market2#hidden", 512;
       for ( .@i = 0; .@i < .shop_size; .@i++ )
           npcshopadditem "market2#hidden", .itemid[.@i], .itemcost[.@i];
       npcshopattach "market2#hidden";
       end;
    }
    
    -    shop    market2#hidden    -1,512:10000

    how will i combine this two scripts?? my goal is to have a NPC that sells Refined Equipments for Coins .. but it will open a shop where you can see like +7 pole axe,+8 Shield Etc.

    thanks in advance..

  9. Good day rathena.. how to change backstab so that you can use this any direction the enemy faces? 

    tried editing

    i tried and change to this

    case RG_BACKSTAP:
    {
             -int dir = map_calc_dir(src, bl->x, bl->y), t_dir = unit_getdir(bl);
             -if ((!check_distance_bl(src, bl, 0) && !map_check_dir(dir, t_dir)) || bl->type == BL_SKILL) {
             +if (!check_distance_bl(src, bl, 0) || bl->type == BL_SKILL) {
                       status_change_end(src, SC_HIDING, INVALID_TIMER);
                       skill_attack(BF_WEAPON, src, src, bl, skillid, skilllv, tick, flag);
                       -dir = dir < 4 ? dir+4 : dir-4; // change direction [Celest]
                       -unit_setdir(bl,dir);
             }
             else if (sd)
                       clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0);
             }
    break;

    but i got errors like the map server isnt running that i can't connect anymore..

     

  10. hi good evening rathena.. i need a NPC for Freebies(only GM 50 - 99) can talk to this

    mes"good day "get player name" what kind of job will you pick??

    pick from jobs 4008,4009,4010,4011,4012 and so on..

    case 1:

               Spear type? , One hand, two hand , go back

            case 1 get item +5 pole axe +7 shield[1] +7greaves[1] +7full plate[1]

           end

    OR -- 

    mes"good day "name of player"??

    input name

    next

    what job will he/she be?

    pick from jobs 4008,4009,4010,4011,4012 and so on..

    case 1:

               Spear type? , One hand, two hand , go back

            case 1 get item +5 pole axe +7 shield[1] +7greaves[1] +7full plate[1]

           end

     

     

    thanks in advance.. 

             

  11. Hello Rathena.. im confused as where to find skill_cast_db.txt.. i tried the search button.. and still cant find skill_cast_db.txt

    tried searching the whole DB folder.. and no skill_cast_db.txt... db/pre-re/skill_cast_db.txt does anyone have this issue.. tried searching on SQL for curiosity of finding it there but it's still missing.. all i can see is skill_nocast_db.txt skill_db.yml and skill_tree.txt,, tried searching on imports outside db.. can somebody help me?

  12. ooooooooooooopsss.. i am so sorry.. you are all right..  it was just a curious question... i just remembered this guy who cried for 100$ and i can't do anything about it ( im not a gm tho ) well thats about it.. there are other ways for scammers to be sentenced..

    @sader1992

    @Normynator

    i sincerely apologize for this matter.. and for breaking the rules and regulations of rathena..

    thanks a lot .. 

  13. Hello this just popped out in my mind while browsing NPCs here

    is it possible.. for an NPC to detect and tell where's the player's address in real world??

    like using locations,or IP address.. or perhaps the Exact address of a player.. (ofcourse it is only GM 99 triggered)

    -What's the use for such and NPC?-

    well my idea is.. if someone got scammed big time.. ofcourse its his/her reposibility for him/her to get scammed.. but we all have hearts.. so we tell the player the scammers exact address 

    it is also for the scammer to think twice or never scam again because of the Location Tracker..

    it is also for the players selling items /equips in game for cash..

    and for the players trolling and such

    its a bit creepy imagining there's such NPC in your server.. like its a stalker NPC lol

    well if this is possible let me know..

  14. prontera,158,181,5	script	Race-To-99	100,{
        if (BaseLevel < 99) {
            npctalk "Sorry, Only Lvl 99 can claim the reward!";
            end;
        }
        if (JobLevel < 70) {
            npctalk "Sorry, Only Job Lvl 70 can claim the reward!";
            end;
        }
        if ($ItemGive == 100) {
            npctalk "Sorry, all rewards has been taken!";
            end;
        }
        if (getreward) {
            npctalk "Sorry, Nothing for you!";
            end;
        }
        announce "Congratulations! "+strcharinfo(0)+" has claimed his reward for Race to 99 Event", bc_all;
        getitem 501, 100;
        ++$ItemGive;
        getreward = 1;
        sleep 2000;
        announce "There are "+(100 - $ItemGive)+" rewards left to give!", bc_all;
        end;
    }
    

    good evening .. how will i add top 100 level 99 (like a rank) from 1st to 100th

    and different rewards for the top 3

    with a pub saying Level 99 Rewarder

    thankyou so much

  15. how will i add the preview item on this script?

    
    prontera,157,149,5	script	Proof of Donation#1	955,{
        mes "Your["+getitemname(.Cost)+"]["+countitem(.Cost)+"]";
        mes "^E217171 Proof of Donation = 25 PHP";
    close2;
    callshop "dyn_shop"+.a,1;
    npcshopattach "dyn_shop"+.a;
    end;
    OnInit:
    set .a,strnpcinfo(2);
    //=========================================
    set .Cost,7179;
    //=========================================
    setarray .buy_id[0],1228;
    setarray .buy_co[0],40;
    //=========================================
    
    npcshopitem "dyn_shop1",.buy_id[0],.buy_co[0];
    for(set .ik,1;.ik<getarraysize(.buy_id);set .ik,.ik+1){
        npcshopadditem "dyn_shop"+.a,.buy_id[.ik],.buy_co[.ik];
    }
    end;
    
    OnBuyItem:
        getinventorylist;
        if(@bought_quantity[@i] <= 0){
            goto OnEnrd;
            end;
        }
        for(set @i,0;@i<getarraysize(@bought_nameid);set @i,@i+1){
    //KeyWorld
            set .@type, getiteminfo( @bought_nameid[.@i], 2 );
            if (  .@type == 4 || .@type == 5 || .@type == 7 || .@type == 8 ) 
                set .@count, .@count + 1;
            else {
                for( set .@j,0; .@j<@inventorylist_count; set .@j, .@j+1 )
                    if ( @inventorylist_id[.@i] == @bought_nameid[.@i] )
                        break;
                if ( .@j == @inventorylist_count )
                    set .@count, .@count+1 ;
            }
            for(set @i2,0;@i2<getarraysize(.buy_id);set @i2,@i2+1){
                if(@bought_nameid[@i]==.buy_id[@i2]){
                    set @gh,@gh+.buy_co[@i2]*@bought_quantity[@i];
                    set @wh,@wh+getiteminfo(@bought_nameid[@i],6)*@bought_quantity[@i];
                }
            }
        }
        if ( .@count + @inventorylist_count > 100 ) {
            announce "[D-Shop]: Can't hold more than 100 items.",bc_self;
            goto OnEnrd;
        }
        if(countitem(.Cost)<@gh){
            announce "[D-Shop]:["+getitemname(.Cost)+"] isn't enough",bc_self;
            goto OnEnrd;
            end;
        }else{
            if(@wh>(MaxWeight-Weight)){
                announce "[D-Shop]:Too heavy",bc_self;
                goto OnEnrd;
                end;
            }else{
                delitem .Cost,@gh;
                for(set @i,0;@i<getarraysize(@bought_nameid);set @i,@i+1){
                    getitem @bought_nameid[@i],@bought_quantity[@i];
                }            
            }
        }
    OnEnrd:
        set @gh,0;
        set @wh,0;
        set @i,0;
        set @i2,0;
        deletearray @bought_quantity,getarraysize(@bought_quantity);
        deletearray @bought_nameid,getarraysize(@bought_nameid);
    end;
    }

    so that there would be an option for preview and purchase the item

  16.  npc/custom/quests/quest_shop.txt 

    how will i change the price of each item .. depending on the amount of proof of donations needed to buy this item?

    here's the script i edited

    //===== rAthena Script =======================================
    //= Euphy's Quest Shop
    //===== By: ==================================================
    //= Euphy
    //===== Current Version: =====================================
    //= 1.7
    //===== Compatible With: =====================================
    //= rAthena Project
    //===== Description: =========================================
    //= A dynamic quest shop based on Lunar's, with easier config.
    //= Includes support for multiple shops & cashpoints.
    //= Item Preview script by ToastOfDoom.
    //===== Additional Comments: =================================
    //= 1.0 Initial script.
    //= 1.2 Added category support.
    //= 1.3 More options and fixes.
    //= 1.4 Added debug settings.
    //= 1.5 Replaced categories with shop IDs.
    //= 1.6 Added support for purchasing stackables.
    //= 1.6a Added support for previewing costumes and robes.
    //= 1.6b Added 'disable_items' command.
    //= 1.6c Replaced function 'A_An' with "F_InsertArticle".
    //= 1.7 Added Success rates - by Mabuhay
    //============================================================
    
    // Shop NPCs -- supplying no argument displays entire menu.
    //	callfunc "qshop"{,<shop ID>{,<shop ID>{,...}}};
    //  ADD YOUR NPC HERE
    //============================================================
    prontera,145,172,6	script	donate Shop#1	998,{ callfunc "dshop"; }
    // prontera,165,203,6	script	Quest Shop#2	998,{ callfunc "dshop",1,2; }	// call the shop 1 and 2 defined below
    // etc.. Add your Shop NPCs 'Quest Shop#XXX' here
    //============================================================
    
    
    // Script Core - DO NOT DUPLICATE THIS NPC !!!!!!!!!!!!!
    //============================================================
    -	script	donate_shop	-1,{
    function Add; function Chk; function Slot;
    OnInit:
    	freeloop(1);
    
    // -----------------------------------------------------------
    //  Basic shop settings.
    // -----------------------------------------------------------
    
    	set .Announce,0;	// Announce quest completion? (1: yes / 0: no)
    	set .ShowSlot,1;	// Show item slots? (2: all equipment / 1: if slots > 0 / 0: never)
    	set .ShowID,0;  	// Show item IDs? (1: yes / 0: no)
    	set .ShowZeny,0;	// Show Zeny cost, if any? (1: yes / 0: no)
    	set .MaxStack,100;	// Max number of quest items purchased at one time.
    	set .SuccessRate,0;	// Enable Success Rates? ( 1: yes / 0: no)
    
    // -----------------------------------------------------------
    //  Points variable -- optional quest requirement.
    //	setarray .Points$[0],"<variable name>","<display name>";
    // -----------------------------------------------------------
    
    	setarray .Points$[0],
    		"#CASHPOINTS", "Cash Points";
    
    
    //=====================================================================================
    // ------------------- ADD YOUR SHOPS NAME AND ITEMS SHOPS STARTING HERE --------------
    //=====================================================================================
    
    // -----------------------------------------------------------
    //  Shop IDs -- to add shops, copy dummy data at bottom of file.
    //	setarray .Shops$[1],"<Shop 1>","<Shop 2>"{,...};
    // -----------------------------------------------------------
    
    	setarray .Shops$[1],
    		"Headgears",	// Shop Named 1
    		"Weapons",		// Shop Named 2
    		"Other";		// Shop Named 3
    
    // -----------------------------------------------------------
    //  Quest items -- do NOT use a reward item more than once!
    //	Add(<shop ID>,<reward ID>,<reward amount>,
    //	    <Zeny cost>,<point cost>,<success rate>
    //	    <required item ID>,<required item amount>{,...});
    // -----------------------------------------------------------
    
    // Shop 1
    	Add(1,18885,1,0,0,100,7179,400);
    	Add(1,18523,1,0,0,100,7179,350);
    	Add(1,5467,1,0,0,100,7179,300);
    	Add(1,5518,1,0,0,100,7179,250);
    	Add(1,5376,1,0,0,100,7179,250);
    	Add(1,5374,1,0,0,100,7179,200);
    	Add(1,19134,1,0,0,100,7179,200);
    	Add(1,5564,1,0,0,100,7179,200);	
    	Add(1,5547,1,0,0,100,7179,150);	
    	Add(1,5801,1,0,0,100,7179,150);	
    	Add(1,5423,1,0,0,100,7179,150);	
    	Add(1,5210,1,0,0,100,7179,100);	
    	Add(1,19180,1,0,0,100,7179,100);
    	Add(1,5388,1,0,0,100,7179,50);	
    	Add(1,5379,1,0,0,100,7179,50);	
    	Add(1,18522,1,0,0,100,7179,50);
    	Add(1,5654,1,0,0,100,7179,50);
    
    
    
    
    // Shop 2
    
    	Add(2,5154,1,0,0,100,7179,25);
    	Add(2,5402,1,0,0,100,7179,25);
    	Add(2,5135,1,0,0,100,7179,50);
    	Add(2,5592,1,0,0,100,7179,50);
    	Add(2,5664,1,0,0,100,7179,50);
    	Add(2,18576,1,0,0,100,7179,50);
    	Add(2,5389,1,0,0,100,7179,75);
    	Add(2,5610,1,0,0,100,7179,100);
    	Add(2,5516,1,0,0,100,7179,100);
    	Add(2,5325,1,0,0,100,7179,100);
    	Add(2,5421,1,0,0,100,7179,100);
    	Add(2,5800,1,0,0,100,7179,100);
    	Add(2,18839,1,0,0,100,7179,100);
    	Add(2,18813,1,0,0,100,7179,150);
    	Add(2,5471,1,0,0,100,7179,150);
    	Add(2,5788,1,0,0,100,7179,250);
    	Add(2,18599,1,0,0,100,7179,300);
    	Add(2,18894,1,0,0,100,7179,500);
    	Add(2,19083,1,0,0,100,7179,500);
    	Add(2,18503,1,0,0,100,7179,1000);
    	Add(2,1225,1,0,0,50,7292,30,969,10,999,50,714,10);
    
    // Shop 3
    	Add(3,531,1,3,0,50,512,1,713,1);
    	Add(3,532,1,3,0,50,513,1,713,1);
    	Add(3,533,1,3,0,50,514,1,713,1);
    	Add(3,534,1,3,0,50,515,1,713,1);
    
    // -----------------------------------------------------------
    
    //=====================================================================================
    // ------------------- YOUR SHOPS AND ITEMS SHOPS HAVE BEEN ADDED ---------------------
    //=====================================================================================
    
    	freeloop(0);
    	set .menu$,"";
    	for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) {
    		set .menu$, .menu$+.Shops$[.@i]+":";
    		npcshopdelitem "dshop"+.@i,909;
    	}
    	end;
    
    OnMenu:
    	set .@size, getarraysize(@i);
    	if (!.@size) set @shop_index, select(.menu$);
    	else if (.@size == 1) set @shop_index, @i[0];
    	else {
    		for(set .@j,0; .@j<.@size; set .@j,.@j+1)
    			set .@menu$, .@menu$+.Shops$[@i[.@j]]+":";
    		set @shop_index, @i[select(.@menu$)-1];
    	}
    	deletearray @i[0],getarraysize(@i);
    	if (.Shops$[@shop_index] == "") {
    		message strcharinfo(0),"An error has occurred.";
    		end;
    	}
    	dispbottom "Select one item at a time.";
    	callshop "dshop"+@shop_index,1;
    	npcshopattach "dshop"+@shop_index;
    	end;
    
    OnBuyItem:
    	// .@q[] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, SuccessRate, { ReqItem, ReqAmt, ... }
    	setarray .@q[0],@bought_nameid[0],((@bought_quantity[0] > .MaxStack)?.MaxStack:@bought_quantity[0]);
    	copyarray .@q[3],getd(".q_"+@shop_index+"_"+.@q[0]+"[0]"),getarraysize(getd(".q_"+@shop_index+"_"+.@q[0]));
    	set .@q[2],.@q[1]*.@q[3];
    	if (!.@q[2] || .@q[2] > 30000) {
    		message strcharinfo(0),"You can't purchase that many "+getitemname(.@q[0])+".";
    		end;
    	}
    	mes "[Donate Shop]";
    	mes "Reward: ^0055FF"+((.@q[2] > 1)?.@q[2]+"x ":"")+Slot(.@q[0])+"^000000";
    	if (.SuccessRate) mes "Success Rate: ^ff0000"+ .@q[6] +"^000000%";
    	mes "Requirements:";
    	disable_items;
    	if (.@q[4]) mes " > "+Chk(Zeny,.@q[4]*.@q[1])+(.@q[4]*.@q[1])+" Zeny^000000";
    	if (.@q[5]) mes " > "+Chk(getd(.Points$[0]),.@q[5]*.@q[1])+(.@q[5]*.@q[1])+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+(.@q[5]*.@q[1])+")^000000";
    	if (.@q[7]) for(set .@i,7; .@i<getarraysize(.@q); set .@i,.@i+2)
    		mes " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q[1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000";
    	next;
    	setarray @qe[1], getiteminfo(.@q[0],5), getiteminfo(.@q[0],11);
    	if (@qe[2] > 0 && ((@qe[1] & EQP_HEAD_LOW) || (@qe[1] & EQP_HEAD_TOP) || (@qe[1] & EQP_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_TOP) || (@qe[1] & EQP_COSTUME_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_LOW) || (@qe[1] & EQP_GARMENT) || (@qe[1] & EQP_COSTUME_GARMENT)))
    		set .@preview,1;
    	addtimer 1000, strnpcinfo(0)+"::OnEnd";
    	while(1) {
    		switch(select(" ~ Purchase ^0055FF"+getitemname(.@q[0])+"^000000:"+((.@preview && !@qe[7])?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) {
    		case 1:
    			if (@qe[0]) {
    				mes "[Donate Shop]";
    				mes "You're missing one or more quest requirements.";
    				close;
    			}
    			if (!checkweight(.@q[0],.@q[2])) {
    				mes "[Donate Shop]";
    				mes "^FF0000You need "+(((.@q[2]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000";
    				close;
    			}
    			if (.@q[4]) set Zeny, Zeny-(.@q[4]*.@q[1]);
    			if (.@q[5]) setd .Points$[0], getd(.Points$[0])-(.@q[5]*.@q[1]);
    			if (.@q[7]) for(set .@i,7; .@i<getarraysize(.@q); set .@i,.@i+2)
    				delitem .@q[.@i],.@q[.@i+1]*.@q[1];
    			// If success rate setting is on, this happens if it fails
    			if ( .SuccessRate && .@q[6] <= rand(100) ) { // on fail
    				mes "[Donate Shop]";
    				mes "Opps! Sorry, item crafting has failed!";
    				close;
    			}
    			getitem .@q[0],.@q[2];
    			if (.Announce) announce strcharinfo(0)+" has created "+((.@q[2] > 1)?.@q[2]+"x "+getitemname(.@q[0]):callfunc("F_InsertArticle",getitemname(.@q[0])))+"!",0;
    			specialeffect2 EF_FLOWERLEAF;
    			close;
    		case 2:
    			setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE), 1;
    			if ((@qe[1] & 1) || (@qe[1] & 4096)) changelook LOOK_HEAD_BOTTOM, @qe[2];
    			else if ((@qe[1] & 256) || (@qe[1] & 1024)) changelook LOOK_HEAD_TOP, @qe[2];
    			else if ((@qe[1] & 512) || (@qe[1] & 2048)) changelook LOOK_HEAD_MID, @qe[2];
    			else if ((@qe[1] & 4) || (@qe[1] & 8192)) changelook LOOK_ROBE, @qe[2];
    			break;
    		case 3:
    			close;
    		}
    	}
    
    OnEnd:
    	if (@qe[7]) {
    		changelook LOOK_HEAD_BOTTOM, @qe[3];
    		changelook LOOK_HEAD_TOP, @qe[4];
    		changelook LOOK_HEAD_MID, @qe[5];
    		changelook LOOK_ROBE, @qe[6];
    	}
    	deletearray @qe[0],8;
    	end;
    
    function Add {
    	if (getitemname(getarg(1)) == "null") {
    		debugmes "Quest reward #"+getarg(1)+" invalid (skipped).";
    		return;
    	}
    	setarray .@j[0],getarg(2),getarg(3),getarg(4),getarg(5);
    	for(set .@i,6; .@i<getargcount(); set .@i,.@i+2) {
    		if (getitemname(getarg(.@i)) == "null") {
    			debugmes "Quest requirement #"+getarg(.@i)+" invalid (skipped).";
    			return;
    		} else
    			setarray .@j[.@i-2],getarg(.@i),getarg(.@i+1);
    	}
    	copyarray getd(".q_"+getarg(0)+"_"+getarg(1)+"[0]"),.@j[0],getarraysize(.@j);
    	npcshopadditem "dshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0);
    	return;
    }
    
    function Chk {
    	if (getarg(0) < getarg(1)) {
    		set @qe[0],1;
    		return "^FF0000";
    	} else
    		return "^00FF00";
    }
    
    function Slot {
    	set .@s$,getitemname(getarg(0));
    	switch(.ShowSlot) {
    		case 1: if (!getitemslots(getarg(0))) return .@s$;
    		case 2: if (getiteminfo(getarg(0),2) == 4 || getiteminfo(getarg(0),2) == 5) return .@s$+" ["+getitemslots(getarg(0))+"]";
    		default: return .@s$;
    	}
    }
    }
    
    function	script	dshop	{
    	deletearray @i[0],getarraysize(@i);
    	for(set .@i,0; .@i<getargcount(); set .@i,.@i+1)
    		set @i[.@i],getarg(.@i);
    	doevent "donate_shop::OnMenu";
    	end;
    }
    
    
    // Dummy shop data -- copy as needed.
    //============================================================
    -	shop	dshop1	-1,909:-1
    -	shop	dshop2	-1,909:-1
    -	shop	dshop3	-1,909:-1
    -	shop	dshop4	-1,909:-1
    -	shop	dshop5	-1,909:-1

     

    quest shop.PNG

  17. Just now, Anacondaqq said:

    Hi, the server at the package is from March 2017 and does not have the PR included with the command. That means you must manually take and install an emulator. The package is just for education purposes just to show how everything plus-minus should be packed and can look like. But this is not a package for everyday usage, and so on. I strongly recommend you read the guide and take the package as an example of your problems solving while you will build your own server side. What about updates, I plan a little bit later release it, because right now I'm very overwhelmed and overloaded with my work, so I physically don't have a time for updates. 

    yup your RO package is fine as it is.. it's a stepping stone for use newbies.. and i'm very thankful for your release i was using eathena before.. bc i kinda find it hard downloading so many kinds of tools for a server .. until you released your package.. i can now move to rathena.. bc eathena is gone ithink because their website is down.. anyways keep it up.. and thankyou for such a wonderful release.. 

  18. 4 hours ago, AnnieRuru said:

    wait ...........

    your server doesn't support *bg_get_data type 1

    https://github.com/rathena/rathena/pull/2179

    how old is your emulator ? seriously ....

    part of the reason why I dislike rathena ... doesn't have plugin features too

     

    and for the 2nd request, yup I can do that ~

    but since you also needs some time to update your server, I'll just edit this post when its done

    i used @Anacondaqq ragnarok offline server https://rathena.org/board/topic/109823-ragnarok-online-complete-offline-server-client-pack-2018-make-your-ro-server-in-less-then-5-minutes/ on 2017 

    ill try to update my server.. or ill just install the latest.. anyways thanks for supporting us.. ill get back to you when its done.. thanks anniee..

    *heart heart*

     

×
×
  • Create New...