-
Posts
340 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Eross
-
Dispel Buffs on entering portal or warp by priest but not on teleport
Eross posted a question in Scripting Support
Hi guys ! Ive created a simple script that will dispel a player on map load. But the problem is my only plan is to dispel players who enter the portal or who uses warps (priest), so inshort it has to be a different map to trigger the dispel and not by Teleport skill.. How to make teleport skip the dispel ?? thankyou .. OnPCLoadMapEvent: //for( set .i,0; .i < getarraysize( .Maps$ ); set .i,.i + 1 ) //if( strcharinfo(3) == .Maps$[.i] ) //sc_end sc_spirit; sc_end sc_gospel; sc_end SC_POEMBRAGI; sc_end SC_APPLEIDUN; sc_end SC_ASSNCROS; sc_end SC_WHISTLE; //sc_end 37; // holy weapon //sc_end 38; // holy armor sc_end 187; // increase all stat sc_end 194; // increase hit sc_end 196; // increase flee sc_end 198; // max hp increase sc_end 199; // max sp increase sc_end 200; // attach strength sc_end 202; // increase def sc_end 214; // SC_SCRESIST sc_end 175; // POEMBRAGI sc_end 181; // SERVICE4U //specialeffect2 235; end; -
Thankyou sir !!! I will try this later ... One more question .. How about making it up to max 5 mob id ??? like for example I type @killcount Poring and @killcount Fabre and 3 other they all work but on 6th it should say , @killcount max is 5 only . with @killcount reset 1 to 5 ,,and @killcount will show 5 mobs ..Thankyou sir
-
Hi ! I would like to request for a script that counts mob kills .. @killcount <mob id> or @killcount <mobname> For example. @killcount 1002 / @killcount Poring or poring (not case sensitive) . Everytime I kill poring a bottom message will show on my bottom chat saying "Poring kill: <number of kills>" .. When I type @killcount without monster name or ID it should show "Killed Porings: <kill count>" ..With @killcount reset function. Thanks
-
Im getting error help
-
Hi ! Im using an old Hourly System, I just want to add a feature that will: 1. Allow first player of first account to login and activate hourly system 2. the second and next dual character will automatically been hault its system and wont get any hourly points 3. Regardless the map, even they have different maps it will check the gepard id Sorry for my bad english. I hope you can help me The Script im using : - script hourlypoints FAKE_NPC,{ OnInit: //announce "[30 Minutes Points System]: The system have been reloaded, please relog again to get more points.", bc_all; announce "[Hourly Reward System]: Hourly system has been reloaded, please relog again to get more points.", bc_all; .point_name$ = "Hourly Points"; .point_amt = 5; // Normal points gained. .dlimit = 900; // Stop points if afk greater then in seconds. 600s = 10 minutes //43200 .enable = 1; .level = 0; .online_time = 3600; // One hour = 3600 seconds bindatcmd "hourlyinfo", "hourlypoints::OnAtcommand", 0, 100; //bindatcmd "hourlypoints", "hourlypoints::OnCheckPoints", 0, 100; end; OnPCLoginEvent: if (BaseLevel >= .level) { #idle = 0; @backup_time = 0; if (!#acctick || #acctick > .online_time) #acctick = gettimetick(2) + .online_time; else #acctick += gettimetick(2); while(.enable) { @idle_time = checkidle(); if (checkvending() >= 1 || checkchatting() == 1 || @idle_time >= .dlimit) // { #acctick += @idle_time; // Add idle time #idle = 1; dispbottom "The hourly points event haulted because you were vending, chatting, or idle."; } else { sleep2 1000; @backup_time = [email protected]_left = #acctick - gettimetick(2); if ([email protected]_left <= 0) { if (vip_status(1)) { #HOURLYPOINTS += .point_amt + 1; #acctick = gettimetick(2) + .online_time; dispbottom "[Hourly Reward System]: Gained " + .point_amt + " " + .point_name$ + " +1 " + .point_name$ + " [Vip Bonus]. Stay online and gain more points."; } else { #HOURLYPOINTS += .point_amt; #acctick = gettimetick(2) + .online_time; dispbottom "[Hourly Reward System]: Gained " + .point_amt + " " + .point_name$ + ". Total " + #HOURLYPOINTS + " Hourly Points. Stay online to gain more points."; } } else { [email protected]_left = .online_time - [email protected]_left; [email protected]$ = ""; [email protected] = [email protected]_left / 60; [email protected]_left -= ([email protected] * 60); if ([email protected] > 1) [email protected]$ += [email protected] + " minutes, "; else if ([email protected] > 0) [email protected]$ += [email protected] + " minute, "; if ([email protected]_left > 1 || [email protected]_left == 0) [email protected]$ += [email protected]_left + " seconds"; else if ([email protected]_left == 1) [email protected]$ += [email protected]_left + " second"; if ([email protected] == 15 && [email protected]_left == 0 || [email protected] == 30 && [email protected]_left == 0 || [email protected] == 45 && [email protected]_left == 0) dispbottom "[Hourly Reward System]: You spend a total of [" + [email protected]$ + "] playing."; } } if (#idle) break; } } end; OnPCLogoutEvent: // BackUP online time if (BaseLevel >= .level) { if (@backup_time) #acctick = @backup_time; } end; OnCheckPoints: dispbottom "[Hourly Reward System]: You have a total of ["+ #HOURLYPOINTS +"] Hourly Points.",0xRRGGBB; end; OnAtcommand: if (BaseLevel >= .level) { if (#idle) { [email protected]$ = ""; [email protected] = @idle_time / 60; [email protected]_left = @idle_time - ([email protected] * 60); if ([email protected] > 1) [email protected]$ += [email protected] + " minutes, "; else if ([email protected] > 0) [email protected]$ += [email protected] + " minute, "; if ([email protected]_left > 1 || [email protected]_left == 0) [email protected]$ += [email protected]_left + " seconds"; else if ([email protected]_left == 1) [email protected]$ += [email protected]_left + " second"; dispbottom "[Hourly Reward System]: You been idle for " + [email protected]$ + ". Please relog again.",0xRRGGBB; } else { [email protected]_left = @backup_time; [email protected]$ = ""; [email protected] = [email protected]_left / 60; [email protected]_left -= ([email protected] * 60); if ([email protected] > 1) [email protected]$ += [email protected] + " minutes, "; else if ([email protected] > 0) [email protected]$ += [email protected] + " minute, "; if ([email protected]_left > 1 || [email protected]_left == 0) [email protected]$ += [email protected]_left + " seconds"; else if ([email protected]_left == 1) [email protected]$ += [email protected]_left + " second"; dispbottom "[Hourly Reward System]: You have [" + [email protected]$ + "] left in able to gain a hourly points.",0xRRGGBB; } } end; }
-
Good day ! I've created a simple give away npc that has name of event GM on it My questions is .. Is it possible to broadcast the item name including the name that signed into it ?? For example, I will open this scroll and the broadcast should be : "[Player Name] has obtained Battle Manual from [Eross's Angel Egg Scroll]!!!" Instead of just: "[Player Name] has obtained Battle Manual from [Angel Egg Scroll]!!!" Thankyou and a Blessed Sunday to everyone
-
Hi ! I found it already .. I hexed it on client . found it on %s C
-
Hi ! I would like to ask how to change these ?? I want to change it to DC instead of C and Cashpoints .. Thankyou !!!
-
Hi ! Does anyone here know how to revert the claymore trap behavior to its classic behavior ?? Claymore trap now can only hit 1 but my players want the old behavior which hits multiple .. Please help anyone .. I saw a guide in hercules but I think its not compatible with rathena
-
Hi ! Im using 2013 client with custom job diff and works perfectly fine ... Im using LUAs on admin My problem is, I decided to upgrade to 2015 client but seems like its not working anymore and Im getting loop error message when trying to launch client...Can anyone help me ? Thanks
-
Hi ! I've already did some of this but I noticed that there are some steps I didnt done ... Can you point out what step is for not removing the buff on relogin in ... Thankyou so much btw sir
-
Hi, does anyone here have an idea how to disable party bonus if there are same Gepard id or IP in party?? The party bonus exp im refering is the one in party.conf ... Please forgive me if I post it on wrong section ... I just need help thankyou
-
Thanks ! how about in homunculus sir ?
-
Hi ! I have a script that disable dual gepard id in a map ... How to make this allow only 3 same gepard ID in map ??? Thanks - script disable_duals -1,{ end; OnInit: // 1= if you have gepard 0=if you do not use gepard set .Gepard,1; setarray .current_maps$[0] , "pvp_n_1-5", "guild_vs1", "guild_vs2", "guild_vs3", "guild_vs4", "guild_vs5", "pvp_y_1-2", "pvp_y_2-2", "prtg_cas01", "prtg_cas02", "prtg_cas03", "prtg_cas04", "prtg_cas05", "payg_cas01", "payg_cas02", "payg_cas03", "payg_cas04", "payg_cas05", "gefg_cas01", "gefg_cas02", "gefg_cas03", "gefg_cas04", "gefg_cas05", "aldeg_cas01", "aldeg_cas02", "aldeg_cas03", "aldeg_cas04", "aldeg_cas05", "arug_cas01", "arug_cas02", "arug_cas03", "arug_cas04", "arug_cas05", "schg_cas01", "schg_cas02", "schg_cas03", "schg_cas04", "schg_cas05", "ordeal_1-1"; end; OnPCLoadMapEvent: if (.Gepard == 1) { //GEPARD SHIELD ID CHECKER for(set [email protected] ,0;[email protected]<getarraysize(.current_maps$);set [email protected],[email protected]+1) { if (strcharinfo(3) == .current_maps$[[email protected]]) { getmapxy([email protected]$,[email protected],[email protected],BL_PC); } } query_sql("SELECT last_unique_id FROM `login` WHERE account_id = "+getcharid(3)+"", [email protected]$); query_sql("SELECT account_id FROM `login` WHERE last_unique_id = '"[email protected]$+"'", [email protected]); set [email protected],getcharid(3,strcharinfo(0)); for(set [email protected] ,0;[email protected]<getarraysize([email protected]);set [email protected],[email protected]+1) { if(attachrid([email protected][[email protected]])) { if ([email protected] == 2000001) { set [email protected],0; } else { getmapxy([email protected]$,[email protected],[email protected],BL_PC); if ([email protected]$ == [email protected]$){ set [email protected],[email protected]+1; } } } } detachrid; attachrid [email protected]; if([email protected] > 1) { dispbottom "Sorry, dual login is not allowed on this map."; sleep2 500; dispbottom "Warping you back to Savepoint now..."; sleep2 1000; warp "SavePoint",0,0; } end; } else { for(set [email protected] ,0;[email protected]<getarraysize(.current_maps$);set [email protected],[email protected]+1) { if (strcharinfo(3) == .current_maps$[[email protected]]) { getmapxy([email protected]$,[email protected],[email protected],BL_PC); } } query_sql("SELECT last_ip FROM `login` WHERE account_id = "+getcharid(3)+"", [email protected]$); query_sql("SELECT account_id FROM `login` WHERE last_ip = '"[email protected]$+"'", [email protected]); set [email protected],getcharid(3,strcharinfo(0)); for(set [email protected] ,0;[email protected]<getarraysize([email protected]);set [email protected],[email protected]+1) { if(attachrid([email protected][[email protected]])) { //if .Gepard is 0 add id of accounts to which the system will not affect, brothers, couple, gms, etc ... [email protected] == accountId if ([email protected] == 2000001 || [email protected] == 2000156 || [email protected] == 2000249 || [email protected] == 2000002 || [email protected] == 2000031 || [email protected] == 2000050 || [email protected] == 2000021 || [email protected] == 2000073 || [email protected] == 2000029) { set [email protected],0; } else { getmapxy([email protected]$,[email protected],[email protected],BL_PC); if ([email protected]$ == [email protected]$){ set [email protected],[email protected]+1; } } } } detachrid; attachrid [email protected]; if([email protected] > 1) { dispbottom "Sorry, Double Login is not allowed on this map."; sleep2 1000; dispbottom "Warping you back to Savepoint..."; sleep2 2000; warp "SavePoint",0,0; } end; } }
-
Hi ! I just need help how to lessen the points given whenever a player goes AFK or IDLE .. This is an old Hourly system , I want to just give 1 point to those Afk players . they will continue gaining points while idle but not same as active players who have 5 to 6 points ... Thankyou ! - script hourlypoints FAKE_NPC,{ OnInit: //announce "[30 Minutes Points System]: The system have been reloaded, please relog again to get more points.", bc_all; announce "[Hourly Reward System]: Hourly system has been reloaded, please relog again to get more points.", bc_all; .point_name$ = "Hourly Points"; .point_amt = 5; // Normal points gained. .dlimit = 900; // Stop points if afk greater then in seconds. 600s = 10 minutes //43200 .enable = 1; .level = 0; .online_time = 3600; // One hour = 3600 seconds bindatcmd "hourlytime", "hourlypoints::OnAtcommand", 0, 100; bindatcmd "hourlypoints", "hourlypoints::OnCheckPoints", 0, 100; end; OnPCLoginEvent: if (BaseLevel >= .level) { #idle = 0; @backup_time = 0; if (!#acctick || #acctick > .online_time) #acctick = gettimetick(2) + .online_time; else #acctick += gettimetick(2); while(.enable) { @idle_time = checkidle(); if (checkvending() >= 1 || checkchatting() == 1 || @idle_time >= .dlimit) // { #acctick += @idle_time; // Add idle time #idle = 1; dispbottom "The hourly points event haulted because you were vending, chatting, or idle."; } else { sleep2 1000; @backup_time = [email protected]_left = #acctick - gettimetick(2); if ([email protected]_left <= 0) { if (vip_status(1)) { #HOURLYPOINTS += .point_amt + 1; #acctick = gettimetick(2) + .online_time; dispbottom "[Hourly Reward System]: Gained " + .point_amt + " " + .point_name$ + " +1 " + .point_name$ + " [Vip Bonus]. Stay online and gain more points."; } else { #HOURLYPOINTS += .point_amt; #acctick = gettimetick(2) + .online_time; dispbottom "[Hourly Reward System]: Gained " + .point_amt + " " + .point_name$ + ". Total " + #HOURLYPOINTS + " Hourly Points. Stay online to gain more points."; } } else { [email protected]_left = .online_time - [email protected]_left; [email protected]$ = ""; [email protected] = [email protected]_left / 60; [email protected]_left -= ([email protected] * 60); if ([email protected] > 1) [email protected]$ += [email protected] + " minutes, "; else if ([email protected] > 0) [email protected]$ += [email protected] + " minute, "; if ([email protected]_left > 1 || [email protected]_left == 0) [email protected]$ += [email protected]_left + " seconds"; else if ([email protected]_left == 1) [email protected]$ += [email protected]_left + " second"; if ([email protected] == 15 && [email protected]_left == 0 || [email protected] == 30 && [email protected]_left == 0 || [email protected] == 45 && [email protected]_left == 0) dispbottom "[Hourly Reward System]: You spend a total of [" + [email protected]$ + "] playing."; } } if (#idle) break; } } end; OnPCLogoutEvent: // BackUP online time if (BaseLevel >= .level) { if (@backup_time) #acctick = @backup_time; } end; OnCheckPoints: dispbottom "[Hourly Reward System]: You have a total of ["+ #HOURLYPOINTS +"] Hourly Points.",0xRRGGBB; end; OnAtcommand: if (BaseLevel >= .level) { if (#idle) { [email protected]$ = ""; [email protected] = @idle_time / 60; [email protected]_left = @idle_time - ([email protected] * 60); if ([email protected] > 1) [email protected]$ += [email protected] + " minutes, "; else if ([email protected] > 0) [email protected]$ += [email protected] + " minute, "; if ([email protected]_left > 1 || [email protected]_left == 0) [email protected]$ += [email protected]_left + " seconds"; else if ([email protected]_left == 1) [email protected]$ += [email protected]_left + " second"; dispbottom "[Hourly Reward System]: You been idle for " + [email protected]$ + ". Please relog again.",0xRRGGBB; } else { [email protected]_left = @backup_time; [email protected]$ = ""; [email protected] = [email protected]_left / 60; [email protected]_left -= ([email protected] * 60); if ([email protected] > 1) [email protected]$ += [email protected] + " minutes, "; else if ([email protected] > 0) [email protected]$ += [email protected] + " minute, "; if ([email protected]_left > 1 || [email protected]_left == 0) [email protected]$ += [email protected]_left + " seconds"; else if ([email protected]_left == 1) [email protected]$ += [email protected]_left + " second"; dispbottom "[Hourly Reward System]: You have [" + [email protected]$ + "] left in able to gain a hourly points.",0xRRGGBB; } } end; }
-
Thankyou !!
-
Hi Im trying to edit this script .. It has a NEXT and Preview features but I want to make it just a menu style where you can select name of hg and preview it .. But at some reason regardless on what option menu I choose it appears that its always showing the first item id ... function script Preview_Items { setarray @look[0], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE); //@i = 0; setarray .items[0], 19676, 19677, 19729; [email protected]_item_size = getarraysize(.items[0]); for ([email protected] = 0; [email protected] < [email protected]_item_size; [email protected]++) { [email protected]$ = [email protected]$ + ([email protected] > 0 ? ":" : "") + getitemname(.items[[email protected]]); } [email protected] = select( [email protected]$ ) - 1; //M_REPEAT: @equip = getiteminfo(.items[@i], 5); @view = getiteminfo(.items[@i], 11); if(@equip != -1 && @view > 0) { changelook LOOK_HEAD_BOTTOM, @look[0]; changelook LOOK_HEAD_TOP, @look[1]; changelook LOOK_HEAD_MID, @look[2]; changelook LOOK_ROBE, @look[3]; deltimer strnpcinfo(0)+"::OnEnd"; if ((@equip & 1) || (@equip & 4096)) changelook LOOK_HEAD_BOTTOM, @view; else if ((@equip & 256) || (@equip & 1024)) changelook LOOK_HEAD_TOP, @view; else if ((@equip & 512) || (@equip & 2048)) changelook LOOK_HEAD_MID, @view; else if ((@equip & 4) || (@equip & 8192)) changelook LOOK_ROBE, @view; addtimer 1000, strnpcinfo(0)+"::OnEnd"; } @next = @i == getarraysize(.items)-1 ? 0 : @i+1; @prev = @i == 0 ? getarraysize(.items)-1 : @i-1; mes "[ Costume Preview ]"; mes "Item Name: ^6666ff"+getitemname(.items[@i])+"^000000"; mes "Item ID: "+.items[@i]; menu "Next [ ^6666ff"+getitemname(.items[@next])+" ^000000]",M_NEXT,"Previous [ ^6666ff"+getitemname(.items[@prev])+"^000000 ]",M_PREVIOUS,"Random",M_RANDOM; end; M_NEXT: next; @i = @next; goto M_REPEAT; end; M_PREVIOUS: next; @i = @prev; goto M_REPEAT; end; M_RANDOM: next; @i = rand(getarraysize(.items)); goto M_REPEAT; end; OnEnd: changelook LOOK_HEAD_BOTTOM, @look[0]; changelook LOOK_HEAD_TOP, @look[1]; changelook LOOK_HEAD_MID, @look[2]; changelook LOOK_ROBE, @look[3]; end; }
-
Hi ! Im using Euphy's Quest NPC for my donation .. I just want to ask how to enable multi purchase ??? It allows buying single item only ..Please help I need this one ,., Thankyou //===== rAthena Script ======================================= //= Euphy's Quest Shop //===== By: ================================================== //= Euphy //===== Update Hat Maker By: ================================================== //= Boy //===== Current Version: ===================================== //= 1.4a //===== Compatible With: ===================================== //= rAthena SVN r15340+ //===== Description: ========================================= //= A dynamic quest shop based on Lunar's, with easier config. //= Includes support for multiple shops & cashpoints. //= Item Preview script by ToastOfDoom. //============================================================ brasilis,277,226,4 script Donation Shop 859,{ function Add; function Chk; function Slot; function A_An; mes "[Aureus Kafra]"; mes "Welcome to ^FF0000Regular Donation Shop^000000 "+strcharinfo(0)+"!"; mes "Here you can buy ^0000FFDonation Items^000000."; mes "This is to help our server to keep running."; mes "You can also acquire ^0000FFAureus Tokens^000000 from streamer's event"; mes "Please, select shop category."; if(.Shops$ != "") set [email protected],1; else { set [email protected]$,""; for(set [email protected],1; [email protected]<=getarraysize(.Shops$); set [email protected],[email protected]+1) set [email protected]$, [email protected]$+.Shops$[[email protected]]+":"; set [email protected], select([email protected]$); } dispbottom "Select one item at a time."; callshop "donationshop"[email protected],1; npcshopattach "donationshop"[email protected]; end; function Add { if (getitemname(getarg(1))=="null") { debugmes "Quest reward #"+getarg(1)+" invalid (skipped)."; return; } for(set [email protected],5; [email protected]<127; set [email protected],[email protected]+2) { if (!getarg([email protected],0)) break; if (getitemname(getarg([email protected]))=="null") { debugmes "Quest requirement #"+getarg([email protected])+" invalid (skipped) on Quest ItemID "+ getarg(1) +"."; return; } } for(set [email protected],2; [email protected]<[email protected]; set [email protected],[email protected]+1) set getd(".q_"+getarg(1)+"["+([email protected])+"]"), getarg([email protected]); npcshopadditem "donationshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0); return; } function Chk { if (getarg(0)<getarg(1)) { set @qe0,1; return "^FF0000"; } else return "^00FF00"; } function Slot { set [email protected]$,getitemname(getarg(0)); switch(.ShowSlot){ case 1: if (!getitemslots(getarg(0))) return [email protected]$; case 2: if (getiteminfo(getarg(0),11)>0) return [email protected]$+" ["+getitemslots(getarg(0))+"]"; default: return [email protected]$; } } function A_An { setarray [email protected]$[0],"a","e","i","o","u"; set [email protected]$, "_"+getarg(0); for(set [email protected],0; [email protected]<5; set [email protected],[email protected]+1) if (compare([email protected]$,"_"[email protected]$[[email protected]])) return "an "+getarg(0); return "a "+getarg(0); } OnBuyItem: set [email protected][0],@bought_nameid; copyarray [email protected][1],getd(".q_"[email protected]_nameid+"[0]"),getarraysize(getd(".q_"[email protected]_nameid+"[0]")); if ([email protected][1]) { message strcharinfo(0),"An error has occurred."; end; } mes "[Quest Shop]"; mes "Reward: ^0055FF"+(([email protected][1]>1)[email protected][1]+"x ":"")+Slot([email protected][0])+"^000000"; mes "Requirements:"; if ([email protected][2]) mes " > "+Chk(Zeny,[email protected][2])[email protected][2]+" Zeny^000000"; if ([email protected][3]) mes " > "+Chk(getd(.Points$[0]),[email protected][3])[email protected][3]+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"[email protected][3]+")^000000"; if ([email protected][4]) for(set [email protected],4; [email protected]<getarraysize([email protected]); set [email protected],[email protected]+2) mes " > "+Chk(countitem([email protected][[email protected]]),[email protected][[email protected]+1])+((.DisplayID)?"{"[email protected][[email protected]]+"} ":"")+Slot([email protected][[email protected]])+" ("+countitem([email protected][[email protected]])+"/"[email protected][[email protected]+1]+")^000000"; next; set @qe1, getiteminfo([email protected][0],5); set @qe2, getiteminfo([email protected][0],11); addtimer 1000, strnpcinfo(1)+"::OnEnd"; while(1){ switch(select(" ~ Purchase ^0055FF"+getitemname([email protected][0])+"^000000:"+((((@qe1&1) || (@qe1&256) || (@qe1&512) || (@qe1&1024) || (@qe1&2048) || (@qe1&4096) || (@qe1&8192) || (@qe1&65536)) && @qe2>0 && [email protected])?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) { case 1: if (@qe0) { mes "[Quest Shop]"; mes "You're missing one or more quest requirements."; close; } if (!checkweight([email protected][0],[email protected][1])) { mes "[Quest Shop]"; mes "^FF0000You need "+((([email protected][1]*getiteminfo([email protected][0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000"; close; } if ([email protected][2]) set Zeny, [email protected][2]; if ([email protected][3]) setd .Points$[0], getd(.Points$[0])[email protected][3]; if ([email protected][4]) for(set [email protected],4; [email protected]<getarraysize([email protected]); set [email protected],[email protected]+2) delitem [email protected][[email protected]],[email protected][[email protected]+1]; getitem [email protected][0],[email protected][1]; if (.Announce) announce strcharinfo(0)+" has purchased "+A_An(getitemname([email protected][0]))+" from Donation Shop!",0; specialeffect2 699; close; case 2: set @qe3, getlook(3); set @qe4, getlook(4); set @qe5, getlook(5); if (@qe1&1) atcommand "@changelook 3 "[email protected]; if (@qe1&256) atcommand "@changelook 1 "[email protected]; if (@qe1&512) atcommand "@changelook 2 "[email protected]; if (@qe1&1024) atcommand "@changelook 1 "[email protected]; if (@qe1&2048) atcommand "@changelook 2 "[email protected]; if (@qe1&4096) atcommand "@changelook 3 "[email protected]; if (@qe1&8192) atcommand "@changelook 7 "[email protected]; if (@qe1&65536) atcommand "@changelook 4 "[email protected]; set @qe6,1; break; case 3: close; } } OnEnd: if (@qe6) { atcommand "@changelook 3 "[email protected]; atcommand "@changelook 1 "[email protected]; atcommand "@changelook 2 "[email protected]; atcommand "@changelook 7 "[email protected];atcommand "@changelook 4 "[email protected]; } for(set [email protected],0; [email protected]<7; set [email protected],[email protected]+1) setd "@qe"[email protected],0; end; OnInit: //waitingroom "[Quest Costumes]",0; // --------------------- Config --------------------- // Custom points, if needed: "<variable>","<name to display>" setarray .Points$[0],"#CASHPOINTS","Cash Points"; 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 .DisplayID,0; // Show item IDs? (1: yes / 0: no) set .ShowZeny,1; // Show Zeny cost, if any? (1: yes / 0: no) // Shop categories, if needed: "<Shop 1>","<Shop 2>"{,...}; // Duplicate dummy data for any additional shops (bottom of script). // If no categories, use the second line instead (remove //). setarray .Shops$[1],"Headgear Quest"; //set .Shops$,"n/a"; setarray .Shops$[1],"~ New Release"; setarray .Shops$[2],"~ Popular Items"; setarray .Shops$[3],"~ Limited Scrolls"; setarray .Shops$[4],"~ Rental Items"; setarray .Shops$[5],"~ Permanent Equipments"; setarray .Shops$[6],"~ Usables & ETC"; // Add(<shop number>,<reward ID>,<reward amount>,<Zeny cost>,<point cost>, // <required item ID>,<required item amount>{,...}); // Shop number corresponds with order above (default is 1). // Note: Do NOT use a reward item more than once! sleep 10; Add(1,33030,1,0,0,6732,195); Add(1,502,1,0,0,7179,2400); Add(1,33032,1,0,0,6732,750); Add(1,33033,1,0,0,6732,1200); Add(1,33034,1,0,0,6732,2400); sleep 10; Add(2,34000,1,0,0,7179,2400); Add(2,34001,1,0,0,7179,2400); Add(2,34002,1,0,0,7179,2400); Add(2,34003,1,0,0,7179,2400); Add(2,34004,1,0,0,7179,2400); Add(2,34005,1,0,0,7179,2400); Add(2,34006,1,0,0,7179,2400); Add(2,34007,1,0,0,7179,2400); Add(2,34008,1,0,0,7179,2400); Add(2,34009,1,0,0,7179,2400); Add(2,34010,1,0,0,7179,2400); Add(2,34011,1,0,0,7179,2400); sleep 10; Add(3,14296,1,0,0,7179,60); Add(3,14297,1,0,0,7179,60); Add(3,12785,1,0,0,7179,60); sleep 10; Add(4,17229,1,0,0,7179,450); Add(4,16683,1,0,0,7179,600); Add(4,16682,1,0,0,7179,210); sleep 10; Add(5,5536,1,0,0,6732,1050); Add(5,5597,1,0,0,7179,1800); Add(5,5423,1,0,0,7179,2400); Add(5,5137,1,0,0,7179,2100); Add(5,5314,1,0,0,7179,2100); Add(5,5225,1,0,0,7179,2100); Add(5,5278,1,0,0,7179,2400); Add(5,5325,1,0,0,7179,2400); Add(5,5800,1,0,0,7179,2400); Add(5,5362,1,0,0,7179,2100); Add(5,5377,1,0,0,7179,2100); Add(5,5490,1,0,0,7179,2100); Add(5,5462,1,0,0,7179,2100); sleep 10; Add(6,12412,1,0,0,7179,135); Add(6,12210,1,0,0,7179,75); // -------------------------------------------------- for(set [email protected],1; [email protected]<=getarraysize(.Shops$); set [email protected],[email protected]+1) npcshopdelitem "donationshop"[email protected],909; end; } // -------- Dummy data (duplicate as needed) -------- - shop donationshop1 -1,909:-1,1 - shop donationshop2 -1,909:-1,1 - shop donationshop3 -1,909:-1,1 - shop donationshop4 -1,909:-1,1 - shop donationshop5 -1,909:-1,1 - shop donationshop6 -1,909:-1,1
-
Thanks ! I will try this
-
Hi ! Can you teach me how to make this 10% chance ? Because on this topic they made it 100% .. I dont know how to make it 10% only SUPER NOVICE SPIRIT SKILL - Super Novices above LV 90 have 1% chance to 'erase' the death record - which means, the last 1% EXP loss will be recovered.
-
Hi ! Does anyone know how to fix this ? My pet accesories on storage are on Weapon Tab ..
-
Hi ! I would like to ask if is it possible to use same account with 1 character is on autotrade mode ?? Like for example I have merchant and thief , right after using @autotrade the client will allow me to relogin without removing my merchant into autotrade and play as a thief ? thanks
-
Hi ! I modified a script that I got from rathena called Monster of the day (credits to the author) and added a donation system that will allow players to donate certain amount of zeny to trigger the Repick mode .. My problem is .. How will I make one player to vote once every day only to avoid abuse ?? and I need to add a timer cooldown so players who didnt donate will not be able to cast donation once the repick has done on the same day .. //********************************************************************************** // ____ _ _ _ ____ //| _ \ ___ ___ ____ | | ___ ____ ___ ___ __ ___ _ _ | |_| |/ __ | //| |__// _ \ / _ \ | _ \| | / _ \ | _ \ / _ \ / _| / _)/ _ \ | \| ||___ |\__ | //| | | __/ ||_|| | |__/| || __/ | |__/| __/ | | _\ \ ||_|| | \\ | | | | | //|_|___\___|_\___/_| |___|_|_\___|_| |____\___|_|_|_(___/ \___/_|_|\_|____|_|___|_| //------------------|_|-------------|_|--------------------------------------------- //********************************************************************************** //===== rAthena Script ============================================================= //= Monster Of The Day //===== By: ======================================================================== //= Peopleperson49 (Eddie) - [email protected] //===== Start Date: ================================================================ //= 20NOV2011 //===== Current Version: =========================================================== //= 1.4 //===== Compatible With: =========================================================== //= rAthena SVN //===== Description: =============================================================== //= Another Monster Of The Day script. I made this one from scratch to be very //= simple and work automatically. Uses almost the full list of monsters from //= the mob_branch. I included the dispbottom here when players login, but I //= actually perfer to use a login script with this in it. //===== Version Control: =========================================================== //= 1.0 First Version. //= 1.1 Broke .MobTypeArray[0] into ten seperate arrays to allow full list of mobs //= to be used without overflowing the array. Before I had to limit the number //= of mobs in an array to around 100 or I would randomly get an error from it. //= 1.2 Modified script to not change mobs if scripts are reloaded. Will set mob if //= not already set on OnInit. //= 1.3 Changed getexp to BaseExp. //= 1.4 Added bindatcmd to allow GM to repick the MOTD. //===== Additional Comments:======================================================== //= //================================================================================== //- script MOTD#RoUG -1,{ //prontera,158,190,4 script Monster Of The Day 844,{ prontera,158,190,4 script Monster Spirit 802 ,{ mes "[Monster Of The Day]"; mes "You will earn twice the EXP from killing "+getmonsterinfo($MobType,0)+"s [^0000ff"+$MobType+"^000000] today!"; next; mes "[Monster Of The Day]"; mes "You can donate on our Monster Control Department if you wish to ramdomly change the MOTD."; switch(select("Donate ["+callfunc("F_InsertComma",$motd_zeny) + "/"+callfunc("F_InsertComma",.motd_td)+"].","Nevermind.")) { case 1: Change_Amount: mes "[Monster Of The Day]"; mes "Please input desired amount."; next; input [email protected]_zeny; if ([email protected]_zeny < 1) { mes "[Monster Of The Day]"; mes "Input number greater than 0."; end; } mes "[Monster Of The Day]"; mes "Please confirm Zeny transfer."; next; switch(select("Change Amount:Confirm")) { case 1: [email protected]_zeny = 0; next; goto Change_Amount; end; case 2: if (Zeny < [email protected]_zeny) { mes "[Monster Of The Day]"; mes "Sorry, but you don't have enough"; mes "zeny to donate."; end; } if ([email protected]_zeny > $motd_diff) { mes "[Monster Of The Day]"; mes "The amount you entered will exceed on remaining balance."; mes "Remaining Balance: "+callfunc("F_InsertComma",$motd_diff)+" Zeny"; mes "^ff0000*Please input exact amount next time*."; end; } if ([email protected]_zeny == $motd_diff) { goto Initiate_MOTD; end; } Initiate_MOTD: mes "[Monster Of The Day]"; mes "Zeny has succesfully transfered."; Zeny -= [email protected]_zeny; $motd_zeny += [email protected]_zeny; $motd_diff -= [email protected]_zeny; if ($motd_zeny >= .motd_td) { $motd_zeny = 0; announce ""+.npc$+": We reached the target donation to repick the monster of the day!",bc_all,0xFF6060; // Up to you whether you want to add an extra hour or not, as otherwise the event will be below 48 hours. goto OnAtcommand; } } case 2: end; } end; OnInit: .motd_td = 50000; $motd_diff = .motd_td - $motd_zeny; //Difference between target funds and balance bindatcmd "motd",strnpcinfo(0)+"::OnCheck"; //setnpcdisplay "Monster Of The Day",$MonsterName$,$MobType; bindatcmd "repickmotd",strnpcinfo(3)+"::OnAtcommand",20,99; if($MobType!=0) { end; } OnClock0000: set .RandomArray,rand(0,9); if(.RandomArray==0) { setarray .MobTypeArray[0],1001,1002,1004,1005,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1018,1019,1020,1023,1024,1025,1026,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1040,1041,1042,1044,1045,1047,1048; } if(.RandomArray==1) { setarray .MobTypeArray[0],1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1076,1077,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1099; } if(.RandomArray==2) { setarray .MobTypeArray[0],1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1113,1114,1116,1117,1118,1119,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1138,1139,1140,1141,1143; } if(.RandomArray==3) { setarray .MobTypeArray[0],1144,1145,1146,1148,1149,1151,1152,1153,1154,1155,1156,1158,1160,1161,1163,1164,1165,1166,1167,1169,1170,1174,1175,1176,1177,1178,1179,1180,1182,1185,1186,1188,1189,1191,1192,1193,1194,1195; } if(.RandomArray==4) { setarray .MobTypeArray[0],1196,1197,1199,1200,1201,1202,1203,1204,1205,1206,1207,1208,1209,1211,1212,1213,1214,1215,1216,1219,1242,1243,1245,1246,1248,1249,1250,1253,1254,1255,1256,1257,1258,1259,1260,1261,1262,1263; } if(.RandomArray==5) { setarray .MobTypeArray[0],1264,1265,1266,1267,1268,1269,1270,1271,1273,1274,1275,1276,1277,1278,1279,1280,1281,1282,1283,1289,1290,1291,1292,1293,1294,1295,1296,1297,1298,1299,1300,1301,1302,1303,1304,1305,1306,1307; } if(.RandomArray==6) { setarray .MobTypeArray[0],1308,1309,1310,1311,1313,1314,1315,1316,1317,1318,1319,1320,1321,1322,1323,1365,1366,1367,1368,1369,1370,1371,1372,1374,1375,1376,1377,1378,1379,1380,1381,1382,1383,1384,1385,1386,1387,1390; } if(.RandomArray==7) { setarray .MobTypeArray[0],1391,1392,1400,1401,1402,1403,1404,1405,1406,1408,1409,1410,1412,1413,1415,1416,1417,1493,1494,1495,1497,1498,1499,1500,1503,1504,1505,1506,1507,1508,1509,1510,1512,1513,1514,1515,1516,1517; } if(.RandomArray==8) { setarray .MobTypeArray[0],1519,1520,1582,1584,1586,1587,1613,1614,1615,1616,1617,1618,1619,1620,1621,1622,1627,1628,1629,1631,1632,1633,1664,1665,1666,1667,1668,1669,1670,1671,1672,1673,1675,1676,1677,1678,1679,1680; } if(.RandomArray==9) { setarray .MobTypeArray[0],1681,1682,1686,1687,1692,1693,1694,1695,1696,1699,1703,1713,1714,1715,1717,1718,1736,1737,1738,1752,1753,1754,1755,1769,1770,1772,1773,1774,1775,1776,1777,1778,1780,1781,1782,1783,1784,1789; } set $MobType,.MobTypeArray[rand(0,37)]; announce "[Monster Of The Day]: You will earn twice the EXP from hunting "+getmonsterinfo($MobType,0)+"s ["+$MobType+"] today!",0; //set $MonsterName$,getmonsterinfo($MobType,0); //setnpcdisplay "Monster Of The Day",$MonsterName$,$MobType; end; OnCheck: dispbottom "[Monster Of The Day]: You will earn twice the EXP from hunting "+getmonsterinfo($MobType,0)+"s [^0000ff"+$MobType+"^000000] today!",0xFFFF00; end; OnNPCKillEvent: if(killedrid!=$MobType) { end; } dispbottom "MOTD Experience Gained Base:"+strmobinfo(6,killedrid)+" Job:"+strmobinfo(7,killedrid)+""; set BaseExp,(BaseExp+strmobinfo(6,killedrid)); set JobExp,(JobExp+strmobinfo(7,killedrid)); end; OnAtcommand: if(getgmlevel()<99) { dispbottom "You do not have permission to use this command."; end; } set .RandomArray,rand(0,9); if(.RandomArray==0) { setarray .MobTypeArray[0],1001,1002,1004,1005,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1018,1019,1020,1023,1024,1025,1026,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1040,1041,1042,1044,1045,1047,1048; } if(.RandomArray==1) { setarray .MobTypeArray[0],1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1076,1077,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1099; } if(.RandomArray==2) { setarray .MobTypeArray[0],1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1113,1114,1116,1117,1118,1119,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1138,1139,1140,1141,1143; } if(.RandomArray==3) { setarray .MobTypeArray[0],1144,1145,1146,1148,1149,1151,1152,1153,1154,1155,1156,1158,1160,1161,1163,1164,1165,1166,1167,1169,1170,1174,1175,1176,1177,1178,1179,1180,1182,1185,1186,1188,1189,1191,1192,1193,1194,1195; } if(.RandomArray==4) { setarray .MobTypeArray[0],1196,1197,1199,1200,1201,1202,1203,1204,1205,1206,1207,1208,1209,1211,1212,1213,1214,1215,1216,1219,1242,1243,1245,1246,1248,1249,1250,1253,1254,1255,1256,1257,1258,1259,1260,1261,1262,1263; } if(.RandomArray==5) { setarray .MobTypeArray[0],1264,1265,1266,1267,1268,1269,1270,1271,1273,1274,1275,1276,1277,1278,1279,1280,1281,1282,1283,1289,1290,1291,1292,1293,1294,1295,1296,1297,1298,1299,1300,1301,1302,1303,1304,1305,1306,1307; } if(.RandomArray==6) { setarray .MobTypeArray[0],1308,1309,1310,1311,1313,1314,1315,1316,1317,1318,1319,1320,1321,1322,1323,1365,1366,1367,1368,1369,1370,1371,1372,1374,1375,1376,1377,1378,1379,1380,1381,1382,1383,1384,1385,1386,1387,1390; } if(.RandomArray==7) { setarray .MobTypeArray[0],1391,1392,1400,1401,1402,1403,1404,1405,1406,1408,1409,1410,1412,1413,1415,1416,1417,1493,1494,1495,1497,1498,1499,1500,1503,1504,1505,1506,1507,1508,1509,1510,1512,1513,1514,1515,1516,1517; } if(.RandomArray==8) { setarray .MobTypeArray[0],1519,1520,1582,1584,1586,1587,1613,1614,1615,1616,1617,1618,1619,1620,1621,1622,1627,1628,1629,1631,1632,1633,1664,1665,1666,1667,1668,1669,1670,1671,1672,1673,1675,1676,1677,1678,1679,1680; } if(.RandomArray==9) { setarray .MobTypeArray[0],1681,1682,1686,1687,1692,1693,1694,1695,1696,1699,1703,1713,1714,1715,1717,1718,1736,1737,1738,1752,1753,1754,1755,1769,1770,1772,1773,1774,1775,1776,1777,1778,1780,1781,1782,1783,1784,1789; } set $MobType,.MobTypeArray[rand(0,37)]; announce "[Monster Of The Day]: You will earn twice the EXP from hunting "+getmonsterinfo($MobType,0)+"s ["+$MobType+"] today!",0; //set $MonsterName$,getmonsterinfo($MobType,0); //setnpcdisplay "Monster Of The Day",$MonsterName$,$MobType; end; OnPCLoginEvent: if (#pcloginflag&128) end; dispbottom "[Monster Of The Day]: You will earn twice the EXP from hunting "+getmonsterinfo($MobType,0)+"s [^0000ff"+$MobType+"^000000] today!",0xFFFF00; end; }
-
How to edit jobnames .. It should be professor not scholar and also the @job @jobchange suggesstions THANKYOU GUYS !!!
-
Hi ! Im using @whosell and @whobuy on my old server .. apparently something has change since we upgraded to latest rathena ... errors are coming since then .. Please help heres my source codes Index: atcommand.c =================================================================== --- atcommand.c (revision 16082) +++ atcommand.c (working copy) @@ -8473,6 +8473,69 @@ return 0; } +/*========================================== +* @whobuys - List who is buying the item (amount, price, and location). +* remake by VoidLess, original by zephyrus_cr +* re-edit by deathscythe to work in rAthena +*------------------------------------------*/ +ACMD_FUNC(whobuys) +{ + char item_name[100]; + int item_id, j, count = 0, sat_num = 0; + bool flag = 0; // place dot on the minimap? + struct map_session_data* pl_sd; + struct s_mapiterator* iter; + unsigned int MinPrice = battle_config.vending_max_value, MaxPrice = 0; + struct item_data *item_data; + + nullpo_retr(-1, sd); + memset(item_name, '\0', sizeof(item_name)); + + if (!message || !*message || sscanf(message, "%99[^\n]", item_name) < 1) { + clif_displaymessage(fd, "Input item name or ID (use: @whobuys <name or ID>)."); + return -1; + } + if ((item_data = itemdb_searchname(item_name)) == NULL && + (item_data = itemdb_exists(atoi(item_name))) == NULL) + { + clif_displaymessage(fd, msg_txt(sd, 19)); // Invalid item ID or name. + return -1; + } + + item_id = item_data->nameid; + + iter = mapit_getallusers(); + for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) + { + if( pl_sd->buyer_id ) //check if player is autobuying + { + for (j = 0; j < pl_sd->buyingstore.slots; j++) { + if(pl_sd->buyingstore.items[j].nameid == item_id) { + snprintf(atcmd_output, CHAT_SIZE_MAX, "ID: %d | Price: %d z | Amount: %d | Buyer: %s | Location: %s (%d,%d)" + ,pl_sd->buyingstore.items[j].nameid + ,pl_sd->buyingstore.items[j].price + ,pl_sd->buyingstore.items[j].amount + ,pl_sd->status.name + ,mapindex_id2name(pl_sd->mapindex) + ,pl_sd->bl.x, pl_sd->bl.y); + if(pl_sd->buyingstore.items[j].price < MinPrice) MinPrice = pl_sd->buyingstore.items[j].price; + if(pl_sd->buyingstore.items[j].price > MaxPrice) MaxPrice = pl_sd->buyingstore.items[j].price; + clif_displaymessage(fd, atcmd_output); + count++; + flag = 1; + } + } + if(flag && pl_sd->mapindex == sd->mapindex){ + clif_viewpoint(sd, 1, 1, pl_sd->bl.x, pl_sd->bl.y, ++sat_num, 0xFFFFFF); + flag = 0; + } + } + } + mapit_free(iter); + + if(count > 0) { + snprintf(atcmd_output,CHAT_SIZE_MAX, "Found %d ea. Prices from %dz to %dz", count, MinPrice, MaxPrice); + clif_displaymessage(fd, atcmd_output); + } else + clif_displaymessage(fd, "Nobody buying it now."); + + return 0; +} + /** * Fills the reference of available commands in atcommand DBMap **/ @@ -8717,6 +8780,7 @@ ACMD_DEF(charcommands), ACMD_DEF(font), ACMD_DEF(accinfo), + ACMD_DEF(whobuys), /** * For Testing Purposes, not going to be here after we're done. **/ diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index cab676cce..b7456cda7 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -8395,6 +8395,152 @@ ACMD_FUNC(mapflag) { return 0; } +/*========================================== +* @whosells - List who is vending the item (amount, price, and location). +* ported to work in latest rA [Cookie] +*------------------------------------------*/ +ACMD_FUNC(whosells) +{ + char item_name[100]; + int item_id = 0, j, count = 0, sat_num = 0; + int s_type = 1; // search bitmask: 0-name,1-id, 2-card, 4-refine + int refine = 0,card_id = 0; + bool flag = 0; // place dot on the minimap? + struct map_session_data* pl_sd; + struct s_mapiterator* iter; + unsigned int MinPrice = battle_config.vending_max_value, MaxPrice = 0; + struct item_data *item_data; + nullpo_retr(-1, sd); + + + if (!message || !*message) { + clif_displaymessage(fd, "Use: @whosells (<+refine> )(<item_id>)(<[card_id]>) or @whosells <name>"); + return -1; + } + if (sscanf(message, "+%d %d[%d]", &refine, &item_id, &card_id) == 3){ + s_type = 1+2+4; + } + else if (sscanf(message, "+%d %d", &refine, &item_id) == 2){ + s_type = 1+4; + } + else if (sscanf(message, "+%d [%d]", &refine, &card_id) == 2){ + s_type = 2+4; + } + else if (sscanf(message, "%d[%d]", &item_id, &card_id) == 2){ + s_type = 1+2; + } + else if (sscanf(message, "[%d]", &card_id) == 1){ + s_type = 2; + } + else if (sscanf(message, "+%d", &refine) == 1){ + s_type = 4; + } + else if (sscanf(message, "%d", &item_id) == 1 && item_id == atoi(message)){ + s_type = 1; + } + else if (sscanf(message, "%99[^\n]", item_name) == 1){ + s_type = 1; + if ((item_data = itemdb_searchname(item_name)) == NULL){ + clif_displaymessage(fd, "Not found item with this name"); + return -1; + } + item_id = item_data->nameid; + } + else { + clif_displaymessage(fd, "Use: @whosells (<+refine> )(<item_id>)(<[card_id]>) or @whosells <name>"); + return -1; + } + + //check card + if(s_type & 2 && ((item_data = itemdb_exists(card_id)) == NULL || item_data->type != IT_CARD)){ + clif_displaymessage(fd, "Not found a card with than ID"); + return -1; + } + //check item + if(s_type & 1 && (item_data = itemdb_exists(item_id)) == NULL){ + clif_displaymessage(fd, "Not found an item with than ID"); + return -1; + } + //check refine + if(s_type & 4){ + if (refine<0 || refine>10){ + clif_displaymessage(fd, "Refine out of bounds: 0 - 10"); + return -1; + } + /*if(item_data->type != IT_WEAPON && item_data->type != IT_ARMOR){ + clif_displaymessage(fd, "Use refine only with weapon or armor"); + return -1; + }*/ + } + iter = mapit_getallusers(); + + for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) + { + if( pl_sd->vender_id ) //check if player is vending + { + for (j = 0; j < pl_sd->vend_num; j++) { + if((item_data = itemdb_exists(pl_sd->cart.u.items_cart[pl_sd->vending[j].index].nameid)) == NULL) + continue; + if(s_type & 1 && pl_sd->cart.u.items_cart[pl_sd->vending[j].index].nameid != item_id) + continue; + if(s_type & 2 && ((item_data->type != IT_ARMOR && item_data->type != IT_WEAPON) || + (pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[0] != card_id && + pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[1] != card_id && + pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[2] != card_id && + pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[3] != card_id))) + continue; + if(s_type & 4 && ((item_data->type != IT_ARMOR && item_data->type != IT_WEAPON) || pl_sd->cart.u.items_cart[pl_sd->vending[j].index].refine != refine)) + continue; + if(item_data->type == IT_ARMOR) + snprintf(atcmd_output, CHAT_SIZE_MAX, "Refine: +%d | ID: %d | Card: [%d] | Price: %d z | Amount: %d | Seller: %s | Location: %s (%d,%d)" + ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].refine + ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].nameid + ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[0] + ,pl_sd->vending[j].value + ,pl_sd->vending[j].amount + ,pl_sd->status.name + ,mapindex_id2name(pl_sd->mapindex) + ,pl_sd->bl.x,pl_sd->bl.y); + else if(item_data->type == IT_WEAPON) + snprintf(atcmd_output, CHAT_SIZE_MAX, "Refine: +%d | ID: %d | Cards: [%d,%d,%d,%d] | Price: %d z | Amount: %d | Seller: %s | Location: %s (%d,%d)" + ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].refine + ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].nameid + ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[0] + ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[1] + ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[2] + ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[3] + ,pl_sd->vending[j].value + ,pl_sd->vending[j].amount + ,pl_sd->status.name + ,mapindex_id2name(pl_sd->mapindex) + ,pl_sd->bl.x,pl_sd->bl.y); + else + snprintf(atcmd_output, CHAT_SIZE_MAX, "ID: %d | Price: %d z | Amount: %d | Seller: %s | Location: %s (%d,%d)" + ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].nameid + ,pl_sd->vending[j].value + ,pl_sd->vending[j].amount + ,pl_sd->status.name + ,mapindex_id2name(pl_sd->mapindex) + ,pl_sd->bl.x, pl_sd->bl.y); + if(pl_sd->vending[j].value < MinPrice) MinPrice = pl_sd->vending[j].value; + if(pl_sd->vending[j].value > MaxPrice) MaxPrice = pl_sd->vending[j].value; + clif_displaymessage(fd, atcmd_output); + count++; + flag = 1; + } + if (flag && pl_sd->mapindex == sd->mapindex) { + //if (flag && pl_sd->bl.m == sd->bl.m) { + clif_viewpoint(sd, 1, 1, pl_sd->bl.x, pl_sd->bl.y, ++sat_num, 0xFFFFFF); + flag = 0; + } + } + } + mapit_free(iter); + if(count > 0) { + snprintf(atcmd_output, CHAT_SIZE_MAX, "Found %d ea. Prices from %dz to %dz.", count, MinPrice, MaxPrice); + clif_displaymessage(fd, atcmd_output); + } else + clif_displaymessage(fd, "Nobody is selling it now."); + return 0; +} + /*=================================== * Remove some messages *-----------------------------------*/ @@ -10593,6 +10739,7 @@ void atcommand_basecommands(void) { ACMD_DEFR(channel,ATCMD_NOSCRIPT), ACMD_DEF(fontcolor), ACMD_DEF(langtype), + ACMD_DEF(whosells), #ifdef VIP_ENABLE ACMD_DEF(vip), ACMD_DEF(showrate), whobuy_whosell.patch