Jump to content
  • 0

@item Mod From Eathena


Jhosef

Question


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  299
  • Reputation:   5
  • Joined:  04/05/12
  • Last Seen:  

I try This to Rathena but its not Working

Can you help me

@item patch

Index: atcommand.c
===================================================================
--- atcommand.c (revision 14843)
+++ atcommand.c (working copy)
@@ -1576,6 +1576,7 @@
{
 char item_name[100];
 int number = 0, item_id, flag;
+ int itemid, level; //To Check the item_deny from sql [Vengence]
 struct item item_tmp;
 struct item_data *item_data;
 int get_count, i;
@@ -1602,6 +1603,27 @@
 }

 item_id = item_data->nameid;
+ //To Check the item_deny from sql [Vengence]
+ if(SQL_ERROR == Sql_Query(mmysql_handle, "SELECT * FROM `item_deny` WHERE `itemid` = '%d'",item_id))
+  {
+   Sql_ShowDebug(mmysql_handle);
+  }
+  else
+  {
+   while( SQL_SUCCESS == Sql_NextRow(mmysql_handle) )
+   {
+    char *data;
+    Sql_GetData(mmysql_handle, 0, &data, NULL);
+    itemid = atoi(data);
+    Sql_GetData(mmysql_handle, 1, &data, NULL);
+    level = atoi(data);
+   }
+  }
+ if (item_id == itemid && pc_isGM(sd) < level) {
+		    clif_displaymessage(sd->fd, "You are restricted from creating this item.");
+   return -1;
+   }
+
 get_count = number;
 //Check if it's stackable.
 if (!itemdb_isstackable2(item_data))

item_deny Sql

SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `item_deny`
-- ----------------------------
DROP TABLE IF EXISTS `item_deny`;
CREATE TABLE `item_deny` (
 `itemid` smallint(5) NOT NULL,
 `level` tinyint(3) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of item_deny
-- ----------------------------
INSERT INTO `item_deny` VALUES ('501', '90');
INSERT INTO `item_deny` VALUES ('502', '90');

Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  90
  • Reputation:   2
  • Joined:  11/14/11
  • Last Seen:  

change all level to group_id

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  299
  • Reputation:   5
  • Joined:  04/05/12
  • Last Seen:  

1>c:\users\adminjoseph\desktop\rathena runk\src\map\atcommand.c(1413): error C2065: 'itemid' : undeclared identifier

1>c:\users\adminjoseph\desktop\rathena runk\src\map\atcommand.c(1415): error C2065: 'group_id' : undeclared identifier

1>c:\users\adminjoseph\desktop\rathena runk\src\map\atcommand.c(1418): error C2065: 'itemid' : undeclared identifier

1>c:\users\adminjoseph\desktop\rathena runk\src\map\atcommand.c(1418): warning C4013: 'pc_isGM' undefined; assuming extern returning int

1>c:\users\adminjoseph\desktop\rathena runk\src\map\atcommand.c(1418): error C2065: 'group_id' : undeclared identifier

still an error

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  407
  • Reputation:   159
  • Joined:  11/18/11
  • Last Seen:  

Index: atcommand.c
===================================================================
--- atcommand.c (revision 16385)
+++ atcommand.c (working copy)
@@ -1372,7 +1372,7 @@
ACMD_FUNC(item)
{
 char item_name[100];
- int number = 0, item_id, flag;
+ int number = 0, item_id, flag, level, itemid;
 struct item item_tmp;
 struct item_data *item_data;
 int get_count, i;
@@ -1399,6 +1399,26 @@
 }

 item_id = item_data->nameid;
+ 
+ //To Check the item_deny from sql [Vengence]
+ if(SQL_ERROR == Sql_Query(mmysql_handle, "SELECT * FROM `item_deny` WHERE `itemid` = '%d'",item_id))
+ Sql_ShowDebug(mmysql_handle);
+ else
+ {
+ while( SQL_SUCCESS == Sql_NextRow(mmysql_handle) )
+ {
+ char *data;
+ Sql_GetData(mmysql_handle, 0, &data, NULL);
+ itemid = atoi(data);
+ Sql_GetData(mmysql_handle, 1, &data, NULL);
+ level = atoi(data);
+ }
+ }
+ if (item_id == itemid && pc_get_group_level(sd) < level)
+ {
+ clif_displaymessage(sd->fd, "You are restricted from creating this item.");
+ return -1;
+ }
 get_count = number;
 //Check if it's stackable.
 if (!itemdb_isstackable2(item_data))

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  299
  • Reputation:   5
  • Joined:  04/05/12
  • Last Seen:  

thanks its already Working :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   1
  • Joined:  12/21/11
  • Last Seen:  

How to add item to be deny in the sql table? do I have to add item_deny.txt or something else?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

How to add item to be deny in the sql table? do I have to add item_deny.txt or something else?

load it into your sql database...

example..

INSERT INTO `item_deny` VALUES ('501', '90');
INSERT INTO `item_deny` VALUES ('502', '90');

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   1
  • Joined:  12/21/11
  • Last Seen:  

ok I get it now, I will manually type it all if item I want to deny. Tnx sir Emistry and Happy New Year.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

I've got some error for this src.. Need some help...

 

        CC      atcommand.c
atcommand.c: In function 'atcommand_item':
atcommand.c:1169:5: warning: 'flag' may be used uninitialized in this function [-Wuninitialized]
atcommand.c:1146:5: warning: 'itemid' may be used uninitialized in this function [-Wuninitialized]
atcommand.c:1146:24: warning: 'group_id' may be used uninitialized in this function [-Wuninitialized]

I'm using this src : http://rathena.org/board/topic/67383-item-mod-from-eathena/#entry119245



BUMP



BUMP

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

BUMP

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

bump, how to use this at rathena 17701?


bump


bump


bump

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...