Jump to content

AnnieRuru

Members
  • Posts

    2044
  • Joined

  • Last visited

  • Days Won

    51

Everything posted by AnnieRuru

  1. script.c else if(st->state != END && st->rid){ //Resume later (st is already attached to player). if(st->bk_st) { ShowWarning("Unable to restore stack! Double continuation!\n"); //Report BOTH scripts to see if that can help somehow. ShowDebug("Previous script (lost):\n"); script_reportsrc(st->bk_st); ShowDebug("Current script:\n"); script_reportsrc(st); script_free_state(st->bk_st); st->bk_st = NULL; } } it just like OnPCDieEvent topic just now when having multiple event labels trigger on same player, that error message is "event queue full" this one however can be reproduce by prontera,154,183,5 script asdas 100,{ attachrid 2000000; mes "asdasdasd"; next; mes "asdasdas"; close; } dual-client from account_id 2000001 click on that npc it keep sending dialog to account_id 2000000 [Warning]: Unable to restore stack! Double continuation! [Debug]: Previous script (lost): [Debug]: Source (NPC): asdas at prontera (154,183) [Debug]: Current script: [Debug]: Source (NPC): asdas at prontera (154,183) in other words, some of your GM in your server send npc:bk twice to your player to perform a bot-check this error should be consider minor because it is an utility script ... and I don't think this will harm your server at all but if this error happens in an event script than its another story ...
  2. hmm quite an old topic but http://www.eathena.ws/board/index.php?s=&showtopic=242936&view=findpost&p=1323849 if want to use sc_berserk, you MUST also make a time limit @NovaGFX, well this topic seems ok but the other topic ... try to provide a script rather than just criticize others ... because this topic is quite old already
  3. prontera,154,183,5 script headgear finder 100,{ mes "input a headgear item_id"; next; input .@upper_headgear; // try 2220 if ( !( .@nb = query_sql("select id, name_japanese from item_db where equip_locations & 256 and view = ( select view from item_db where equip_locations & 256 and id = "+ .@upper_headgear +" )", .@item_id, .@item_name$ ) ) ) { mes "no headgear was found"; close; } mes "these are the items that has same view_id when you input that item_id"; next; for ( .@i = 0; .@i < .@nb; .@i++ ) .@menu$ = .@menu$ + .@item_name$[.@i] +":"; .@pick = select( .@menu$ ) -1; mes "you chose "+ .@item_name$[ .@pick ]; getitem .@item_id[ .@pick ], 1; close; } well better don't complicated the topic, so just do something like this if your input only ask in numeric value, then use input .@numeric_var <-- without the '$' at the end then the user will find it hard to inject your script because the input can only accept numbers and yes, your script at 1st post is possible to get SQL injection ... but I dunno what command should I input to inject that script ... lol because you run query_sql 3 times with different functions ...
  4. from what I understand from his script, the difficulty is generated randomlyand the reward is given by the formula of monster's level x mob need to hunt I haven't figure out the way to do "increasing difficulty with each progress" though perhaps you can suggest a formula for it you mean to take this mission, they need to be in party ?has minimum party members retrictions ... and then all party members will complete as a whole ? sounds interesting ... already like an event script no idea what this means
  5. -- post on 11 November 2012 -- damn ... I thought this is 1 of my interested topic, but the description failed at least explain as much as something like this http://www.eathena.w...howtopic=271291 EDIT: well that script is not 1vs1 ... its 1 vs many .. EDIT2: or you want something like this ? http://www.eathena.w...howtopic=269206 I think I can finish this one in just few hours if I start now level2 type event script pvp/gvg is easy for me, me learning battleground script already <3 -- post on 13 November 2012 7.02PM -- this morning I received a PM ... the PM title name "I call hax!" and a link to this topic is like he is asking me to challenge this script sql-files replace into mob_db2 values (2911,'OBJ_A2','North_emperium','Blue_Crystal',90,10,1,0,0,0,1,2,160,99,1,1,1,1,1,1,0,0,2,0,20,352,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); replace into mob_db2 values (2912,'OBJ_B2','South_emperium','Pink_Crystal',90,10,1,0,0,0,1,2,160,99,1,1,1,1,1,1,0,0,2,0,20,352,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); replace into mob_db2 values (2913,'ARCHER_GUARDIAN','ArcherGuardian','ArcherGuardian',74,10,1,1,1,12,1120,1600,56,60,95,80,80,90,165,55,14,16,2,7,80,8164,265,1200,1200,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); replace into mob_db2 values (2914,'ARCHER_GUARDIAN','ArcherGuardian','ArcherGuardian',74,10,1,1,1,12,1120,1600,56,60,95,80,80,90,165,55,14,16,2,7,80,8164,265,1200,1200,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); replace into mob_db2 values (2915,'ARCHER_GUARDIAN','ArcherGuardian','ArcherGuardian',74,10,1,1,1,12,1120,1600,56,60,95,80,80,90,165,55,14,16,2,7,80,8164,265,1200,1200,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); mob_avail 2911, 1914 2912, 1915 2913, 1285 2914, 1285 2915, 1285 npc script custom_woe0.1.txt patch custom_woe.diff time I read PM -> 1pm (GMT+8) now the time -> 7pm so I really did finished this in "just few hours" EDIT: ... he later say to me its a misunderstanding x.x please learn to do it yourself in db\re\mob_skill_db.txtbecause every server has different rates 10.xxpm EDIT: found a bug sleep 6000; // same as detachrid monster "event_01", .guardian_xy[ getarg(0) *2 ], .guardian_xy[ getarg(0) *2 +1 ], "--ja--", 2913 + .@kill_gid, 1, strnpcinfo(0) +"::Onguard"+( getarg(0) +1 )+"down"; replace with sleep 6000; // same as detachrid if ( .start == 2 )// <<- add this line monster "event_01", .guardian_xy[ getarg(0) *2 ], .guardian_xy[ getarg(0) *2 +1 ], "--ja--", 2913 + .@kill_gid, 1, strnpcinfo(0) +"::Onguard"+( getarg(0) +1 )+"down"; just found out if the event ended, but the sleep will still running killmonster will not remove this mob if is spawn a bit later found another bug ... forgot to add guildlock mapflag last EDIT: somebody merge my post ...
  6. yeah its possible its only impossible to get sql injection IF ... 1. input .@string_var$; query_sql ".... where data = '"+ escape_sql(.@string_var$) +"'"; 2. input .@int_var; query_sql ".... where data = "+ .@int_var; all other methods can get sql injection
  7. http://rathena.org/board/topic/72571-battleground-system-without-waitingroom/ you have to use this source modification
  8. 1. please post the script with proper indent http://en.wikipedia....ki/Indent_style 2.
  9. buildin_rid2name: invalid RID comes from script.c BUILDIN_FUNC(rid2name) { struct block_list *bl = NULL; int rid = script_getnum(st,2); if((bl = map_id2bl(rid))) { ......... } else { ShowError("buildin_rid2name: invalid RID\n"); script_pushconststr(st,"(null)"); } return 0; }] how to reproduce - script lfhdsfkjs -1,{ OnPCKillEvent: sleep2 500; announce strcharinfo(0) +" killed "+ rid2name(killedrid), 0; end; } get dual client and summon 1 poring cast lord of vermillion kill both of them ... player and poring at once and you get that error if somehow the poring dies a bit later than killing a player a player was set killedrid into account_id, but killing a mob is set killedrid into mob_id, thus you get this bug so means you have to remove your sleep2 ... but seriously ... I'm more interested to know how can your server can get event_queue_full ... unless you are not using rathena ?
  10. http://www.eathena.ws/board/index.php?showtopic=270783 in-game referral can always be abuse by creating multiple accounts
  11. lol [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: bonus (2 parameters): [Debug]: Data: number value=47 [Debug]: Data: number value=1 -> bonus bMdef,1; [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: bonus2 (3 parameters): [Debug]: Data: number value=1011 [Debug]: Data: number value=7 [Debug]: Data: number value=10 -> bonus2 bSubRace,RC_DemiHuman,10; [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: bonus (2 parameters): [Debug]: Data: number value=1003 [Debug]: Data: number value=15 -> bonus bCastrate,15; [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: bonus (2 parameters): [Debug]: Data: number value=16 [Debug]: Data: number value=3 -> bonus bInt,3;
  12. http://rathena.org/board/topic/66279-pvp-woe-gvg-instanced-pvp/page__hl__instance in theory it is possible, but nobody has ever do party vs party in an instance script imo
  13. AnnieRuru

    Tax Script

    prontera,155,180,5 script kjhfksjdhf 100,{ if ( select ( "add", "delete", "shop" ) == 3 ) { callshop "guild_shop_hidden#"+ 1, 1; close; } else if ( @menu == 1 ) { .@add = select( .accepted_id_menu$ ) -1; for ( .@i = 0; .@i < .guild_shop_size[1]; .@i += 2 ) { if ( .accepted_id[ .@add ] == getd(".guild_shop_sellid"+ 1 +"["+ .@i +"]") ) { mes getitemname( .accepted_id[ .@add ] ) +" is repeated"; close; } } input .@price, getiteminfo( .accepted_id[ .@add ] , 0 ), 1000000000; npcshopadditem "guild_shop_hidden#"+ 1, .accepted_id[ .@add ], .@price; setarray getd(".guild_shop_sellid"+ 1 +"["+ .guild_shop_size[1] +"]"), .accepted_id[ .@add ], .@price; $guild_shop_sellid$[1] = $guild_shop_sellid$[1] + .accepted_id[ .@add ] +"#"+ .@price +"#"; .guild_shop_size[1] += 2; close; } else if ( @menu == 2 ) { .@menu$ = ""; for ( .@i = 0; .@i < .guild_shop_size[1]; .@i += 2 ) .@menu$ = .@menu$ + getitemname( getd(".guild_shop_sellid"+ 1 +"["+ .@i +"]") ) +":"; .@delete = select( .@menu$ ) -1; npcshopdelitem "guild_shop_hidden#"+ 1, getd(".guild_shop_sellid"+ 1 +"["+ .@delete *2 +"]"); deletearray getd(".guild_shop_sellid"+ 1 +"["+ .@delete *2 +"]"), 2; .guild_shop_size[1] -= 2; $guild_shop_sellid$[1] = ""; // reconstruct for ( .@i = 0; .@i < .guild_shop_size[1]; .@i++ ) $guild_shop_sellid$[1] = $guild_shop_sellid$[1] + getd(".guild_shop_sellid"+ 1 +"["+ .@i +"]") +"#"; close; } close; // doesn't read OnInit: setarray .accepted_id, 501,502,503,504,505,506; // accepted item ID npcshopdelitem "guild_shop_hidden#"+ 1, 501; .@size = getarraysize( .accepted_id ); for ( .@i = 0; .@i < .@size; .@i++ ) .accepted_id_menu$ = .accepted_id_menu$ + getitemname( .accepted_id[.@i] ) +":"; if ( $guild_shop_sellid$[1] == "" ) end; explode .@guild_shop_sellid$, $guild_shop_sellid$[1], "#"; .guild_shop_size[1] = getarraysize( .@guild_shop_sellid$ ); for ( .@i = 0; .@i < .guild_shop_size[1]; .@i += 2 ) { npcshopadditem "guild_shop_hidden#"+ 1, atoi( .@guild_shop_sellid$[ .@i ] ), atoi( .@guild_shop_sellid$[ .@i +1 ] ); setarray getd(".guild_shop_sellid"+ 1 +"["+ .@i +"]"), atoi( .@guild_shop_sellid$[ .@i ] ), atoi( .@guild_shop_sellid$[ .@i +1 ] ); } end; } - shop guild_shop_hidden#1 -1,501:1000 this script is seriously tough, just 50 lines already looks like this and not even 30% finish this is just a sketch script to manipulate dynamic shop in-game if perhaps there's another idea to tackle this function ? or else I'll be using the same technique from my mission board script will try complete this little bit day by day EDIT: yeah I'll add in some stuffs posted by GmOcean in post#10 later that manipulating item ID and item price is somehow new system to me I dunno which is the best method to deny the item ID because if there's no protection, guild master can setup a shop and buy them that is usually not available by normal means EDIT2: or maybe I did wrong ? lol issit the shop npc should've sell a preset list of items ? suddenly I have a feeling I made wrong script again ...
  14. let me google for you click the 2nd link
  15. in my test server prontera,159,189,5 script kjfhskdj 100,{ end; OnInit: bonus bstr, 100; close; } [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: bonus (2 parameters): [Debug]: Data: number value=13 [Debug]: Data: number value=100 [Debug]: Source (NPC): kjfhskdj at prontera (159,189) it is reported unless you are not using rathena make sure your script.c has something like this especially script_reportsrc
  16. find bg_monster .red,"bat_a01",171,346, "--ja--",1915, strnpcinfo(3)+"::OnRedDown"; bg_monster .blue,"bat_a01",162,50, "--ja--",1914, strnpcinfo(3)+"::OnBlueDown"; add below bg_monster .red,"bat_a01",171,346, "--ja--",1285, strnpcinfo(3)+"::Onguardian"; bg_monster .red,"bat_a01",171,346, "--ja--",1286, strnpcinfo(3)+"::Onguardian"; bg_monster .red,"bat_a01",171,346, "--ja--",1287, strnpcinfo(3)+"::Onguardian"; bg_monster .blue,"bat_a01",162,50, "--ja--",1285, strnpcinfo(3)+"::Onguardian"; bg_monster .blue,"bat_a01",162,50, "--ja--",1286, strnpcinfo(3)+"::Onguardian"; bg_monster .blue,"bat_a01",162,50, "--ja--",1287, strnpcinfo(3)+"::Onguardian"; find killmonster "bat_a01", strnpcinfo(3)+"::OnRedDown"; killmonster "bat_a01", strnpcinfo(3)+"::OnBlueDown"; add below killmonster "bat_a01", strnpcinfo(3)+"::Onguardian"; add somewhere Onguardian: end; btw did you realize you just asked a noob question
  17. prontera,155,177,5 script Card Seller 100,{ mes "Welcome to card seller ... meh lazy to say"; next; .@s = select( .alphabet_menu$ ) -1; close2; callshop "card_mob#"+ .alphabet$[.@s], 1; end; OnInit: freeloop 1; .@total = query_sql("select distinct left( name_japanese, 1 ) as aaa from item_db right join mob_db on item_db.id = mob_db.dropcardid where ~mode & 32 and type = 6 group by name_japanese order by aaa", .alphabet$ ); for ( .@i = 0; .@i < .@total; .@i++ ) { .alphabet_menu$ = .alphabet_menu$ + .alphabet$[.@i] +" Cards:"; .@nb = query_sql( "select item_db.id from item_db right join mob_db on item_db.id = mob_db.dropcardid where ~mode & 32 and type = 6 and left( name_japanese, 1 ) = '"+ .alphabet$[.@i] +"' group by name_japanese order by name_japanese limit 128", .@id ); npcshopdelitem "card_mob#"+ .alphabet$[.@i], 501; for ( .@j = 0; .@j < .@nb; .@j++ ) npcshopadditem "card_mob#"+ .alphabet$[.@i], .@id[.@j], 1000000; } freeloop 0; end; } - shop card_mob#A -1,501:1000 - shop card_mob#B -1,501:1000 - shop card_mob#C -1,501:1000 - shop card_mob#D -1,501:1000 - shop card_mob#E -1,501:1000 - shop card_mob#F -1,501:1000 - shop card_mob#G -1,501:1000 - shop card_mob#H -1,501:1000 - shop card_mob#I -1,501:1000 - shop card_mob#J -1,501:1000 - shop card_mob#K -1,501:1000 - shop card_mob#L -1,501:1000 - shop card_mob#M -1,501:1000 - shop card_mob#N -1,501:1000 - shop card_mob#O -1,501:1000 - shop card_mob#P -1,501:1000 - shop card_mob#Q -1,501:1000 - shop card_mob#R -1,501:1000 - shop card_mob#S -1,501:1000 - shop card_mob#T -1,501:1000 - shop card_mob#U -1,501:1000 - shop card_mob#V -1,501:1000 - shop card_mob#W -1,501:1000 - shop card_mob#X -1,501:1000 - shop card_mob#Y -1,501:1000 - shop card_mob#Z -1,501:1000
  18. yeah this code doesn't work in eathena #define JOBL_UPPER 0x1000 //4096 #define JOBL_BABY 0x2000 //8192 rathena already has #define JOBL_THIRD 0x4000 //16384 lol eathena development so slow already, just switch to ra <3
  19. - script demotor npc -1,{ OnPCLoginEvent: if ( upper & 4 == 0 ) { dispbottom "few line's like Enjoy your stay etc"; end; } jobchange roclass ( eaclass( class ) & ~0x4000, sex ); joblevel = 100; atcommand "@allskill"; mes "pop up"; close; } I have a feeling this script doesn't work in rathena ... ok I double check src\map\map.h, should be working
  20. lol if it is pvp ladder or quest board script where the data is manipulated in-game of course have to execute query_sql in real-time but this script, 1. to add a new card, also means need to add things like num2itemdesctable.txt etc at the client side it also means, need to shut down the server to do so so my method of using OnInit is correct 2. my query only search inside `item_db` table, not `item_db2` table LMAO
  21. but I called them up only once inside OnInit: labelmeans the query is only executed only once during server startup if you mean the script on post#5 I agree but the script on post#12 I have to disagree I also knew that long time ago though EDIT: or probably a better way is ... A~Z use query_sql + dynamic shop mini-boss and MVP use "shop" npc ? seems this idea is better EDIT2: prontera,155,177,5 script Card Seller 100,{ mes "Welcome to card seller ... meh lazy to say"; next; if ( select ( "Normal Cards", "Mini-boss Cards", "MVP Cards" ) == 1 ) { .@s = select( .alphabet_menu$ ) -1; close2; callshop "card_mob#"+ .alphabet$[.@s], 1; end; } close2; callshop "card_mob#"+( ( @menu == 2 )? "miniboss":"MVP" ), 1; end; OnInit: freeloop 1; .@total = query_sql("select distinct left( name_japanese, 1 ) as aaa from item_db right join mob_db on item_db.id = mob_db.dropcardid where ~mode & 32 and type = 6 group by name_japanese order by aaa", .alphabet$ ); for ( .@i = 0; .@i < .@total; .@i++ ) { .alphabet_menu$ = .alphabet_menu$ + .alphabet$[.@i] +" Cards:"; .@nb = query_sql( "select item_db.id from item_db right join mob_db on item_db.id = mob_db.dropcardid where ~mode & 32 and type = 6 and left( name_japanese, 1 ) = '"+ .alphabet$[.@i] +"' group by name_japanese order by name_japanese limit 128", .@id ); npcshopdelitem "card_mob#"+ .alphabet$[.@i], 501; for ( .@j = 0; .@j < .@nb; .@j++ ) npcshopadditem "card_mob#"+ .alphabet$[.@i], .@id[.@j], 1000000; } freeloop 0; end; } - shop card_mob#A -1,501:1000 - shop card_mob#B -1,501:1000 - shop card_mob#C -1,501:1000 - shop card_mob#D -1,501:1000 - shop card_mob#E -1,501:1000 - shop card_mob#F -1,501:1000 - shop card_mob#G -1,501:1000 - shop card_mob#H -1,501:1000 - shop card_mob#I -1,501:1000 - shop card_mob#J -1,501:1000 - shop card_mob#K -1,501:1000 - shop card_mob#L -1,501:1000 - shop card_mob#M -1,501:1000 - shop card_mob#N -1,501:1000 - shop card_mob#O -1,501:1000 - shop card_mob#P -1,501:1000 - shop card_mob#Q -1,501:1000 - shop card_mob#R -1,501:1000 - shop card_mob#S -1,501:1000 - shop card_mob#T -1,501:1000 - shop card_mob#U -1,501:1000 - shop card_mob#V -1,501:1000 - shop card_mob#W -1,501:1000 - shop card_mob#X -1,501:1000 - shop card_mob#Y -1,501:1000 - shop card_mob#Z -1,501:1000 - shop card_mob#miniboss -1,4054:1000000,4241:1000000,4391:1000000,4428:1000000,4426:1000000,4290:1000000,4300:1000000,4392:1000000,4171:1000000,4397:1000000,4174:1000000,4398:1000000,4179:1000000,4266:1000000,4451:1000000,4250:1000000,4423:1000000,4354:1000000,4047:1000000,4163:1000000,4384:1000000,4431:1000000,4394:1000000,4395:1000000,4197:1000000,4198:1000000,4393:1000000,4203:1000000,4207:1000000,4440:1000000,4396:1000000,4254:1000000,4238:1000000,4237:1000000,4429:1000000,4406:1000000,4427:1000000,4306:1000000,4183:1000000 - shop card_mob#MVP -1,4236:1000000,4359:1000000,4425:1000000,4145:1000000,4168:1000000,4386:1000000,4142:1000000,4134:1000000,4137:1000000,4123:1000000,4330:1000000,4441:1000000,4352:1000000,4408:1000000,4128:1000000,4324:1000000,4363:1000000,4365:1000000,4430:1000000,4403:1000000,4419:1000000,4376:1000000,4357:1000000,4276:1000000,4361:1000000,4146:1000000,4399:1000000,4132:1000000,4131:1000000,4143:1000000,4135:1000000,4144:1000000,4148:1000000,4121:1000000,4407:1000000,4342:1000000,4263:1000000,4367:1000000,4318:1000000,4302:1000000,4305:1000000,4374:1000000,4372:1000000 like this perhaps, and the query // mini-boss select item_db.id, name_japanese from item_db right join mob_db on item_db.id = mob_db.dropcardid where mode & 32 and type = 6 and mexp = 0 and item_db.id not in ( select item_db.id from item_db right join mob_db on item_db.id = mob_db.dropcardid where ~mode & 32 and type = 6 ) and item_db.id not in ( select item_db.id from item_db right join mob_db on item_db.id = mob_db.dropcardid where mode & 32 and type = 6 and mexp != 0 ) group by item_db.id order by name_japanese; // MVP select item_db.id, name_japanese from item_db right join mob_db on item_db.id = mob_db.dropcardid where mode & 32 and type = 6 and mexp != 0 and item_db.id not in ( select item_db.id from item_db right join mob_db on item_db.id = mob_db.dropcardid where ~mode & 32 and type = 6 ) and item_db.id not in ( select item_db.id from item_db right join mob_db on item_db.id = mob_db.dropcardid where mode & 32 and type = 6 and mexp = 0 ) group by item_db.id order by name_japanese; EDIT3: found out the reason that slowing down the query time is because of having 'group by' inside 'in' so removed it
  22. just when I found out can use IN statement to counter the value being repeated in other table select item_db.id, name_english from item_db right join mob_db on item_db.id = mob_db.dropcardid where mode & 32 and type = 6 and mexp != 0 and item_db.id in ( select item_db.id from item_db right join mob_db on item_db.id = mob_db.dropcardid where mode & 32 and type = 6 and mexp = 0 group by item_db.id ) group by item_db.id order by name_japanese limit 128; this execution time is 0.4 seconds compare to 0.002 sec without using IN <.< so ... have to use Euphy's method... thx to Euphy <3 @Ryokem lol, me no programming background ... high school graduate only, hahaha of cos sure laughable XD
  23. http://www.eathena.ws/board/index.php?s=&showtopic=275677&view=findpost&p=1512424 http://www.eathena.ws/board/index.php?s=&showtopic=275817&view=findpost&p=1512666 btw ... you know a map name "test" is not accepted to be made into instance map ... sure throw gravity error it has to be <number>@<5 characters> it can be easily counter with using resnametable.txt though
  24. prontera,156,180,5 script Name2 100,{ mes "[Valkyrie Helm Changer]"; getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) { if ( compare( .itemidcompare$, ":"+ @inventorylist_id[.@i] +":" ) ) { .@menu$ = .@menu$ +( .@item_name$[.@c] = callfunc("getitemname2", @inventorylist_id[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i]) )+":"; .@id[.@c] = @inventorylist_id[.@i]; .@refine[.@c] = @inventorylist_refine[.@i]; .@identify[.@c] = @inventorylist_identify[.@i]; .@attribute[.@c] = @inventorylist_attribute[.@i]; .@card1[.@c] = @inventorylist_card1[.@i]; .@card2[.@c] = @inventorylist_card2[.@i]; .@card3[.@c] = @inventorylist_card3[.@i]; .@card4[.@c] = @inventorylist_card4[.@i]; .@c++; } } if ( .@c == 0 ) { mes "You need a Valkyrie Helm to use my services."; close; } else if ( .@c > 1 ) { mes "There are more than one Valkyrie Helm in your inventory."; mes "Please select one to be exchanged."; next; .@s = select( .@menu$ ) -1; mes "[Valkyrie Helm Changer]"; } setarray @head_exchanger, .@id[.@s], .@identify[.@s], .@refine[.@s], .@attribute[.@s], .@card1[.@s], .@card2[.@s], .@card3[.@s], .@card4[.@s]; mes "Which Valkyrie Helm would you like to have?"; close2; callshop "head_exchanger#hidden", 1; end; OnBuyItem: mes "[Valkyrie Helm Changer]"; if ( getarraysize( @bought_nameid ) > 1 ) mes "Please only choose 1 headgear"; else if ( !countitem2( @head_exchanger[0], @head_exchanger[1], @head_exchanger[2], @head_exchanger[3], @head_exchanger[4], @head_exchanger[5], @head_exchanger[6], @head_exchanger[7] ) ) mes "You need a Valkyrie Helm to use my services."; else if ( zeny < .req_zeny ) mes "You need " + .req_zeny + "z to use my services."; else { mes "Thank you!"; zeny -= .req_zeny; delitem2 @head_exchanger[0], 1, @head_exchanger[1], @head_exchanger[2], @head_exchanger[3], @head_exchanger[4], @head_exchanger[5], @head_exchanger[6], @head_exchanger[7]; getitem2 @bought_nameid, 1, @head_exchanger[1], @head_exchanger[2], @head_exchanger[3], @head_exchanger[4], @head_exchanger[5], @head_exchanger[6], @head_exchanger[7]; } deletearray @head_exchanger; close; OnInit: .req_zeny = 10000; // zeny requirement setarray .itemid, 5001, 5002, 5003, 5004, 5005, 5006; // put all your headgear in this list npcshopdelitem "head_exchanger#hidden", 501; .@size = getarraysize( .itemid ); for ( .@i = 0; .@i < .@size; .@i++ ) { npcshopadditem "head_exchanger#hidden", .itemid[.@i], 1; .itemidcompare$ = .itemidcompare$ +":"+ .itemid[.@i] +":"; } npcshopattach "head_exchanger#hidden"; end; } - shop head_exchanger#hidden -1,501:1000 my getitemname2 function LOL Mootie spoiled my fun XD
×
×
  • Create New...