Jump to content

AnnieRuru

Members
  • Posts

    2044
  • Joined

  • Last visited

  • Days Won

    51

Everything posted by AnnieRuru

  1. .@pet_id is the unique ID of the pet you can see that by generate through `pet` table .@pet_class is the answer you are looking for monster "gon_test", 62, 86, getd(".@pet_name$[.@s]"), getd(".@pet_class[.@s]"), 1,strnpcinfo(0)+"::OnDead",0,1;
  2. should get me review in PM 1st ...you already bomb my pm so much whats the difference having 1 more yeah x.xI only test by create 2 missions, so haven't try up above 30 already noticed thatlike player couldn't drop a mission after they have picked and swap mission order to make the npc looks more organized etc actually you know, your sql way makes me re-think ... probably can go unlimited ... so its not limited by any script engine anymore just now I look at the script too much 5th ... I can't pick a mission <.< [SQL]: DB error - Incorrect integer value: 'AnnieRuru' for column 'name' at row 1 [Debug]: at d:\rathena\src\map\script.c:14885 - INSERT INTO `player_mission` VAL UES ( 444132381,62120,2000000,150000,'AnnieRuru','',1388568855,NOW(),'0000-00-00 00:00:00' );.... please ....why are you using gettimetick(0), but not gettimetick(2) ?
  3. I asked you to do this since 21 Dec .. means took you around 11 days not so bad, around the same amount of time I took to write this 3 years ago 1st obvious bug the menu if I input the title name with the ":" symbol, the menu becomes 2 lines when players want to choose a quest and the menu option number become mess up 2nd, the job limitation should default to everyone on, not everyone off my way is use to limit certain jobs, but your way is force everyone to enable all jobs 3rd, I have never complete the custom variable stuffs ... means, the reward with a custom variable, can be use with achievement system or custom point currency I plan to do that but I couldn't do it that time, thinking that you can do though 4th http://www.eathena.ws/board/index.php?s=&showtopic=241133&view=findpost&p=1318425 your script is able to hit string limitation when the menu is too long, cause client crash seems your way of saving the variable is different than mine can tell that immediately you are using SQL table instead of setarray it also means your script would probably break the 5080 mission limit, but still limited to the string length that a menu can gives 5th Mission Offered by use wrong color, Red<=>Green is opposite nvm seems like need to go through the .@check_progress variable once to get it done a weird way though
  4. wait ... I thought there is no script command to summon a specific pet ? we only have *bpet script command and @hatch atcommand to open a menu to select which pet you want to hatch monster "gon_test", 62, 86, "Test pet1", 1647, 1,strnpcinfo(0)+"::Dead",0,1;you do realize that using this script command will summon a hostile monster, not a slave monster you know ? or you actually mean this script ? http://www.eathena.ws/board/index.php?s=&showtopic=242792&view=findpost&p=1324032 there is no intimacy in this kind of slave monster though however it might be possible if you set them around with lots of variables ... curious, are you writing something like pokemon pet fighting system ? now this sound interesting
  5. like I said previously the reason why it can spawn on 1st one, because your script uses *goto*goto script command can carry the scope variable over but after it hits *end; then the scope variable vanish after you summon your 1st mvp, the .@mapname$ variable still persist with *goto script command but when you want to summon your 2nd mvp, the .@mapname$ variable already gone because you trigger it with the monster's event label, which is "BTA::OnBTAKilled" within those line where it trigger OnBTAKilled: until goto OnSpawn: label, you didn't set your .@mapname$ variable back [Debug]: mapindex_name2id: Map "" not found in index list!you have to change .@mapname$ into .mapname$to make this variable exist throughout the script
  6. @Kido has actually tried to script this, and asked for my support in PM but his script is made too long with just the *menu script command I think this is why most scripters turn away because many people here still couldn't utilize advance scripting technique and I also noticed this extending rental item feature ... which have to use getinventorylist command makes me wants to dig this in myself I lost count of how many techniques I used inside EDIT: wait, accessory and god items has different rate ok prontera,150,180,5 script kjdhfksj 100,{ mes "what do you want?"; next; if ( select ( "Gears", "Extend my items" ) == 1 ) { mes "what item you want"; next; .@category_select = select ( "Accessory", "Lower Gears", "Mid Gears", "Head Gears", "Godly Gears" ); mes "what item you want"; next; if ( .@category_select != 5 ) .@id_select = select( getd( "."+ .category$[ .@category_select ] +"_id_menu$" ) ) -1; else .@id_select = select( .god_id_menu$ ) -1; mes "how many days"; next; .@days = select( .day_menu$ ); if ( countitem( .rentitem ) < .@days ) { mes "sorry insufficient ticket!"; close; } mes "here's you're item!"; if ( .@category_select == 1 || .@category_select == 5 ) delitem .rentitem, .@days *2; else delitem .rentitem, .@days; if ( .@category_select != 5 ) rentitem getd( "."+ .category$[ .@category_select ] +"_id_start" ) + .@id_select, 60*60*24* .@days; else rentitem .god_id[ .@id_select ], 60*60*24* .@days; } else { getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) { if ( compare( .id_compare$, "#"+ @inventorylist_id[.@i] +"#" ) ) { .@item_id[.@c] = @inventorylist_id[.@i]; .@expire[.@c] = @inventorylist_expire[.@i]; .@menu$ = .@menu$ + getitemname( @inventorylist_id[.@i] ) +":"; .@c++; } } if ( !.@c ) { mes "there is no rental item in your inventory"; close; } mes "which item"; next; .@s = select( .@menu$ ) -1; if ( countitem( .@item_id[.@s] ) >= 2 ) { mes "there are more than 1 of "+ getitemname( .@item_id[.@s] ) +" in your inventory. Make sure there is only 1 of them in your inventory."; close; } mes "how many days"; next; .@days = select( .day_menu$ ); if ( countitem( .rentitem ) < .@days ) { mes "sorry insufficient ticket!"; close; } mes "here's you're item!"; if ( .@item_id[.@s] >= 8000 && .@item_id[.@s] < 9000 ) delitem .rentitem, .@days; else delitem .rentitem, .@days *2; delitem .@item_id[.@s], 1; rentitem .@item_id[.@s], .@expire[.@s] - gettimetick(2) + 60*60*24* .@days; close; } close; OnInit: setarray .category$[1], "accessory", "lower", "mid", "head"; for ( .@i = 1; .@i <= 10; .@i++ ) .day_menu$ = .day_menu$ + .@i +":"; .id_compare$ = "#"; set .rentitem, 24042; // itemID to rent // Accessory items .accessory_id_start = 20000; .accessory_id_end = 20005; for ( .@i = .accessory_id_start; .@i <= .accessory_id_end; .@i++ ) { .accessory_id_menu$ = .accessory_id_menu$ + getitemname( .@i ) +":"; .id_compare$ = .id_compare$ + .@i +"#"; } // Lower Gears .lower_id_start = 8000; .lower_id_end = 8021; for ( .@i = .lower_id_start; .@i <= .lower_id_end; .@i++ ) { .lower_id_menu$ = .lower_id_menu$ + getitemname( .@i ) +":"; .id_compare$ = .id_compare$ + .@i +"#"; } // Mid Gears .mid_id_start = 8022; .mid_id_end = 8036; for ( .@i = .mid_id_start; .@i <= .mid_id_end; .@i++ ) { .mid_id_menu$ = .mid_id_menu$ + getitemname( .@i ) +":"; .id_compare$ = .id_compare$ + .@i +"#"; } // Head Gears .head_id_start = 8037; .head_id_end = 8059; for ( .@i = .head_id_start; .@i <= .head_id_end; .@i++ ) { .head_id_menu$ = .head_id_menu$ + getitemname( .@i ) +":"; .id_compare$ = .id_compare$ + .@i +"#"; } // Godly Item IDs setarray .god_id, 2629, 2410; .@size = getarraysize( .god_id ); for ( .@i = 0; .@i < .@size; .@i++ ) { .god_id_menu$ = .god_id_menu$ + getitemname( .god_id[.@i] ) +":"; .id_compare$ = .id_compare$ + .god_id[.@i] +"#"; } end; } EDIT for below: at least you have tried ~
  7. OnKilled: announce "Invasion MvP : Someone killed a mvp at "+ .Map$[ .RandMap ] +" keep defending!!! ",0; set mvp_point, mvp_point + 1;// +1 mvp point dispbottom "You have "+ mvp_point +" MVP Points"; end;this should workif you want players to see their points, perhaps you can make another npc for it
  8. your script "eibroch" but inside db\map_index.txt says einbroch check the spelling ? you mean like making a ladder ?
  9. there's quite a few errors in the script script error on npc/custom1/zzz.txt line 26 parse_line: expected ';' 21 : set .@mapName$,"pvp_2vs2"; // On which map should the event be 22 : set .@spawnCordX,40; // X-Cordinate where the mob spawns 23 : set .@spawnCordY,33; // Y-Cordinate where the mob spawns 24 : set .@minGmRank,99; // Minimal GM level to use this script 25 : set .@globalAnnounce,0; // Should the script announce kills global * 26 : set .@MvPList[0],1150','1511,1373,1719,1785,1768; 27 : 28 : if (getgmlevel() < .@minGmRank) end; 29 : 30 : if ( compare( .@atcmd_parameters$, "on" ) ) { 31 : goto OnEnable; [Warning]: Unexpected type for argument 5. Expected number. [Debug]: Data: string value="+.@MvPList[.@i]+" [Debug]: Function: monster [Debug]: Source (NPC): BTA (invisible/not on a map) [Warning]: buildin_monster: Attempted to spawn non-existing monster class 0also, your variable usage pretty much mess up OnDoBTA: // - NPC Config // --------------------------------------------------------------------------- set .@mapName$,"pvp_2vs2"; // On which map should the event be set .@spawnCordX,40; // X-Cordinate where the mob spawns set .@spawnCordY,33; // Y-Cordinate where the mob spawns ..... end; ..... OnSpawn: monster .@mapName$,.@spawnCordX,.@spawnCordY,"+getmonsterinfo(.@MvPList[.@i],0)+","+.@MvPList[.@i]+",1,"BTA::OnBTAKilled";I'm sure the .@mapName$ here will be an empty string ...well since you posted in scripting support, I guess this is your script ? this script quite mess up though
  10. I tried the script I input 1 [Error]: buildin_getitem: Nonexistant item 1 requested. [Debug]: Source (NPC): Sample at prontera (150,150)getitemname return "null" when it item ID wasn't found BUILDIN_FUNC(getitemname) ..... if (i_data == NULL) { script_pushconststr(st,"null"); return 0; }also [Debug]: Source (NPC): Sample at prontera (150,150) [Warning]: Incorrect use of 'close' command! (source:Sample / path:@ßX)when attaching an ID that wasn't talking to an npcthat ID should've use end; instead of close ... also, the .@id is a scope variable using addrid attach the rid on other players, has to use .id <-- npc variable I think I do ... wait I edit ok prontera,150,150,0 script Sample 123,{ if ( getgmlevel() < 99 ) end; mes "Input item id"; next; input .itemid; if ( getitemname( .itemid ) == "null" ) { mes "non-existant id"; close; } .@origin = getcharid(3); addrid 0; // 0 or 1 getitem .itemid, 1; if ( .@origin == getcharid(3) ) close; else end; } @Patskie
  11. LOL, then you should've put this script into your script release xD haha, make me laugh until my stomachache ! I had fun *cracking* your unreadable script lol though of course I know how to produce from scratch too EDIT: query_sql("SELECT char_id,CAST(`value` AS SIGNED) FROM `global_reg_value` WHERE `str` = 'MVP_Rank' ORDER BY CAST(`value` AS SIGNED) DESC LIMIT 20",.@cid,.@value);now this is interesting ...I just recheck sql-files\main.sql CREATE TABLE IF NOT EXISTS `global_reg_value` ( `char_id` int(11) unsigned NOT NULL default '0', `str` varchar(255) NOT NULL default '', `value` varchar(255) NOT NULL default '0', `type` tinyint(1) NOT NULL default '3', `account_id` int(11) unsigned NOT NULL default '0', PRIMARY KEY (`char_id`,`str`,`account_id`), KEY `account_id` (`account_id`) ) ENGINE=MyISAM;the `value` and `str` isn't indexmeans, your script probably will run through the whole table to sort the value ... its very unoptimized way to write this perhaps, it might be better to do this via altering the `char` table...
  12. LOL !! yeah I tried to rewrite this, feels like wasting time though /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * ~~~~~~~~ Euphy's MVP Ladder v1.3 ~~~~~~~~ * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ prontera,148,170,6 script MVP Ladder 891,{ function f00000; function f00001; function f00002; function f00003; function f00004; function f00005; function f00006; function f00007; function f00008; function f00009; f00008(0); function f00000 { if ( getmonsterinfo(killedrid,22) ) { f00009 ( strcharinfo(0)+" has slain"+" the ferocious "+strmobinfo(1,killedrid)+"!",16); setd .a00005$[8],getd(.a00005$[8])+1; if (getd(.a00005$[8])==1) query_sql("INSERT "+"INTO `global_reg_value` (`char_id`,`str`,`value`,`type`,`account"+"_id`) VALUES ("+ getcharid(0) +",'" + .a00005$[8] + "','1',3,0)"); else query_sql( "UPDATE `global_reg_value` SET `value` = '" + getd(.a00005$[8])+"' WHERE char_id = " + getcharid(0) + " AND `str` ='"+.a00005$[8]+"'"); dispbottom "~ You've killed " +getd(.a00005$[8])+" MVPs. ~"; specialeffect2 313; } end; } function f00001 { for( set .@a00000,2; .@a00000<getargcount(); set .@a00000,.@a00000+1 ) setd "." +getarg(0)+ "["+(.@a00000+getarg(1,0)-2)+"]", getarg(.@a00000); return; } function f00002 { if (.a00005$[8]!= "") deletearray getd("."+getarg(0)+"[0]"),getarg(1,128); else f00001("a00005$",8,"WhyA"+"reYouReadingThis"); return; } function f00003 { if (.a00005$[0]!="") { if (@a00007) return "^777777"+getarg(0)+ "^000000"; set .@a00001, rand(1,7); set .@a00000$,.a00005$[.@a00001]; for (f00001("a00006",0,0,.@a00001); .a00006<getstrlen(getarg(0)); set .a00006,.a00006+1) { set .@a00000$, .@a00000$ + charat( getarg(0), .a00006 ) + .a00005$[.a00006[1]]; set .a00006[1],(.a00006[1]==7)?1:.a00006[1]+1; } f00002("a00006"); return .@a00000$ + .a00005$[0]; } else f00001("a00005$", 0, "^000000", "^FF0000", "^FF7F00", "^FFFF00","^00FF00","^0000FF", "^6600FF", "^8B00FF"); return; } function f00004 { if ( compare( getarg(0), "|" ) ) f00001("a00003$", 0, f00005(atoi(substr(getarg(0),1,getstrlen(getarg(0)) - 1)))); else f00001("a00003$", 0, getarg(0)); mes f00003(.a00003$); f00002("a00003$"); if ( getarg(1,0)==2) next; else if (getarg(1,0)==1) close; else if (getarg(1,0)) sleep2(getarg(1,0)); return; } function f00005 { if (.a00004$[0]!="") return .a00004$[getarg(0,0)]; else f00001("a00004$",0,"[MVP Ladde"+"r]", "Hello!", "What are you doing here?", " ~ Check rankings."," ~ My stats.", " ~ This hurts my eyes...", " ~ Turn the rainbows"+" back on!", " ~ Oh, just passing by. ;3", "See ya!" ); return; } function f00006 { set .@a00000, select(f00003( .a00004$[3]) + ":" +f00003(.a00004$[4])+ ":"+((@a00007)?":"+f00003(.a00004$[6]):f00003(.a00004$[5]) + ":") + ":" +f00003(.a00004$[7])); f00004("|0"); if (.@a00000==1) f00007(); else if (.@a00000 == 2) f00004("You have "+"killed "+getd(.a00005$[1<<3])+" MVPs.",1); else if (.@a00000==3) { if (rand(2)) { set @a00007,1; f00004("k.",1); } else { misceffect 183; percentheal -100,-100; close; } }else if (.@a00000==4){ set @a00007,0; specialeffect 410,25; f00004("Just a moment...",1);} else return; } function f00007 { query_sql("SELECT char_id,CAST(`value` AS SIGNE"+ "D) FROM `global_reg_value` WHERE `str` = '"+.a00005$[8]+"' ORDER"+ " BY CAST(`value` AS SIGNED) DESC LIMIT 20", .@a00001, .@a00002 ); for(set .@a00000, 0; .@a00000<getarraysize(.@a00001); set .@a00000, .@a00000+1) { query_sql("SELECT `name` FROM `char` WHERE char_id="+ .@a00001[.@a00000] + ";", .@a00003$); set .@a00004$[.@a00000], .@a00003$; } for(set .@a00000,0; .@a00000 < getarraysize(.@a00001); set .@a00000, .@a00000 + 1) f00004( "[" + ( .@a00000 + 1 ) + "] " + .@a00004$[.@a00000] + " ~ "+.@a00002[.@a00000] +" kills"); close; } OnInit: f00008(1); function f00008 { if ( getarg(0) ) { if ( .a00005$[8] == "") { f00002(); f00003(); f00005(); f00009(); } else { getmapxy(.@a00000$,.@a00001,.@a00002,0); monster .@a00000$, .@a00001,.@a00002," ",2194,2,strnpcinfo(0)+"::OnInit";end;}} else { f00004("|0"); f00004("|1", 400); f00004("|2", 2); f00006(); f00004( "|8", 1); } } OnNPCKillEvent: f00000(); end; function f00009 { if ( getarg( 0, "" ) == "") while(1) { sleep(5000); if ( !rand(100) ) { getmapxy( .@a00000$, .@a00001, .@a00002, 1 ); set .@a00003, 2194; setnpcdisplay( strnpcinfo(0), .@a00003 ); for( set .@a00004, 0; .@a00004 < 10; set .@a00004, .@a00004 + 1 ) { misceffect 901; monster .@a00000$, .@a00001, .@a00002, " ", .@a00003, 10, strnpcinfo(0) + "::OnInit"; sleep(2500); } hideonnpc strnpcinfo(0); end; } } else { announce getarg(0), getarg(1); return; } } }I'm able to rearrange until this partelse if (.@a00000==3) { // <-- means if you choose the menu option no.3 you have 50% chance to change the menu color into black or 50% chance to get yourself killed ... usually you shouldn't kill a player unless it is an event script because if do something like this in utility script, and you forgot to put nopenalty mapflag players will get their experience deducted in town and I remember I told euphy in PM last year because if somebody else able to replicate your script and do better, you just make yourself looks plain stupidespecially in this community board lol well, euphy made his fireworks script having very high script readability, so I think he already understand by now perhaps this is 1 of his older script
  13. http://www.eathena.ws/board/index.php?s=&showtopic=242936&view=findpost&p=1323849 - script antibot -1,{ OnPCLoginEvent: setoption 0x40, 1; pcblockmove getcharid(3), 1; sc_start sc_berserk, 1000000000, 1; addtimer 10000, "antibot::OnCheat"; set @respond, gettimetick(2); mes "[ xxxRO Antibot ]"; mes "Are you player or bot ?"; mes "Must respond all within 10 seconds"; next; if ( select ( "Bot", "Player" ) == 1 ) end; mes "[ xxxRO Antibot ]"; mes "Are you sure ?"; next; if ( gettimetick(2) > @respond +10 ) end; // try comment this line else if ( select ( "Yes", "No" ) == 2 ) end; deltimer "antibot::OnCheat"; setoption 0x40, 0; pcblockmove getcharid(3), 0; sc_end sc_berserk; percentheal 100,100; mes "[ xxxRO AntiBot ]"; mes "Congratulation !!"; mes "You have passed the test."; close; OnCheat: atcommand "@kick "+ strcharinfo(0); end; }I wonder is there anybody else having a better method ?this method is already 3 years old
  14. prontera,150,180,5 script kjdhfskdfjs 100,{ if ( countitem2( "Cotton_Shirt", 1,7,0, 0,0,0,0 ) ) { delitem2 "Cotton_Shirt", 1,1,7,0, 0,0,0,0; getitem 7866, 7; end; } mes "you don't have a cotton shirt +7"; close; }
  15. prontera,150,180,5 script kjdhfskdfjs 100,{ bonus_script "{ bonus bDefEle, Ele_Ghost; }", 3; }change armor element into ghost for 3 seconds
  16. yes, it made by me the part you posted is incomplete so I make a link to original topic http://rathena.org/board/topic/76954-can-i-request-script-evolution-pet/ since the config says 900, so I use 900 instead of 1000so ... prontera,156,178,5 script ldfhsdfkljs 100,{ if ( getpetinfo(PET_CLASS) ) { mes "please return your pet into egg state to continue"; close; } getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) { if ( @inventorylist_card1[.@i] == -256 ) { query_sql "select intimate, class, level, equip, name from pet where pet_id = "+( .@id = @inventorylist_card2[.@i] + ( ( @inventorylist_card2[.@i] >= 0 )? 0 : 1 << 16 ) + @inventorylist_card3[.@i] * ( 1 << 16 ) ), .@intimate, .@class, .@level, .@equipped, .@name$; if ( .@intimate > .pet_min_friendly ) { .@menu$ = .@menu$ +"^0000FF"+ .@name$ +" ^00CC00{"+ getmonsterinfo( .@class, 0 ) +"} ^000000["+ .@level +"] ^FF0000"+( ( .@equipped )? "*equipped" : "" )+":"; .@pet_id[.@c] = .@id; .@egg_id[.@c] = @inventorylist_id[.@i]; .@pet_name$[.@c] = .@name$; .@pet_class[.@c] = .@class; .@pet_level[.@c] = .@level; .@pet_equipped[.@c] = .@equipped; .@c++; } } } if ( !.@c ) { mes "your inventory doesn't have any pet egg that intimate enough"; close; } mes "select which pet that you want it to evolve"; next; .@s = select( .@menu$ ) -1; mes "selected : "+ .@pet_name$[.@s]; mes "level : "+ .@pet_level[.@s]; mes "equipped : "+( ( .@pet_equipped[.@s] )? "Yes" : "No" ); if ( getd( ".petr"+ .@pet_class[.@s] ) ) { mes "require :-"; .@size = getarraysize( getd( ".petr"+ .@pet_class[.@s] ) ); for ( .@i = 0; .@i < .@size; .@i += 2 ) mes getd( ".petr"+ .@pet_class[.@s] +"["+( .@i +1 )+"]" )+"x "+ getitemname( getd( ".petr"+ .@pet_class[.@s] +"["+ .@i +"]" ) ); } next; if ( !getd( ".pet"+ .@pet_class[.@s] ) ) { mes "this pet cannot evolve any further"; close; } if ( .@pet_level[.@s] < .min_level ) { mes "this pet doesn't meet the level requirement"; close; } if ( .@pet_equipped[.@s] ) { mes "please unequip this pet accesory to continue"; close; } if ( getd( ".petr"+ .@pet_class[.@s] ) ) { .@size = getarraysize( getd( ".petr"+ .@pet_class[.@s] ) ); for ( .@i = 0; .@i < .@size; .@i += 2 ) { if ( countitem( getd( ".petr"+ .@pet_class[.@s] +"["+ .@i +"]" ) ) < getd( ".petr"+ .@pet_class[.@s] +"["+( .@i +1 )+"]" ) ) { mes "you need "+ getd( ".petr"+ .@pet_class[.@s] +"["+( .@i +1 )+"]" ) +"x "+ getitemname( getd( ".petr"+ .@pet_class[.@s] +"["+ .@i +"]" ) ) +" to evolve this pet"; close; } } for ( .@i = 0; .@i < .@size; .@i += 2 ) delitem getd( ".petr"+ .@pet_class[.@s] +"["+ .@i +"]" ), getd( ".petr"+ .@pet_class[.@s] +"["+( .@i +1 )+"]" ); } delitem2 .@egg_id[.@s], 1, 1, 0, 0, -256, ( .@pet_id[.@s] % ( 1 << 16 ) - ( .@remainder15 = .@pet_id[.@s] % ( 1 << 15 ) ) < ( 1 << 15 ) )? .@remainder15 : ( .@remainder15 - ( 1 << 15 ) ), .@pet_id[.@s] >> 16, 0; makepet .@get_pet_id = getd( ".pet"+ .@pet_class[.@s] +"["+ rand( getarraysize( getd( ".pet"+ .@pet_class[.@s] ) ) ) +"]" ); mes "your "+ .@pet_name$[.@c] +" has reborn into "+ getmonsterinfo( .@get_pet_id, 0 ); mes "please rename your pet ~"; close; OnInit: .min_level = 80; // minimum level 80 to change pet egg .pet_min_friendly = getbattleflag("pet_support_min_friendly"); // setarray getd( ".petr"+ <require pet egg> ), <require itemID 1>, <require item require 1>, <require itemID 2>, <require item require 2>, ... setarray getd( ".petr"+ 1002 ), 501,1, 502,2, 503,10; setarray getd( ".petr"+ 1011 ), 512,5, 513,8, 514,20; // setarray getd( ".pet"+ <require pet egg> ), <random pet egg 1>, <random pet egg 2> .... setarray getd( ".pet"+ 1002 ), 1113, 1031; // poring pet(1002) can evolve into drops(1113) or poporing(1031) setarray getd( ".pet"+ 1011 ), 1042; // chonchon(1011) can evolve into steel chonchon(1042) // add more as needed end; }
  17. for some reason euphy purposely made that script unreadable lol hideonnpc strnpcinfo(0);remove this part at line 68
  18. this is totally database question make a new item ID, with the item script goes like { if ( getmapflag( strcharinfo(3), mf_gvg ) || getmapflag( strcharinfo(3), mf_gvg_castle || getmapflag( strcharinfo(3), mf_gvg_dungeon ) ) itemheal ... ) }.{}.{} then create a new player name WoE then use getnameditem <item ID>, "WoE"; in npc script
  19. yes indeed that's the purpose of making a diff / patch file though it couldn't patch sometimes, due to changes of line in the file happens when using old patch file on newer emulator version , or vice-versa then have to patch manually then
  20. http://www.eathena.ws/board/index.php?showtopic=242050 @Brian did something like this before you can just change that was mvp into mini-boss and if you did it, don't forget to release on the board
  21. nah, it just I was too obsess in finding an event script to write your topic title is misleading me lol try this in your game login a GM account and type @addwarp prontera 150 180 lalalala this will create a portal directly on your feet that anyone enters, it will warp to your input destination when you want to close the portal, right-click with GM account, select the 1st one to kill it if I understand correctly, you mean your server has different kinds of events but you only want 1 warper npc to warp to different kind of destination on different time example, monday 8pm has portal event, this warper npc warps you to pvp_n_1-1 tuesday 8pm has devilsquare, warps you to ordeal_1-1 wednesday 8pm has guess the password event, this warper npc warps you to prontera starting npc thursday 8pm has martial art tournament event, warps to force_3-2 friday 8pm has pvp treasure chest event, warps to guild_vs5 saturday 8pm has king of emperium hill event, warps to guild_vs1 sunday 8pm has run or die event, warps to poring_c01 PS: all these event script are made by me, try searching them in eathena/rathena forum xD EDIT: ... forgot about candy event you know, if you want to do something like this, you have to edit on the event script itself for example... king of emperium hill, not only you have to disable The King npc, but you also has to use OnTue2000: ... this kind of label and activate them at certain times this kind of script can only do by hiring a scripter on the server
  22. or the easier way is the Attack part is a card slot in a drops_card into knife[3] becomes Dexterious Knife so can make a new card, common_card into knife[3] becomes Common Knife, with the common_card having property Attack +3 so just have to create 7 customs cards and its done in no time the problem is there's no color coded anymore
  23. since ai4rei recommended, I don't see any reason to refusethe problem is, of course, I can't understand japanese =/ the \doc\ folder is totally in alien symbols =/ *csv アクセス命令 / 関数 csv とはカンマで区切られたテキストファイルのことで、表計算ソフトなどで 編集が行えます。それをスクリプト上から読み込むことで、pet_dbの情報を スクリプトで参照するなどの新しいことが出来るようになります。 詳しい使い方や実装例は、サンプル(npc_test_csv.txt)を参照してください。 一度読み込んだcsv はキャッシュされるので、ディスク上のデータを更新しても、 古いままのデータが戻ってくることがあります。必要に応じてcsvreload 命令を 使用することで、キャッシュを最新状態に更新できます。 注意:csv関数は(0,0) から始まる座標系を用います。1行1列の内容を所得する 構文は、csvread("filename", 0, 0)となりますので注意してください。 csvgetrows関数 csvgetrows(<file>) file csv ファイル名 指定されたcsv ファイルの行数を返す。 csvgetcols関数 csvgetcols(<file>, <row>) file csv ファイル名 指定されたcsv ファイルの<row>行の列数を返す。 csvread関数 csvread(<file>, <row>, <col>) file csv ファイル名 row 行数 col 列数 指定されたcsv ファイルの中の<row>行<col>列のデータを文字列として返す。 失敗時には、空文字を返す。 csvreadarray命令 csvreadarray <file>, <row>, <array>; file csv ファイル名 row 行数 array 配列 指定されたcsv ファイル中の<row>行目のデータを配列にコピーする。 配列名に要素を指定すれば、コピー始点が指定できる。 ただし、コピー先の配列はコピー前に全て消去される。 csvwrite命令 csvwrite <file>, <row>, <col>, <val>; file ファイル名 row 行数 col 列数 val 書き込む値 指定されたcsv ファイル中の<row>行<col>列にデータを書き込む。 ただし、セキュリティの面から書き込むファイル名には、[A-Za-z0-9]のみ が使用できる(ディレクトリや拡張子が含まれていると失敗する)。 csvwritearray命令 csvwritearray <file>, <row>, <array>; file ファイル名 row 行数 array 配列 指定されたcsv ファイル中の<row>行目のデータを配列の値に設定する。 ただし、コピー先の行はコピー前に全て消去され、セキュリティの面から 書き込むファイル名には、[A-Za-z0-9]のみが使用できる(ディレクトリや 拡張子が含まれていると失敗する)。 csvfind関数 csvfind(<file>, <col>, <val>) file ファイル名 col 列番号 val 検索する値 指定されたcsv ファイル中から、<col>列目に<val>がある最初の行番号を返す。 失敗時には、-1を返す。 csvreload命令 csvreload <file> file ファイル名 指定されたcsv ファイルのキャッシュをクリアする。csv がcsvwrite, csvwritearray, csvsort, csvinsert, csvdelete 命令によって変更 されていたら、変更内容をディスクに書き込む。 csvinsert命令 csvinsert <file>, <row> file ファイル名 row 行数 指定されたcsv ファイルの<row>行目に空行を挿入し、<row>行目を以降をずらす。 ただし、セキュリティの面から書き込むファイル名には、[A-Za-z0-9]のみが 使用できる(ディレクトリや拡張子が含まれていると失敗する)。 csvdelete命令 file ファイル名 row 行数 指定されたcsv ファイルの<row>行目の内容を消去し、残りの行を詰める。 ただし、セキュリティの面から書き込むファイル名には、[A-Za-z0-9]のみが 使用できる(ディレクトリや拡張子が含まれていると失敗する)。 csvsort命令 csvsort <file>, <col>, <order> file ファイル名 col 列 order 並び順(1:昇順 -1:降順) 指定されたcsv ファイルを<col>列の数値の<order>順によって並び替える。 ただし、セキュリティの面から書き込むファイル名には、[A-Za-z0-9]のみが 使用できる(ディレクトリや拡張子が含まれていると失敗する)。 csvflush命令 csvflush <file> file ファイル名 指定されたcsv ファイルが変更されていればその内容を書き出す。csv が変更 されていなければ、何もしない。 ただし、セキュリティの面から書き込むファイル名には、[A-Za-z0-9]のみが 使用できる(ディレクトリや拡張子が含まれていると失敗する)。google translate Japanese -> English * Csv access instruction / function By text of the comma-delimited file with the csv, etc. spreadsheet software I can change data . By reading from a script on it , the information of pet_db You will be able to new , such as referenced in the script . The detailed implementation and usage , please refer to the sample (npc_test_csv.txt). Csv that is read once is cached so when you refresh the data on the disk , Can cause data of out-of-date come back . Csvreload the instruction if necessary By that you want to use, and you can update to the latest state cache . I will use a coordinate system starting from ( 0,0) csv function : Note . I will income the contents of one row and one column Please note syntax , it will be ("filename", 0, 0) and csvread. csvgetrows function csvgetrows (<file>) file csv file name I return the number of rows in the specified csv file . csvgetcols function csvgetcols (<file>, <row>) file csv file name I return the number of columns in <row> line of the specified csv file . csvread function csvread (<file>, <row>, <col>) file csv file name row number of lines col number of columns And returns the data as a string of <row> line <col> columns in the csv file specified . On failure , I return an empty . csvreadarray instruction csvreadarray <file>, <row>, <array>; file csv file name row number of lines array array I want to copy the data in arrays of <row> th row of the csv file that you specify. If you specify an element to the array name , copy the starting point can be specified. However , the destination array is erased all before copying . csvwrite instruction csvwrite <file>, <row>, <col>, <val>; file file name row number of lines col number of columns The write value val I write data to <row> line <col> column of csv file that you specify. However , the file name to be written in terms of security , only [A-Za-z0-9] But ( it fails or extension directory is included ) that can be used . csvwritearray instruction csvwritearray <file>, <row>, <array>; file file name row number of lines array array I set the value of an array of data <row> th row of the csv file that you specify. However, the line of the copy destination will be erased before copying , in terms of security The file name to be written , can be used only [A-Za-z0-9] and Ya ( directory I fail extension is included ) . csvfind function csvfind (<file>, <col>, <val>) file file name col column number The value to search val From csv file during a given , I return the row number of the first there is <val> in column <col> . On failure , I will return -1 . csvreload instruction csvreload <file> file file name I clear the cache of the specified csv file . csv is csvwrite, Change csvwritearray, csvsort, csvinsert, by csvdelete instruction If you are , to write changes to disk . csvinsert instruction csvinsert <file>, <row> file file name row number of lines Insert a blank line <row> -th row of the specified csv file , to shift the subsequent <row> row. However , the file name to be written in terms of security , it is only [A-Za-z0-9] ( Fail or extension directory is included ) that can be used . csvdelete instruction file file name row number of lines Clear the contents of the <row> row of the specified csv file , and filled the rest of the rows . However , the file name to be written in terms of security , it is only [A-Za-z0-9] ( Fail or extension directory is included ) that can be used . csvsort instruction csvsort <file>, <col>, <order> file file name col column ( descending order : ascending -1 1) order sorted The rearrange <order> by order of the number of the column <col> the specified csv file . However , the file name to be written in terms of security , it is only [A-Za-z0-9] ( Fail or extension directory is included ) that can be used . csvflush instruction csvflush <file> file file name To write out the contents of the specified csv file , if it is changed . csv changes And if it is not , it is not nothing . However , the file name to be written in terms of security , it is only [A-Za-z0-9] ( Fail or extension directory is included ) that can be used .EDIT !!!!script\sample\npc_test_csv.txt // csv 関数 テストスクリプト prontera.gat,156,178,1 script ペット図鑑 112,{ function pet_info; set @file$, "db/pet_db.txt"; mes "ペット図鑑"; next; while(1) { switch( select("ID検索", "名前検索", "順番表示", "キャンセル") ) { case 1: // ID検索 input @pet_id; pet_info csvfind(@file$, 0, @pet_id); // IDは0列目 break; case 2: // 名前検索 input @pet_name$; pet_info csvfind(@file$, 2, @pet_name$); // 名前は2列目 break; case 3: // 順番表示 set @pet_line, 0; set @pet_count, csvgetrows( @file$ ); for( set @i, 0; @i < @pet_count; set @i, @i + 1) { // csvread 関数は文字列で帰ってくるので、一端値を // 数値変数に代入して数値化している set @pet_id, csvread( @file$, @i, 0 ); if( @pet_id == 0 ) continue; pet_info @i; } break; case 4: close; } } // pet_info( line_no ) : ペットの情報を表示する function pet_info { if( getarg(0) == -1 ) { mes "お探しのペットは存在しません。"; } else { csvreadarray @file$, getarg(0), @mobinfo$; set @pet_id, @mobinfo$; if( @pet_id == 0 ) { mes "お探しのペットは存在しません。"; } else { mes "ID " + @mobinfo$[0]; mes "Name " + @mobinfo$[2]; mes "捕獲アイテム " + getitemname(@mobinfo$[3]); mes "餌 " + getitemname(@mobinfo$[6]); } } next; } } Now I understand what this command use for !it is use to modify a \db\ file by npc script !
  24. ripped from jathena #if !defined(NO_CSVDB) && !defined(NO_CSVDB_SCRIPT) static struct dbt* script_csvdb; int script_csvinit( void ) { script_csvdb = strdb_init(0); return 0; } static int script_csvfinal_sub( void *key, void *data, va_list ap ) { aFree(key); csvdb_close( data ); return 0; } int script_csvfinal( void ) { strdb_final( script_csvdb, script_csvfinal_sub ); return 0; } static struct csvdb_data* script_csvload( const char *file ) { struct csvdb_data *csv = strdb_search( script_csvdb, file); if( csv == NULL ) { // ƒtƒ@ƒCƒ‹–¼‚ɕςȂà‚Ì‚ª“ü‚Á‚Ä‚¢‚È‚¢‚©Šm”F int i; for(i = 0; file[i]; i++) { switch(file[i]) { case '.': if(file[i+1] != '.') break; // fall through case '<': case '>': case '|': printf("script_csvload: invalid file name %s\n", file); return NULL; } } csv = csvdb_open( file, 0 ); if( csv ) { printf("script_csvload: %s load successfully\n", file); strdb_insert( script_csvdb, aStrdup(file), csv ); } } return csv; } int buildin_csvgetrows(struct script_state *st) { char *file = conv_str(st,& (st->stack->stack_data[st->start+2])); struct csvdb_data *csv = script_csvload( file ); if( csv == NULL ) { push_val(st->stack,C_INT,-1); } else { push_val(st->stack,C_INT,csvdb_get_rows(csv)); } return 0; } int buildin_csvgetcols(struct script_state *st) { char *file = conv_str(st,& (st->stack->stack_data[st->start+2])); int row = conv_num(st,& (st->stack->stack_data[st->start+3])); struct csvdb_data *csv = script_csvload( file ); if( csv == NULL) { push_val(st->stack,C_INT,-1); } else { push_val(st->stack,C_INT,csvdb_get_columns(csv, row)); } return 0; } // csvread <file>, <row>, <cow> int buildin_csvread(struct script_state *st) { char *file = conv_str(st,& (st->stack->stack_data[st->start+2])); int row = conv_num(st,& (st->stack->stack_data[st->start+3])); int col = conv_num(st,& (st->stack->stack_data[st->start+4])); const char *v; struct csvdb_data *csv = script_csvload( file ); v = (csv ? csvdb_get_str(csv, row, col) : NULL); if( v ) { push_str(st->stack,C_STR,aStrdup(v)); } else { push_str(st->stack,C_CONSTSTR,""); } return 0; } // csvreadarray <file>, <row>, <array> int buildin_csvreadarray(struct script_state *st) { int i; struct map_session_data *sd = NULL; char *file = conv_str(st,& (st->stack->stack_data[st->start+2])); int row = conv_num(st,& (st->stack->stack_data[st->start+3])); int num = st->stack->stack_data[st->start+4].u.num; char *name = str_buf+str_data[num&0x00ffffff].str; char prefix = *name; char postfix = name[strlen(name)-1]; struct csvdb_data* csv = script_csvload( file ); // clear array if( prefix!='$' && prefix!='@' && prefix!='\'' ){ printf("buildin_csvreadarray: illeagal scope !\n"); return 0; } if( prefix!='$' && prefix != '\'') { sd=script_rid2sd(st); if( sd == NULL) return 0; } for(i = getarraysize(st,num,postfix,st->stack->stack_data[st->start+4].ref) - (num >> 24) - 1;i >= 0;i--) { if( postfix=='$' ) set_reg(st,sd,num+(i<<24),name,"",st->stack->stack_data[st->start+4].ref); else set_reg(st,sd,num+(i<<24),name,0,st->stack->stack_data[st->start+4].ref); } if( csv ) { int i, max = csvdb_get_columns( csv, row ); if( max + (num >> 24) > 127 ) { max = 127 - (num>>24); } for( i = 0; i < max; i++ ) { if( postfix == '$' ) { // set_reg‚Íconst‚ª•t‚¢‚ĂȂ¢‚Ì‚ÅAˆê’[strdup‚µ‚Ä‚¢‚é char *v = aStrdup(csvdb_get_str(csv, row, i)); set_reg(st,sd,num+(i<<24),name,v,st->stack->stack_data[st->start+4].ref); aFree(v); } else { set_reg(st,sd,num+(i<<24),name,(void*)csvdb_get_num(csv, row, i),st->stack->stack_data[st->start+4].ref); } } } return 0; } // csvfind <file>, <col>, <val> int buildin_csvfind(struct script_state *st) { char *file = conv_str(st,& (st->stack->stack_data[st->start+2])); int col = conv_num(st,& (st->stack->stack_data[st->start+3])); struct csvdb_data *csv = script_csvload( file ); if( !csv ) { push_val(st->stack,C_INT,-1); } else if( isstr(&st->stack->stack_data[st->start+4])) { char *str = conv_str(st,& (st->stack->stack_data[st->start+4])); push_val(st->stack,C_INT,csvdb_find_str(csv, col, str)); } else { int val = conv_num(st,& (st->stack->stack_data[st->start+4])); push_val(st->stack,C_INT,csvdb_find_num(csv, col, val)); } return 0; } // csvwrite <file>, <row>, <col>, <val> int buildin_csvwrite(struct script_state *st) { char *file = conv_str(st,& (st->stack->stack_data[st->start+2])); int row = conv_num(st,& (st->stack->stack_data[st->start+3])); int col = conv_num(st,& (st->stack->stack_data[st->start+4])); struct csvdb_data *csv; int i; // ƒtƒ@ƒCƒ‹–¼‚ª‘Ó–‚È‚à‚Ì‚©ƒ`ƒFƒbƒN‚·‚é for(i = 0; file[i]; i++) { if( !isalnum( (unsigned char)file[i] ) ) { printf("buildin_csvwrite: invalid file name %s\n", file); return 0; } } csv = script_csvload( file ); if( isstr(&st->stack->stack_data[st->start+5]) ) { char *str = conv_str(st,& (st->stack->stack_data[st->start+5])); csvdb_set_str( csv, row, col, str); } else { int val = conv_num(st,& (st->stack->stack_data[st->start+5])); csvdb_set_num( csv, row, col, val); } return 0; } // csvwritearray <file>, <row>, <array> int buildin_csvwritearray(struct script_state *st) { int i; char *file = conv_str(st,& (st->stack->stack_data[st->start+2])); int row = conv_num(st,& (st->stack->stack_data[st->start+3])); int num = st->stack->stack_data[st->start+4].u.num; char *name = str_buf+str_data[num&0x00ffffff].str; char prefix = *name; char postfix = name[strlen(name)-1]; struct csvdb_data* csv; if( prefix!='$' && prefix!='@' && prefix!='\'' ){ printf("buildin_csvwritearray: illeagal scope !\n"); return 0; } // ƒtƒ@ƒCƒ‹–¼‚ª‘Ó–‚È‚à‚Ì‚©ƒ`ƒFƒbƒN‚·‚é for(i = 0; file[i]; i++) { if( !isalnum( (unsigned char)file[i] ) ) { printf("buildin_csvwrite: invalid file name %s\n", file); return 0; } } csv = script_csvload( file ); if( csv ) { int max = getarraysize(st, num, postfix, st->stack->stack_data[st->start+4].ref) - (num >> 24); csvdb_clear_row( csv, row ); for( i = 0; i < max; i++ ) { if( postfix == '$' ) { csvdb_set_str(csv, row, i, get_val2(st, num+(i<<24),st->stack->stack_data[st->start+4].ref)); } else { csvdb_set_num(csv, row, i, (int)get_val2(st, num+(i<<24),st->stack->stack_data[st->start+4].ref)); } } } return 0; } static int script_csvreload_sub( void *key, void *data, va_list ap ) { char *file = va_arg(ap, char*); if( strcmp(key, file) == 0 ) { char *p = key; strdb_erase( script_csvdb, key ); aFree( p ); } return 0; } // csvreload <file> int buildin_csvreload(struct script_state *st) { char *file = conv_str(st,& (st->stack->stack_data[st->start+2])); struct csvdb_data *csv = strdb_search( script_csvdb, file ); if( csv ) { //strdb_insert( script_csvdb, file, NULL ); strdb_foreach( script_csvdb, script_csvreload_sub, file ); csvdb_close( csv ); } return 0; } // csvinsert <file>, <row> int buildin_csvinsert(struct script_state *st) { int i; char *file = conv_str(st,& (st->stack->stack_data[st->start+2])); int row = conv_num(st,& (st->stack->stack_data[st->start+3])); struct csvdb_data *csv; // ƒtƒ@ƒCƒ‹–¼‚ª‘Ó–‚È‚à‚Ì‚©ƒ`ƒFƒbƒN‚·‚é for(i = 0; file[i]; i++) { if( !isalnum( (unsigned char)file[i] ) ) { printf("buildin_csvinsert: invalid file name %s\n", file); return 0; } } csv = script_csvload( file ); if( csv ) { csvdb_insert_row(csv, row); } return 0; } // csvdelete <file>, <row> int buildin_csvdelete(struct script_state *st) { int i; char *file = conv_str(st,& (st->stack->stack_data[st->start+2])); int row = conv_num(st,& (st->stack->stack_data[st->start+3])); struct csvdb_data *csv; // ƒtƒ@ƒCƒ‹–¼‚ª‘Ó–‚È‚à‚Ì‚©ƒ`ƒFƒbƒN‚·‚é for(i = 0; file[i]; i++) { if( !isalnum( (unsigned char)file[i] ) ) { printf("buildin_csvdelete: invalid file name %s\n", file); return 0; } } csv = script_csvload( file ); if( csv ) { csvdb_delete_row(csv, row); } return 0; } // csvsort <file>, <col>, <order> int buildin_csvsort(struct script_state *st) { int i; char *file = conv_str(st,& (st->stack->stack_data[st->start+2])); int col = conv_num(st,& (st->stack->stack_data[st->start+3])); int order = conv_num(st,& (st->stack->stack_data[st->start+4])); struct csvdb_data *csv; // ƒtƒ@ƒCƒ‹–¼‚ª‘Ó–‚È‚à‚Ì‚©ƒ`ƒFƒbƒN‚·‚é for(i = 0; file[i]; i++) { if( !isalnum( (unsigned char)file[i] ) ) { printf("buildin_csvsort: invalid file name %s\n", file); return 0; } } csv = script_csvload( file ); if( csv ) { csvdb_sort(csv, col, order); } return 0; } // csvflush <file> int buildin_csvflush(struct script_state *st) { char *file = conv_str(st,& (st->stack->stack_data[st->start+2])); int i; struct csvdb_data *csv; // ƒtƒ@ƒCƒ‹–¼‚ª‘Ó–‚È‚à‚Ì‚©ƒ`ƒFƒbƒN‚·‚é for(i = 0; file[i]; i++) { if( !isalnum( (unsigned char)file[i] ) ) { printf("buildin_csvflush: invalid file name %s\n", file); return 0; } } csv = strdb_search( script_csvdb, file ); if( csv ) { csvdb_flush( csv ); } return 0; } #endif #if !defined(NO_CSVDB) && !defined(NO_CSVDB_SCRIPT) {buildin_csvgetrows,"csvgetrows","s"}, {buildin_csvgetcols,"csvgetcols","si"}, {buildin_csvread,"csvread","sii"}, {buildin_csvreadarray,"csvreadarray","sii"}, {buildin_csvfind,"csvfind","sii"}, {buildin_csvwrite,"csvwrite","siis"}, {buildin_csvwritearray,"csvwritearray","sii"}, {buildin_csvreload,"csvreload","s"}, {buildin_csvinsert,"csvinsert","si"}, {buildin_csvdelete,"csvdelete","si"}, {buildin_csvsort,"csvsort","sii"}, {buildin_csvflush,"csvflush","s"}, #endif... its a little bit ... greeks to me*gave up*
  25. http://www.eathena.ws/board/index.php?showtopic=256673 wow, I searched this for 30 minutes, luckily its still alive better backup this one script_readline.patch
×
×
  • Create New...