Bypass Trade Restriction via Trade Ticket


This modification allows you trade normally non-trade-able items using a custom trade ticket defined in  trade.h. The items are those defined in item_trade.txt

The currently set item is 501(Red Potion), it is recommended to change it to a custom non-droppable item.

Index: trade.c
 ===================================================================
 --- trade.c (revision 16496)
 +++ trade.c (working copy)
 @@ -316,6 +316,10 @@
 int trade_i, trade_weight;
 int src_lv, dst_lv;

+ //[clydelion]
 + int i,j = 0;
 + int ttcindex, ttc = 0;
 +
 nullpo_retv(sd);
 if( !sd->state.trading || sd->state.deal_locked > 0 )
 return; //Can't add stuff.
 @@ -343,7 +347,18 @@
 item = &sd->status.inventory[index];
 src_lv = pc_get_group_level(sd);
 dst_lv = pc_get_group_level(target_sd);
 - if( !itemdb_cantrade(item, src_lv, dst_lv) && //Can't trade
 +
 + //[clydelion]
 + if( item->nameid == BYPASS_TRADE_TICKET )
 + return;
 + for( i = 0; i < MAX_INVENTORY; i++ ){
 + if( sd->status.inventory[i].nameid == BYPASS_TRADE_TICKET ){
 + j++;
 + ttc = sd->status.inventory[i].amount;
 + ttcindex = i;
 + }
 + }
 + if( (!itemdb_cantrade(item, src_lv, dst_lv) && !j && ttc < amount) && //Can't trade
 (pc_get_partner(sd) != target_sd || !itemdb_canpartnertrade(item, src_lv, dst_lv)) ) //Can't partner-trade
 {
 clif_displaymessage (sd->fd, msg_txt(260));
 @@ -373,6 +388,10 @@
 return;
 }

+ //[clydelion]
 + if(itemdb_cantrade(item, src_lv, dst_lv) == 0)
 + pc_delitem(sd,ttcindex,amount,0,0,LOG_TYPE_OTHER);
 +
 if( sd->deal.item[trade_i].index == index )
 { //The same item as before is being readjusted.
 if( sd->deal.item[trade_i].amount + amount > sd->status.inventory[index].amount )
 @@ -448,6 +467,12 @@
 struct map_session_data *target_sd;
 int trade_i;

+ //[clydelion]
 + struct item item_tmp;
 + struct item item;
 + memset(&item_tmp,0,sizeof(item_tmp));
 + memset(&item,0,sizeof(item_tmp));
 + item_tmp.nameid=BYPASS_TRADE_TICKET;
 target_sd = map_id2sd(sd->trade_partner);

if(!sd->state.trading)
 @@ -464,6 +489,11 @@
 for(trade_i = 0; trade_i < 10; trade_i++) { // give items back (only virtual)
 if (!sd->deal.item[trade_i].amount)
 continue;
 +
 + //[clydelion]
 + item = sd->status.inventory[sd->deal.item[trade_i].index];
 + if(itemdb_cantrade(&item, pc_get_group_level(sd), pc_get_group_level(target_sd)) == 0)
 + pc_additem(sd, &item_tmp, sd->deal.item[trade_i].amount,LOG_TYPE_OTHER);
 clif_additem(sd, sd->deal.item[trade_i].index, sd->deal.item[trade_i].amount, 0);
 sd->deal.item[trade_i].index = 0;
 sd->deal.item[trade_i].amount = 0;
 @@ -484,6 +514,11 @@
 for(trade_i = 0; trade_i < 10; trade_i++) { // give items back (only virtual)
 if (!target_sd->deal.item[trade_i].amount)
 continue;
 +
 + //[clydelion]
 + item = target_sd->status.inventory[target_sd->deal.item[trade_i].index];
 + if(itemdb_cantrade(&item, pc_get_group_level(target_sd), pc_get_group_level(sd)) == 0)
 + pc_additem(target_sd, &item_tmp, target_sd->deal.item[trade_i].amount,LOG_TYPE_OTHER);
 clif_additem(target_sd, target_sd->deal.item[trade_i].index, target_sd->deal.item[trade_i].amount, 0);
 target_sd->deal.item[trade_i].index = 0;
 target_sd->deal.item[trade_i].amount = 0;
 Index: trade.h
 ===================================================================
 --- trade.h (revision 16496)
 +++ trade.h (working copy)
 @@ -5,6 +5,9 @@
 #define _TRADE_H_

//#include "map.h"
 +
 +#define BYPASS_TRADE_TICKET 501 //[clydelion]
 +
 struct map_session_data;

void trade_traderequest(struct map_session_data *sd, struct map_session_data *target_sd);

Display Vending Items in FluxCP


Click to expand

I’ve made a modification to display vended item to your existing FluxCP website. The modification requires a new table in the database, modification to the source, and a modification to FluxCP. Additional information can be added like the coordinates of the seller, etc. The addon is tested by me and (so far) found no problems. I’m selling this add-on for a small amount of $25,  thank you.

Note:

  1. If any bugs are found, I am happy to fix it for everyone who bought it.
  2. The vending information will be deleted from the website/database when:
    1. The player logs out without using @autotrade
    2. The player force quits the client
    3. The map-sever is restarted
  3. The Vending information will be retained in the website/database when:
    1. The add-on uses it’s own database, thus do not have a connection to inventory/item tables
    2. I have the right to deny selling the add-on to any individual.
  4. The add-on uses it’s own database, thus do not have a connection to inventory/item tables
  5. I have the right to deny selling the add-on to any individual.
  6. Please do not redistribute modifications/addons/etc you bought from me, as the payment from my work is the prime motivation for me to work on new ones and release some for free.
  7. To buy, please contact me via options in the contact page.

Auto delete dropped items


Here’s an atcommand I made to delete trash items when you drop it in-game.

Usage:
1. Use @dropautodelete in-game
2. Drop all the items you want to delete (it won’t be dropped to the ground)
3. Reload or use @dropautodelete again to turn it back to normal.

Note:
1. Dropped items are deleted permanently
2. It is advisable to change the command to something like @trash, @garbage for easy memorizing.

Index: src/map/atcommand.c
===================================================================
--- src/map/atcommand.c	(revision 16213)
+++ src/map/atcommand.c	(working copy)
@@ -8572,6 +8572,19 @@
 	return 0;
 }
 
+ACMD_FUNC(dropautodelete)
+{
+	nullpo_retr(-1, sd);
+	sd->state.dropautodelete = !sd->state.dropautodelete;
+
+	if(sd->state.dropautodelete)
+		clif_displaymessage(fd, "Dropped items will now be deleted automatically");
+	else {
+		clif_displaymessage(fd, "Dropped items will appear on the floor");
+	}
+	return 0;
+}
+
 /**
  * Fills the reference of available commands in atcommand DBMap
  **/
@@ -8817,6 +8830,7 @@
 		ACMD_DEF(font),
 		ACMD_DEF(accinfo),
 		ACMD_DEF(set),
+		ACMD_DEF(dropautodelete),
 		/**
 		 * For Testing Purposes, not going to be here after we're done.
 		 **/
Index: src/map/pc.c
===================================================================
--- src/map/pc.c	(revision 16213)
+++ src/map/pc.c	(working copy)
@@ -3745,6 +3745,13 @@
 		return 0;
 	}
 	
+	if( sd->state.dropautodelete )
+	{
+		pc_delitem(sd, n, amount, 1, 0, LOG_TYPE_PICKDROP_PLAYER);
+		clif_dropitem(sd, n, amount);
+		return 1;
+	}
+
 	if (!map_addflooritem(&sd->status.inventory[n], amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 2))
 		return 0;
 	
Index: src/map/pc.h
===================================================================
--- src/map/pc.h	(revision 16213)
+++ src/map/pc.h	(working copy)
@@ -146,6 +146,7 @@
 		struct guild *gmaster_flag;
 		unsigned int prevend : 1;//used to flag wheather you've spent 40sp to open the vending or not.
 		unsigned int warping : 1;//states whether you're in the middle of a warp processing
+		unsigned int dropautodelete  : 1; //autodelete dropped items. thus, nothing can be seen by you nor other players.
 	} state;
 	struct {
 		unsigned char no_weapon_damage, no_magic_damage, no_misc_damage;

First blog post


So yeah, I’ve decided to make a blog.

This blog will hold all the customization made by me, service-related information, my tools to make RO-server development easy and all other ragnarok-related contents (w/c are worth posting).

planned content updates:

blog theme, guides, pre-made src modifications(paid/free), request area