Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/09/24 in all areas

  1. To modify your script so that the NPC checks for 6 different item requirements before allowing the player to use the warp, you need to enhance the F_Warp function to handle multiple items and their respective quantities. Here is a modified version of your script that checks for 6 different items and their amounts before warping the player: lhz_dun03,239,78,4 script Bio Entrance 651,{ function F_Warp; if (countitem(501) > 0 && countitem(502) > 0 && countitem(503) > 0 && countitem(504) > 0 && countitem(505) > 0 && countitem(506) > 0) goto case_1; else { mes "You do not have the required items to use this warp."; close; } case_1: F_Warp([501, 502, 503, 504, 505, 506], [1, 1, 1, 1, 1, 1], "lhz_dun04", 244, 61); end; end; function F_Warp { .@items = getarg(0); .@amounts = getarg(1); .@map$ = getarg(2, ""); .@x = getarg(3, 0); .@y = getarg(4, 0); for (.@i = 0; .@i < getarraysize(.@items); .@i++) { if (countitem(.@items[.@i]) < .@amounts[.@i]) { mes "You do not have enough of item " + .@items[.@i] + " to use this warp."; close; } } for (.@i = 0; .@i < getarraysize(.@items); .@i++) { delitem .@items[.@i], .@amounts[.@i]; } warp .@map$, .@x, .@y; return; } } fireboy and watergirl
    1 point
  2. script - script RateSelect -1,{ OnPCLoginEvent: switch (individual_rate) { case 1: .@exp_rate_multiplier = 100; .@jexp_rate_multiplier = 100; set .@rate_description$, "x1 (Low Rate)"; break; case 2: .@exp_rate_multiplier = 2500; .@jexp_rate_multiplier = 2500; set .@rate_description$, "x25 (Mid Rate)"; break; case 3: .@exp_rate_multiplier = 5000; .@jexp_rate_multiplier = 5000; set .@rate_description$, "x50 (High Rate)"; break; case 4: .@exp_rate_multiplier = 10000; .@jexp_rate_multiplier = 10000; set .@rate_description$, "x100 (Super High Rate)"; break; default: mes "[Rate Selector]"; mes "Select your preferred server rate for this character."; mes "BE CAREFUL: YOU CAN'T CHANGE IT AFTERWARD!"; individual_rate = select("Low Rate:Mid Rate:High Rate:Super High Rate"); close2; goto OnPCLoginEvent; // Return to case evaluation after selection } // Save the multipliers to the player variables set #exp_rate_multiplier, .@exp_rate_multiplier; set #jexp_rate_multiplier, .@jexp_rate_multiplier; fakeIcon(getcharid(0),2002,0,1); dispbottom "You have chosen the " + .@rate_description$ + " for your character."; end; OnNPCKillEvent: // Retrieve the stored multipliers .@exp_rate_multiplier = #exp_rate_multiplier; .@jexp_rate_multiplier = #jexp_rate_multiplier; .@base_exp = getmonsterinfo(killedrid, MOB_BASEEXP) * .@exp_rate_multiplier; .@job_exp = getmonsterinfo(killedrid, MOB_JOBEXP) * .@jexp_rate_multiplier; // Debug messages to track values dispbottom "[Debug] Base EXP: " + .@base_exp; dispbottom "[Debug] Job EXP: " + .@job_exp; if (.@base_exp > 0 || .@job_exp > 0) { // Use getcharid(0) to specify the character ID getexp2(.@base_exp, .@job_exp); } else { dispbottom "[Error] Experience values are zero."; } end; } stateiconinfo.lub StateIconList[EFST_IDs.EFST_RATE_UP] = { haveTimeLimit = 1, posTimeLimitStr = 2, descript = { { "RATE UP", COLOR_TITLE_BUFF }, { "%s", COLOR_TIME }, { "Increases your Bonus EXP and Job Exp" }, { "x1 / x25 / x50 / x100" }, { "Grants players different rewards" }, { "depending on what they choose." } } } efstids.lub EFST_VIPSTATE1 = 2000, EFST_VIPSTATE2 = 2001, EFST_RATE_UP = 2002, __newindex = function() error("unknown state") end } setmetatable(EFST_IDs, EFST_IDs) stateiconimginfo.lub -- Other official effects [EFST_IDs.EFST_VIPSTATE1] = "SI_VIP.tga", [EFST_IDs.EFST_VIPSTATE2] = "SI_VIP2.tga", [EFST_IDs.EFST_RATE_UP] = "RATE_UP.tga", [EFST_IDs.EFST_YGGDRASIL_BLESS] = "vitata500.tga", [EFST_IDs.EFST_PERIOD_RECEIVEITEM_2ND] = "ITEM_G.tga", [EFST_IDs.EFST_PERIOD_PLUSEXP_2ND] = "EXP_G.tga" } } status.hpp /// @APIHOOK_END /// Do not modify code above this, since it will be automatically generated by the API again EFST_VIPSTATE1 = 2000, EFST_VIPSTATE2 = 2001, EFST_RATE_UP = 2002, EFST_MAX, script_constants.hpp /// @APIHOOK_END /// Do not modify code above this, since it will be automatically generated by the API again export_constant(EFST_VIPSTATE1); export_constant(EFST_VIPSTATE2); export_constant(EFST_RATE_UP); export_constant(EFST_MAX); Install fakeicon: https://rathena.org/board/files/file/4034-fake-icon-stats/ RATE_UP.tga RATE_UP.tga
    1 point
  3. trunk/npc/guild/agit_template.txt Replace this line: mapannounce strnpcinfo(2),"The emperium has been destroyed.",bc_map|bc_woe,"0x00CCFF",FW_NORMAL,12; With this: mapannounce strnpcinfo(2),"The emperium has been destroyed by " + strcharinfo(0),bc_map|bc_woe,"0x00CCFF",FW_NORMAL,12; ==================================================== Find : // Respawn the Emperium, and display new owners. Add before the line : set .@breaker$, strcharinfo(0); Find : end; // War of Emperium has ended. Add before the line : announce "The [" + getcastlename(strnpcinfo(2)) + "] castle has been conquered by [ "+.@breaker$+" ] of the [" + getguildName(.@GID) + "] guild.",bc_all; here..
    1 point
×
×
  • Create New...