laklaker Posted May 15, 2012 Posted May 15, 2012 Hello! I would like just to request something? I wanted to create a npc that trades a card for specific players like for example: Anonymous (This is a real IGN) Skull can be tradable into a card. Would you think it would work? Thanks! Quote
KeyWorld Posted May 16, 2012 Posted May 16, 2012 My fault: delitem2 7420, 1, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16; About the name, you have to reloadscript. Here a fix : // Damn !? No reloadscript ?! if ( .char_name$ == "" ) { donpcevent strnpcinfo(3) + "::OnInit"; sleep2 1; // Execute OnInit before continue. } mes "I give you an apple if you give me " + .char_name$ . "'s skull !"; next; if ( countitem2( 7420, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16 ) ) { mes "Yeah you have the skull ! I give you an apple"; delitem2 7420, 1, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16; getitem 512, 1; } else { mes "Damn, you don't have it..."; } close; OnInit: set .char_name$, "Anonymous"; query_sql("SELECT `char_id` FROM `char` WHERE `name`='" + escape_sql(.char_name$) + "' LIMIT 1", .cible_cid ); if ( !.cible_cid ) debugmes "[skull Trader] Invalid name specify ?"; end; Quote
Emistry Posted May 15, 2012 Posted May 15, 2012 Skull ID - 7420 and yes you can trade it into another Card if your NPC does so. just check for item 7420 and trade to the Card you want. Quote
laklaker Posted May 15, 2012 Author Posted May 15, 2012 Skull ID - 7420 and yes you can trade it into another Card if your NPC does so. just check for item 7420 and trade to the Card you want. I mean just to specific skulls? Like My skull only? Thanks! And could you please put some examples of the codes? Thanks Quote
Nameless2you Posted May 15, 2012 Posted May 15, 2012 Skulls, like yours that are dropped in pvp are just normal skulls, id 7420, nothing special about them, they're just signed with your name, no different worth or any other id. Quote
ForteXX Posted May 15, 2012 Posted May 15, 2012 Im pretty sure (s)he's wanting it to read the name off of the skull, perhaps for something like a mercenary script (kill a certain person and bring in their skull). Quote
KeyWorld Posted May 15, 2012 Posted May 15, 2012 Just an example: mes "I give you an apple if you give me " + .char_name$ . "'s skull !"; next; if ( countitem2( 7420, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16 ) ) { mes "Yeah you have the skull ! I give you an apple"; delitem2 7420, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16; getitem 512, 1; } else { mes "Damn, you don't have it..."; } close; OnInit: set .char_name$, "Anonymous"; query_sql("SELECT `char_id` FROM `char` WHERE `name`='" + escape_sql(.char_name$) + "' LIMIT 1", .cible_cid ); end; Good luck. 1 Quote
laklaker Posted May 16, 2012 Author Posted May 16, 2012 Just an example: mes "I give you an apple if you give me " + .char_name$ . "'s skull !"; next; if ( countitem2( 7420, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16 ) ) { mes "Yeah you have the skull ! I give you an apple"; delitem2 7420, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16; getitem 512, 1; } else { mes "Damn, you don't have it..."; } close; OnInit: set .char_name$, "Anonymous"; query_sql("SELECT `char_id` FROM `char` WHERE `name`='" + escape_sql(.char_name$) + "' LIMIT 1", .cible_cid ); end; Good luck. Hello there! I tried your script how ever it doesn't recognized a name. + An error in this line delitem2 7420, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16; Quote
Emistry Posted May 16, 2012 Posted May 16, 2012 you can try this http://upaste.me/657c37123fcc206 Quote
laklaker Posted May 16, 2012 Author Posted May 16, 2012 Ok thanks! I'll try it when I get back in home. Same as the one as I said. :| Quote
laklaker Posted May 16, 2012 Author Posted May 16, 2012 (edited) My fault: delitem2 7420, 1, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16; About the name, you have to reloadscript. Here a fix : // Damn !? No reloadscript ?! if ( .char_name$ == "" ) { donpcevent strnpcinfo(3) + "::OnInit"; sleep2 1; // Execute OnInit before continue. } mes "I give you an apple if you give me " + .char_name$ . "'s skull !"; next; if ( countitem2( 7420, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16 ) ) { mes "Yeah you have the skull ! I give you an apple"; delitem2 7420, 1, 1, 0, 0, 254, 0, .cible_cid & 0x00FFFF, .cible_cid >> 16; getitem 512, 1; } else { mes "Damn, you don't have it..."; } close; OnInit: set .char_name$, "Anonymous"; query_sql("SELECT `char_id` FROM `char` WHERE `name`='" + escape_sql(.char_name$) + "' LIMIT 1", .cible_cid ); if ( !.cible_cid ) debugmes "[skull Trader] Invalid name specify ?"; end; I'll try this when I get back home. Thanks! It works now however the delitem wont work :|. Edited May 16, 2012 by laklaker Quote
miapotter Posted May 18, 2012 Posted May 18, 2012 i also need something like this. however it wont work on me also. Quote
Question
laklaker
Hello! I would like just to request something? I wanted to create a npc that trades a card for specific players like for example: Anonymous (This is a real IGN) Skull can be tradable into a card. Would you think it would work? Thanks!
13 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.