Jump to content

Emistry

Forum Moderator
  • Posts

    9,746
  • Joined

  • Days Won

    305

Everything posted by Emistry

  1. dispbottom "You've successfully mined the ore."; if (MineExp < 100000) { if (@minechance >= 12) [email protected]_exp = 3; else if (@minechance >= 7) [email protected]_exp = 2; else if (@minechance >= 1) [email protected]_exp = 1; } if ([email protected]_exp) { MineExp += [email protected]_exp; dispbottom "You've gained "[email protected]_exp+" Mining Exp."; }
  2. - script day_night_npc -1,{ OnInit: bindatcmd("summonwarps", strnpcinfo(3) +"::OnWarpact"); end; //OnClock1151: //OnInit: OnWarpact: sleep 1; // if you want to use different script file, then slow down the script execution if(gettime(DT_DAYOFMONTH)==10) { // day warp enablenpc "launchwarp#1"; disablenpc "nightwarp#1"; } else { enablenpc "nightwarp#1"; disablenpc "launchwarp#1"; } end; } map,90,87,0 warp launchwarp#1 1,1,iz_int,18,26 //test your event label is wrong, and your script has extra curley bracket that ended the script, and causing errors
  3. you can also use this to search for the card in a user inventory *checkequipedcard(<card id>) This function will return 1 if the card specified by its item ID number is inserted into any equipment they have in their inventory, currently equipped or not.
  4. item_combo effect should be done at db/re/item_combo_db.txt this way, you won't need to worry about same effect triggered multiple times. isequipped(61500, 61501, 61502, 61503, 61504); using this would tell you how many items are currently equipped.
  5. //================================================== // gef_fild10 - Geffen Field //================================================== gef_fild10,0,0 monster Orc Warrior 1023,179,5000,0,"sample_npc_name::OnKill" gef_fild10,0,0 monster Orc Lady 1273,55,5000,0,"sample_npc_name::OnKill" gef_fild10,0,0 monster Orc Baby 1686,27,5000,0,"sample_npc_name::OnKill" gef_fild10,0,0,0,0 boss_monster Orc Lord 1190,1,7200000,600000,0,"sample_npc_name::OnKill" gef_fild10,46,350,5,5 monster Blue Plant 1079,3,900000,450000,"sample_npc_name::OnKill" gef_fild10,287,61,5,5 monster Blue Plant 1079,3,900000,450000,"sample_npc_name::OnKill" gef_fild10,300,253,5,5 monster Green Plant 1080,3,360000,180000,"sample_npc_name::OnKill" add a npc event to each of the monster in gef_fild10, and load the npc. - script sample_npc_name -1,{ OnKill: if (!mobcount(strcharinfo(3), strnpcinfo(3)+"::OnBossKill")) { if (.monster_kill < 10000) { .monster_kill++; if (.monster_kill >= 10000) { monster strcharinfo(3), 0, 0, "Lord of Orcs", 1190, 1, strnpcinfo(3)+"::OnBossKill"; } } else { .monster_kill = 0; } } end; OnBossKill: // rewards end; }
  6. https://rathena.org/board/topic/116439-showcase-npc-buyingstore/
  7. your setting isn't configured correctly. conf\inter_athena.conf // MySQL Login server login_server_ip: 127.0.0.1 login_server_port: 3306 login_server_id: ragnarok login_server_pw: ragnarok login_server_db: ragnarok login_codepage: login_case_sensitive: no ipban_db_ip: 127.0.0.1 ipban_db_port: 3306 ipban_db_id: ragnarok ipban_db_pw: ragnarok ipban_db_db: ragnarok ipban_codepage: // MySQL Character server char_server_ip: 127.0.0.1 char_server_port: 3306 char_server_id: ragnarok char_server_pw: ragnarok char_server_db: ragnarok // MySQL Map Server map_server_ip: 127.0.0.1 map_server_port: 3306 map_server_id: ragnarok map_server_pw: ragnarok map_server_db: ragnarok // MySQL Log Database log_db_ip: 127.0.0.1 log_db_port: 3306 log_db_id: ragnarok log_db_pw: ragnarok log_db_db: ragnarok log_codepage: log_login_db: loginlog
  8. you can try this. - script SupplyTrigger -1,{ OnInit: OnSat1930: OnSun1930: OnAgitEnd: OnAgitEnd2: if (gettime(DT_HOUR) == 19 && gettime(DT_MINUTE) >= 30) { hideoffnpc "Guild Supply#1"; hideoffnpc "Supply#2"; hideoffnpc "Guild Supply#3"; // hideoffnpc "Guild Supply#4"; } else { hideonnpc "Guild Supply#1"; hideonnpc "Supply#2"; hideonnpc "Guild Supply#3"; // hideonnpc "Guild Supply#4"; } end; } as long as the time is between 07:30PM to 07:59PM, the NPC will be enabled.
  9. monster "<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event label>",<size>,<ai>}; may refer dead branch item for example.
  10. https://rathena.org/board/topic/74160-remove-buff-from-gospel-when-enter-a-map/
  11. true, but its not really an ideal solution. why? although the emulator is kinda updated but the emulator still assume array value 0 still exists. .array[4001] = 999999; debugmes ".array size = " + getarraysize(.array); // output: .array size = 4002 this meant, your current array total size is 4002, which wasted the memory the allocated for the total of 4001 data from index 0 to 4000, and you dont even need it. dont forgot that card_id could be above 5 digits or even 6 digits ID nowadays, which will end up wasting even more than we expected..
  12. there are multiple way to do it .... method 1. by exploit the setd/getd to store the price of each card into a variable, so less looping required. prontera,155,181,5 script Card Buyer 757,{ mes "["+strnpcinfo(1)+"]"; mes "You have any card to sell ? <3"; next; getinventorylist; for ([email protected] = 0; [email protected] < @inventorylist_count; [email protected]++) { [email protected] = getd(".card_"[email protected]_id[[email protected]]); if ([email protected]) [email protected]$ = [email protected]$ + getitemname(@inventorylist_id[[email protected]]) + " ^FF0000"+F_InsertComma([email protected])+" Zeny^000000"; [email protected]$ = [email protected]$ + ":"; } [email protected] = select([email protected]$) - 1; clear; [email protected] = getd(".card_"[email protected]_id[[email protected]]); mes "["+strnpcinfo(1)+"]"; mes "Sell "+getitemname(@inventorylist_id[[email protected]])+" for ^FF0000"+F_InsertComma([email protected])+" Zeny^000000?"; if (select("Confirm", "Cancel") == 1) { delitem @inventorylist_id[[email protected]], 1; Zeny += [email protected]; clear; mes "["+strnpcinfo(1)+"]"; mes "You have sold "+getitemname(@inventorylist_id[[email protected]])+" for ^FF0000"+F_InsertComma([email protected])+" Zeny^000000."; } close; function AddCard { [email protected] = getarg(0, 0); [email protected] = getargcount(); for ([email protected] = 1; [email protected] <= [email protected]; [email protected]++) setd(".card_"+getarg([email protected], 0), [email protected]); return; } OnInit: // AddCard( <zeny>, <card_id>...); AddCard( 10000, 4001, 4002, 4003, 4004); AddCard(100000, 4011, 4012, 4013, 4014); AddCard(500000, 4021, 4022, 4023, 4024, 4025); AddCard(999999, 4031, 4032, 4033, 4034, 4035, 4036); end; } method 2. by adjust the buy field in item_db, and set it to the value you want, then have the NPC to check for "Buy" value (why buy and not sell? because we wouldn't want player to exploit overcharge skill and direct sell to NPC) Example: set the Poring Card's Buy value to 999,999 Zeny - Id: 4001 AegisName: Poring_Card Buy: 999999 and have the NPC check and retrieve the Buy field value and use as selling price. prontera,155,181,5 script Card Buyer 757,{ mes "["+strnpcinfo(1)+"]"; mes "You have any card to sell ? <3"; next; getinventorylist; for ([email protected] = 0; [email protected] < @inventorylist_count; [email protected]++) { [email protected] = getiteminfo(@inventorylist_id[[email protected]], ITEMINFO_BUY); if ([email protected] && getiteminfo(@inventorylist_id[[email protected]], ITEMINFO_TYPE) == IT_CARD) [email protected]$ = [email protected]$ + getitemname(@inventorylist_id[[email protected]]) + " ^FF0000"+F_InsertComma([email protected])+" Zeny^000000"; [email protected]$ = [email protected]$ + ":"; } [email protected] = select([email protected]$) - 1; clear; [email protected] = getiteminfo(@inventorylist_id[[email protected]], ITEMINFO_BUY); mes "["+strnpcinfo(1)+"]"; mes "Sell "+getitemname(@inventorylist_id[[email protected]])+" for ^FF0000"+F_InsertComma([email protected])+" Zeny^000000?"; if (select("Confirm", "Cancel") == 1) { delitem @inventorylist_id[[email protected]], 1; Zeny += [email protected]; clear; mes "["+strnpcinfo(1)+"]"; mes "You have sold "+getitemname(@inventorylist_id[[email protected]])+" for ^FF0000"+F_InsertComma([email protected])+" Zeny^000000."; } close; }
  13. you can try something like this. - script #mvp_kill -1,{ OnInit: setarray .p_rwd, 607,1; // Party reward <item>,<amount> setarray .s_rwd, 607,1; // Solo reward <item>,<amount> .chance = 50; // Drop rate chances % // .gm = 10; // Prevents gm level and above to trigger the event // MVP Map list setarray .t_maps$[0],"moc_pryd06","lhz_dun03","gld2_prt","abbey02","ayo_dun02","lhz_dun04","ra_fild02","xmas_fild01","dic_dun02","beach_dun","iz_dun05","tur_dun04","lhz_dun02","jupe_core","moc_fild22","anthell02","odin_tem03","gon_dun03","gef_fild02","thana_boss","gef_fild10","ein_dun02","gef_fild14","moc_pryd04","dew_dun01","in_sphinx5","niflheim","moc_fild17","xmas_dun02","ice_dun03","kh_dun02","treasure02","moc_prydn2","pay_dun04","ra_san05","mosk_dun03","ama_dun03","thor_v03","gef_dun01","mjolnir_04","abyss_03","dic_dun03","prt_sewb4","pay_fild11","gef_dun02","gl_chyard","ra_fild03","ra_fild04","ve_fild01","ve_fild02","lou_dun03","prt_maze03","bra_dun02"; .t_maps_size = getarraysize(.t_maps$); end; OnNPCKillEvent: //if (getgmlevel() >= .gm) end; // If gm = event wont happen if (strcharinfo(3) == instance_mapname("06guild_01") || strcharinfo(3) == instance_mapname("force_1-1")) end; if (getmonsterinfo(killedrid, MOB_MVPEXP)) { for ([email protected] = 0; [email protected] < .t_maps_size; [email protected]++) { if (strcharinfo(3) == .t_maps$[[email protected]]) { if (getcharid(1)) { getpartymember getcharid(1), 1; getpartymember getcharid(1), 2; for ([email protected] = 0; [email protected] < [email protected]; [email protected]++) { if (isloggedin([email protected][[email protected]], [email protected][[email protected]])) { [email protected][[email protected]] = [email protected][[email protected]]; [email protected]++; } } if (rand(100) < .chance) getitem .p_rwd[0], .p_rwd[1], [email protected][ rand([email protected]) ]; [email protected]_message$ = "[ System ] : Player ["+ strcharinfo(0) +"] of party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo(killedrid, MOB_NAME) +" at "+ strcharinfo(3); } else { if (rand(100) < .chance) getitem .s_rwd[0], .s_rwd[1]; [email protected]_message$ = "[ System ] : Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo(killedrid, MOB_NAME) +" alone at "+ strcharinfo(3); } MVPKills = MVPKills+1; dispbottom "---------------------------------------------------"; dispbottom "You killed a total of "+MVPKills+" MVP"+((MVPKills == 1)?"":"s")+"."; dispbottom "---------------------------------------------------"; } } addrid(0); if (#mvpon) { dispbottom [email protected]_message$; } } end; } or - script #mvp_kill -1,{ OnInit: setarray .p_rwd, 607,1; // Party reward <item>,<amount> setarray .s_rwd, 607,1; // Solo reward <item>,<amount> .chance = 50; // Drop rate chances % // .gm = 10; // Prevents gm level and above to trigger the event // MVP Map list setarray .t_maps$[0],"moc_pryd06","lhz_dun03","gld2_prt","abbey02","ayo_dun02","lhz_dun04","ra_fild02","xmas_fild01","dic_dun02","beach_dun","iz_dun05","tur_dun04","lhz_dun02","jupe_core","moc_fild22","anthell02","odin_tem03","gon_dun03","gef_fild02","thana_boss","gef_fild10","ein_dun02","gef_fild14","moc_pryd04","dew_dun01","in_sphinx5","niflheim","moc_fild17","xmas_dun02","ice_dun03","kh_dun02","treasure02","moc_prydn2","pay_dun04","ra_san05","mosk_dun03","ama_dun03","thor_v03","gef_dun01","mjolnir_04","abyss_03","dic_dun03","prt_sewb4","pay_fild11","gef_dun02","gl_chyard","ra_fild03","ra_fild04","ve_fild01","ve_fild02","lou_dun03","prt_maze03","bra_dun02"; end; OnNPCKillEvent: //if (getgmlevel() >= .gm) end; // If gm = event wont happen if (strcharinfo(3) == instance_mapname("06guild_01") || strcharinfo(3) == instance_mapname("force_1-1")) end; if (getmonsterinfo(killedrid, MOB_MVPEXP)) { if (inarray(.t_maps$, strcharinfo(3)) != -1) { [email protected]_id = getcharid(1); if ([email protected]_id) { getpartymember [email protected]_id, 1; getpartymember [email protected]_id, 2; for ([email protected] = 0; [email protected] < [email protected]; [email protected]++) { if (isloggedin([email protected][[email protected]], [email protected][[email protected]])) { [email protected][[email protected]] = [email protected][[email protected]]; [email protected]++; } } if (rand(100) < .chance) getitem .p_rwd[0], .p_rwd[1], [email protected][ rand([email protected]) ]; [email protected]_message$ = "[ System ] : Player ["+ strcharinfo(0) +"] of party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo(killedrid, MOB_NAME) +" at "+ strcharinfo(3); } else { if (rand(100) < .chance) getitem .s_rwd[0], .s_rwd[1]; [email protected]_message$ = "[ System ] : Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo(killedrid, MOB_NAME) +" alone at "+ strcharinfo(3); } MVPKills = MVPKills+1; dispbottom "---------------------------------------------------"; dispbottom "You killed a total of "+MVPKills+" MVP"+((MVPKills == 1)?"":"s")+"."; dispbottom "---------------------------------------------------"; addrid(2, 0, [email protected]_id); if (#mvpon) { dispbottom [email protected]_message$; } } } end; }
  14. OnInit: OnHour00: .rand_time_1 = rand(0, 11); .rand_time_2 = rand(12, 23); OnMinute00: if (gettime(DT_HOUR) == .rand_time_1 || gettime(DT_HOUR) == .rand_time_2) { // scripts. } end;
  15. OnInit: OnHour00: .rand_time_1 = rand(0, 11); .rand_time_2 = rand(12, 23); OnMinute00: if (gettime(DT_HOUR) == .rand_time_1 || gettime(DT_HOUR) == .rand_time_2) { // scripts. } end;
  16. just change the catalogue effect then. *searchstores <uses>,<effect>; Invokes the store search window, which allows to search for both vending and buying stores. Parameter uses indicates, how many searches can be started, before the window has to be reopened. Effect value affects, what happens, when a result item is double-clicked and can be one of the following: 0 = Shows the store's position on the mini-map and highlights the shop sign with yellow color, when the store is on same map as the invoking player. 1 = Directly opens the shop, regardless of distance. Example: // Item Universal_Catalog_Gold (10 uses, effect: open shop) searchstores 10,1;
  17. you have other NPC script that added the loadevent mapflag at payon map. all OnPCLoadMapEvent script should add extra map checking to avoid it trigger unnecessary event which come from other NPC scripts. It is a global event which will trigger all NPC that has this event label.
  18. prontera,155,3 script Sample 757,{ [email protected]_id = getcharid(2); if ([email protected]_id) { if (getguildname([email protected]_id) == "My_guild") { switch (select("Storage:Tool Dealer:Cashshop")) { case 1: openstorage; break; case 2: callshop "yourshop",1; break; case 3: callshop "yourshop",1; break; } } } end; }
  19. depend on what you're doing with the NPC to hide/unhide and only visible to your char, you can use this command. *cloakonnpc "<NPC object name>"{,<character ID>}; *cloakoffnpc "<NPC object name>"{,<character ID>}; These commands will make the NPC object specified display as cloaked/uncloaked, even though not actually disabled. The player can interact with a NPC cloaked (via NPC click, monster event..) but the NPC trigger area is disabled. If <character ID> is given then the NPC will only display to the specified player until he/she leaves the map, logs out, or the npc option is changed. If no <character ID> is specified it will display to the area.
  20. what is the merit of still using this command when we already have better option? https://divine-pride.net/database/search?q=Catalogue
  21. https://rathena.org/board/topic/78346-checking-quantity-of-items/?sortby=date
  22. getnameditem(7420, "Dummy's Char Name"); getnameditem(7420, <dummy_char_id>);
  23. - script Sample -1,{ OnInit: .card_id = 4001; end; OnPCLoginEvent: if (isequipped(.card_id)) { for ([email protected] = EQI_ACC_L; [email protected] < EQI_SHADOW_ACC_L; [email protected]++) { for ([email protected] = 0; [email protected] < 4; [email protected]++) { if (getequipcardid([email protected], [email protected]) == .card_id) { successremovecards [email protected]; break; } } } // TODO: script command to add item into storage. } end; } you can do something like this, but to add item into storage, that would need a custom source mod to implement it.
  24. conf/battle/client.conf#L40-L41 // Visible area size (how many squares away from a player they can see) area_size: 14 you can try increase this, you should be able to view the message however, if your server AOE skills range are calculated based on this setting above, then you probably have issue with these AOE skills hitting a wider range.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.