-
Posts
9,746 -
Joined
-
Days Won
305
Community Answers
-
Emistry's post in VIP register NPC was marked as the answer
#CASHPOINTS -= .vip_cashpoint[[email protected]]; vip_time (.vip_day[[email protected]] * 1440); // 30 days VIP if ([email protected] == 2) { getitem 501, 1; getitem 501, 2; getitem 501, 3; } mes .npc$; mes "Congratulations you just got "+.vip_day[[email protected]]+" days VIP."; close; change to this.
-
Emistry's post in How to add on % on give out item? was marked as the answer
you could use these instead.
*groupranditem <group id>{,<sub_group>}; Returns the item_id of a random item picked from the group specified. The different groups and their group number are specified in 'db/(pre-)re/item_group_db.txt'. When used in conjunction with other functions, you can get a random item. For example, for a random pet lure: getitem groupranditem(IG_Taming),1; 'sub_group' is used to get the available random items of item group from specified random group. 0 for 'must' item group, and random item group is 1 until 5 (MAX_ITEMGROUP_RANDGROUP+1). More info, see doc/item_group.txt. --------------------------------------- *getrandgroupitem <group_id>{,<quantity>{,<sub_group>{,<identify>{,<char_id>}}}}; Similar to the above example, this command allows players to obtain the specified quantity of a random item from the group "<group id>". The different groups and their group number are specified in db/(pre-)re/item_group_db.txt If 'quantity' is not defined or 0, it will uses defined amount from Item Group list. If 'sub_group' is not defined the value will be 1 (since random group is 1 ~ 5, and 0 is 'must' item group). For item with type IT_WEAPON, IT_ARMOR, IT_PETARMOR, and IT_SHADOWGEAR will be given as unidentified item (as defined by itemdb_isidentified in src/map/itemdb.cpp) except if 'identify' is defined with value 1. More info, see doc/item_group.txt. --------------------------------------- *getgroupitem <group_id>{,<identify>{,<char_id>}}; Gives item(s) to the attached player based on item group contents. This is not working like 'getrandgroupitem' which only give 1 item for specified item group & sub_group. For item with type IT_WEAPON, IT_ARMOR, IT_PETARMOR, and IT_SHADOWGEAR will be given as unidentified item (as defined by itemdb_isidentified in src/map/itemdb.cpp) except if 'identify' is defined with value 1. More info, see doc/item_group.txt.
-
Emistry's post in Campfire Script Error was marked as the answer
you're not even downloading the script from rAthena files and using a herc version from the pastebin link.
I believe I dont need to spoonfeed you how to use the download button from forum download section.
-
Emistry's post in R> Item Exchanger was marked as the answer
prontera,155,181,4 script Sample 4_F_KAFRA1,{ [email protected] = select(.menu$) - 1; if (countitem(.required_item[[email protected]]) < .required_amount[[email protected]]) { mes "Exchange - Failed"; mes "You dont have enough "+.required_amount[[email protected]]+"x "+getitemname(.required_item[[email protected]])+" to exchange into "+.reward_amount[[email protected]]+"x "+getitemname(.reward_item[[email protected]]); } else { delitem .required_item[[email protected]], .required_amount[[email protected]]; getitem .reward_item[[email protected]], .reward_amount[[email protected]]; mes "Exchange - Success"; mes "Exchanged "+.required_amount[[email protected]]+"x "+getitemname(.required_item[[email protected]])+" to exchange into "+.reward_amount[[email protected]]+"x "+getitemname(.reward_item[[email protected]]); } close; function func_Exchange { .required_item[.size] = getarg(0, 0); .required_amount[.size] = getarg(1, 0); .reward_item[.size] = getarg(2, 0); .reward_amount[.size] = getarg(3, 0); .menu$ = .menu$ + "> "+.required_amount[.size]+"x "+getitemname(.required_item[.size])+" to "+.reward_amount[.size]+"x "+getitemname(.reward_item[.size]) + ":"; .size++; return; } OnInit: // func_Exchange(<required_item>, <required_amount>, <reward_item>, <reward_amount>); func_Exchange(501, 1, 601, 1); func_Exchange(502, 1, 602, 2); func_Exchange(503, 1, 603, 3); end; } you can try this.
or this (with refine requirements)
prontera,155,181,4 script Sample 4_F_KAFRA1,{ [email protected] = select(.menu$) - 1; if (countitem2(.required_item[[email protected]], 1, .required_refine[[email protected]], 0, 0, 0, 0,0) < .required_amount[[email protected]]) { mes "Exchange - Failed"; mes "You dont have enough "+.required_amount[[email protected]]+"x "+(.required_refine[[email protected]]?"+"+.required_refine[[email protected]]:"")+" "+getitemname(.required_item[[email protected]])+" to exchange into "+.reward_amount[[email protected]]+"x "+getitemname(.reward_item[[email protected]]); } else { delitem2(.required_item[[email protected]], .required_amount[[email protected]], 1, .required_refine[[email protected]], 0, 0, 0, 0, 0); getitem .reward_item[[email protected]], .reward_amount[[email protected]]; mes "Exchange - Success"; mes "Exchanged "+.required_amount[[email protected]]+"x "+getitemname(.required_item[[email protected]])+" to exchange into "+.reward_amount[[email protected]]+"x "+getitemname(.reward_item[[email protected]]); } close; function func_Exchange { .required_refine[.size] = getarg(0, 0); .required_item[.size] = getarg(1, 0); .required_amount[.size] = getarg(2, 0); .reward_item[.size] = getarg(3, 0); .reward_amount[.size] = getarg(4, 0); .menu$ = .menu$ + "> "+.required_amount[.size]+"x "+(.required_refine[.size]?"+"+.required_refine[.size]:"")+" "+getitemname(.required_item[.size])+" to "+.reward_amount[.size]+"x "+getitemname(.reward_item[.size]) + ":"; .size++; return; } OnInit: // func_Exchange(<required_refine>, <required_item>, <required_amount>, <reward_item>, <reward_amount>); func_Exchange(1, 5001, 1, 601, 1); func_Exchange(2, 5001, 1, 602, 2); func_Exchange(3, 5001, 1, 603, 3); end; }
this aren't suitable, using npc-scope variable in such fashion will just end up possible hack-attempts.
-
Emistry's post in How to add on function to Refiner Npc was marked as the answer
its a function, not a NPC lol
just load the function above to overwrite the existing function
or add these NPC
// Weapon/Armor Refiners //============================================================ prt_in,63,60,0 script Hollgrehenn 85,{ callfunc "refinemain","Hollgrehenn",0; end; } morocc_in,73,38,6 script Aragham 99,{ callfunc "refinemain","Aragham",0; end; } payon,144,173,5 script Antonio 88,{ callfunc "refinemain","Antonio",0; end; } alberta_in,28,58,0 script Fredrik 85,{ callfunc "refinemain","Fredrik",0; end; } yuno_in01,171,21,4 script Lambert 88,{ callfunc "refinemain","Lambert",0; end; } ein_in01,24,87,5 script Manthasman 826,{ callfunc "refinemain","Manthasman Pruhag",0; end; } lhz_in02,282,20,7 script Fulerr 869,{ callfunc "refinemain","Fulerr",0; end; }
-
Emistry's post in (Npc)Drop in an npc event was marked as the answer
OnKill: if (playerattached()) { getmapxy([email protected]$, [email protected], [email protected], BL_PC); for ([email protected] = 0; [email protected] < 10; [email protected]++) makeitem 7539, 1, [email protected]$, [email protected] + rand(-3,3), [email protected] + rand(-3,3); } end;
-
Emistry's post in How to check player HP&SP when fighting? was marked as the answer
if (Hp < 100) // current player HP is less than 100 if (Sp < 50) // current player SP is less than 50 both Hp and Sp variable can be used.
-
Emistry's post in Killedrid detectable when killing areamonster was marked as the answer
On1stFloor: set monster,1; dispbottom "Congratulations! You have killed the monster."; end; there are no need to check for killedrid since the event label are only triggered when you killed the target monster.
and what's the point to check for monster id during spawning process?
-
Emistry's post in how to increase the medal gain was marked as the answer
Reward_BG(<rate1>, <rate2>); amount = (rate / 3) + (total_bg_member/2); rate1 = reward rate for team 1
rate2 = reward rate for team 2
do the calculation yourself and edit the value.
-
Emistry's post in R> Random Quest NPC was marked as the answer
prontera,155,181,5 script Sample 4_F_KAFRA1,{ if (!quest_random) { quest_random = rand(1, 3); mes "You have been assigned with a new quest."; next; } switch(quest_random) { case 1: setarray [email protected], 4001, 1; setarray [email protected], 512; setarray [email protected], 100; break; case 2: setarray [email protected], 4002, 1; setarray [email protected], 501, 502, 503; setarray [email protected], 3, 1, 2; break; case 3: setarray [email protected], 4003, 1; setarray [email protected], 512, 503; setarray [email protected], 300, 100; break; default: mes "invalid quest."; close; } mes "Quest Requirement(s):"; [email protected] = getarraysize([email protected]); for ([email protected] = 0; [email protected] < [email protected]; [email protected]++) { mes " > "[email protected][[email protected]]+"x "+getitemname([email protected][[email protected]]); if (countitem([email protected][[email protected]]) < [email protected][[email protected]]) [email protected]++; } if ([email protected]) { next; if (select("Submit Quest", "Cancel") == 1) { for ([email protected] = 0; [email protected] < [email protected]; [email protected]++) delitem [email protected][[email protected]], [email protected][[email protected]]; getitem [email protected][0], [email protected][1]; quest_random = 0; } } close; } try
-
Emistry's post in HELP > Item namer mod was marked as the answer
hmm, there are actually some hack-attempt that you could try to get this done...
execute this SQL to create a dummy character with the char name "[BROKEN]"
INSERT INTO `char` (`char_id`, `account_id`, `char_num`, `name`, `class`, `base_level`, `job_level`, `base_exp`, `job_exp`, `zeny`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `max_hp`, `hp`, `max_sp`, `sp`, `status_point`, `skill_point`, `option`, `karma`, `manner`, `party_id`, `guild_id`, `pet_id`, `homun_id`, `elemental_id`, `hair`, `hair_color`, `clothes_color`, `body`, `weapon`, `shield`, `head_top`, `head_mid`, `head_bottom`, `robe`, `last_map`, `last_x`, `last_y`, `save_map`, `save_x`, `save_y`, `partner_id`, `online`, `father`, `mother`, `child`, `fame`, `rename`, `delete_date`, `moves`, `unban_time`, `font`, `uniqueitem_counter`, `sex`, `hotkey_rowshift`, `clan_id`, `title_id`, `show_equip`, `last_login`) VALUES (1, 1, 1, '[BROKEN]', 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 40, 40, 11, 11, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 'prontera', 155, 181, 'prontera', 155, 181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'U', 0, 0, 0, 0, '2019-08-25 02:34:01'); then give item using this ..
getitem2 [email protected],1,1,[email protected],0,254,0,1&0xffff,(1>>16)&0xffff;
-
Emistry's post in Item display message when not used on defined map was marked as the answer
{ if( strcharinfo(3) != "darkmall" ) { mes "Only usable at darkmall map."; close; } else { buyingstore 2; } },{},{}
-
Emistry's post in Limit cards in castles was marked as the answer
you can try something like this.
- script Sample -1,{ OnInit: .max_card_count = 1; setarray [email protected]$, "prtg_cas01", "prtg_cas02", "prtg_cas03", "prtg_cas04", "prtg_cas05"; [email protected]_size = getarraysize([email protected]$); .compare_map$ = "#"; for ([email protected] = 0; [email protected] < [email protected]_size; [email protected]++) { setmapflag [email protected]$[[email protected]], mf_loadevent; .compare_map$ = .compare_map$ + [email protected]$[[email protected]] + "#"; } end; OnPCLoadMapEvent: if (compare(.compare_map$, "#"+strcharinfo(3)+"#")) { if (isequippedcnt(4001,4002,4003,4004,4005) >= .max_card_count) { warp "SavePoint", 0, 0; } } end; } list all the mvp card here.
if (isequippedcnt(4001,4002,4003,4004,4005) >= .max_card_count) {
-
Emistry's post in Best 2009 or 2010 Clients was marked as the answer
for 2010 client, you can try this online diff patcher
http://rathena.sourceforge.net/tools/diff_patcher.php
not sure if it still work, but you could try.
for 2010, if i recall correctly 2010-07-30 are stable enough and recommended during that time.
-
Emistry's post in help with mvp sand script please was marked as the answer
try
- script Sample -1,{ OnInit: .map$ = "guild_vs1"; .max_round = 40; end; OnClock0000: if (.status) end; .round = 0; .status = 1; OnSummon: sleep 3000; .round++; if (.round <= .max_round) { mapannounce .map$, "ROUND - "+.round+"/"+.max_round+"!", bc_map; sleep 5000; monster .map$,50,50,"--ja--",-3,1,strnpcinfo(3)+"::OnReward"; } else { .status = 0; .round = 0; killmonsterall .map$; } end; OnReward: donpcevent strnpcinfo(3)+"::OnSummon"; addrid(1, 0, 5, .map$); // Prize + Amount if (.round <= 10) [email protected] = 1; else if (.round <= 20) [email protected] = 2; else if (.round <= 30) [email protected] = 3; else [email protected] = 4; getitem 501, [email protected]; getitem 502, [email protected]; getitem 503, [email protected]; end; }
-
Emistry's post in Event duel 1x1 was marked as the answer
if( [email protected] < 1 || [email protected] < 1 ) try change to
if( [email protected] < 7 || [email protected] < 7 )
-
Emistry's post in DB error unknow column autofeed in field list was marked as the answer
sql-files/upgrades/upgrade_20180404.sql
sql-files/upgrades/upgrade_20190309.sql
-
Emistry's post in Custom Waitingroom was marked as the answer
hmm ... the second picture look like something like this.
prontera,155,181,5 script Sample 4_F_KAFRA1,{ end; OnInit: [email protected]$ = strnpcinfo(4); [email protected]$ = strnpcinfo(0); while (1) { showscript [email protected]$ +": user(s) "+getmapusers([email protected]$)+" at "[email protected]$; sleep 3000; } end; }
not something recommended tho since it drain unnecessary resources.
-
Emistry's post in command isequipped correct use was marked as the answer
you could also do like this.
if (isequippedcnt(1292,13071,18112,21000) <= 0) { message strcharinfo (0), "You have not equipped any Upg weapon"; } else if (countitem (6240) < 1 || countitem (984) < 1) { message strcharinfo (0), "You need some ores so I can upgrade your weapon"; } else { // upgrage... }
-
Emistry's post in Moving NPC? was marked as the answer
you need to reset the destination coordinate so that it could keep re-roll a new destination.
odin_tem03,276,236,3 script Valkyrie Eir 1751,{ mes "Hello"; close; OnInit: npcspeed 200; OnTimer13000: set $valk_walkx,rand(100,299); //random x on map set $valk_walky,rand(100,230); //random y on map initnpctimer; end; OnTimer2000: OnTimer10000: npcwalkto $valk_walkx, $valk_walky; end; }
-
Emistry's post in Teleporter was marked as the answer
try this
prontera,100,100,4 script Champions Room 100,{ [email protected] = getcharid(2); mes "[Champions Room]"; for([email protected] = 0; [email protected] < .castle_size; [email protected]++) { [email protected] = getcastledata(.castles$[[email protected]],CD_GUILD_ID); if([email protected] && [email protected] == [email protected]) { mes "Welcome to the Champions Hall!"; mes "What do you want?"; next; switch(select( "- Enter", "- Information", "Leave" )) { case 1: mes "[Champions Room]"; mes "I'll take you there!"; close2; warp "sec_in01",167,37; end case 2: mes "[Champions Room]"; mes "There you will find exclusive quests."; break; default: mes "[Champions Room]"; mes "Come back when you need"; break; } close; } } mes "Sorry, only members of the clans that have conquered the castles can enter!"; close; OnInit: setarray .castles$[0], "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"; .castle_size = getarraysize(.castles$); end; }
-
Emistry's post in Woe Timer HELP was marked as the answer
prontera,155,181,5 script Sample 4_F_KAFRA,{ end; OnAgitStart: .woe_timer_1 = gettimetick(2) + 3600; // 1 hour WOE FE donpcevent strnpcinfo(3)+"::OnCountdown"; end; OnAgitStart2: .woe_timer_2 = gettimetick(2) + 3600; // 1 hour WOE SE donpcevent strnpcinfo(3)+"::OnCountdown"; end; OnCountdown: [email protected] = gettimetick(2); if (.woe_timer_1 > [email protected]) [email protected]$ = [email protected]$ + "(FE: "+(.woe_timer_1 - [email protected])+") "; if (.woe_timer_2 > [email protected]) [email protected]$ = [email protected]$ + "(SE: "+(.woe_timer_2 - [email protected])+") "; if ([email protected]$ != "") { [email protected]$ = "WOE " + [email protected]$; sleep 1000; donpcevent strnpcinfo(3)+"::OnCountdown"; } end; }
-
Emistry's post in Master Menu? was marked as the answer
also known as "GM menu"
the extra menu that shown when you right click on the object.
-
Emistry's post in Modify daily rewards was marked as the answer
cutin .Pic$[[email protected]],4; change to
cutin sprintf("Daily_%02d_%d", [email protected], gettime(6)), 4;