-
Posts
377 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Eross
-
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 .@i,1; else { set .@menu$,""; for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) set .@menu$, .@menu$+.Shops$[.@i]+":"; set .@i, select(.@menu$); } dispbottom "Select one item at a time."; callshop "donationshop"+.@i,1; npcshopattach "donationshop"+.@i; end; function Add { if (getitemname(getarg(1))=="null") { debugmes "Quest reward #"+getarg(1)+" invalid (skipped)."; return; } for(set .@n,5; .@n<127; set .@n,.@n+2) { if (!getarg(.@n,0)) break; if (getitemname(getarg(.@n))=="null") { debugmes "Quest requirement #"+getarg(.@n)+" invalid (skipped) on Quest ItemID "+ getarg(1) +"."; return; } } for(set .@i,2; .@i<.@n; set .@i,.@i+1) set getd(".q_"+getarg(1)+"["+(.@i-2)+"]"), getarg(.@i); 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 .@s$,getitemname(getarg(0)); switch(.ShowSlot){ case 1: if (!getitemslots(getarg(0))) return .@s$; case 2: if (getiteminfo(getarg(0),11)>0) return .@s$+" ["+getitemslots(getarg(0))+"]"; default: return .@s$; } } function A_An { setarray .@A$[0],"a","e","i","o","u"; set .@B$, "_"+getarg(0); for(set .@i,0; .@i<5; set .@i,.@i+1) if (compare(.@B$,"_"+.@A$[.@i])) return "an "+getarg(0); return "a "+getarg(0); } OnBuyItem: set .@q[0],@bought_nameid; copyarray .@q[1],getd(".q_"+@bought_nameid+"[0]"),getarraysize(getd(".q_"+@bought_nameid+"[0]")); if (!.@q[1]) { message strcharinfo(0),"An error has occurred."; end; } mes "[Quest Shop]"; mes "Reward: ^0055FF"+((.@q[1]>1)?.@q[1]+"x ":"")+Slot(.@q[0])+"^000000"; mes "Requirements:"; if (.@q[2]) mes " > "+Chk(Zeny,.@q[2])+.@q[2]+" Zeny^000000"; if (.@q[3]) mes " > "+Chk(getd(.Points$[0]),.@q[3])+.@q[3]+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+.@q[3]+")^000000"; if (.@q[4]) for(set .@i,4; .@i<getarraysize(.@q); set .@i,.@i+2) mes " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1])+((.DisplayID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+.@q[.@i+1]+")^000000"; next; set @qe1, getiteminfo(.@q[0],5); set @qe2, getiteminfo(.@q[0],11); addtimer 1000, strnpcinfo(1)+"::OnEnd"; while(1){ switch(select(" ~ Purchase ^0055FF"+getitemname(.@q[0])+"^000000:"+((((@qe1&1) || (@qe1&256) || (@qe1&512) || (@qe1&1024) || (@qe1&2048) || (@qe1&4096) || (@qe1&8192) || (@qe1&65536)) && @qe2>0 && !@qe6)?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) { case 1: if (@qe0) { mes "[Quest Shop]"; mes "You're missing one or more quest requirements."; close; } if (!checkweight(.@q[0],.@q[1])) { mes "[Quest Shop]"; mes "^FF0000You need "+(((.@q[1]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000"; close; } if (.@q[2]) set Zeny, Zeny-.@q[2]; if (.@q[3]) setd .Points$[0], getd(.Points$[0])-.@q[3]; if (.@q[4]) for(set .@i,4; .@i<getarraysize(.@q); set .@i,.@i+2) delitem .@q[.@i],.@q[.@i+1]; getitem .@q[0],.@q[1]; if (.Announce) announce strcharinfo(0)+" has purchased "+A_An(getitemname(.@q[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 "+@qe2; if (@qe1&256) atcommand "@changelook 1 "+@qe2; if (@qe1&512) atcommand "@changelook 2 "+@qe2; if (@qe1&1024) atcommand "@changelook 1 "+@qe2; if (@qe1&2048) atcommand "@changelook 2 "+@qe2; if (@qe1&4096) atcommand "@changelook 3 "+@qe2; if (@qe1&8192) atcommand "@changelook 7 "+@qe2; if (@qe1&65536) atcommand "@changelook 4 "+@qe2; set @qe6,1; break; case 3: close; } } OnEnd: if (@qe6) { atcommand "@changelook 3 "+@qe3; atcommand "@changelook 1 "+@qe4; atcommand "@changelook 2 "+@qe5; atcommand "@changelook 7 "+@qe3;atcommand "@changelook 4 "+@qe3; } for(set .@i,0; .@i<7; set .@i,.@i+1) setd "@qe"+.@i,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 .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) npcshopdelitem "donationshop"+.@i,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 ! 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 .@motd_zeny; if (.@motd_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: .@motd_zeny = 0; next; goto Change_Amount; end; case 2: if (Zeny < .@motd_zeny) { mes "[Monster Of The Day]"; mes "Sorry, but you don't have enough"; mes "zeny to donate."; end; } if (.@motd_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 (.@motd_zeny == $motd_diff) { goto Initiate_MOTD; end; } Initiate_MOTD: mes "[Monster Of The Day]"; mes "Zeny has succesfully transfered."; Zeny -= .@motd_zeny; $motd_zeny += .@motd_zeny; $motd_diff -= .@motd_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
-
Hi ! thanks for your help ! ive already done it by adding manually .. Thanks for your help sir !
-
Hi I cant find those lines on my status.cpp sir
-
Novice able to join a party without meeting basic skill level requirement?
Eross replied to Eross's question in Installation Support
Yes sir .. Everything is working fine except the level 5 -
Novice able to join a party without meeting basic skill level requirement?
Eross replied to Eross's question in Installation Support
Hi ! I dont know if this is a bug, but novice character with below level 5 basic skill can join party .. Please help Hi! can you help me fix my Novice Basic skill ?? As you can see on the picture below .. I dont have basic skills yet but I can join party which contradicts what the skill description says Please help I cant find any answer online .. Thanks -
Hi ! What do you mean by pointshop sir ? like #CASHPOINT ?? Do I need to convert the .@credit to #CASHPOINT
-
Hi I would like to request a donation shop npc witch has these features: 1. Choose buy option (Pods or .@credit) query_sql("SELECT `balance` FROM `" + escape_sql(.creditTable$) + "` WHERE `account_id` = " + getcharid(3) + " LIMIT 0,30", .@credits); 2. Buy more than 1 items 3. View headgear items like on Quest Item features .. Thanks
-
Regarding critical on PR_MACEMASTERY passive .. How to add +1 critical for every skill level ? Thankyou !
-
I want to request for a source modification that will change the Preserve skill behaviour like the following: 1. Can toggle On and Off 2. Wont deactivate on death and re-login I found a thread about toggle on and off but that was from year 2012 and I think the modification will not work on latest RA Please help .. thankyou so much
-
Hi ! how to make self buff to be a party buff ? For example Crazy uproar ..I want to make It behave like Gloria and Magnificat ... Thanks
-
Yes but your Status Point doesnt get refunded
-
Hi ! Is it possible to pick just 1 skill only to reset and refund skillpoints at the same time ??? instead of resetting all my skills .. Thanks
-
Hi ! everybody know that reseting stats can be done by using resetstatus; script .. But how about if I only want to reset is STR or AGI or Dex ?? How to do that ???
-
Convert your HTML to PHP .. Add files on your web and configure convert your html files to php by changing the extension name .html to .php use <include php> tags to insert statuses
-
Hi ! since Im using bootstrap navbar with foreach array in every links .. does anyone know how to add an array icons ?? Like example <Home Icon> Home, <Info Icon> Informations so on etc...
-
Thanks a lot guys !
-
Oh ! thanks squash man .. but if a player avail vip and moved into group 5 , does this mean that the group 0 commands will not be inherit ???