-
Posts
303 -
Joined
-
Days Won
12
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Posts posted by n0tttt
-
-
mapmoblist
static int count_mob(struct block_list *bl, va_list ap) // [FE] { struct mob_data *md = (struct mob_data*)bl; short id = va_arg(ap, short); if (md->class_ == id) return 1; return 0; } ACMD_FUNC(mapmoblist) // [FE] { char temp[100]; bool mob_searched[MAX_MOB_DB]; bool mob_mvp[MAX_MOB_DB]; // Store mvp data.. struct s_mapiterator* it; unsigned short count = 0, i, mapindex = 0; int m = 0; memset(mob_searched, 0, MAX_MOB_DB); memset(mob_mvp, 0, MAX_MOB_DB); if (message && *message) { // Player input map name, search mob list for that map mapindex = mapindex_name2id(message); if (!mapindex) { clif_displaymessage(fd, "Map not found"); return -1; } m = map_mapindex2mapid(mapindex); } else { // Player doesn't input map name, search mob list in player current map mapindex = sd->mapindex; m = sd->bl.m; } clif_displaymessage(fd, "--------Monster List--------"); sprintf(temp, "Mapname: %s", mapindex_id2name(mapindex)); clif_displaymessage(fd, temp); clif_displaymessage(fd, "Monsters: "); //Looping and search for mobs it = mapit_geteachmob(); while (true) { TBL_MOB* md = (TBL_MOB*)mapit_next(it); if (md == NULL) break; if (md->bl.m != m || md->status.hp <= 0) continue; if (mob_searched[md->mob_id] == true) continue; // Already found, skip it if (mob_db(md->mob_id)->mexp) { mob_searched[md->mob_id] = true; mob_mvp[md->mob_id] = true; // Save id for later continue; // It's MVP! } mob_searched[md->mob_id] = true; count = map_foreachinmap(count_mob, m, BL_MOB, md->class_); sprintf(temp, " %s[%d] : %d", mob_db(md->mob_id)->jname, md->mob_id, count); clif_displaymessage(fd, temp); } mapit_free(it); clif_displaymessage(fd, "MVP: "); // Looping again and search for mvp, not sure if this is the best way.. for (i = 1000; i < MAX_MOB_DB; i++) { //First monster start at 1001 (Scorpion) if (mob_mvp[i] == true) { count = map_foreachinmap(count_mob, m, BL_MOB, i); sprintf(temp, " %s[%d] : %d", mob_db(i)->jname, i, count); clif_displaymessage(fd, temp); } } return 0; }
Hope it works.
- 1
-
Yeah, the script isn't coded like that. Based on the names, it was made with wings in mind. It would require a bigger change to make it do that. But does it work right for your needs now, or do you really need that feature?
-
I don't understand very well.
conf/log_athena.conf:
// Track Zeny Changes // Filter settings // 0 - don't log; 1 - log any zeny changes; 2.....1000000 - minimal absolute logging zeny value log_zeny: 0
Is this what you want?
This is how the table works:
-- -- Table structure for table `zenylog` -- # ZenyLog types # (M)onsters # (T)rade # (V)ending Sell/Buy # (S)hop Sell/Buy # (N)PC Change amount # (A)dministrators # (E)Mail # (B)uying Store # Ban(K) Transactions CREATE TABLE IF NOT EXISTS `zenylog` ( `id` int(11) NOT NULL auto_increment, `time` datetime NOT NULL, `char_id` int(11) NOT NULL default '0', `src_id` int(11) NOT NULL default '0', `type` enum('T','V','P','M','S','N','D','C','A','E','I','B','K') NOT NULL default 'S', `amount` int(11) NOT NULL default '0', `map` varchar(11) NOT NULL default '', PRIMARY KEY (`id`), INDEX (`type`) ) ENGINE=MyISAM AUTO_INCREMENT=1;
I don't know if you want a npc shop with OnSellItem or something, but in case you want that kind of shop and it doesn't work, you can use something like this:
prontera,150,150,4 script Seller 100,{ callshop "shop_seller",2; end; OnSellItem: for(.@size = getarraysize(@sold_nameid);.@i < .@size;.@i++) { if(@sold_nameid[.@i] == 969) { .@amt = @sold_amount[.@i]; .@zeny = 100000*.@amt; Zeny += .@zeny; delitem 969,.@amt; //query_logsql "INSERT INTO `zenylog` (`time`, `char_id`, `src_id`, `type`, `amount`, `map`) VALUES (NOW(), '"+getcharid(0)+"'", '"+getcharid(3)+"'", 'S', '"+escape_sql(strcharinfo(3))+"')"; end; } } end; OnInit: npcshopattach "shop_seller"; end; } - shop shop_seller -1,512:1
Hope it works... if you want to use another table, tell me, because as I said, I didn't understand very well.
-
Nice script. Wouldn't you mind a little bit of editing? I don't even know if this will work or not, but I added a few setunitdatas
// https://rathena.org/board/topic/114033-battleground-multiplayer-whith-evilclone/ function script F_ShuffleNumbers { deletearray getarg(2); .@static = getarg(0); .@range = getarg(1) +1 - .@static; .@count = getarg(3, .@range); if (.@range <= 0 || .@count <= 0) return 0; if (.@count > .@range) .@count = .@range; for (.@i = 0; .@i < .@range; ++.@i) .@temparray[.@i] = .@i; for (.@i = 0; .@i < .@count; ++.@i) { .@rand = rand(.@range); set getelementofarray( getarg(2), .@i ), .@temparray[.@rand] + .@static; .@temparray[.@rand] = .@temparray[--.@range]; } return .@count; } prontera,155,185,5 script bg_pvp_clone 1_F_MARIA,{ .minplayer2start = 1; // 1vs1 mes "bg_pvp_clone"; if ( .start == true ) { mes "bg_pvp_clone is on-going"; close; } while ( .aid[.@i] != getcharid(3) && .@i < .size ) ++.@i; if ( .@i < .size ) { mes "You already join the queue."; close; } select "join"; mes "you have to stick to this map"; close2; .aid[ .size++ ] = getcharid(3); for ( .@i = 0; .@i < .size; ++.@i ) { if ( !isloggedin( .aid[.@i] ) ) { deletearray .aid[.@i], 1; --.@i; --.size; } else { attachrid .aid[.@i]; if ( strcharinfo(3) != strnpcinfo(4) ) { deletearray .aid[.@i], 1; --.@i; --.size; } } } detachrid; if ( .size < .minplayer2start *2 ) { announce .size +" players join", bc_npc | bc_area; end; } .start = true; .red = bg_create( "bat_c01",53,128, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead" ); .blue = bg_create( "bat_c01",146,56, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead" ); callfunc "F_ShuffleNumbers", 0, .size -1, .@r; for ( .@i = 0; .@i < .size; ++.@i ) { attachrid .aid[ .@r[.@i] ]; bg_join ( .@i % 2 )? .red : .blue; } detachrid; deletearray .aid; .size = 0; bg_warp .red, "bat_c03", 53,128; bg_warp .blue, "bat_c03", 146,56; for ( .@i = 0; .@i < 20; ++.@i ) { if (.@i % 10 == 0) .@size = bg_get_data( ((.@i < 10) ? .red : .blue), 1 ); .@player = $@arenamembers[rand(.@size)]; .@mob = bg_monster( ((.@i < 10) ? .red : .blue), "bat_c03", 0,0, "--ja--", rand(1799,1804), strnpcinfo(0)+"::On"+((.@i < 10) ? "Red" : "Blue")+"CloneKill" ); setunitdata .@mob,UMOB_SEX,readparam( Sex, .@player); setunitdata .@mob,UMOB_CLASS,readparam( Class, .@player); setunitdata .@mob,UMOB_HAIRSTYLE,getlook( LOOK_HAIR, .@player); setunitdata .@mob,UMOB_HAIRCOLOR,getlook( LOOK_HAIR_COLOR, .@player); setunitdata .@mob,UMOB_HEADBOTTOM,getlook( LOOK_HEAD_BOTTOM, .@player); setunitdata .@mob,UMOB_HEADMIDDLE,getlook( LOOK_HEAD_MID, .@player); setunitdata .@mob,UMOB_HEADTOP,getlook( LOOK_HEAD_TOP, .@player); setunitdata .@mob,UMOB_CLOTHCOLOR,getlook( LOOK_CLOTHES_COLOR, .@player); setunitdata .@mob,UMOB_SHIELD,getlook( LOOK_SHIELD, .@player); setunitdata .@mob,UMOB_WEAPON,getlook( LOOK_WEAPON, .@player); } sleep 10000; // Match Duration if ( .winside == .red || .redscore > .bluescore ) { mapannounce "bat_c03", "- Red side Won the match !", bc_map; callsub L_reward, .red; } else if ( .winside == .blue || .bluescore > .redscore ) { mapannounce "bat_c03", "- Blue side Won the match !", bc_map; callsub L_reward, .blue; } else mapannounce "bat_c03", "Battle end as a draw", bc_map; bg_destroy .red; bg_destroy .blue; mapwarp "bat_c03", "prontera",150,185; .redscore = .bluescore = .start = false; bg_updatescore "bat_c03", 0, 0; end; L_reward: bg_get_data getarg(0), 1; for ( .@i = 0; .@i < $@arenamemberscount; ++.@i ) getitem 501,1, $@arenamembers[.@i]; return; OnRedCloneKill: callsub L_CloneKill, .red, .blue, .bluescore, rand(1799,1804), "::OnRedCloneKill"; OnBlueCloneKill: callsub L_CloneKill, .blue, .red, .redscore, rand(1659,1663), "::OnBlueCloneKill"; L_CloneKill: .@mob = bg_monster( getarg(0), "bat_c03", 0,0, "--ja--", getarg(3), strnpcinfo(0) + getarg(4) ); .@size = bg_get_data( getarg(0), 1 ); .@player = $@arenamembers[rand(.@size)]; setunitdata .@mob,UMOB_SEX,readparam( Sex, .@player); setunitdata .@mob,UMOB_CLASS,readparam( Class, .@player); setunitdata .@mob,UMOB_HAIRSTYLE,getlook( LOOK_HAIR, .@player); setunitdata .@mob,UMOB_HAIRCOLOR,getlook( LOOK_HAIR_COLOR, .@player); setunitdata .@mob,UMOB_HEADBOTTOM,getlook( LOOK_HEAD_BOTTOM, .@player); setunitdata .@mob,UMOB_HEADMIDDLE,getlook( LOOK_HEAD_MID, .@player); setunitdata .@mob,UMOB_HEADTOP,getlook( LOOK_HEAD_TOP, .@player); setunitdata .@mob,UMOB_CLOTHCOLOR,getlook( LOOK_CLOTHES_COLOR, .@player); setunitdata .@mob,UMOB_SHIELD,getlook( LOOK_SHIELD, .@player); setunitdata .@mob,UMOB_WEAPON,getlook( LOOK_WEAPON, .@player); set getarg(2), getarg(2) +1; // killing clones add 1 point if ( .redscore < 100 && .bluescore < 100 ) bg_updatescore "bat_c03", .redscore, .bluescore; if ( getarg(2) == 100 ) { .winside = getarg(1); awake strnpcinfo(0); } end; OnRedQuit: callsub L_Quit, .red, .blue, "Red"; OnBlueQuit: callsub L_Quit, .blue, .red, "Blue"; L_Quit: if ( bg_get_data( getarg(0), 0 ) ) end; mapannounce "bat_c03", "All "+ getarg(2) +" team members has Quit!", bc_map; .winside = getarg(1); awake strnpcinfo(0); end; OnRedDead: callsub L_Dead, .red, .blue, .bluescore; OnBlueDead: callsub L_Dead, .blue, .red, .redscore; L_Dead: set getarg(2), getarg(2) +3; // killing players add 3 points if ( .redscore < 100 && .bluescore < 100 ) bg_updatescore "bat_c03", .redscore, .bluescore; if ( getarg(2) == 100 ) { .winside = getarg(1); awake strnpcinfo(0); } sleep2 1250; percentheal 100,100; end; } bat_c03 mapflag battleground 2 bat_c03 mapflag nosave SavePoint bat_c03 mapflag nowarp bat_c03 mapflag nowarpto bat_c03 mapflag noteleport bat_c03 mapflag nomemo bat_c03 mapflag nopenalty bat_c03 mapflag nobranch bat_c03 mapflag noicewall
EDIT: Ups, I didn't see that edit.
- 1
-
Hope it works.
//===== rAthena Script ======================================= //= Healer //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.1 //===== Compatible With: ===================================== //= rAthena Project //===== Description: ========================================= //= Basic healer script. //===== Additional Comments: ================================= //= 1.0 Initial script. //= 1.1 Aligned coordinates with @go. //============================================================ - script Healer -1,{ .@Delay = 0; // Heal delay, in seconds setarray .@Item[0], 7539, 10; if ( $healer_rent <= gettimetick(2) && countitem(.@Item[0]) >= .@Item[1]) { message strcharinfo(0), "Do you want to rent this NPC? Price: "+.@Item[1]+" "+getitemname(.@Item[0])+"."; if ( select("No:Yes") == 2 ) { if (countitem(.@Item[0]) >= .@Item[1]) { delitem .@Item[0], .@Item[1]; $healer_zeny = 0; $healer_price = 0; $healer_rent = gettimetick(2) + 7 * 24 * 60 * 60; $healer_id = getcharid(3); } } } else if ( $healer_rent > gettimetick(2) && getcharid(3) == $healer_id ) { message strcharinfo(0),"Rent time left: "+Time2Str($healer_rent)+"."; message strcharinfo(0),"Zeny avaiaible: "+F_InsertComma($healer_zeny)+"."; switch(select("Continue:Set cost:"+(($healer_zeny)? "Withdraw zeny" : ""))) { case 2: input $healer_price; break; case 3: if($healer_zeny) { message strcharinfo(0), F_InsertComma($healer_zeny)+" received."; Zeny += $healer_zeny; $healer_zeny = 0; } else { message strcharinfo(0),"There isn't any zeny."; } break; } } if(countitem(.@Item[0])) { message strcharinfo(0),"Currency: "+getitemname(.@Item[0])+"."; for(.@i = 1;.item_amt[.@i] > 0;.@i++) { .@start = .index[.@i - 1]; if(!(#healer_unlock & 1 << (.@i - 1))) .@menu$+= "Unlock "+.buff_name$[.@i]+" ("+.item_amt[.@i]+")"; .@menu$+= ":"; } .@buff = select(.@menu$); if(countitem(.@Item[0] >= .item_amt[.@buff]) { #healer_unlock^= (1 << (.@buff - 1)) } if (@HD > gettimetick(2)) end; if ($healer_price) { message strcharinfo(0), "Healing costs " + F_InsertComma($healer_price) + " Zeny."; if (Zeny < $healer_price) end; if (select("^0055FFHeal^000000:^777777Cancel^000000") == 2) end; if(Zeny < $healer_price) end; Zeny -= $healer_price; $healer_zeny += $healer_price; } specialeffect2 EF_HEAL2; percentheal 100,100; if(#healer_unlock) { for(.@i = 1;.item_amt[.@i] > 0;.@i++) { if(#healer_unlock & (1 << (.@i - 1))) { .@start = .buff_index[.@i - 1]; .@end = .buff_index[.@i]; for(.@i = .@start;.@i <= .@end;.@i++) sc_start .buff_id[.@i],240000,.buff_lv[.@i]; } } } if (.@Delay) @HD = gettimetick(2) + .@Delay; end; OnInit: .@id$ = strnpcinfo(2); if(.@id$ != "") { // add_buff(<item amount>,"name",<buff>,<lvl>{,<buff>,<lvl>}); add_buff(1,"Agi and Blessing",SC_INCREASEAGI,10,SC_BLESSING,10); //add_buff(2,...); .buff_id = 0; .total_buffs = 0; } end; function add_buff { .buff_name$[++.buff_id] = getarg(1); .item_amt[.buff_id] = getarg(0); .@args = getargcount(); for(.@i = 2;.@i < .@args;.@i+= 2) { .buff_id[.@i + .total_buffs - 2] = getarg(.@i); .buff_lv[.@i + .total_buffs - 2] = getarg(.@i + 1); } .total_buffs+= ((.@i/2) - 1); .buff_index[.buff_id] = .total_buffs; } } // Duplicates //============================================================ alberta,25,240,6 duplicate(Healer) Healer#alb 909 aldebaran,135,118,6 duplicate(Healer) Healer#alde 909 amatsu,200,79,4 duplicate(Healer) Healer#ama 909 ayothaya,207,169,6 duplicate(Healer) Healer#ayo 909 comodo,184,158,6 duplicate(Healer) Healer#com 909 einbech,57,36,6 duplicate(Healer) Healer#einbe 909 einbroch,57,202,6 duplicate(Healer) Healer#einbr 909 geffen,115,72,6 duplicate(Healer) Healer#gef 909 gonryun,156,122,6 duplicate(Healer) Healer#gon 909 hugel,89,150,6 duplicate(Healer) Healer#hug 909 izlude,121,150,6 duplicate(Healer) Healer#izl 909 //Pre-RE: (125,118) jawaii,250,139,4 duplicate(Healer) Healer#jaw 909 lighthalzen,152,100,6 duplicate(Healer) Healer#lhz 909 louyang,226,103,4 duplicate(Healer) Healer#lou 909 manuk,272,144,6 duplicate(Healer) Healer#man 909 mid_camp,203,289,6 duplicate(Healer) Healer#mid 909 moc_ruins,72,164,4 duplicate(Healer) Healer#moc 909 morocc,153,97,6 duplicate(Healer) Healer#mor 909 moscovia,220,191,4 duplicate(Healer) Healer#mos 909 niflheim,212,182,5 duplicate(Healer) Healer#nif 909 payon,179,106,4 duplicate(Healer) Healer#pay 909 prontera,162,193,4 duplicate(Healer) Healer#prt 909 rachel,125,116,6 duplicate(Healer) Healer#rac 909 splendide,201,153,4 duplicate(Healer) Healer#spl 909 thor_camp,249,74,4 duplicate(Healer) Healer#thor 909 umbala,105,148,3 duplicate(Healer) Healer#umb 909 veins,217,121,4 duplicate(Healer) Healer#ve 909 xmas,143,136,4 duplicate(Healer) Healer#xmas 909 yuno,164,45,4 duplicate(Healer) Healer#yuno 909 // Duplicates (Renewal) //============================================================ brasilis,194,221,6 duplicate(Healer) Healer#bra 909 dewata,195,187,4 duplicate(Healer) Healer#dew 909 dicastes01,201,194,4 duplicate(Healer) Healer#dic 909 ecl_in01,45,60,4 duplicate(Healer) Healer#ecl 909 malangdo,132,114,6 duplicate(Healer) Healer#mal 909 malaya,227,204,6 duplicate(Healer) Healer#ma 909 mora,55,152,4 duplicate(Healer) Healer#mora 909
- 1
-
I recommend to fuse this with another OnPCKillEvent to avoid having a large event queue.
- script Anti_FreeKill -1,{ OnPCKillEvent: if(@last_kill == killedrid) { if(++@last_killamt >= 29) { atcommand "@jailfor 1h "+strcharinfo(0); announce strcharinfo(0)+" has been cheating with "+rid2name(@last_kill)+".",bc_all; @last_killamt = 0; @last_kill = 0; end; } } else { @last_killamt = 0; } @last_kill = killedrid; end; OnPCDieEvent: @last_killamt = 0; end; }
- 1
-
First of all, did you try the last NEMO version? https://gitlab.com/4144/Nemo/-/archive/master/Nemo-master.zip
You can check which clients it can work on: http://nemo.herc.ws/patches/IncreaseViewID/
- 1
-
I have a script which I haven't released because... more than 1 year without test server. I hope it works, though. Tell me how it goes. It also has commands.
- script Login_Config -1,{ OnInit: // Names of channels to show. setarray .channel_name$[0],"Global","Support","Trading"; // Channels names to join. setarray .channel$[0],"global","support","trade"; // Commands. setarray .command$[0],"autoloot","noask","noks","showdelay","showexp","showzeny"; bindatcmd "channels", "Login_Config::OnChannels"; bindatcmd "loginconf","Login_Config::OnConfig"; end; OnChannels: .@n$ = "^3227cd[Channel Manager]^000000"; mes .@n$; mes "Here you can change which channels you'll join when you log in."; mes "Remember the configuration is shared between all your characters."; .@size = getarraysize(.channel$); next; do { .@menu$ = ""; for(.@i = 0;.@i < .@size;.@i++) { if(#config & (1 << .@i)) .@menu$+= "^539c36["+.channel_name$[.@i]+"]^000000:"; else .@menu$+= "^b6101b["+.channel_name$[.@i]+"]^000000:"; } .@s = select("Finish.",.@menu$) - 1; if(.@s) #config^= (1 << (.@s - 1)); } while(.@s); close; OnConfig: .@n$ = "^3227cd[Login Manager]^000000"; mes .@n$; mes "Here you can change your login config."; mes "Remember the configuration is shared between all your characters."; .@size = getarraysize(.command$); .@offset = getarrayzize(.channel$) - 1; next; do { .@menu$ = ""; for(.@i = 0;.@i < .@size;.@i++) { if(#config & (1 << (.@i + .@offset + 1))) .@menu$+= "^539c36@"+.command$[.@i]+" "+((.command$[.@i] == "autoloot")? "("+((#rate_at)? #rate_at : 100)+"%)" : "")+".^000000:"; else .@menu$+= "^b6101b@"+.command$[.@i]+".^000000:"; } .@s = select("Finish.",.@menu$) - 1; if(.command$[.@s - 1] == "autoloot" && !(#config & (1 << (.@s + .@offset)))) { input .@n; if(.@n && .@n < 100) #rate_at = .@n; else if(!.@n) continue; } else if(.command$[.@s - 1] == "autoloot") { #rate_at = 0; } if(.@s) #config^= (1 << (.@s + .@offset)); } while(.@s); close; OnPCLoginEvent: if(#config) { .@size1 = getarraysize(.channel$); .@size2 = getarraysize(.command$) + .@size1; for(;.@i < .@size2;.@i++) { if(#config & (1 << .@i)) { if(.@i < .@size1) atcommand "@join #"+.channel$[.@i]; else atcommand "@"+.command$[.@i - .@size1]+" "+((.command$[.@i - .@size1] == "autoloot" && #rate_at)? #rate_at+"" : ""); } } } end; }
- 1
-
If the item is not really "repeatable", then you can look it by the id in the inarray. If it is, then we have to create an extra array with the EQP_* constants found in script_constants.hpp with the slots.
- script Extra_ItemConf -1,{ function add_item; OnInit: /* add_item(id, evolution mode, monster id, amount, id...); If you want any monster, use 111. Evolution modes: 1 = Every X numer of mobs (1%). 2 = Experience (1%). */ /* Adaga */ add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga /* 1HSword */ add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H /* 2HSword */ add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H /* 2HAxe */ add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H /* Maces */ add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H /* Arcos */ add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos /* Cajados */ add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados /* 1HSpear */ add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200); /* 2HSpear */ add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100); /* Knuckles */ add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100); /* Violin */ add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150); /* Whip */ add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100); /* Katar */ add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100); /* Debug */ add_item(2301, 1, 111, 1, 2302, 1, 111, 2); /* 0 = Won't be evolved automatically. 1 = Will be evolved automatically */ .auto = 1; /* Color of the announces. */ setarray .c$[0],"ffffff", // % of evolution. "03fd20", // Wings evolving. "11f4cc"; // Wings evolved. /* slots to check. EQI_ACC_L (0) - Accessory 1 EQI_ACC_R (1) - Accessory 2 EQI_SHOES (2) - Footgear (shoes, boots) EQI_GARMENT (3) - Garment (mufflers, hoods, manteaux) EQI_HEAD_LOW (4) - Lower Headgear (beards, some masks) EQI_HEAD_MID (5) - Middle Headgear (masks, glasses) EQI_HEAD_TOP (6) - Upper Headgear EQI_ARMOR (7) - Armor (jackets, robes) EQI_HAND_L (8) - Left hand (weapons, shields) EQI_HAND_R (9) - Right hand (weapons) EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear EQI_COSTUME_GARMENT (13) - Costume Garment EQI_AMMO (14) - Arrow/Ammunition EQI_SHADOW_ARMOR (15) - Shadow Armor EQI_SHADOW_WEAPON (16) - Shadow Weapon EQI_SHADOW_SHIELD (17) - Shadow Shield EQI_SHADOW_SHOES (18) - Shadow Shoes EQI_SHADOW_ACC_R (19) - Shadow Accessory 2 EQI_SHADOW_ACC_L (20) - Shadow Accessory 1 */ setarray .slots[0], /*EQI_HAND_R,*/ EQI_HAND_L, EQI_ARMOR, EQI_SHOES, EQI_GARMENT; //============================================= end; OnNPCKillEvent: if(!@evolving) { // Cache. That old loop on every mob killed... if(@evo_var[0] && isequipped(@evo_var[0])) { .@has_item = true; .@item_id = @evo_var[0]; .@i = @evo_var[1] - 1; .@j = @evo_var[2] - 1; .@slot = @evo_var[3]; .@mob_id = getd(".it_mob_"+.@i+"_"+.@j); if(killedrid != .@mob_id && .@mob_id > 1001) end; } else { .@size = getarraysize(.slots); while(.@slot < .@size && !.@has_item) { .@item_id = getequipid(.slots[.@slot]); .@slot++; if(.@item_id < 0) continue; .@i = 0; while(.@i < .w1 && !.@has_item) { .@j = 0; while(.@j < .w2[.@i] && !.@has_item) { .@item_evo = getd(".it_id_"+.@i+"_"+.@j); if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) { .@mob_id = getd(".it_mob_"+.@i+"_"+.@j); if(killedrid == .@mob_id || .@mob_id < 1001) { .@has_item = true; setarray @evo_var[0],.@item_id,.@i + 1,.@j + 1,.@slot; } } else if(.@item_id == .@item_evo) { end; } if(!.@has_item) .@j++; } if(!.@has_item) .@i++; } } } if(.@has_item) { if(getd(".it_mode_"+.@i+"_"+.@j) == 1) { .@amount = getd("mobs_"+.@item_id) + 1; setd "mobs_"+.@item_id,.@amount; if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end; setd "mobs_"+.@item_id,0; } else if(getd(".it_mode_"+.@i+"_"+.@j) == 2) { .@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid); setd "exp_"+.@item_id,.@amount; if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end; setd "exp_"+.@item_id,0; } else { debugmes "Script Items_Evo, error: wrong mode."; end; } specialeffect2 EF_BEGINSPELL6; sleep2 rand(190,280); specialeffect2 EF_ENERGYDRAIN3; .@percent = getd("evo_"+.@item_id); if(.@percent < 100) { setd "evo_"+.@item_id,++.@percent; announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0]; } if(.@percent >= 100 && .auto && !@evolving) { @evolving = true; specialeffect2 EF_GUMGANG3; sleep2 500; specialeffect2 EF_BASH3D2; sleep2 300; specialeffect2 EF_BLUEBODY; sleep2 300; announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1]; .@k = 3; while(.@k--) { specialeffect2 EF_DOUBLECASTBODY; sleep2 900; } specialeffect2 EF_STORMKICK5; sleep2 200; specialeffect2 EF_BUBBLE_DROP; sleep2 500; getinventorylist; .@k = inarray(@inventorylist_id,.@item_id); if(.@k != -1) { if(!@inventorylist_expire[.@k]) { setarray .@iteminfo,@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k]; setarray .@roid,@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k]; setarray .@val,@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k]; setarray .@par,@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k]; .@bound = @inventorylist_bound[.@k]; } else { @evolving = false; } if(@evolving) { .@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1)); if(getarraysize(.@val)){ delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par; if(.@bound) getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par; else getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par; } else { delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5]; if(.@bound) getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account; else getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5]; } equip .@evo_item; setd "evo_"+.@item_id,0; deletearray @evo_var; announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2]; @evolving = false; } } } } } end; function add_item { for(.@args = getargcount();.@i < .@args;.@i+= 4) { .@j = .w2[.w1]++; setd ".it_id_"+.w1+"_"+.@j,getarg(.@i); // id. if(getarg(.@i + 4,0) != 0) { setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1); // mode. setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2); // mob id. setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3); // amount. } } .w1++; } }
Sometimes weird characters appear when you edit something. IDK why.
-
It's because the script uses .@i for indexing which wing, and you added a loop which also uses .@i
I changed the loop to use inarray and kept the rest like you did (just erased the other bits because they were confusing me).
Tell me how it goes.
- script Extra_ItemConf -1,{ function add_item; OnInit: /* add_item(id, evolution mode, monster id, amount, id...); If you want any monster, use 111. Evolution modes: 1 = Every X numer of mobs (1%). 2 = Experience (1%). */ /* Adaga */ add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga /* 1HSword */ add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H /* 2HSword */ add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H /* 2HAxe */ add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H /* Maces */ add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H /* Arcos */ add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos /* Cajados */ add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados /* 1HSpear */ add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200); /* 2HSpear */ add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100); /* Knuckles */ add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100); /* Violin */ add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150); /* Whip */ add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100); /* Katar */ add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100); /* Debug */ add_item(2301, 1, 111, 1, 2302, 1, 111, 2); /* 0 = Won't be evolved automatically. 1 = Will be evolved automatically */ .auto = 1; /* Color of the announces. */ setarray .c$[0],"ffffff", // % of evolution. "03fd20", // Wings evolving. "11f4cc"; // Wings evolved. /* slots to check. EQI_ACC_L (0) - Accessory 1 EQI_ACC_R (1) - Accessory 2 EQI_SHOES (2) - Footgear (shoes, boots) EQI_GARMENT (3) - Garment (mufflers, hoods, manteaux) EQI_HEAD_LOW (4) - Lower Headgear (beards, some masks) EQI_HEAD_MID (5) - Middle Headgear (masks, glasses) EQI_HEAD_TOP (6) - Upper Headgear EQI_ARMOR (7) - Armor (jackets, robes) EQI_HAND_L (8) - Left hand (weapons, shields) EQI_HAND_R (9) - Right hand (weapons) EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear EQI_COSTUME_GARMENT (13) - Costume Garment EQI_AMMO (14) - Arrow/Ammunition EQI_SHADOW_ARMOR (15) - Shadow Armor EQI_SHADOW_WEAPON (16) - Shadow Weapon EQI_SHADOW_SHIELD (17) - Shadow Shield EQI_SHADOW_SHOES (18) - Shadow Shoes EQI_SHADOW_ACC_R (19) - Shadow Accessory 2 EQI_SHADOW_ACC_L (20) - Shadow Accessory 1 */ setarray .slots[0], /*EQI_HAND_R,*/ EQI_HAND_L, EQI_ARMOR, EQI_SHOES, EQI_GARMENT; //============================================= end; OnNPCKillEvent: if(!@evolving) { // Cache. That old loop on every mob killed... if(@evo_var[0] && isequipped(@evo_var[0])) { .@has_item = true; .@item_id = @evo_var[0]; .@i = @evo_var[1] - 1; .@j = @evo_var[2] - 1; .@slot = @evo_var[3]; .@mob_id = getd(".it_mob_"+.@i+"_"+.@j); if(killedrid != .@mob_id && .@mob_id > 1001) end; } else { .@size = getarraysize(.slots); while(.@slot < .@size && !.@has_item) { .@item_id = getequipid(.slots[.@slot]); .@slot++; if(.@item_id < 0) continue; .@i = 0; while(.@i < .w1 && !.@has_item) { .@j = 0; while(.@j < .w2[.@i] && !.@has_item) { .@item_evo = getd(".it_id_"+.@i+"_"+.@j); if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) { .@mob_id = getd(".it_mob_"+.@i+"_"+.@j); if(killedrid == .@mob_id || .@mob_id < 1001) { .@has_item = true; setarray @evo_var[0],.@item_id,.@i + 1,.@j + 1,.@slot; } } else if(.@item_id == .@item_evo) { end; } if(!.@has_item) .@j++; } if(!.@has_item) .@i++; } } } if(.@has_item) { if(getd(".it_mode_"+.@i+"_"+.@j) == 1) { .@amount = getd("mobs_"+.@item_id) + 1; setd "mobs_"+.@item_id,.@amount; if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end; setd "mobs_"+.@item_id,0; } else if(getd(".it_mode_"+.@i+"_"+.@j) == 2) { .@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid); setd "exp_"+.@item_id,.@amount; if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end; setd "exp_"+.@item_id,0; } else { debugmes "Script Items_Evo, error: wrong mode."; end; } specialeffect2 EF_BEGINSPELL6; sleep2 rand(190,280); specialeffect2 EF_ENERGYDRAIN3; .@percent = getd("evo_"+.@item_id); if(.@percent < 100) { setd "evo_"+.@item_id,++.@percent; announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0]; } if(.@percent >= 100 && .auto && !@evolving) { @evolving = true; specialeffect2 EF_GUMGANG3; sleep2 500; specialeffect2 EF_BASH3D2; sleep2 300; specialeffect2 EF_BLUEBODY; sleep2 300; announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1]; .@k = 3; while(.@k--) { specialeffect2 EF_DOUBLECASTBODY; sleep2 900; } specialeffect2 EF_STORMKICK5; sleep2 200; specialeffect2 EF_BUBBLE_DROP; sleep2 500; .@slot--; .@part = .slots[.@slot]; getinventorylist; .@k = inarray(@inventorylist_equip,.@part); if(.@k == -1) end; if(!@inventorylist_expire[.@k]){ setarray .@iteminfo,@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k]; setarray .@roid,@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k]; setarray .@val,@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k]; setarray .@par,@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k]; .@bound = @inventorylist_bound[.@k]; } else { end; } .@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1)); if(getarraysize(.@val)){ delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par; if(.@bound) getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par; else getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par; } else { delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5]; if(.@bound) getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account; else getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5]; } equip .@evo_item; setd "evo_"+.@item_id,0; deletearray @evo_var; announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2]; @evolving = false; } } } end; function add_item { for(.@args = getargcount();.@i < .@args;.@i+= 4) { .@j = .w2[.w1]++; setd ".it_id_"+.w1+"_"+.@j,getarg(.@i); // id. if(getarg(.@i + 4,0) != 0) { setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1); // mode. setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2); // mob id. setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3); // amount. } } .w1++; } }
-
Change it to:
.@amount = getd("mobs_"+.@item_id) + 1;
Sorry.
-
It's a recent command: https://github.com/rathena/rathena/commit/78edf851a00d61dbf3a6668c6f21f1dd1cbb6c45
Thank you for testing my script. It's a shame the two methods you tested didn't work.
The only way I can think now is by using sc_start, but it would overlap with other buffs...
- script bonus_party -1,{ OnPCStatCalcEvent: .@item_id = 1201; .@pid = getcharid(1); .@oid = getcharid(3); if(isequipped(.@item_id) && .@pid) { .@is_leader = is_party_leader(); getpartymember .@pid,1,.@party_cid; getpartymember .@pid,2,.@party_aid; .@size = $@partymembercount; for(;.@i < .@size;.@i++) { if(isloggedin(.@party_aid[.@i],.@party_cid[.@i])) { .@n++; if(.@is_leader && .@party_aid[.@i] != .@oid) { if(attachrid(.@party_aid[.@i])) { .@time = getstatus(SC_INCALLSTATUS,5); if(.@time <= 10000) { sc_start SC_INCALLSTATUS,60000,max(1,getstatus(SC_INCALLSTATUS,1) + !@party_bonus); if(!.@time) @party_bonus = true; } } } } } attachrid .@oid; //sc_start SC_INCSTR,60000,.@n; bonus bStr,.@n; } end; }
Edit: just did a little change (idk if it works) in case the player already had that buff, the script will sum +1 to avoid overwriting. Hope it works (can't test, I don't have a test server).
-
setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; for( set .@i,1; .@i <= 10; set .@i,.@i+1 ) { if( getequipisequiped(.@indices[.@i]) ) set .@menu$, .@menu$ + F_getpositionname(.@indices[.@i]) + " - [ " + getequipname(.@indices[.@i]) + " ]"; set .@menu$, .@menu$ + ":"; } set .@part, .@indices[ select(.@menu$) ]; if(!getequipisequiped(.@part)) { mes "[ ^04B4AEIsaac^000000 ]"; mes "Young one... Your not wearing anything there that I can remove cards from."; end; } set .@cardcount,getequipcardcnt(.@part); if(.@cardcount == 0) { mes "[ ^04B4AEIsaac^000000 ]"; mes "Young one... There are no cards compounded on this item. I can do nothing with it, I'm afraid."; end; } if (!checkweight(1202,(.@cardcount+1))) { mes "^3355FFJust a minute!"; mes "I can't offer any of my"; mes "services to you because"; mes "you're carrying too much"; mes "stuff. Put your extra items in"; mes "Kafra Storage and come again~"; end; } countbound; .@size = getarraysize(@bound_items); .@item = getquipid(.@part); for(.@i = 0;.@i< .@size;.@i++) { if(@bound_items[.@i] == .@item) { mes "This item is bounded."; close; } }
- 1
-
How didn't I see this post...
Anyways here's a fixed version of the script I made on a PM. I edited it because it looks better and more readable this way.
- script Items_Conf -1,{ function add_item; OnInit: /* add_item(id, evolution mode, monster id, amount, id...); If you want any monster, use 111. Evolution modes: 1 = Every X numer of mobs (1%). 2 = Experience (1%). */ /* Adaga */ add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga /* 1HSword */ add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H /* 2HSword */ add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H /* 2HAxe */ add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H /* Maces */ add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H /* Arcos */ add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos /* Cajados */ add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados /* 1HSpear */ add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200); /* 2HSpear */ add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100); /* Knuckles */ add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100); /* Violin */ add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150); /* Whip */ add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100); /* Katar */ add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100); /* Debug */ /* 0 = Won't be evolved automatically. 1 = Will be evolved automatically */ .auto = 1; /* Color of the announces. */ setarray .c$[0],"09e2f9", // % of evolution. "d43438", // Wings evolving. "e2f909"; // Wings evolved. /* slots to check. EQI_ACC_L (0) - Accessory 1 EQI_ACC_R (1) - Accessory 2 EQI_SHOES (2) - Footgear (shoes, boots) EQI_GARMENT (3) - Garment (mufflers, hoods, manteaux) EQI_HEAD_LOW (4) - Lower Headgear (beards, some masks) EQI_HEAD_MID (5) - Middle Headgear (masks, glasses) EQI_HEAD_TOP (6) - Upper Headgear EQI_ARMOR (7) - Armor (jackets, robes) EQI_HAND_L (8) - Left hand (weapons, shields) EQI_HAND_R (9) - Right hand (weapons) EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear EQI_COSTUME_GARMENT (13) - Costume Garment EQI_AMMO (14) - Arrow/Ammunition EQI_SHADOW_ARMOR (15) - Shadow Armor EQI_SHADOW_WEAPON (16) - Shadow Weapon EQI_SHADOW_SHIELD (17) - Shadow Shield EQI_SHADOW_SHOES (18) - Shadow Shoes EQI_SHADOW_ACC_R (19) - Shadow Accessory 2 EQI_SHADOW_ACC_L (20) - Shadow Accessory 1 */ setarray .slots[0], EQI_HAND_R, EQI_HAND_L; //============================================= end; OnNPCKillEvent: if(!@evolving) { // Cache. That old loop on every mob killed... if(@evo_var[0] && isequipped(@evo_var[0])) { .@has_item = true; .@item_id = @evo_var[0]; .@i = @evo_var[1] - 1; .@j = @evo_var[2] - 1; .@slot = @evo_var[3]; .@mob_id = getd(".it_mob_"+.@i+"_"+.@j); if(killedrid != .@mob_id && .@mob_id > 1001) end; } else { .@size = getarraysize(.slots); while(.@slot < .@size && !.@has_item) { .@item_id = getequipid(.slots[.@slot]); .@slot++; if(.@item_id < 0) continue; .@i = 0; while(.@i < .w1 && !.@has_item) { .@j = 0; while(.@j < .w2[.@i] && !.@has_item) { .@item_evo = getd(".it_id_"+.@i+"_"+.@j); if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) { .@mob_id = getd(".it_mob_"+.@i+"_"+.@j); if(killedrid == .@mob_id || .@mob_id < 1001) { .@has_item = true; setarray @evo_var[0],.@item_id,.@i + 1,.@j + 1,.@slot; } } else if(.@item_id == .@item_evo) { end; } if(!.@has_item) .@j++; } if(!.@has_item) .@i++; } } } if(.@has_item) { if(getd(".it_mode_"+.@i+"_"+.@j) == 1) { .@amount = ++getd("mobs_"+.@item_id); setd "mobs_"+.@item_id,.@amount; if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end; setd "mobs_"+.@item_id,0; } else if(getd(".it_mode_"+.@i+"_"+.@j) == 2) { .@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid); setd "exp_"+.@item_id,.@amount; if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end; setd "exp_"+.@item_id,0; } else { debugmes "Script Items_Evo, error: wrong mode."; end; } specialeffect2 EF_BEGINSPELL6; sleep2 rand(190,280); specialeffect2 EF_ENERGYDRAIN3; .@percent = getd("evo_"+.@item_id); if(.@percent < 100) { setd "evo_"+.@item_id,++.@percent; announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0]; } if(.@percent >= 100 && .auto && !@evolving) { @evolving = true; specialeffect2 EF_GUMGANG3; sleep2 500; specialeffect2 EF_BASH3D2; sleep2 300; specialeffect2 EF_BLUEBODY; sleep2 300; announce getitemname(.@item_id)+" is evolving...",bc_self,"0x"+.c$[1]; .@k = 3; while(.@k--) { specialeffect2 EF_DOUBLECASTBODY; sleep2 900; } specialeffect2 EF_STORMKICK5; sleep2 200; specialeffect2 EF_BUBBLE_DROP; sleep2 500; .@slot--; setarray .@card[1],getequipcardid(.slots[.@slot],0),getequipcardid(.slots[.@slot],1),getequipcardid(.slots[.@slot],2),getequipcardid(.slots[.@slot],3); .@refine = getequiprefinerycnt(.slots[.@slot]); if(getiteminfo(.@item_id,2) == IT_WEAPON) { for(.@k = 0;.@k < 5;.@k++) { .@option_id[.@k] = getequiprandomoption(.slots[.@slot],.@k,ROA_ID); .@option_val[.@k] = getequiprandomoption(.slots[.@slot],.@k,ROA_VAL); if(!.@has_option && .@option_val[.@k])) .@has_option = true; } } .@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1)); delequip .slots[.@slot]; if(.@has_option) getitembound3 .@evo_item,1,true,.@refine,false,.@card[1],.@card[2],.@card[3],.@card[4],Bound_Char,.@option_id,.@option_val,0; else getitembound2 .@evo_item,1,true,.@refine,false,.@card[1],.@card[2],.@card[3],.@card[4],Bound_Char; equip .@evo_item; setd "evo_"+.@item_id,0; deletearray @evo_var; announce "Congratulations, your "+getitemname(.@item_id)+" has evolved to "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2]; @evolving = false; } } } end; function add_item { for(.@args = getargcount();.@i < .@args;.@i+= 4) { .@j = .w2[.w1]++; setd ".it_id_"+.w1+"_"+.@j,getarg(.@i); // id. if(getarg(.@i + 4,0) != 0) { setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1); // mode. setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2); // mob id. setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3); // amount. } } .w1++; } }
Based on ||chris|| snippet, since I don't really know about the random options system.
-
Yeah, I updated the script but the update hasn't been aproved yet. Sorry!
-
//===== Hercules Script ====================================== //= Wheel of Fortune //===== By =================================================== //= Habilis //= Edited by Myriad //===== Version ============================================== //= 1.02 - June 15, 2018 // - Made the script work with zeny, to be more accesibly to everyone. //= 1.01 - June 14, 2018 // - Added @wheel_of_fortune GM command (level 98+). // - Merged S_Pay and S_Loop subs into main line of text. // - S_Gamble is now S_Spin and it will 'return' instead of // calling back to the initial sub. //= 1.00 - June 13, 2018 // - Initial script edit for Habilis. //===== Description ========================================== //= Wheel of fortune something. //============================================================ prontera,164,169,1 script Wheel of Fortune#Main 2_SLOT_MACHINE,{ OnTalk: if (!countitem(7517) && #freewheelfortunespin < 0) { mes("[^0055FFLucky Spin^000000]", .EventName$); mes("You are out of Gold Coins"); mes("and have no more"); mes("free spins. Come back"); mes("next time for more!"); close(); } .@mes$ = (#freewheelfortunespin > 0) ? sprintf(", but you, my friend, have %d free spin%s!", #freewheelfortunespin, (#freewheelfortunespin == 1) ? "" : "s") : "."; addtimer(1, sprintf("%s::OnEnd", strnpcinfo(NPC_NAME))); mes("[^0055FFLucky Spin^000000]", .EventName$); mes("Do you want to spin the wheel?"); mes("It costs ^FF00001 Gold Coin^000000 to play", .@mes$); next(); while (true) { if (!countitem(7517) && #freewheelfortunespin < 0) callsub(S_End); switch (select( (#freewheelfortunespin > 0) ? sprintf("Yes! Use free spin! (%d left)", #freewheelfortunespin) : "", (countitem(7517)) ? "Yes!. (costs 1 gold coin)" : "", "No (Leave)" )) { // pay with free spin case 1: if (#freewheelfortunespin > 0) { if ((#freewheelfortunespin -= 1) < 0) #freewheelfortunespin = 0; callsub(S_Spin); } else callsub(S_End); break; // Pay with zeny case 2: if (countitem(7517)) { delitem 7517,1; callsub(S_Spin); } else { cutin("aca_salim02", 2); mes("[^0055FFLucky Spin^000000]", .EventName$); mes("Awww, you don't have enough to gamble..."); mes(" "); mes("Have you ever heard?"); mes("'Money isn't all that matters' Got it?"); mes("Byeeeeeeeeeeeeee ;)"); callsub(S_End); } break; default: callsub(S_End); } } // Wheel spin animation S_Spin: .@Sector = rand(.Sector_Range[0], .Sector_Range[1]); .@Display = .@Sector * 2 - 1; .@Speed = .Spin_Speed; for (.@i = 0; .@i < .nbTurns; .@i++) { .@b = .Cutin_Range[0]; while (.@b <= .Cutin_Range[1]) { cutin(sprintf("%s%d", .Cutin$, .@b), 4); sleep2(.@Speed); .@b++; .@Speed += 1; // not ++, because you may want to adjust the stopping +1 +2 +3 } } .@b = .Cutin_Range[0]; while (.@b < .@Display) { cutin(sprintf("%s%d", .Cutin$, .@b), 4); sleep2(.@Speed); .@b++; } cutin(sprintf("%s%d", .Cutin$, .@b), 4); if (.Prize_ID[.@Sector] == -1) { // Free spin if (.Sound_Effects) soundeffect("wheel_jackpot.wav", 0); announce(sprintf("[%s] : Wow, %dx more Free spins!!!", .EventName$, .Prize_Qty[.@Sector]), bc_blue | bc_self); #freewheelfortunespin = #freewheelfortunespin == 0 ? .Prize_Qty[.@Sector] : #freewheelfortunespin + .Prize_Qty[.@Sector]; } else if (.Prize_ID[.@Sector] == 0) { // Nothing if (.Sound_Effects) soundeffect("wheel_lost.wav", 0); announce(sprintf("[%s] : Awwww, no luck in your gamble, more luck in love...", .EventName$), bc_blue | bc_self); } else { // Item if (.Sound_Effects) soundeffect("wheel_won.wav", 0); announce(sprintf("[%s] : %dx %s - enjoy your prize!", .EventName$, .Prize_Qty[.@Sector], getitemname(.Prize_ID[.@Sector])), bc_blue | bc_self); getitem(.Prize_ID[.@Sector], .Prize_Qty[.@Sector]); } sleep2(1000); if (!countitem(7517) && #freewheelfortunespin < 0) { mes("[^0055FFLucky Spin^000000]", .EventName$); mes("You are out of Gold Coins"); mes("and have no more"); mes("free spins. Come back"); mes("next time for more!"); close(); } return; S_End: close2(); OnEnd: cutin("", 255); end; OnInit: .EventName$ = "Wheel Of Fortune"; bindatcmd("wheel_of_fortune", "Wheel_of_Fortune::OnCommand", 98,false); .Spin_Speed = 50; // What is the base spin speed? (ms) .nbTurns = 2; // How many times the arrow makes a complete turn, before entering the stopping routine .Sound_Effects = true; // Enable sound effects? (true/false) // You must have a total of 10 prizes. DO NOT remove 0 or -1 from the array and do not // change their order. setarray(.Prize_ID[1], -1, 7539, 14345, 7539, 617, 607, 7539, 604, 0, 12214); setarray(.Prize_Qty[1], 2, 3, 1, 1, 3, 3, 1, 3, 0, 1); // Don't touch below .Cutin$ = "WheelOfFortune_"; setarray(.Sector_Range, 1, 10); // Sector range setarray(.Cutin_Range, 0, 19); // Cutin range end; }
-
//******* Guild Manager by Vhan48********** //******* Please Keep my Credits********* //********Thank you******************* prontera,135,195,4 script Guild Manager 884,{ mes "[Guild Manager]"; if(!getcharid(2) && BaseLevel >= 99 && JobLevel >= 70) { mes "Hi "+ strcharinfo ( 0 ) +" I'm the guild manager, I can help you organize a guild for a fee"; next; mes "[Guild Manager]"; mes "Do you want to avail my service?"; switch(select("Yes!:I'll think about it.")) { case 1: mes "[Guild Manager]"; mes "Okay,you will need the following items:"; next; mes "Caveiras (7420) x50"; next; mes "[Guild Manager]"; mes "Are you sure you to gather it all?"; next; if(select("Yes","No")==1) { if(countitem(7420)<50) { mes "[Guild Manager]"; mes "Sorry,You haven't completed the requirements yet, please come back after completing it."; close; } mes "[Guild Manager]"; mes "Seems like , it's a piece of cake for you?"; delitem 7420,50; next; mes "[Guild Manager]"; mes "Please Enter the name of the Guild that you want to be organized:"; next; input .@name$; next; mes "[Guild Manager]"; mes "Congratulations. You have now created your own guild!."; close2; atcommand "@guild "+.@name$; atcommand "@guild +49"; announce " Guild Master "+ strcharinfo ( 0 ) +" has established the "+.@name$+" Guild! Make your members proud!.",0; end; } break; case 2: mes "[Guild Manager]"; mes "Ok, decide carefully"; close; } } else { mes "Hi "+ strcharinfo ( 0 ) +" . You must not be in a guild and should be base level 99 and job level 70 to avail my services."; } close; }
I didn't put in the all skills since guilds get lvl 50, and if I put guildskill commands there'll be skillpoints impossible to waste (since there isn't a guildskillpointcount param as far as I know).
-
There's no "Mp". You have to use SP instead.
// https://rathena.org/board/topic/81757-full-buffs-npc/?do=findComment&comment=194862 - script Buffer -1,{ if( @delay_buff ) end; if ( rid2name(getcharid(3)) == "TestDummy" ) { .@buff_time = INFINITE_TICK; } else { .@buff_time = 600000 * 4; } skilleffect 384,0; sc_start SC_MELTDOWN,.@buff_time,5; skilleffect 383,0; sc_start SC_WINDWALK,.@buff_time,5; skilleffect 378,0; sc_start SC_EDP,.@buff_time,5; skilleffect 465,0; sc_start SC_KAITE,.@buff_time,7; skilleffect 464,0; sc_start SC_KAUPE,.@buff_time,3; skilleffect 462,0; sc_start SC_KAIZEL,.@buff_time,7; skilleffect 8,0; sc_start SC_ENDURE,.@buff_time,10; skilleffect 33,0; sc_start SC_ANGELUS,.@buff_time,10; skilleffect 45,0; sc_start SC_CONCENTRATE,.@buff_time,10; skilleffect 74,0; sc_start SC_MAGNIFICAT,.@buff_time,5; skilleffect 75,0; sc_start SC_GLORIA,.@buff_time,5; skilleffect 459,0; sc_start SC_ADRENALINE2,.@buff_time,1; skilleffect 66,0; sc_start SC_IMPOSITIO,.@buff_time,5; skilleffect 67,0; sc_start SC_SUFFRAGIUM,.@buff_time,3; skilleffect 34,0; sc_start SC_BLESSING,.@buff_time,10; skilleffect 29,0; sc_start SC_INCREASEAGI,.@buff_time,10; skilleffect 112,0; sc_start SC_WEAPONPERFECTION,.@buff_time,10; skilleffect 114,0; sc_start SC_MAXIMIZEPOWER,.@buff_time,5; skilleffect 357,0; sc_start SC_CONCENTRATION,.@buff_time,5; skilleffect 355,0; sc_start SC_AURABLADE,.@buff_time,5; skilleffect 155,0; sc_start SC_LOUD,.@buff_time,1; sc_start SC_ASPDPOTION2,.@buff_time,0; sc_start SC_STRFood,.@buff_time,30; sc_start SC_AGIFood,.@buff_time,30; sc_start SC_VITFood,.@buff_time,30; sc_start SC_INTFood,.@buff_time,30; sc_start SC_DEXFood,.@buff_time,30; sc_start SC_LUKFood,.@buff_time,30; sc_start SC_HitFood,.@buff_time,30; sc_start SC_FleeFood,.@buff_time,30; sc_start SC_BATKFood,.@buff_time,30; sc_start SC_MATKFood,.@buff_time,30; skilleffect 380,0; sc_start SC_TRUESIGHT,.@buff_time,5; skilleffect 361,0; sc_start SC_ASSUMPTIO,.@buff_time,5; if ( class == Job_Kagerou || class == Job_Oboro ) { skilleffect 3022,0; sc_start SC_IZAYOI,.@buff_time,5; } switch ( basejob ) { case Job_Alchemist: set .@spirit, 445; break; case Job_Monk: set .@spirit, 447; break; case Job_Star_Gladiator: set .@spirit, 448; break; case Job_Sage: set .@spirit, 449; break; case Job_Crusader: set .@spirit, 450; break; case Job_SuperNovice: set .@spirit, 451; break; case Job_Knight: set .@spirit, 452; break; case Job_Wizard: set .@spirit, 453; break; case Job_Priest: set .@spirit, 454; break; case Job_Bard: case Job_Dancer: set .@spirit, 455; break; case Job_Rogue: set .@spirit, 456; break; case Job_Assassin: set .@spirit, 457; break; case Job_Blacksmith: set .@spirit, 458; break; case Job_Hunter: set .@spirit, 460; break; case Job_Soul_Linker: set .@spirit, 461; break; default: if ( upper == 1 && baselevel < 70 ) { set .@spirit, 494; } } if ( .@spirit ) { sc_start4 sc_spirit, .@buff_time, 5, .@spirit,0,0; skilleffect .@spirit, 5; } percentheal 100,100; if (Hp % 2 == 1) { heal -1,0; } if (Sp % 2 == 1) { heal 0,-1; } skilleffect 3026,0; sc_start SC_ZANGETSU,.@buff_time,5; percentheal 100,100; @delay_buff++; sleep2 2000; @delay_buff = 0; end; } prontera,147,174,6 duplicate(Buffer) Buffer#prt 758 e_tower,82,108,3 duplicate(Buffer) Buffer#wtower 758
-
data/luafiles514/lua files/signboardlist.lub
I think you have to let it like this:
IT_NONE = 0 IT_BMP = 1 IT_SPRITE = 2 IT_SIGNBOARD = 3 SignBoardList = { }
-
It uses "@menu" var to call one of the two shops. This is why case 1 and 2 are the same.
discount flag is just for Merchant Discount skill.
<edit>
-
prontera,150,150,4, script Shop 100,{ mes "Hello player!"; mes "Would you like to buy with Cash or Items?"; switch(select("Cash","Currency","Exit")) { case 1: case 2: callshop "shop"+@menu,1; case 3: close; } } - shop1 cashshop 1234,100,1525,110 - shop2 itemshop 7720,1,1234,20,1525,25
-
You could use the one which comes with rAthena, setting different shops for different requirements.
This is an example:
//===== rAthena Script ======================================= //= Euphy's Quest Shop //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.6c //===== Compatible With: ===================================== //= rAthena Project //===== Description: ========================================= //= A dynamic quest shop based on Lunar's, with easier config. //= Includes support for multiple shops & cashpoints. //= Item Preview script by ToastOfDoom. //===== Additional Comments: ================================= //= 1.0 Initial script. //= 1.2 Added category support. //= 1.3 More options and fixes. //= 1.4 Added debug settings. //= 1.5 Replaced categories with shop IDs. //= 1.6 Added support for purchasing stackables. //= 1.6a Added support for previewing costumes and robes. //= 1.6b Added 'disable_items' command. //= 1.6c Replaced function 'A_An' with "F_InsertArticle". //============================================================ // Shop NPCs -- supplying no argument displays entire menu. // callfunc "qshop"{,<shop ID>{,<shop ID>{,...}}}; // ADD YOUR NPC HERE //============================================================ prontera,164,203,6 script Quest Shop#1 998,{ callfunc "qshop"; } // prontera,165,203,6 script Quest Shop#2 998,{ callfunc "qshop",1,2; } // call the shop 1 and 2 defined below // etc.. Add your Shop NPCs 'Quest Shop#XXX' here //============================================================ // Script Core - DO NOT DUPLICATE THIS NPC !!!!!!!!!!!!! //============================================================ - script quest_shop -1,{ function Add; function Chk; function Slot; OnInit: freeloop(1); // ----------------------------------------------------------- // Basic shop settings. // ----------------------------------------------------------- set .Announce,1; // Announce quest completion? (1: yes / 0: no) set .ShowSlot,1; // Show item slots? (2: all equipment / 1: if slots > 0 / 0: never) set .ShowID,0; // Show item IDs? (1: yes / 0: no) set .ShowZeny,0; // Show Zeny cost, if any? (1: yes / 0: no) set .MaxStack,100; // Max number of quest items purchased at one time. // ----------------------------------------------------------- // Points variable -- optional quest requirement. // setarray .Points$[0],"<variable name>","<display name>"; // ----------------------------------------------------------- setarray .Points$[0], "#CASHPOINTS", "Cash Points"; //===================================================================================== // ------------------- ADD YOUR SHOPS NAME AND ITEMS SHOPS STARTING HERE -------------- //===================================================================================== // ----------------------------------------------------------- // Shop IDs -- to add shops, copy dummy data at bottom of file. // setarray .Shops$[1],"<Shop 1>","<Shop 2>"{,...}; // ----------------------------------------------------------- setarray .Shops$[1], "Apple (cash points)", // Shop Named 1 "Aple (items)"; // Shop Named 2 // ----------------------------------------------------------- // Quest items -- do NOT use a reward item more than once! // Add(<shop ID>,<reward ID>,<reward amount>, // <Zeny cost>,<point cost>, // <required item ID>,<required item amount>{,...}); // ----------------------------------------------------------- // Shop 1 Add(1,512,1,0,100); // Shop 2 Add(2,512,1,0,0,7539,100,513,10); // ----------------------------------------------------------- //===================================================================================== // ------------------- YOUR SHOPS AND ITEMS SHOPS HAVE BEEN ADDED --------------------- //===================================================================================== freeloop(0); set .menu$,""; for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) { set .menu$, .menu$+.Shops$[.@i]+":"; npcshopdelitem "qshop"+.@i,909; } end; OnMenu: set .@size, getarraysize(@i); if (!.@size) set @shop_index, select(.menu$); else if (.@size == 1) set @shop_index, @i[0]; else { for(set .@j,0; .@j<.@size; set .@j,.@j+1) set .@menu$, .@menu$+.Shops$[@i[.@j]]+":"; set @shop_index, @i[select(.@menu$)-1]; } deletearray @i[0],getarraysize(@i); if (.Shops$[@shop_index] == "") { message strcharinfo(0),"An error has occurred."; end; } dispbottom "Select one item at a time."; callshop "qshop"+@shop_index,1; npcshopattach "qshop"+@shop_index; end; OnBuyItem: // .@q[] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, { ReqItem, ReqAmt, ... } setarray .@q[0],@bought_nameid[0],((@bought_quantity[0] > .MaxStack)?.MaxStack:@bought_quantity[0]); copyarray .@q[3],getd(".q_"+@shop_index+"_"+.@q[0]+"[0]"),getarraysize(getd(".q_"+@shop_index+"_"+.@q[0])); set .@q[2],.@q[1]*.@q[3]; if (!.@q[2] || .@q[2] > 30000) { message strcharinfo(0),"You can't purchase that many "+getitemname(.@q[0])+"."; end; } mes "[Quest Shop]"; mes "Reward: ^0055FF"+((.@q[2] > 1)?.@q[2]+"x ":"")+Slot(.@q[0])+"^000000"; mes "Requirements:"; disable_items; if (.@q[4]) mes " > "+Chk(Zeny,.@q[4]*.@q[1])+(.@q[4]*.@q[1])+" Zeny^000000"; if (.@q[5]) mes " > "+Chk(getd(.Points$[0]),.@q[5]*.@q[1])+(.@q[5]*.@q[1])+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+(.@q[5]*.@q[1])+")^000000"; if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2) mes " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q[1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000"; next; setarray @qe[1], getiteminfo(.@q[0],5), getiteminfo(.@q[0],11); if (@qe[2] > 0 && ((@qe[1] & EQP_HEAD_LOW) || (@qe[1] & EQP_HEAD_TOP) || (@qe[1] & EQP_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_TOP) || (@qe[1] & EQP_COSTUME_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_LOW) || (@qe[1] & EQP_GARMENT) || (@qe[1] & EQP_COSTUME_GARMENT))) set .@preview,1; addtimer 1000, strnpcinfo(0)+"::OnEnd"; while(1) { switch(select(" ~ Purchase ^0055FF"+getitemname(.@q[0])+"^000000:"+((.@preview && !@qe[7])?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) { case 1: if (@qe[0]) { mes "[Quest Shop]"; mes "You're missing one or more quest requirements."; close; } if (!checkweight(.@q[0],.@q[2])) { mes "[Quest Shop]"; mes "^FF0000You need "+(((.@q[2]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000"; close; } if (.@q[4]) set Zeny, Zeny-(.@q[4]*.@q[1]); if (.@q[5]) setd .Points$[0], getd(.Points$[0])-(.@q[5]*.@q[1]); if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2) delitem .@q[.@i],.@q[.@i+1]*.@q[1]; getitem .@q[0],.@q[2]; if (.Announce) announce strcharinfo(0)+" has created "+((.@q[2] > 1)?.@q[2]+"x "+getitemname(.@q[0]):callfunc("F_InsertArticle",getitemname(.@q[0])))+"!",0; specialeffect2 EF_FLOWERLEAF; close; case 2: setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE), 1; if ((@qe[1] & 1) || (@qe[1] & 4096)) changelook LOOK_HEAD_BOTTOM, @qe[2]; else if ((@qe[1] & 256) || (@qe[1] & 1024)) changelook LOOK_HEAD_TOP, @qe[2]; else if ((@qe[1] & 512) || (@qe[1] & 2048)) changelook LOOK_HEAD_MID, @qe[2]; else if ((@qe[1] & 4) || (@qe[1] & 8192)) changelook LOOK_ROBE, @qe[2]; break; case 3: close; } } OnEnd: if (@qe[7]) { changelook LOOK_HEAD_BOTTOM, @qe[3]; changelook LOOK_HEAD_TOP, @qe[4]; changelook LOOK_HEAD_MID, @qe[5]; changelook LOOK_ROBE, @qe[6]; } deletearray @qe[0],8; end; function Add { if (getitemname(getarg(1)) == "null") { debugmes "Quest reward #"+getarg(1)+" invalid (skipped)."; return; } setarray .@j[0],getarg(2),getarg(3),getarg(4); for(set .@i,5; .@i<getargcount(); set .@i,.@i+2) { if (getitemname(getarg(.@i)) == "null") { debugmes "Quest requirement #"+getarg(.@i)+" invalid (skipped)."; return; } else setarray .@j[.@i-2],getarg(.@i),getarg(.@i+1); } copyarray getd(".q_"+getarg(0)+"_"+getarg(1)+"[0]"),.@j[0],getarraysize(.@j); npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0); return; } function Chk { if (getarg(0) < getarg(1)) { set @qe[0],1; return "^FF0000"; } else return "^00FF00"; } function Slot { set .@s$,getitemname(getarg(0)); switch(.ShowSlot) { case 1: if (!getitemslots(getarg(0))) return .@s$; case 2: if (getiteminfo(getarg(0),2) == 4 || getiteminfo(getarg(0),2) == 5) return .@s$+" ["+getitemslots(getarg(0))+"]"; default: return .@s$; } } } function script qshop { deletearray @i[0],getarraysize(@i); for(set .@i,0; .@i<getargcount(); set .@i,.@i+1) set @i[.@i],getarg(.@i); doevent "quest_shop::OnMenu"; end; } // Dummy shop data -- copy as needed. //============================================================ - shop qshop1 -1,909:-1 - shop qshop2 -1,909:-1 - shop qshop3 -1,909:-1 - shop qshop4 -1,909:-1 - shop qshop5 -1,909:-1
-
Show the code of the commands. I'm not sure if I may fix it, but I may help better if you did.
- 1
-
Can you test this one?
- script Monster_Walk -1,{ OnInit: monster "prontera",150,150,"Poring",1002,1; .@id = $@mobid[0]; setarray .@path[0], 155,150, 155,155, 160,155, 165,160; .@size = getarraysize(.@path); while(true) { unitwalk .@id,.@path[.@i*2],.@path[.@i*2 + 1]; .@i = (.@i + 2)%.@size; sleep 1200; } end; }
- 1
Can't keep refine, cards and enchants after evolve
in Scripting Support
Posted
I tried. Tell me if it works.
- script Extra_ItemConf -1,{ function add_item; OnInit: /* add_item(id, evolution mode, monster id, amount, id...); If you want any monster, use 111. Evolution modes: 1 = Every X numer of mobs (1%). 2 = Experience (1%). */ /* Adaga */ add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga /* 1HSword */ add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H /* 2HSword */ add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H /* 2HAxe */ add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H /* Maces */ add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H /* Arcos */ add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos /* Cajados */ add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados /* 1HSpear */ add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200); /* 2HSpear */ add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100); /* Knuckles */ add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100); /* Violin */ add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150); /* Whip */ add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100); /* Katar */ add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100); /* Debug */ add_item(2301, 1, 111, 1, 2302, 1, 111, 2); /* 0 = Won't be evolved automatically. 1 = Will be evolved automatically */ .auto = 1; /* Color of the announces. */ setarray .c$[0],"ffffff", // % of evolution. "03fd20", // Wings evolving. "11f4cc"; // Wings evolved. /* slots to check. EQI_ACC_L (0) - Accessory 1 EQI_ACC_R (1) - Accessory 2 EQI_SHOES (2) - Footgear (shoes, boots) EQI_GARMENT (3) - Garment (mufflers, hoods, manteaux) EQI_HEAD_LOW (4) - Lower Headgear (beards, some masks) EQI_HEAD_MID (5) - Middle Headgear (masks, glasses) EQI_HEAD_TOP (6) - Upper Headgear EQI_ARMOR (7) - Armor (jackets, robes) EQI_HAND_L (8) - Left hand (weapons, shields) EQI_HAND_R (9) - Right hand (weapons) EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear EQI_COSTUME_GARMENT (13) - Costume Garment EQI_AMMO (14) - Arrow/Ammunition EQI_SHADOW_ARMOR (15) - Shadow Armor EQI_SHADOW_WEAPON (16) - Shadow Weapon EQI_SHADOW_SHIELD (17) - Shadow Shield EQI_SHADOW_SHOES (18) - Shadow Shoes EQI_SHADOW_ACC_R (19) - Shadow Accessory 2 EQI_SHADOW_ACC_L (20) - Shadow Accessory 1 */ setarray .slots[0], /*EQI_HAND_R,*/ EQI_HAND_L, EQI_ARMOR, EQI_SHOES, EQI_GARMENT; //============================================= end; OnNPCKillEvent: .@size = getarraysize(.slots); while(.@slot < .@size) { .@item_id = getequipid(.slots[.@slot]); .@slot++; if(.@item_id < 0) continue; .@i = 0; while(.@i < .w1) { .@j = 0; .@has_item = false; while(.@j < .w2[.@i] && !.@has_item) { .@item_evo = getd(".it_id_"+.@i+"_"+.@j); if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) { .@mob_id = getd(".it_mob_"+.@i+"_"+.@j); if(killedrid == .@mob_id || .@mob_id < 1001) { if(getd(".it_mode_"+.@i+"_"+.@j) == 1) { .@amount = getd("mobs_"+.@item_id) + 1; setd "mobs_"+.@item_id,.@amount; if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) continue; setd "mobs_"+.@item_id,0; } else { .@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid); setd "exp_"+.@item_id,.@amount; if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) continue; setd "exp_"+.@item_id,0; } specialeffect2 EF_BEGINSPELL6; sleep2 rand(190,280); specialeffect2 EF_ENERGYDRAIN3; .@percent = getd("evo_"+.@item_id); if(.@percent < 100) { setd "evo_"+.@item_id,++.@percent; announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0]; } if(.@percent >= 100 && .auto) { specialeffect2 EF_GUMGANG3; sleep2 500; specialeffect2 EF_BASH3D2; sleep2 300; specialeffect2 EF_BLUEBODY; sleep2 300; announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1]; .@k = 3; while(.@k--) { specialeffect2 EF_DOUBLECASTBODY; sleep2 900; } specialeffect2 EF_STORMKICK5; sleep2 200; specialeffect2 EF_BUBBLE_DROP; sleep2 500; if(!.@inventory) { getinventorylist; .@inventory = true; } .@k = inarray(@inventorylist_id,.@item_id); if(.@k != -1) { if(!@inventorylist_expire[.@k]) { setarray .@iteminfo[0],@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k]; setarray .@roid[0],@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k]; setarray .@val[0],@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k]; setarray .@par[0],@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k]; .@bound = @inventorylist_bound[.@k]; } else { continue; } .@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1)); if(getarraysize(.@val)){ delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par; if(.@bound) getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par; else getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par; } else { delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5]; if(.@bound) getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account; else getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5]; } equip .@evo_item; setd "evo_"+.@item_id,0; announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2]; } .@has_item = true; } else if(.@item_id == .@item_evo) { continue; } } } .@j++; } .@i++; } } end; function add_item { for(.@args = getargcount();.@i < .@args;.@i+= 4) { .@j = .w2[.w1]++; setd ".it_id_"+.w1+"_"+.@j,getarg(.@i); // id. if(getarg(.@i + 4,0) != 0) { setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1); // mode. setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2); // mob id. setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3); // amount. } } .w1++; } }