Jump to content

mawjustin

Members
  • Posts

    121
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by mawjustin

  1. On 4/12/2020 at 6:21 AM, Emistry said:

    try this.

    
    prontera,155,181,5	script	Sample	4_F_KAFRA1,{
    	
    	for (.@eqi = EQI_SHOES; .@eqi < EQI_HAND_R; .@eqi++) {
    		.@equip_id = getequipid(.@eqi);
    		if (.@equip_id > 0) 
    			.@menu$ = .@menu$ + getitemname(.@equip_id) + " ["+getitemslots(.@equip_id)+"]";
    		.@menu$ = .@menu$ + ":";
    	}
    	mes "Select an equipment.";
    	.@eqi = select(.@menu$) - 1 + EQI_SHOES;
    	mes "Equip: "+getitemname(getequipid(.@eqi));
    	if (.itemid_size) {
    		mes "Required Items:";
    		for (.@i = 0; .@i < .itemid_size; .@i++) {
    			mes " -> "+F_InsertComma(.amount[.@i])+"x "+getitemname(.itemid[.@i]);
    			if (countitem(.itemid[.@i]) < .amount[.@i])
    				.@fail++;
    		}
    	}
    	if (!.@fail) {
    		if (select("Reset Enchantment", "Cancel") == 1) {
    			for (.@i = 0; .@i < .itemid_size; .@i++)
    				delitem .itemid[.@i], .amount[.@i];
    			.@equip_id = getequipid(.@eqi);
    			.@refine = getequiprefinerycnt(.@eqi);
    			for (.@i = 0; .@i < 4; .@i++)
    				.@card[.@i] = getequipcardid(.@eqi, .@i);
    			delequip .@eqi;
    			getitem2 .@equip_id, 1, 1,.@refine,0,.@card[0],.@card[1],.@card[2],.@card[3];
    			mes "Done reset enchant.";
    		}
    	}
    	close;
    	
    	OnInit:
    		setarray .itemid, 501, 502;
    		setarray .amount, 1, 2;
    		.itemid_size = getarraysize(.itemid);
    		end;
    }

     

    Thank you! it works! I just did a bit of modification to align with my server.

    @Emistry sir, I did some changes in your file, how do we implement this?
     

    jupe_ele,38,50,5	script	Tollere#1	4_F_KAFRA1,{ // 
    
    // THIS WILL READ ALL THE ITEMS AVAILABLE, INCLUDING SHADOW EQUIPMENT
    	for (.@eqi = EQI_SHOES; .@eqi <= EQI_SHADOW_ACC_L; .@eqi++) {
    		.@equip_id = getequipid(.@eqi);
    		if (.@equip_id > 0) 
    			.@menu$ = .@menu$ + getitemname(.@equip_id) + " ["+getitemslots(.@equip_id)+"]";
    		.@menu$ = .@menu$ + ":";
    	}
    
    mes .npc_n$;
    mes "Hello Adventurer!";
    mes "my name is Tollere ";
    mes "I specialize in removing ^006600Enchantment^000000 and ^006600Random Option^000000";
    mes "using ^FF0000"+getitemname(.itemid)+"^000000.";
    mes "which process do you need?";
    
    // RESET ENCHANTMENT = REMOVE STONE/ORBS ON CARD SLOT, BUT RETAIN RANDOM OPTION
    // RANDOM OPTION REMOVAL = REMOVE RANDOM OPTION, BUT RETAIN THE ORBS/STONE ON CARD SLOT
    if (select("Reset Enchantment","Random Option Removal") == 1) {
    	next;
    	mes "Select an equipment for";
    	mes "^006600Enchant Removal^000000";
    	.@eqi = select(.@menu$) - 1 + EQI_SHOES;
    	mes "Equip: "+getitemname(getequipid(.@eqi));
    	if (.itemid_size) {
    		mes "Required Items:";
    		for (.@i = 0; .@i < .itemid_size; .@i++) {
    			mes " -> "+F_InsertComma(.amount[.@i])+"x "+getitemname(.itemid[.@i]);
    			if (countitem(.itemid[.@i]) < .amount[.@i])
    				.@fail++;
    		}
    	}
    	if (!.@fail) {
    		if (select("Reset Enchantment", "Cancel") == 1) {
    			for(.@ii=0;.@ii<(MAX_ITEM_RDM_OPT-0);.@ii++){
    				.@r_id[.@ii] = getequiprandomoption(.s_all_loc[.@eqi],.@i,ROA_ID);
    				.@r_v[.@ii] = getequiprandomoption(.s_all_loc[.@eqi],.@i,ROA_VALUE);
    				.@r_p[.@ii] = getequiprandomoption(.s_all_loc[.@eqi],.@i,ROA_PARAM);
       	 			}
    			for (.@i = 0; .@i < .itemid_size; .@i++)
    				delitem .itemid[.@i], .amount[.@i];
    			.@equip_id = getequipid(.@eqi);
    			.@refine = getequiprefinerycnt(.@eqi);
    			for (.@i = 0; .@i < 4; .@i++)
    				.@card[.@i] = getequipcardid(.@eqi, .@i);
    			delequip .@eqi;
    			//getitem2 .@equip_id, 1, 1,.@refine,0,0,0,0,0;
    			getitem3 .@equip_id, 1, 1, .@refine, 0, 0, 0, 0, 0,.@r_id,.@r_v,.@r_p;
    			getitem .@card[0],1;
    			getitem .@card[1],1;
    			getitem .@card[2],1;
    			getitem .@card[3],1;
    			mes "Done Reset Enchantment.";
    		}
    	}
    	close;
    	} else {
    	next;
    	mes "Select an equipment for";
    	mes "^006600Random Option Removal^000000";
    	.@eqi = select(.@menu$) - 1 + EQI_SHOES;
    	mes "Equip: "+getitemname(getequipid(.@eqi));
    	if (.itemid_size) {
    		mes "Required Items:";
    		for (.@i = 0; .@i < .itemid_size; .@i++) {
    			mes " -> "+F_InsertComma(.amount[.@i])+"x "+getitemname(.itemid[.@i]);
    			if (countitem(.itemid[.@i]) < .amount[.@i])
    				.@fail++;
    		}
    	}
    	if (!.@fail) {
    		if (select("Random Option Removal", "Cancel") == 1) {
    			for (.@i = 0; .@i < .itemid_size; .@i++)
    				delitem .itemid[.@i], .amount[.@i];
    			.@equip_id = getequipid(.@eqi);
    			.@refine = getequiprefinerycnt(.@eqi);
    			for (.@i = 0; .@i < 4; .@i++)
    				.@card[.@i] = getequipcardid(.@eqi, .@i);
    			delequip .@eqi;
    			getitem2 .@equip_id, 1, 1,.@refine,0,.@card[0],.@card[1],.@card[2],.@card[3];
    			mes "Done Random Option Removal.";
    		}
    	}
    	close;
    	} 
    close;
    	
    	OnInit:
    		.npc_n$ = "[^4B0082 Tollere ^000000]"; // NPC Name.
    		setarray .itemid, 60002;
    		setarray .amount, 1;
    		.itemid_size = getarraysize(.itemid);
    		end;
    }

    My goal for this is 

    1. Reset Enchantment = will remove and put the orbs/stones into the inventory in all card slot of the item, but will retain the Random Option

    2. Random Option Removal = will remove the random option, but will retain the orb/stone in card slot.

     

    Is there a way to do it like my goal??

  2. On 4/5/2020 at 10:45 PM, Patskie said:

    You can try 

     

    
    prontera,150,150,0	script	Monster Of The Day	835,{
    	end;
    		
    	OnNPCKillEvent:
    		if (getmonsterinfo(killedrid, MOB_NAME) != .motd$) end;
    		.@party_id = getcharid(1);
    		.map$ = strcharinfo(3);
    		if (!.@party_id && rand(100) < .chance) {
    			BaseExp += .base_exp_bonus;
    			JobExp += job_exp_bonus;
    			Zeny += .zeny;
    			getitem .item, 1;
    		} else {
    			addrid(2, 0, .@party_id);
    			if (strcharinfo(3) == .map$ && Hp && rand(100) < .chance) {
    				BaseExp += .base_exp_bonus;
    				JobExp += .job_exp_bonus;
    				Zeny += .zeny;
    				getitem .item, 1;
    			}
    		}
    		end;
    	
    	OnClock0000:
    		.motd$ = .mobs$[rand(getarraysize(.mobs$))];
    		delwaitingroom;
    		waitingroom "[MOTD] " + .motd$, 0;
    		announce "Monster of the day has been changed. New monster of the day is " + .motd$, 0;
    		end;
    	
    	OnInit:
    		.zeny = 1000; // zeny reward
    		.item = 1000; // item reward
    		.job_exp_bonus = 1000; // base exp bonus
    		.base_exp_bonus = 1000; // job exp bonus
    		setarray .mobs$[0], "Scorpion", "Poring", "Fabre"; // mob names
    		.chance = 100; // chance to get bonus
    		.motd$ = .mobs$[rand(getarraysize(.mobs$))];
    		delwaitingroom;
    		waitingroom "[MOTD] " + .motd$, 0;
    		announce "Monster of the day has been changed. New monster of the day is " + .motd$, 0;
    		end;
    }

     

    Thank you, I'll test this out.

     

    EDIT @Patskie it's not giving rewards..

  3. May I ask for assistance on how to limit Bounty Hunter Abuse?

    This script is from @deathscythe13

    Player can only be listed in bounty 1x a day.

    Kill Streak must be unique Player ID.
    Or
    Set timer per kill for the same ID.

    //made by deathscythe13
    -	script	Bounty	-1,{
    OnInit:
    set $wantedlistlength,10;	// bounty length
    set .rewarditem, 50000;	//reward item id
    set .killstreak, 10; // kill streak before gets to bounty
    end;
    OnPCKillEvent:
    getmapxy.@map$,.@x,.@y,0;
    if(getcharid(3)==killedrid) end;
    //if(.@map$ != "guild_vs5") end;
    
    for(set .@i,0; .@i < $wantedlistlength && rid2name(killedrid)!=$wantedlist$[.@i]; set .@i, .@i+1);
    if(.@i < $wantedlistlength && rid2name(killedrid)==$wantedlist$[.@i]) {
     set .@price , 3 - (.@i);   // amount of reward (i dunnoe the calc sorry)
     getitem .rewarditem,.@price;  
     dispbottom "You have killed a bounty!";
     for(set .@remove,.@i; .@remove < $wantedlistlength; set .@remove, .@remove+1) {
      set $wantedlist$[.@remove], $wantedlist$[.@remove+1];  
      set $wantedliststreak[.@remove], $wantedliststreak[.@remove+1];  
     }		  
     announce rid2name(killedrid)+" has been removed in the bounty list!",0;	
    }
    else {
     set killerstreak, killerstreak+1;
     dispbottom "Kill Streak: "+killerstreak;
    }
    
    
    if(killerstreak >= .killstreak) {
     for(set .@i, 0; .@i < $wantedlistlength && $wantedliststreak[.@i] > killerstreak; set .@i, .@i+1);
    
      if(.@i < $wantedlistlength && killerstreak >= $wantedliststreak[.@i]) {
     for(set .@x ,0; .@x < $wantedlistlength && $wantedlist$[.@x]!=strcharinfo(0); set .@x, .@x+1);
      if(.@x < $wantedlistlength && $wantedlist$[.@x]==strcharinfo(0)) {
       for(set .@already, .@x; .@already < $wantedlistlength; set .@already, .@already+1) {
    	set $wantedlist$[.@already], $wantedlist$[.@already+1];
    	set $wantedliststreak[.@already], $wantedliststreak[.@already+1];
       }
      }
    
     for(set .@x, ($wantedlistlength-1); .@x > .@i ; set .@x, .@x-1) {
      set $wantedlist$[.@x], $wantedlist$[.@x-1];
      set $wantedliststreak[.@x], $wantedliststreak[.@x-1];
     }
    announce strcharinfo(0)+" is now in bounty list top "+(.@i+1)+"!",0;
    
    set $wantedlist$[.@i], strcharinfo(0);
    set $wantedliststreak[.@i], killerstreak;
    
      }
    }
    
    attachrid(killedrid);
    if(killerstreak) {
     set killerstreak, 0;
     dispbottom "Your streak has been reset because you died!";
    }
    
    end;
    }
    
    moc_para01,48,179,3	script	Wanted List	837,{
    
    mes "[^4B0082 Wanted List ^000000]";
    mes "Announcement:";
    mes "This is the current Wanted List.";
    mes "Anyone who can kill any of these";
    mes "people will be reward with "+getitemname(50000)+"";
    next;
    mes "[^4B0082 Wanted List ^000000]";
    mes "Current Wanted List";
    mes "";
    for (set .@i,0; .@i < $wantedlistlength; set .@i, .@i+1) {
     set .@no, .@i+1;
     mes .@no+".) "+$wantedlist$[.@i]+" Streak: "+$wantedliststreak[.@i];
    }
    next;
    mes "[^4B0082 Wanted List ^000000]";
    mes "Happy hunting.";
    close;
    }


     

  4. 3 hours ago, Emistry said:

    what's the point of make it account bound when you want to allow it vend-able?

    if you want it to freely transfer here and there, then dont use bounded items.

     

    I want the players to use zeny as main mode of trading, instead of directly using Proof of Donation as main currency.

    I'm following this concept. Check at 5:02

     

  5. Is there a possibility to do this?

    Make an item account bound, which in essence cannot be traded, or stored in guild storage, but can be vended.

    I'm trying to materialize a flow like this:

    1. Buy proof of donation

    2. Proof of donation is Account Bound.

    3. Proof of donation Cannot be traded.

    4. But, Proof of donation can be vended using Vend skill.

    I'm trying to force players into using zeny as the main currency and avoid using Proof of donation as main currency.

  6. Hello guys, I set my item in item_trade.txt as this:

    50000,459,100    // Cash Coin  

    It can't be dropped, traded, etc. but it can be stored in vend, unfortunately I can't vend it either.

    i understand that in item_trade.txt there's :

    // 2   - item can't be traded (nor vended)

    // 16  - item can't be placed in the cart

    so I set it to cant be tradable but can be placed in cart.

    Is there a way for us to somewhat bypass vend restriction when you have a certain item in your inventory?

    So it will make a Non-tradable, but Vendable item?

    Thanks.
     

  7. Can we separate PK Points and PVP Points?

    This is the PVP Points that I have.

    -	script	PVPPOINTS	-1,{
    OnPCKillEvent:
    getmapxy.@map$,.@x,.@y,0;
    if(getcharid(3)==killedrid) end;
    if(.@map$ != "pvp_y_1-2") end;
    
    set .@player1, getcharid(3);
    set .@player2, killedrid;
    
    attachrid(.@player2);
    set .@player2points, #CASHPOINTS;
    if(.@player2points) {
     set #CASHPOINTS, #CASHPOINTS - 1;
     dispbottom "You Lost 1 Cash Point from "+rid2name(killerrid);
    }
     emotion e_sob,1;
    
    attachrid(.@player1);
    if(.@player2points) {
     set #CASHPOINTS, #CASHPOINTS + 1;
     dispbottom "You Gained 1 Cash Points from "+rid2name(killedrid);
    }
    else
     dispbottom "Sorry no cash points on the "+rid2name(killedrid);
     emotion e_meh,1;
    end;
    }

    The PVP Ladder

    //===== EinherjarRo Scripts ==================================
    //= PvP Ladder
    //===== Author ===============================================
    //= Stolao
    //===== Current Version: =====================================
    //= 3.21
    //===== Compatible With: =====================================
    //= rAthena SVN
    //===== Description: =========================================
    // Configurable Pvp Ladder
    //===== Comments: ============================================
    //= [Stolao]
    //===== Additional Comments: =================================
    //= 3.00 Overhaul
    //= 3.01 Fixed missing "No" for "No Ygg"
    //= 3.02 Added Show Map Name Option
    //= 3.03 Added Max Players Option
    //= 3.04 Optimized and fixed SQL queries [Secret]
    //= 3.05 Replaced some queries with addrid(0)
    //= 3.06 Updated Rewards to RODEX compatable
    //= 3.07 Fixed all rom referancing room [0] player limit
    //= 3.08 Made Made .MaxPlayers = 0, mean unlimited
    //= 3.09 Removed use of getd
    //= 3.0A Cleaned up some code
    //= 3.0B Moved Menu Generation to fix Map Count not showing
    //= 3.0C Actually Added RoDex Support now
    //= 3.0D Fixed Map Menu Generation
    //= 3.0E Fixed sql query
    //= 3.0F Cleaned Code a bit
    //= 3.10 Did more Cleaned Code a bit
    //= 3.11 Fixed a logic bug in GM reset
    //= 3.12 Added Waiting Room
    //= 3.13 Added Dynamic Waiting Room
    //= 3.14 Moved and added more At_Commands
    //= 3.15 Dynamic Waiting Room (&4096) require Waiting Room (&2048) to work
    //= 3.16 Increased Waiting Room Rotation Time
    //= 3.17 Fixed Typos in Reset PVP Stats
    //= 3.18 Removed unnessisary next, creating hang screens
    //= 3.19 Made compatable with new mail command
    //= 3.1A Reformatted Rewards in conf to support 5 items
    //= 3.1B Fixeda Hang when entering Nightmare PVP (thanks klesler)
    //= 3.1C Cied incorrrect use of close
    //= 3.1D Fixed Missing Party Check (thanks Haikenz)
    //= 3.1E Fixed Not opening PVP ladder, only GVG ladder (thanks Haikenz)
    //= 3.1F Fixed a warning when generating waitingroom
    //= 3.20 Fixed Missing Guild Check (thanks Haikenz)
    //= 3.21 Changed Default maps to pvp maps
    //===== Todo: ================================================
    //= Condence repeat queries
    //===== Contact Ifo: =========================================
    //= [Stolao]
    // Email: [email protected]
    //============================================================
    moc_para01,26,14,3	script	Ladder	837,{
    //==================================
    OnPvpLadder:	//-- Menus
    //==================================
    
    	.@Menu = select(((getarraysize(.MapName$))?"Enter PvP Map:":":")+
    			((.Options&1)?"Pvp Ladder:":":")+
    			((.Options&2)?"GvG Ladder:":":")+
    			((.Options&8)?"Top Guild:":":")+
    			((.Options&16)?"PvP Shops:":":")+
    			((.Options&1 || .Options&2 || .Options&8 || .Options&16)?"Personal Stats:":":")+
    			((getgmlevel() >= 99)?"Reset PVP Stats":""));
    	switch(.@Menu){ 
    		case 2:
    		case 3:
    			if(.@Menu == 2){
    				if(.Options&384)
    					.@key$ = "m_kda";
    				else if(.Options&256)
    					.@key$ = "kda";
    				else if(.Options&128)
    					.@key$ = "m_pkcount";
    				else 	.@key$ = "pl_pkcount";
    			} else {
    				if(.Options&384)
    					.@key$ = "gvg_kda";
    				else if(.Options&256)
    					.@key$ = "m_gvg_kda";
    				else if(.Options&128)
    					.@key$ = "m_gvg_kcount";
    				else 	.@key$ = "gvg_kcount";
    			}
    			query_sql("SELECT `char_reg_num`.`value`,`char`.`name`,`char`.`char_id` FROM `char` INNER JOIN `char_reg_num` ON `char_reg_num`.`char_id`=`char`.`char_id` WHERE `char_reg_num`.`key`='" + .@key$ + "' ORDER BY `char_reg_num`.`value` DESC LIMIT 10",.@value,.@name$,.@cid);
    			if(!(.Options&256)){
    				for(.@i = 0; .@i < getarraysize(.@cid); .@i++) {
    					if(.@i == 2){
    						if(.Options&128)
    							.@key$ = "m_dthcount";
    						else	.@key$ = "pl_dthcount";
    					} else if(.Options&128)
    						.@key$ = "m_gvg_dcount";
    					else	.@key$ = "gvg_dcount";
    					query_sql("SELECT CAST(`value` AS SIGNED) FROM `char_reg_num` WHERE char_id = "+.@cid[.@i]+" AND `key` = '';",.@j);
    					.@Death[.@i] = .@j;
    				}
    			}
    			mes "~ ^990000"+((.Options&128)?"Monthly ":"") + ((.@Menu == 2)?"PvP":"GvG") +" Ladder^000000 ~";
    			if (!getarraysize(.@cid)){
    				mes "The rankings are empty.";
    			} else {
    				for(.@i = 0; .@i<getarraysize(.@cid); .@i++){
    					if((.@i+1) % 10 != 0){
    						if(.Options&256)
    							mes "#"+(.@i+1)+" ^0000FF"+.@name$[.@i]+"^000000 "+.@value[.@i];
    						else 	mes "#"+(.@i+1)+" ^0000FF"+.@name$[.@i]+"^000000 [^00EE00"+callfunc("F_InsertPlural",.@value[.@i],"~ kill")+"] [^EE0000"+callfunc("F_InsertPlural",.@Death[.@i],"~ death")+"]";
    					} else next;
    				}
    			}
    			close;
    		case 4:
    			if(.Options&256)
    				.@key$ = "Guild_Kda";
    			else	.@key$ = "Guild_Kills";
    			if(.Options&128)
    				.@key$ = "$M_" + .@key$;
    			else	.@key$ = "$" + .@key$;
    			query_sql("SELECT `index`, CAST(`value` AS SIGNED) FROM `global_acc_reg_num` WHERE `key` = '" + .@key$ + "' ORDER BY CAST(`value` AS SIGNED) DESC LIMIT 10",.@gid,.@value);
    			if (!getarraysize(.@gid)){
    				mes "The rankings are empty.";
    			} else {
    				for(.@i = 0; .@i < getarraysize(.@gid); .@i++){
    					//query_sql("SELECT `value` FROM `global_acc_reg_num` WHERE `index` = "+.@gid[.@i]+";",.@j$); // ??? [Secret]
    					mes "#"+(.@i+1)+" ^0000EE["+getguildname(.@gid[.@i])+"]^000000 with [^00EE00"+callfunc("F_InsertPlural",$Guild_Kills[.@gid[.@i]],"~ kill")+"] and [^EE0000"+callfunc("F_InsertPlural",$Guild_Deaths[.@gid[.@i]],"~ death")+"]";
    				}
    			}
    			close;
    		case 5:
    			callshop "PvP_Cash_Shop",1;
    			end;
    		case 6:
    			if(.Options&1){
    				mes "[PvP]";
    				mes "Lifetime:","^00EE00"+ callfunc("F_InsertPlural",pl_pkcount,"kill") +"^000000 - ^EE0000"+ callfunc("F_InsertPlural",pl_dthcount,"death") + ((.Options&256)?" - ^0000EE"+ kda +" Total":"") +"^000000";
    				if(.Options&128) mes "Monthly:","^00EE00"+ callfunc("F_InsertPlural",m_pkcount,"kill") +"^000000 - ^EE0000"+ callfunc("F_InsertPlural",m_dthcount,"death") + ((.Options&256)?" - ^0000EE"+ m_kda +" Total":"") +"^000000";
    			}
    			if(.Options&16) mes "You Have "+ #PvpPoints +" Spendable Points";
    			if(.Options&2){
    				if(.Options&1) next;
    				mes "[GvG]";
    				mes "Lifetime:","^00EE00"+ callfunc("F_InsertPlural",gvg_kcount,"kill") +"^000000 - ^EE0000"+ callfunc("F_InsertPlural",gvg_dcount,"death")+((.Options&256)?" - ^0000EE"+ gvg_kda +" Total":"")+"^000000";
    				if(.Options&128) mes "Monthly:","^00EE00"+ callfunc("F_InsertPlural",m_gvg_kcount,"kill") +"^000000 - ^EE0000"+ callfunc("F_InsertPlural",m_gvg_dcount,"death") + ((.Options&256)?" - ^0000EE"+ m_gvg_kda +" Total":"") +"^000000";
    			}
    			if(.Options&8 && getcharid(2)){
    				if(.Options&2 || .Options&3) next;
    				mes "[Guild Stats]";
    				mes "Lifetime:","^00EE00"+ callfunc("F_InsertPlural",$Guild_Kills[getcharid(2)],"kill") +"^000000 - ^EE0000"+ callfunc("F_InsertPlural",$Guild_Deaths[getcharid(2)],"death") + ((.Options&256)?" - ^0000EE"+ $Guild_Kda[getcharid(2)] +" Total":"")+ "^000000";
    				if(.Options&128) mes "Monthly:","^00EE00"+ callfunc("F_InsertPlural",$M_Guild_Kills[getcharid(2)],"kill") +"^000000 - ^EE0000"+ callfunc("F_InsertPlural",$M_Guild_Deaths[getcharid(2)],"death") + ((.Options&256)?" - ^0000EE"+ $M_Guild_Kda[getcharid(2)] +" Total":"") +"^000000";
    			}
    			close;
    
    		case 7:
    			.@i = select("Monthly:Lifetime") - 1;
    			.@L$[0] = (.Options&1)?"Pvp Ladder":"";
    			.@L$[1] = (.Options&2)?"GvG Ladder":"";
    			.@L$[2] = (.Options&8)?"Top Guild":"";
    			.@j = select(implode(.@L$,":")) - 1;
    			mes "Are you sure you want to reset this the "+((.@i)?"Lifetime":"Monthly")+" "+.@L$[.@j]+"?";
    			if(select("No:Yes")!=2)
    				close;
    			close2;
    			switch(.@i * 3 + .@j){
    				case 0:
    					query_sql("DELETE FROM `char_reg_num` WHERE `key` = 'm_pkcount' OR `key` = 'm_kda' OR `key` = 'pl_dthcount'");
    					addrid(0);
    					m_pkcount = m_kda = m_dthcount = 0;
    					break;
    				case 1:
    					query_sql("DELETE FROM `char_reg_num` WHERE `key` = 'pl_pkcount' OR `key` = 'kda' OR `key` = 'pl_dthcount'");
    					addrid(0);
    					pl_pkcount = kda = pl_dthcount = 0;
    					break;
    				case 2:
    					query_sql("DELETE FROM `char_reg_num` WHERE `key` = 'm_gvg_kcount' OR `key` = 'm_gvg_kda' OR `key` = 'm_gvg_dcount'");
    					addrid(0);
    					m_gvg_kcount = m_gvg_kda = m_gvg_dcount = 0;
    					break;
    				case 3:
    					query_sql("DELETE FROM `char_reg_num` WHERE `key` = 'gvg_kcount' OR `key` = 'gvg_kda' OR `key` = 'gvg_dcount'");
    					addrid(0);
    					gvg_kcount = gvg_kda = gvg_dcount = 0;
    					break;
    				case 4:
    					cleararray $M_Guild_Kills[0],0,getarraysize($M_Guild_Kills);
    					cleararray $M_Guild_Kda[0],0,getarraysize($M_Guild_Kda);
    					cleararray $M_Guild_Deaths[0],0,getarraysize($M_Guild_Deaths);
    					break;
    				case 5:
    					cleararray $Guild_Kills[0],0,getarraysize($Guild_Kills);
    					cleararray $Guild_Kda[0],0,getarraysize($Guild_Kda);
    					cleararray $Guild_Deaths[0],0,getarraysize($Guild_Deaths);
    					break;
    			}
    			end;
    
    		case 1:	//===== Dont Touch - Menu Generation ======================
    			for(.@i = 0; .@i < getarraysize(.MapName$); .@i++){
    				.@MapList$[.@i] = "["+ ((.MapMode[.@i]&2)?"^EE3333Nightmare ":"") + 
    					((.MapMode[.@i]&4)?"Party ":"") + 
    					((.MapMode[.@i]&1)?"GvG":"PvP") +"^000000] "+ 
    					((.MapMode[.@i] >= 8)?"No ":"") + 
    					((.MapMode[.@i]&8)?"Ygg ":"") + 
    					((.MapMode[.@i]&16)?"3rds ":"") + 
    					((.MapMode[.@i]&32)?"Trans ":"") + 
    					((.MapMode[.@i]&64)?.MapName$[.@i]:"") + 
    					((.MaxPlayers[.@i])?"["+getmapusers(.MapName$[.@i])+"/"+.MaxPlayers[.@i]+"]":"");
    			}
    			//==========================================================
    			.@m = select(implode(.@MapList$,":")) - 1;
    			if(.MapMode[.@m]&2){
    				mes "You are about to enter NIGHTMARE PvP, on death you will lose gear randomly.";
    				if(select("Nevermind:Continue") == 1)
    					close;
    			} else	if(.MapMode[.@m]&8 && (countitem(607) || countitem(608))){
    				mes "No "+getitemname(607)+" or "+getitemname(608)+" Allowed.";
    				close;
    			} else 	if(.MapMode[.@m]&16){
    				mes "No 3rd Classes Allowed.";
    				close;
    			} else	if(.MapMode[.@m]&32){
    				mes "No Trans Classes Allowed.";
    				close;
    			} else if(.MaxPlayers[.@m] && getmapusers(.MapName$[.@m]) >= .MaxPlayers[.@m]){
    				mes "Room is Full.";
    				close;
    			} else	if(.MapMode[.@m]&4 && getcharid(1) <= 0 ){
    				mes "You must be in a Party to join.";
    				close;
    			} else	if(.MapMode[.@m]&1 && getcharid(2) <= 0 ){
    				mes "You must be in a Guild to join.";
    				close;
    			}
    			announce "[ PvP Warper ] "+strcharinfo(0)+" has entered in "+((.MapMode[.@m]&1)?"GvG":"PvP")+" Room",0,((.MapMode[.@m]&1)?0x00CC99:0xEE0000);
    			warp .MapName$[.@m],0,0;
    	}
    	end;
    
    //==================================
    OnPCKillEvent:	//-- Adding Stats
    //==================================
    
    	if(!getgmlevel() || .Options&512){
    		if(LastPK == killedrid) RepeatKill++;
    		else {
    			LastPK = killedrid;
    			RepeatKill = 0;
    		}
    		if(.Options&4)
    			announce "[PVP]: "+strcharinfo(0)+" has slain "+ rid2name(LastPK) + ((RepeatKill)?" for the "+callfunc("F_GetNumSuffix",RepeatKill)+" time in a row":"") +".",bc_all;
    		if((RepeatKill < .RepeatCount && .Options&32) || !.Options&32){
    			if(.Options&1) pl_pkcount++;
    			if(.Options&129) m_pkcount++;
    			if(.Options&257) kda++;
    			if(.Options&385) m_kda++;
    			if(.Options&16) #PvpPoints++;
    			if((getmapflag(strcharinfo(3),MF_GVG) || getmapflag(strcharinfo(3),MF_GVG_NOPARTY)) && (agitcheck() || agitcheck2()) && getcharid(2) && .Options&2){
    				gvg_kcount++;
    				if(.Options&128) m_gvg_kcount++;
    				if(.Options&256) gvg_kda++;
    				if(.Options&384) m_gvg_kda++;
    				if(.Options&8) $Guild_Kills[getcharid(2)]++;
    				if(.Options&136) $M_Guild_Kills[getcharid(2)]++;
    				if(.Options&256) $Guild_Kda[getcharid(2)]++;
    				if(.Options&264) $M_Guild_Kda[getcharid(2)]++;
    			}
    			attachrid(LastPK);
    			if(.Options&1) pl_dthcount++;
    			if(.Options&129) m_dthcount++;
    			if(.Options&257) kda -= 1;
    			if(.Options&385) m_kda -= 1;
    			if((getmapflag(strcharinfo(3),MF_GVG) || getmapflag(strcharinfo(3),MF_GVG_NOPARTY)) && (agitcheck() || agitcheck2()) && getcharid(2) && .Options&2){
    				gvg_dcount++;
    				if(.Options&128) m_gvg_dcount++;
    				if(.Options&258) gvg_kda -= 1;
    				if(.Options&384) m_gvg_kda -= 1;
    				if(.Options&8) $Guild_Deaths[getcharid(2)]++;
    				if(.Options&136) $M_Guild_Deaths[getcharid(2)]++;
    				if(.Options&256) $Guild_Kda[getcharid(2)] -= 1;
    				if(.Options&264) $M_Guild_Kda[getcharid(2)] -= 1;
    			}
    		} else if(.Options&1024) atcommand "@request [PvP Ladder]: "+strcharinfo(0)+" is showing signs of abusing the PvP Ladder Please Investigate";
    		if(.Options&64) warp "Save",0,0;
    	}
    	end;
    
    //==================================
    OnHour00:	//-- Monthly Rewards
    //==================================
    
    	if(gettime(5) == 1 && .Options&128 && .MailType){
    		if(.RewardType&1 && .Options&1){
    			query_sql("SELECT char_id,`char`.name,CAST(`value` AS SIGNED) FROM `char_reg_num` INNER JOIN `char` ON `char`.char_id = `char_reg_num`.char_id WHERE `key` = '"+((.Options&256)?"m_kda":"m_pkcount")+"' ORDER BY CAST(`value` AS SIGNED) DESC LIMIT "+getarraysize(.PVP_Items$)+"",.@cid,.@name$,.@value);
    			for(.@i = 0; .@i< getarraysize(.@cid); .@i++)
    				mail .@cid[.@i], "no-reply", "PvP Ranking", "Congratulations!% You have placed #"+(.@i+1)+" in the PvP Raning this Month % % %[ Your reward is attached. ]", .PVP_Zeny[.@i], getd(".Pitem"+.@i), getd(".Pqnt"+.@i);
    			announce "[PVP Ranking]: Rewards have been mailed to the top "+getarraysize(.PVP_Items$)+" in PvP~!",bc_blue|bc_all;
    			query_sql("UPDATE `mail` SET message = REPLACE(message,'%',CHAR(13)) WHERE send_name = 'no-reply'");
    		}
    		sleep 10000;
    		if(.RewardType&2 && .Options&2){
    			query_sql("SELECT char_id,`char`.name,CAST(`value` AS SIGNED) FROM `char_reg_num` INNER JOIN `char` ON `char`.char_id = `char_reg_num`.char_id WHERE `key` = '"+((.Options&256)?"m_gvg_kda":"m_gvg_kcount")+"' ORDER BY CAST(`value` AS SIGNED) DESC LIMIT "+getarraysize(.GVG_Items$)+"",.@cid,.@name$,.@value);
    			for(.@i = 0; .@i<getarraysize(.@cid); .@i++) 
    				mail .@cid[.@i], "no-reply", "PvP Ranking", "Congratulations!% You have placed #"+(.@i+1)+" in the PvP Raning this Month % % %[ Your reward is attached. ]", .GVG_Zeny[.@i], getd(".Gitem"+.@i), getd(".Gqnt"+.@i);
    			announce "[GVG Ranking]: Rewards have been mailed to the top "+getarraysize(.GVG_Items$)+" in GvG~!",bc_blue|bc_all;
    			query_sql("UPDATE `mail` SET message = REPLACE(message,'%',CHAR(13)) WHERE send_name = 'no-reply'");
    		}
    		cleararray $M_Guild_Kills[0],0,getarraysize($M_Guild_Kills);
    		cleararray $M_Guild_Kda[0],0,getarraysize($M_Guild_Kda);
    		cleararray $M_Guild_Deaths[0],0,getarraysize($M_Guild_Deaths);
    		query_sql("DELETE FROM `char_reg_num` WHERE `key` = 'm_pkcount' OR `key` = 'm_kda' OR `key` = 'm_dthcount' OR `key` = 'm_gvg_kcount' OR `key` = 'm_gvg_kda' OR `key` = 'm_gvg_dcount'");
    		addrid(0);
    		m_pkcount = 0;
    		m_kda = 0;
    		m_dthcount = 0;
    		m_gvg_kcount = 0;
    		m_gvg_kda = 0;	
    		m_gvg_dcount = 0;
    		end;
    	}
    
    //==================================
    OnInit:		//-- Config
    //==================================
    
    	// Gets NPC Name
    	// Lets you change NPC name without breaking anything
    	.NPC$ = strnpcinfo(0);
    
    	// At_Commands
    	bindatcmd("PvpLadder" ,.NPC$+"::OnPvpLadder",0,99);
    	bindatcmd("Pvpladder" ,.NPC$+"::OnPvpLadder",0,99);
    	bindatcmd("pvpLadder" ,.NPC$+"::OnPvpLadder",0,99);
    	bindatcmd("pvpladder" ,.NPC$+"::OnPvpLadder",0,99);
    
    	// Bitwise Variable
    	// 1: Record PvP
    	// 2: Record GvG (agit on and gvg map)
    	// 4: Announce When Someone gets a kill
    	// 8: Record Total Guild Stats
    	// 16: Gain PvP Points on Kills (#PvpPoints)
    	// 32: Repeat Kill Protection
    	// 64: Warp to Save on abuse
    	// 128: Monthly Stats
    	// 256: Order by KDA instead of most kills
    	// 512: Allow GMs to Join PvP
    	// 1024: Request a GM on Abuse
    	// 2048: Enable Waiting Room
    	// 4096: Dynamic Waiting Room
    	.Options = 1|2|4|8|16|32|128|256|1024|2048|4096;
    
    	// Monthly Reward Types
    	// 1: Pvp
    	// 2: Gvg
    	.RewardType = 1|2;
    
    	// PVP Rewards
    	// Rewards are Mailed to winners
    	// Zeny Rewards
    	setarray .PVP_Zeny,
    		1000000,500000,250000,125000,62500,// 1st - 5th
    		  31250, 15620,  7810,  3905, 1952;// 6th - 10th
    
    	// Ro Dex Supports 5 Items
    	// Old Mail DOES NOT support multiple items
    	// "Item 1, Qnt 1, Item 2, Qnt 2, Item 3, Qnt 3, Item 4, Qnt 4, Item 5, Qnt 5"
    	setarray .PVP_Items$,
    		"501,10,0,0,0,0,0,0,0,0",// 1st
    		"501,9,0,0,0,0,0,0,0,0",
    		"501,8,0,0,0,0,0,0,0,0",
    		"501,7,0,0,0,0,0,0,0,0",
    		"501,6,0,0,0,0,0,0,0,0",
    		"501,5,0,0,0,0,0,0,0,0",
    		"501,4,0,0,0,0,0,0,0,0",
    		"501,3,0,0,0,0,0,0,0,0",
    		"501,2,0,0,0,0,0,0,0,0",
    		"501,1,0,0,0,0,0,0,0,0";// 10th
    
    	// GVG Rewards
    	// Rewards are Mailed to winners
    	// Zeny Rewards
    	setarray .GVG_Zeny,
    		1000000,500000,250000,125000,62500,// 1st - 5th
    		  31250, 15620,  7810,  3905, 1952;// 6th - 10th
    
    	// Ro Dex Supports 5 Items
    	// Old Mail DOES NOT support multiple items
    	// "Item 1, Qnt 1, Item 2, Qnt 2, Item 3, Qnt 3, Item 4, Qnt 4, Item 5, Qnt 5"
    	setarray .GVG_Items$,
    		"501,10,0,0,0,0,0,0,0,0",// 1st
    		"501,9,0,0,0,0,0,0,0,0",
    		"501,8,0,0,0,0,0,0,0,0",
    		"501,7,0,0,0,0,0,0,0,0",
    		"501,6,0,0,0,0,0,0,0,0",
    		"501,5,0,0,0,0,0,0,0,0",
    		"501,4,0,0,0,0,0,0,0,0",
    		"501,3,0,0,0,0,0,0,0,0",
    		"501,2,0,0,0,0,0,0,0,0",
    		"501,1,0,0,0,0,0,0,0,0";// 10th
    
    	// Number of kills on same person before it detects abuse
    	.RepeatCount = 5;
    
    	// Players Shown in PvP Ladder
    	.MaxRank = 10;
    
    	// Map Names
    	setarray .MapName$,"pvp_n_1-2","pvp_n_1-1","pvp_n_1-4","pvp_n_1-3","pvp_n_1-5";
    
    	// Pvp Mode
    	// Modes are Addative
    	//	0 = Normal Pvp
    	//	1 = Gvg
    	//	2 = Nightmare
    	//	4 = Party
    	//	8 = No Ygg
    	//	16 = No 3rds
    	//	32 = No Trans
    	//	64 = Show Map Name
    	setarray .MapMode,0,1,2,4,56;
    
    	// Max Players Per Map
    	// 0 = No Limit
    	setarray .MaxPlayers,0,50,10,36,50;
    
    	// Mapflags for all PvP maps
    	// regardless of Mode
    	setarray .mapflag,
    		mf_nowarp,	mf_nowarpto,		mf_nosave,
    		mf_nomemo,	mf_noteleport,		mf_nopenalty,
    		mf_noreturn,	mf_nobranch,		mf_nomobloot,
    		mf_nomvploot,	MF_NOZENYPENALTY,	MF_NOTRADE,
    		MF_NOCOMMAND,	mf_nodrop;
    
    //===== Dont Touch - Mapflag & Waiting Room Generation =====
    	if(getwaitingroomstate(1) == -1)
    		delwaitingroom;
    	if(.Options&2048 && !.Options&4096)
    		waitingroom "PvP Ladder",0;
    	for(.@i = 0; .@i < getarraysize(.MapName$); .@i++){
    		for ( .@f = 0; .@f < .@size; .@f++ )
    			setmapflag .MapName$[.@i], .mapflag[.@f];
    		if(.MapMode[.@i]&4) setmapflag .MapName$[.@i], mf_partylock;
    		if(.MapMode[.@i]&2) setmapflag .MapName$[.@i], MF_NIGHTMAREDROP;
    		if(.MapMode[.@i]&1){
    			setmapflag .MapName$[.@i], MF_GUILDLOCK;
    			setmapflag .MapName$[.@i], MF_GVG;
    		} else{
    			setmapflag .MapName$[.@i], MF_PVP_NOGUILD;
    			setmapflag .MapName$[.@i], MF_PVP;
    		}
    		if(!.MapMode[.@i]&4){
    			if(.MapMode[.@i]&1) setmapflag .MapName$[.@i], MF_GVG_NOPARTY;
    				else	setmapflag .MapName$[.@i], MF_NOPARTY;
    		}
    	}
    	freeloop(1);
    	for(.@i = 0; .@i < getarraysize(.PVP_Items$); .@i++){
    		explode(.@convert$,.PVP_Items$[.@i],",");
    		for(.@c = 0; .@c < getarraysize(.@convert$) && .@c < 10; .@c++)
    			.@convert[.@c] = atoi(.@convert$[.@c]);
    		for(.@k = 0; .@k < getarraysize(.@convert); .@k += 2){
    			setd ".Pitem"+.@i+"["+getarraysize(getd(".Pitem"+.@i))+"]",.@convert[.@k];
    			setd ".Pqnt"+.@i+"["+getarraysize(getd(".Pqnt"+.@i))+"]",.@convert[.@k+1];
    		}
    	}
    	for(.@i = 0; .@i < getarraysize(.GVG_Items$); .@i++){
    		explode(.@convert$,.GVG_Items$[.@i],",");
    		for(.@c = 0; .@c < getarraysize(.@convert$) && .@c < 10; .@c++)
    			.@convert[.@c] = atoi(.@convert$[.@c]);
    		for(.@k = 0; .@k < getarraysize(.@convert); .@k += 2){
    			setd ".Gitem"+.@i+"["+getarraysize(getd(".Gitem"+.@i))+"]",.@convert[.@k];
    			setd ".Gqnt"+.@i+"["+getarraysize(getd(".Gqnt"+.@i))+"]",.@convert[.@k+1];
    		}
    	}
    	while(.Options&6144) {
    		for(.@i = 0; .@i < getarraysize(.MapName$); .@i++){
    			.@MapList$[.@i] = "["+ ((.MapMode[.@i]&2)?"Nightmare ":"") + 
    				((.MapMode[.@i]&4)?"Party ":"") + 
    				((.MapMode[.@i]&1)?"GvG":"PvP") +"] "+ 
    				((.MapMode[.@i] >= 8)?"No ":"") + 
    				((.MapMode[.@i]&8)?"Ygg ":"") + 
    				((.MapMode[.@i]&16)?"3rds ":"") + 
    				((.MapMode[.@i]&32)?"Trans ":"") + 
    				((.MapMode[.@i]&64)?.MapName$[.@i]:"") + 
    				((.MaxPlayers[.@i])?"["+getmapusers(.MapName$[.@i])+"/"+.MaxPlayers[.@i]+"]":"");
    			delwaitingroom;
    			waitingroom .@MapList$[.@i],0;
    			sleep 3000;
    		}
    	}
    //==========================================================
    }
    
    //==================================
    		//-- Call Shop
    //==================================
    
    -	pointshop	PvP_Cash_Shop	-1,#PvpPoints,501:1,502:2

    And, this is the PK Points with NPC

    -	shop	custom_seller2	-1,501:500
    moc_para01,45,12,2	script	PK Points Dealer	100,{
    	mes "[PK Points Dealer]";
    	mes "I will sell you items for PK points.";
    	mes "Each time you kill a player you'll get 1 PK point to spend here!";
    	next;
    	mes "[PK Points Dealer]";
    	mes "You currently have [^0000ff"+pk_points+"^000000] PK points to spend.";
    	callshop "custom_seller2",1;
    	npcshopattach "custom_seller2";
    	end;
    	
    OnBuyItem:
    	for(set .@i,0; .@i<getarraysize(.customs); set .@i,.@i+1) {
    		for(set .@d,0; .@d<getarraysize(@bought_nameid); set .@d,.@d+1) {
    			if(@bought_nameid[.@d]==.customs[.@i]) {
    				if(checkweight(@bought_nameid[.@d],@bought_quantity[.@d])) {
    					if(pk_points >= .Price[.@i]*@bought_quantity[.@d]) {
    						set pk_points, pk_points - .Price[.@i]*@bought_quantity[.@d];
    						getitem @bought_nameid[.@d],@bought_quantity[.@d];
    					} else dispbottom "You don't have enough PK points to purchase that item.";
    				} else dispbottom "Purchasing these items will put you over the weight limit!";
    			}
    		}
    	}
    	deletearray @bought_quantity, getarraysize(@bought_quantity);
    	deletearray @bought_nameid, getarraysize(@bought_nameid);
    	close;
    
    OnPCKillEvent:
    	//if( strcharinfo(3) != .map$ ) end;
    	copyarray( @killed$[1], @killed$[0], .saved_l-1 );
    	@killed$ = ""+killedrid;
    	if( countstr( implode( @killed$, "|" ), ""+killedrid, 0 ) <= .rstrk_l ) {
    		pk_points++;
    		dispbottom "You've gained one point! Your total is ["+pk_points+"] PK point(s).";
    	}
    	end;
    	
    	
    OnInit:
    	set .map$, "guild_vs3";
    	set .saved_l, 3; //Length of saved ids can be up to 127.
    	set .rstrk_l, 2; //Level of restriction.
    	setarray .customs[0],  60301,60302,60303,60304,60305,60306, 50000; // Enter the ID of customs here...
    	setarray .Price[0],    1,5,10,25,50,100, 20; // Price for each custom here...
    	npcshopitem "custom_seller2", 0  ,   0; // Don't touch any coding beyond here..
    	for( set .i,0; .customs[.i]; set .i,.i+1 )
    		npcshopadditem "custom_seller2",.customs[.i],.Price[.i];
    	end;
    }

    Is it possible to make this work simultaneously?

    Example, Ony PVP maps like PVP Ladder maps can gain PVP Points. And, the reset of the PK Enabled maps can gain PK Points.

    Is this possible?

  8. On 8/22/2017 at 6:23 PM, GodKnows Jhomz said:

    Just add your title id in "data/luafiles514/lua files/datainfo/titletable.lub", then after that add your custom achievement. Then set the reward title "TitleID: YourCustomTitleID".
    I just did some examples here:

    screenrAthena020.thumb.jpg.597a74d73d3c9a0fee1854b339781d0a.jpgscreenrAthena023.thumb.jpg.dc01eb132a2b877abebbfa62d3b9c7ca.jpgscreenrAthena024.thumb.jpg.3c919837c1465adaae4efbb6658f0016.jpgscreenrAthena029.thumb.jpg.97b005d368bd571498ab49bfb0439493.jpgscreenrAthena030.thumb.jpg.4735ccba6491966b7eda58a2f9bb755b.jpg

    Note: After claiming the title reward in achievement window, you need to reconnect to add it in your equipment tab. ;)

    sir, may we ask for a complete guide on how to do this? im confused on how to implement this.

    This is my titletable.lub

    and my achievement_db.yml

    Thanks

  9. Hello, may I ask for assistance in adding a random option protection item in this? I'm using @Keitenai's script

    Is it possible to add a custom random option protection item, like HD Oridecon or something? As long as they have it in their inventory their items won't break if the random option fails? (HD Oridecon will be consumed per failure.)

    I understand that we can set it the success rate to 0%, but I wan't the players to experience failing in refine rate, but will have the chance to protect their item using HD Oridecon in their inventory or something.

    Thanks in advance.

  10. I've been having some problems with my server, I'm using a GM account (group _id = 99)

    I can login without any problem, but when I use a normal player account (group_id = 0) It says Rejected from Server.

     

    I tried to isolate the concern, it seems that the main reason for my problem is the group_id.

    Because when I changed the group_id of my normal account into 99, I can login without any problem.

    But when I make it into 0 again, and tried to re-login, It says Rejected from Server.

    Is there a solution for this? Thanks!

    image.png.07cc841589dba0fd92b3de52b74df9ea.png

     

×
×
  • Create New...