rentitem2 plugins

Mhalicot

Gamers Republic
Messages
1,971
Points
0
Location
Asia
Github
mhalicot
Emulator
thumb-7851e21f3c4d7a2ef9375abab50a3191-rentitem2.png


File Name: rentitem2 plugins

File Submitter: Mhalicot

File Submitted: 04 Jan 2014

File Category: Plugins

HPM (Script command: rentitem2) (AtCommand: @rentitem) complete package.

Compatible with Windows System Only

if you are using Linux, ignore other files and use only rentitem2.c

some Linux Systwem got many bugs with files what are all ready compiled under VS2010 .

(Windows Compiled wont work on *nix)
Instruction.

1. Download and extract files using 7z or any application that can extract it.

2. extract it in your server directory ex: C:/RO Server/Hercules/

2.1. edit conf/plugins.conf and add rentitem2

3. find rentitem2/rentitem2.sln and recompile it.

4. You can now start using your ready made plugins
default_no1.gif


Pre-Compiled features, ready made MSVC. you can easily rebuild and its ready to go without any trouble on setup.

as simple as Download>Recomple>Play
if you are using VS2010/VS2009/vs2013 or whatsoever and you are failing to compile because of platform issue.

this is what you need to do.

rightclick rentitem2>Configuration Properties>General>

search for Platform Toolset, change VS2012(v110) to VS2010(v100) or VS2009(v90)

then try to recompile again..
Note: Recompile if you modify the script.

the command is rentitem2

If you want to edit look for src/plugins/rentitem2.c
Sample Script:

Code:
// Structure*rentitem2 <Item_ID>,<time>, <identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>;*rentitem2 "<Item_Name>",<time>, <identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>;// Scriptrentitem2 @inventorylist_id[.@item],.rentime,@inventorylist_identify[.@item],@inventorylist_refine[.@item],@inventorylist_attribute[.@item],@inventorylist_card1[.@item],@inventorylist_card2[.@item],@inventorylist_card3[.@item],@inventorylist_card4[.@item];
Note: cannot rent pet eggs/armor, stackable items.

Code:
// AtCommand Structureusage: @rentitem <item name/ID> <Minutes>
*getequipexpiretick(<equipment slot>)

Code:
Returns the number of seconds before the item expires.0 means it never expires (not a rental item)-1 means no item is equipped
Sample Script:

Code:
if (getequipexpiretick(.@part)) {            mes "Sorry. I don't sign rental items.";            emotion e_sry;            close;        }
If you have any questions feel free to drop a comment.

for more info on how to to use HPM visit Here

(Tested on Hercules rev. 137**)

Credit: Original file by Brian and converted by Me

Click here to download this file

 
Last edited by a moderator:
Update 2.0: 

Note: cannot rent pet eggs/armor, stackable items.

// AtCommand Structure

usage: @rentitem <item name/ID> <Minutes> 
 
Last edited by a moderator:
Update: 3.0

*getequipexpiretick(<equipment slot>)Returns the number of seconds before the item expires.0 means it never expires (not a rental item)-1 means no item is equipped
Sample Script:

Code:
if (getequipexpiretick(.@part)) {	mes "Sorry. I don't sign rental items.";	emotion e_sry;	close;}
 
QQ图片20140111101818.jpg

I use @rentitem2  it Unknown command..

Only can use @rentitem but can not add more field to do like refine, slot enchent.

why this??

My system is centos6.5 hercules last svn

 
Kindly read at first page, rentitem2 is for script command no @command for this.

available @command is @rentitem.

 
I can use script @renitem2 but i can't use as @commands, i show "unknown Command", what should i do ?

 
@mahlicot

can i use it in pre-renwal server? because after adding the plugin, i am getting unknown command if i use @rentitem.

 
Last edited by a moderator:
 
@mahlicot

can i use it in pre-renwal server? because after adding the plugin, i am getting unknown command if i use @rentitem.
What version you use? are you sure there is no error upon compiling? please review..


 
 
@mahlicot

can i use it in pre-renwal server? because after adding the plugin, i am getting unknown command if i use @rentitem.
What version you use? are you sure there is no error upon compiling? please review..
yeah. there is no error during compiling. but its working now. I am really interested only in @rentitem. So what i did was i manually put the code below under atcommand.c.

ACMD(rentitem){ char item_name[100]; int number = 0, item_id, flag = 0; struct item item_tmp; struct item_data *item_data; int get_count; memset(item_name, '0', sizeof(item_name)); if (!message || !*message || ( sscanf(message, ""%99[^"]" %d", item_name, &number) < 1 && sscanf(message, "%99s %d", item_name, &number) < 1 )) { clif->message(fd, "Please enter an item name or ID (usage: @rentitem <item name/ID> <minutes>)."); return true; } if (number <= 0) number = 1; if ((item_data = itemdb->search_name(item_name)) == NULL && (item_data = itemdb->exists(atoi(item_name))) == NULL) { clif->message(fd, "Invalid item ID or name."); return false; } item_id = item_data->nameid; get_count = number; //Check if it's stackable. if (itemdb->isstackable2(item_data)) { clif->message(fd, "Cannot create rented stackable items."); return false; } if(item_data->type == IT_PETEGG || item_data->type == IT_PETARMOR) { clif->message(fd, "Cannot create rented pet eggs or pet armors."); return false; } // if not pet egg if (!pet->create_egg(sd, item_id)) { number = get_count*60; memset(&item_tmp, 0, sizeof(item_tmp)); item_tmp.nameid = item_id; item_tmp.identify = 1; item_tmp.expire_time = (unsigned int)(time(NULL) + number); item_tmp.bound = 0; if ((flag = pc->additem(sd, &item_tmp, 1, LOG_TYPE_COMMAND))) clif->additem(sd, 0, 0, flag); } if (flag == 0) clif->message(fd, "Item created."); return true;}

thank you for sharing this tol. asitg!
default_biggrin.png


btw. im am using version 3.0.7.

 
Ahh, no prob.. xD but I cant reproduce your problem, I wish I can figure it out
default_biggrin.png


btw goodluck!

 
getting error like this compiling in linux. looking forward that somebody would make plugin for linux like this
default_smile.png


[Warning]: HPM:plugin_load: failed to retrieve 'HPMDataCheckLen' for 'plugins/rentitem2.dll', most likely not including HPMDataCheck.h, skipping...

 
Last edited by a moderator:
honestly you should try pull request these script commands

*rentitem2

*makeitem2

*getequipexpiretick

should go inside our repo

 
Please correct me I'm wrong, I'm trying to add this feature but then; first let me say what I've d

 

1. Placed rentitem2.c inside 'src\plugins'

2. edited conf/plugins.conf file

Code:
plugins_list: [
    /* Enable HPMHooking when plugins in use rely on Hooking */
    //"HPMHooking",
    //"db2sql",
    //"sample",
    //"other",
    "rentitem2",
]
 
compiled using linux (centos 6)
 
./configure
make clean
make sql
 
started the server using ./athena-start start then there's an error  saying
 
Code:
HPM:plugin_load: failed to load 'plugins/rentitem2.so' (error: plugins/rentitem2.so: cannot open shared object file: no such file or directory)!
HPM:plugin_load: failed to load 'plugins/rentitem2.so' (error: plugins/rentitem2.so: cannot open shared object file: no such file or directory)!
HPM:plugin_load: failed to load 'plugins/rentitem2.so' (error: plugins/rentitem2.so: cannot open shared object file: no such file or directory)!
 
 

 
make sql plugins
 
or even 

make plugins
 


you didn't build your plugins... that's why this error on startup...

 
Last edited by a moderator:
Back
Top