-
Posts
245 -
Joined
-
Last visited
-
Days Won
19
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Winterfox
-
You could combine bindatcmd and readbook. *bindatcmd "<command>","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}; This command will bind a NPC event label to an atcommand. Upon execution of the atcommand, the user will invoke the NPC event label. Each atcommand is only allowed one binding. If you rebind, it will override the original binding. Note: The default level for atcommand is 0 while the default level for charcommand is 100. The following variables are set upon execution: .@atcmd_command$ = The name of the @command used. .@atcmd_parameters$[] = Array containing the given parameters, starting from an index of 0. .@atcmd_numparameters = The number of parameters defined. Example: When a user types the command "@test", an angel effect will be shown. - script atcmd_example -1,{ OnInit: bindatcmd "test",strnpcinfo(3) + "::OnAtcommand"; end; OnAtcommand: specialeffect2 EF_ANGEL2; end; } *readbook <book id>,<page>; This command will open a book item at the specified page.
- 1 reply
-
- 1
-
-
Why don't you simply try it before asking if it works? Everything inside the {} works like in any other script. So of course you can simply chain commands after each other.
-
It needs to be ";" instead of ",". setitemscript(.@itemIds[.@i], "{ bonus(bMaxHP, 100000); bonus(bCritical, 100); }");
-
You can use a floting npc. The npc doesn't need to be visible. You als should call the code using the OnInit label, so you don't have to call it manually. - script TestBonus FAKE_NPC,{ OnInit: setarray(.@itemIds[0], 440008, 1102); // ประกาศอาร์เรย์ itemIds ขนาด 2 for (.@i = 0; .@i < getarraysize(.@itemIds); .@i++) setitemscript(.@itemIds[.@i], "{ bonus(bMaxHP, 100000); }"); }
-
That is wrong. You should take a better look at my example. setitemscript(.@itemIds[.@i], "{ bonus(bMaxHP, 100); }"); You need to add the {} and bonus is enough since you only need 1 value to set the max hp bonus.
-
Extra EXP / DROP Rewards from Monsters killed
Winterfox replied to Louis T Steinhil's question in Scripting Support
To shorten this code, you can use these commands: *getexp <base_exp>,<job_exp>{,<char_id>}; This command will give the invoking character a specified number of base and job experience points. Used for a quest reward. Negative values won't work. The EXP values are adjustted by 'quest_exp_rate' config value, VIP bonus, Guild Tax and EXP boost items such Battle Manual, Bubble Gum, or items that have SC_EXPBOOST or SC_ITEMBOOST. getexp 10000,5000; --------------------------------------- *getexp2 <base_exp>,<job_exp>{,<char_id>}; This command is safety version of 'set' command for BaseExp and JobExp. If using 'set' while the BaseExp or JobExp value is more than 2,147,483,647 (INT_MAX) will causing overflow error. Unlike 'getexp', this command ignores the adjustment factors! So using getexp2 you could shorten your function, while keeping the same effect as the original: function script F_Tower_Exp { setarray(.@bonusExp[1], 10, 20, 40, 80, 100); 'bonuzExp = .@bonusExp['level_mode]; getexp2(getmonsterinfo(killedrid, 3) * 'bonuzExp, getmonsterinfo(killedrid, 4) * 'bonuzExp)) return; } -
Hi, How to make showing player online after Server Name?
Winterfox replied to Alexandrite's question in Client-side Support
I am not 100% sure, but it seems that depends on your client version. I couldn't find any config in rAthena regarding the showing or not showing of the user count. I also couldn't find a patch for the client to enable it. Maybe you are lucky and someone else can tell you more. -
As per a user's request, I added the possibility to modify the chance to catch certain fish based on the rod used. sec_in02, 150, 165, 0 script Fishing Hole 10065,{ Fish: for(.@i = 0; .@i < .rods_size; .@i += .next_rod_step) { if(isequipped(.rods[.@i])) { .@rod_equipped = 1; .@rod_type = .@i; break; } } if(.@rod_equipped == 0 || countitem(.lure) == 0) { dispbottom("[Fishing] You need a Rod and Lure."); end; } specialeffect(EF_BUBBLE, "Fishing Hole"); soundeffect("fishingrod.wav", 0); dispbottom("[Fishing] Casting..."); .@fishing_cast_time = .default_fishing_cast_time; for(.@i = 0; .@i < .fishing_items_size; .@i += 2) if (isequipped(.fishing_items[.@i])) .@fishing_cast_time += .fishing_items[.@i + 1]; progressbar("ffffff", .@fishing_cast_time); delitem(.lure, 1); .@chance_sum = 0; cleararray(.@current_chances[0], 0, .chances_size); for(.@i = 0; .@i < .chances_size; .@i++) { .@modifier = .chances[.@i] * .rods[.@rod_type + (.@i + 1)]; .@current_chances[.@i] += .chances[.@i] * 100 + .@modifier; .@chance_sum += .@current_chances[.@i]; } .@pull = rand(1, .@chance_sum); .@catch = 0; for(.@i = 0; .@i < .chances_size; .@i++) { .@pull -= .@current_chances[.@i]; if(.@pull <= 0) { switch(.@i) { case 0: .@catch = .rare_catches[rand(.rare_catches_size)]; mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a " + getitemname(.@catch) + "!", bc_map, "0x33CC00"); break; case 1: .@catch = .magic_fish; mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a Magical Fish!", bc_map, "0xff77ff"); break; case 2: .@catch = .normal_catches[rand(.normal_catches_size)]; break; case 3: break; } break; } } if(.@catch == 0) { dispbottom("[Fishing] Nothing was caught..."); specialeffect2(EF_TEMP_FAIL); if(.auto_fail == 1) goto Fish; end; } getitem(.@catch, 1); specialeffect2(EF_TEMP_OK); if(.auto == 1) goto Fish; end; OnInit: // Fishing rod <id, rare, magic fish, normal, nothing> // + 1 = 1% increase // - 1 = 1% decrease setarray(.rods, 2764, 0, 0, 0, -25, 2763, 0, 0, 0, -50); // Fishing Lure .lure = 2775; // Auto-Fish .auto = 1; // Auto-Fish on Fail .auto_fail = 1; // Default Cast Time .default_fishing_cast_time = 15; // Chances for catch rarities: <rare>, <magic fish>, <normal>, <nothing> setarray(.chances[0], 5, 3, 55, 37); // Fishing Items setarray(.fishing_items, 2550, -2, 2443, -2, 2764, -3, 2775, -1); // Magic Fish .magic_fish = 6096; // Catches setarray(.normal_catches[0], 579, 908, 909, 963, 956, 6049, 918, 960, 910, 938, 624); // Rare Catches setarray(.rare_catches[0], 644, 603, 617); // CONFIG END // .chances_size = getarraysize(.chances); .rods_size = getarraysize(.rods); .fishing_items_size = getarraysize(.fishing_items); .normal_catches_size = getarraysize(.normal_catches); .rare_catches_size = getarraysize(.rare_catches); .next_rod_step = .chances_size + 1; } sec_in02,153,165,0 duplicate(Fishing Hole) Fishing Hole#1 10065 sec_in02,156,165,0 duplicate(Fishing Hole) Fishing Hole#2 10065 sec_in02,159,165,0 duplicate(Fishing Hole) Fishing Hole#3 10065 sec_in02,162,165,0 duplicate(Fishing Hole) Fishing Hole#4 10065 sec_in02,153,168,0 duplicate(Fishing Hole) Fishing Hole#5 10065 sec_in02,156,168,0 duplicate(Fishing Hole) Fishing Hole#6 10065 sec_in02,159,168,0 duplicate(Fishing Hole) Fishing Hole#7 10065 sec_in02,162,168,0 duplicate(Fishing Hole) Fishing Hole#8 10065 sec_in02,150,168,0 duplicate(Fishing Hole) Fishing Hole#9 10065 sec_in02,153,162,0 duplicate(Fishing Hole) Fishing Hole#10 10065 sec_in02,156,162,0 duplicate(Fishing Hole) Fishing Hole#11 10065 sec_in02,159,162,0 duplicate(Fishing Hole) Fishing Hole#12 10065 sec_in02,150,162,0 duplicate(Fishing Hole) Fishing Hole#14 10065 sec_in02,153,159,0 duplicate(Fishing Hole) Fishing Hole#15 10065 sec_in02,156,159,0 duplicate(Fishing Hole) Fishing Hole#16 10065 sec_in02,159,159,0 duplicate(Fishing Hole) Fishing Hole#17 10065 sec_in02,150,159,0 duplicate(Fishing Hole) Fishing Hole#18 10065 sec_in02,153,156,0 duplicate(Fishing Hole) Fishing Hole#19 10065 sec_in02,156,156,0 duplicate(Fishing Hole) Fishing Hole#20 10065 sec_in02,159,156,0 duplicate(Fishing Hole) Fishing Hole#21 10065 sec_in02,162,156,0 duplicate(Fishing Hole) Fishing Hole#22 10065 sec_in02,150,156,0 duplicate(Fishing Hole) Fishing Hole#23 10065
-
I added that every item picked up from the mvp does expire and as long as you have one of the items in your inventory and are on the same map as the event mvp is, a buff is applied. There are a few things to note though: The script is really resource heavy due to 3 loops, of which 2 run as long as the mob lives and one that runs infinite. The buff will not immediately disappear once you leave the map or the item expires. It will run out with its normal expiration time. Since there is no way to make rentals drop on the floor, the picked up item gets deleted and replaced by a rental version, that means it will seem as if a player picked up 2 items, even though he will have only one in the inventory, of course. - script MVP_EVENT FAKE_NPC,{ OnInit: // Mobinfo .mob = 1159; .map$ = "morocc"; .x = 154; .y = 92; .respawn_time = 15; // Respawntime in minutes .percent = 10; // Item drop every x hp percent. // <x, y>.. setarray(.path, 158, 87, 162, 90, 166, 87, 161, 91, 156, 90); // Dropiteminfo .item = 6797; .repetition = 25; // How often the item drops per x hp percent .expiration_time = 15; // Expiration time in minutes // Buffinfo .skill_effect = 34; // The id of the buff skill .skill_effect_value = 0; // The value the skill effect shows, for example when the skill is heal. .status_effetc_type = SC_BLESSING; .status_ticks = 240000; .status_value1 = 10; .status_value2 = 0; .status_value3 = 0; .status_value4 = 0; // CONFIG END // .move_count = getarraysize(.path) - 2; donpcevent("MVP_EVENT::OnBuffcheck"); .respawn_time *= 1000 * 60; .expiration_time *= 60; OnSpawn: monster(.map$, .x, .y, strmobinfo(1, .mob), .mob, 1); .gid = $@mobid[0]; setunitdata(.gid, UMOB_DMOTION, 0); setunitdata(.gid, UMOB_MODE, MD_CANMOVE | MD_NORANDOMWALK | MD_MVP | MD_KNOCKBACKIMMUNE | MD_STATUSIMMUNE | MD_TELEPORTBLOCK); .curr_pointer = -2; donpcevent("MVP_EVENT::OnDestinationReached"); .@next_drop_percent = 100 - .percent; .@last_hp_percent = 100; freeloop(1); while(unitexists(.gid)) { getunitdata(.gid, .@mvp_data); .@curr_hp_percent = .@mvp_data[UMOB_HP] * 100 / .@mvp_data[UMOB_MAXHP]; if(.@curr_hp_percent == .@last_hp_percent) { sleep(100); continue; } if(.@curr_hp_percent > .@last_hp_percent) .@next_drop_percent = (.@curr_hp_percent / .percent) * .percent; .@last_hp_percent = .@curr_hp_percent; if(.@next_drop_percent >= .@curr_hp_percent) { donpcevent("MVP_EVENT::OnDrop"); .@next_drop_percent -= .percent; } sleep(100); } freeloop(0); sleep(.respawn_time); donpcevent("MVP_EVENT::OnSpawn"); end; OnDrop: for(.@i = 0; .@i < .repetition; .@i++) { getunitdata(.gid, .@mvp_data); makeitem(.item, 1, mapid2name(.@mvp_data[UMOB_MAPID]), .@mvp_data[UMOB_X], .@mvp_data[UMOB_Y], 1); sleep(100); } end; OnDestinationReached: if(!unitexists(.gid)) end; if(.move_count == .curr_pointer) .curr_pointer = 0; else .curr_pointer += 2; unitwalk(.gid, .path[.curr_pointer], .path[.curr_pointer + 1], "MVP_EVENT::OnDestinationReached"); end; OnBuffcheck: freeloop(1); while(true) { addrid(5, 0, .map$); .@item_count = countitem(.item); if(.@item_count > 0) { getinventorylist(getcharid(0)); for(.@i = 0; .@i < @inventorylist_count; .@i++) { if(@inventorylist_id[.@i] == .item && @inventorylist_expire[.@i] == 0) { delitemidx(@inventorylist_idx[.@i], @inventorylist_amount[.@i]); break; } } for(.@i = 0; .@i < .@item_count; .@i++) rentitem(.item, .expiration_time); } if(rentalcountitem(.item) > 0 && getstatus(.status_effetc_type) == 0) { sc_start4(.status_effetc_type, .status_ticks, .status_value1, .status_value2, .status_value3, .status_value4); skilleffect(.skill_effect, .skill_effect_value); } detachrid; sleep(100); } freeloop(0); }
-
It depends on how it is done. I actually build a check so that the mob drops the items again after a heal. Otherwise, it would only drop them once every x percent and even if the hp were raised again would only drop the items at the percentage it would have dropped them without the heal.
-
You use an outdated version of rathena. You need to change: makeitem(.item, .stack_size, mapid2name(.@mvp_data[UMOB_MAPID]), .@mvp_data[UMOB_X] + rand(-1, 1), .@mvp_data[UMOB_Y] + rand(-1, 1), 1); to makeitem(.item, .stack_size, mapid2name(.@mvp_data[UMOB_MAPID]), .@mvp_data[UMOB_X] + rand(-1, 1), .@mvp_data[UMOB_Y] + rand(-1, 1));
-
I thought about it, maybe it would be good to add MD_TELEPORTBLOCK, too. Since some mobs tend to teleport. For anyone interested, I also applied the changes mentioned above here for a final version: - script MVP_EVENT FAKE_NPC,{ OnInit: // Mobinfo .mob = 1159; .map$ = "morocc"; .x = 154; .y = 92; .respawn_time = 15; // Respawntime in minutes .percent = 10; // Item drop every x hp percent. // <x, y>.. setarray(.path, 158, 87, 162, 90, 166, 87, 161, 91, 156, 90); // Dropiteminfo .item = 7959; .repetition = 5; // How often the item drops per x hp percent .stack_size = 5; // Stacksize per drop // CONFIG END // .move_count = getarraysize(.path) - 2; OnSpawn: monster(.map$, .x, .y, strmobinfo(1, .mob), .mob, 1); .gid = $@mobid[0]; setunitdata(.gid, UMOB_DMOTION, 0); setunitdata(.gid, UMOB_MODE, MD_CANMOVE | MD_NORANDOMWALK | MD_MVP | MD_KNOCKBACKIMMUNE | MD_STATUSIMMUNE | MD_TELEPORTBLOCK); .curr_pointer = -2; donpcevent("MVP_EVENT::OnDestinationReached"); .@next_drop_percent = 100 - .percent; .@last_hp_percent = 100; freeloop(1); while(unitexists(.gid)) { getunitdata(.gid, .@mvp_data); .@curr_hp_percent = .@mvp_data[UMOB_HP] * 100 / .@mvp_data[UMOB_MAXHP]; if(.@curr_hp_percent == .@last_hp_percent) { sleep(500); continue; } if(.@curr_hp_percent > .@last_hp_percent) .@next_drop_percent = (.@curr_hp_percent / .percent) * .percent; .@last_hp_percent = .@curr_hp_percent; if(.@next_drop_percent >= .@curr_hp_percent) { donpcevent("MVP_EVENT::OnDrop"); .@next_drop_percent -= .percent; } sleep(500); } freeloop(0); sleep(1000 * 60 * .respawn_time); donpcevent("MVP_EVENT::OnSpawn"); end; OnDrop: for(.@i = 0; .@i < .repetition; .@i++) { getunitdata(.gid, .@mvp_data); makeitem(.item, .stack_size, mapid2name(.@mvp_data[UMOB_MAPID]), .@mvp_data[UMOB_X] + rand(-1, 1), .@mvp_data[UMOB_Y] + rand(-1, 1), 1); } end; OnDestinationReached: if(!unitexists(.gid)) end; if(.move_count == .curr_pointer) .curr_pointer = 0; else .curr_pointer += 2; unitwalk(.gid, .path[.curr_pointer], .path[.curr_pointer + 1], "MVP_EVENT::OnDestinationReached"); end; }
-
When you know how to apply the bonus to ignore knockback to an item via the item db what is your problem? I mean, when you put bonus bNoKnockback; in the script section of an item, it automatically enables the effect as long as you have the item equipped and removes it when you unequip the item. So basically what you are asking for is the default behavior? You could also just check an item that applies bonus bNoKnockback; and use it as a reference for your item. For example, this one: - Id: 20730 AegisName: Loyalists_Hood Name: Loyalists Hood Type: Armor Buy: 10 Weight: 200 Defense: 30 Slots: 1 Locations: Garment: true ArmorLevel: 1 EquipLevelMin: 80 Script: | bonus bStr,2; bonus bMaxHPrate,10; bonus bNoKnockback; bonus2 bSubEle,Ele_All,-20;
-
- script MVP_EVENT FAKE_NPC,{ OnInit: // Mobinfo .mob = 1159; .map$ = "morocc"; .x = 154; .y = 92; .respawn_time = 15; // Respawntime in minutes .percent = 10; // Item drop every x hp percent. // <x, y>.. setarray(.path, 158, 87, 162, 90, 166, 87, 161, 91, 156, 90); // Dropiteminfo .item = 7959; .repetition = 5; // How often the item drops per x hp percent .stack_size = 5; // Stacksize per drop // CONFIG END // .move_count = getarraysize(.path) - 2; OnSpawn: monster(.map$, .x, .y, strmobinfo(1, .mob), .mob, 1); .gid = $@mobid[0]; .curr_pointer = -2; donpcevent("MVP_EVENT::OnDestinationReached"); .@next_drop_percent = 100 - .percent; .@last_hp_percent = 100; freeloop(1); while(unitexists(.gid)) { getunitdata(.gid, .@mvp_data); .@curr_hp_percent = .@mvp_data[UMOB_HP] * 100 / .@mvp_data[UMOB_MAXHP]; if(.@curr_hp_percent == .@last_hp_percent) { sleep(500); continue; } if(.@curr_hp_percent > .@last_hp_percent) .@next_drop_percent = (.@curr_hp_percent / .percent) * .percent; .@last_hp_percent = .@curr_hp_percent; if(.@next_drop_percent >= .@curr_hp_percent) { donpcevent("MVP_EVENT::OnDrop"); .@next_drop_percent -= .percent; } sleep(500); } freeloop(0); sleep(1000 * 60 * .respawn_time); donpcevent("MVP_EVENT::OnSpawn"); end; OnDrop: for(.@i = 0; .@i < .repetition; .@i++) { getunitdata(.gid, .@mvp_data); makeitem(.item, .stack_size, mapid2name(.@mvp_data[UMOB_MAPID]), .@mvp_data[UMOB_X] + rand(-1, 1), .@mvp_data[UMOB_Y] + rand(-1, 1), 1); } end; OnDestinationReached: if(!unitexists(.gid)) end; if(.move_count == .curr_pointer) .curr_pointer = 0; else .curr_pointer += 2; unitwalk(.gid, .path[.curr_pointer], .path[.curr_pointer + 1], "MVP_EVENT::OnDestinationReached"); end; } This will make the mob move and allows configuring how often an item is dropped per percent threshold and how often the item is stacked. The movement is sadly a bit limited. You will have to set several waypoints, for the mob to follow, and the mob will stop permanently when attacked. I didn't find a fix for the problem of stopping, so I will leave it like this. Maybe someone else can help you fix this issue.
-
Where is this function exactly?
-
- script MVP_EVENT FAKE_NPC,{ OnInit: // Mobinfo .mob = 1159; .map$ = "prontera"; .x = 150; .y = 150; .respawn_time = 15; // Respawntime in minutes .percent = 10; // Item drop every x hp percent. // Dropiteminfo .item = 7959; .amount = 5; OnSpawn: monster(.map$, .x, .y, strmobinfo(1, .mob), .mob, 1); .@gid = $@mobid[0]; getunitdata(.@gid, .@mvp_data); .@max_hp = .@mvp_data[UMOB_MAXHP]; freeloop(1); while(unitexists(.@gid)) { getunitdata(.@gid, .@mvp_data); .@curr_hp_percent = ceil((.@mvp_data[UMOB_HP] * 100 / .@max_hp) - .percent, .percent); if(.@curr_hp_percent == .@last_hp_percent) { sleep(500); continue; } if(.@curr_hp_percent > .@last_hp_percent) .@next_drop_percent = .@curr_hp_percent - .percent; .@last_hp_percent = .@curr_hp_percent; if(.@next_drop_percent >= .@curr_hp_percent) { makeitem(.item, .amount, mapid2name(.@mvp_data[UMOB_MAPID]), .@mvp_data[UMOB_X], .@mvp_data[UMOB_Y], 1); .@next_drop_percent -= .percent; } sleep(500); } freeloop(0); sleep(1000 * 60 * .respawn_time); donpcevent("MVP_EVENT::OnSpawn"); end; }
-
prontera, 150, 165, 0 script Fishing Hole 10065,{ Fish: if(!isequipped(.rod) || countitem(.lure) == 0) { dispbottom("[Fishing] You need a Rod and Lure."); end; } specialeffect(EF_BUBBLE, "Fishing Hole"); soundeffect("fishingrod.wav", 0); dispbottom("[Fishing] Casting..."); .@fishing_cast_time = .default_fishing_cast_time; for(.@i = 0; .@i < getarraysize(.fishing_items); .@i += 2) if (isequipped(.fishing_items[.@i])) .@fishing_cast_time += .fishing_items[.@i + 1]; progressbar("ffffff", .@fishing_cast_time); delitem(.lure, 1); .@pull = rand(1, 100); .@catch = 0; .@chance = 0; for(.@i = 0; .@i < 3; .@i++) { .@chance += .chances[.@i]; if(.@pull <= .@chance) { switch(.@i) { case 0: .@catch = .rare_catches[rand(getarraysize(.rare_catches))]; mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a " + getitemname(.@catch) + "!", bc_map, "0x33CC00"); break; case 1: .@catch = .blueback; mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a Blue Fish!", bc_map, "0xff77ff"); break; case 2: .@catch = .normal_catches[rand(getarraysize(.normal_catches))]; break; } break; } } if(.@catch == 0) { dispbottom("[Fishing] Nothing was caught..."); specialeffect2(EF_TEMP_FAIL); if(.auto_fail == 1) goto Fish; end; } getitem(.@catch, 1); specialeffect2(EF_TEMP_OK); if(.auto == 1) goto Fish; end; OnInit: // Fishing rod .rod = 2764; // Fishing Lure .lure = 2775; // Auto-Fish .auto = 1; // Auto-Fish on Fail .auto_fail = 1; // Default Cast Time .default_fishing_cast_time = 15; // Chances for catch rareties: <rare>, <blueback>, <normal> // All chances together can't exceed 100. // If all chances sum up to 100, fishing doesn't fail. setarray(.chances[0], 1, 5, 50); // Fishing Items setarray(.fishing_items, 2550, -2, 2443, -2, 2764, -3, 2775, -1); // Blueback .blueback = 6096; // Catches setarray(.normal_catches[0], 579, 908, 909, 963, 956, 6049, 918, 960, 910, 938, 624); // Rare Catches setarray(.rare_catches[0], 644, 603, 617); }
-
prontera, 150, 165, 0 script Fishing Hole 10065,{ Fish: if(!isequipped(.rod) || countitem(.lure) == 0) { dispbottom("[Fishing] You need a Rod and Lure."); end; } specialeffect(EF_BUBBLE, "Fishing Hole"); soundeffect("fishingrod.wav", 0); dispbottom("[Fishing] Casting..."); delitem(.lure, 1); .@fishing_cast_time = .default_fishing_cast_time; for(.@i = 0; .@i < getarraysize(.fishing_items); .@i += 2) if (isequipped(.fishing_items[.@i])) .@fishing_cast_time += .fishing_items[.@i + 1]; progressbar("ffffff", .@fishing_cast_time); .@rand = rand(1, 100); if(.@rand > 56) { dispbottom("[Fishing] Nothing was caught..."); specialeffect2(EF_TEMP_FAIL); if(.auto_fail == 1) goto Fish; end; } if(.@rand == 1) { .@catch = .rare_catches[rand(getarraysize(.rare_catches))]; mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a " + getitemname(.@catch) + "!", bc_map, "0x33CC00"); } else if(.@rand > 1 && .@rand <= 6) { .@catch = .blueback; mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a Blue Fish!", bc_map, "0xff77ff"); } else if(.@rand > 6) .@catch = .normal_catches[rand(getarraysize(.normal_catches))]; getitem(.@catch, 1); specialeffect2(EF_TEMP_OK); if(.auto == 1) goto Fish; end; OnInit: // Fishing rod .rod = 2764; // Fishing Lure .lure = 2775; // Auto-Fish .auto = 1; // Auto-Fish on Fail .auto_fail = 1; // Default Cast Time .default_fishing_cast_time = 15; // Fishing Items setarray(.fishing_items, 2550, -2, 2443, -2, 2764, -3, 2775, -1); // Blueback .blueback = 6096; // Catches setarray(.normal_catches[0], 579, 908, 909, 963, 956, 6049, 918, 960, 910, 938, 624); // Rare Catches setarray(.rare_catches[0], 644, 603, 617); } In this script version, on each fish, a .lure item will be removed from the inventory. You can either change the lure item 2775 to a misc or etc. item via the item db, or you can leave it as equip, which will reduce the cast time as intended and use something else as lure.
-
- script PARTY_DROP FAKE_NPC,{ OnInit: setarray(.items[0], 505, 1, 10, 502, 1, 20, 501, 1, 30); .min_online_partysize = 4; end; OnNPCKillEvent: .@pid = getcharid(1); if(.@pid == 0) end; getpartymember(.@pid, 1); getpartymember(.@pid, 2); for ( .@i = 0; .@i < $@partymembercount; .@i++ ) if (isloggedin($@partymemberaid[.@i], $@partymembercid[.@i])) .@online_partymembers++; if($@partymembercount < .min_online_partysize || .@online_partymembers < .min_online_partysize) { dispbottom("Partybonus deactivated. To get the bonus there need to be atleast " + .min_online_partysize + " partymembers online."); end; } addrid(2, 0, .@pid); for(.@x = 0; .@x < getarraysize(.items_array); .@x += 3) if(rand(1,100) <= .items[.@x + 2]) getitem(.items[.@x], .items[.@x + 1]); }
-
If i want to give item to player Lv 50+
Winterfox replied to ooGubAoo's question in Scripting Support
- script GIVEAWAY FAKE_NPC,{ OnInit: .min_lvl = 50; .item_id = 501; .amount = 5; .item_name = getitemname(.item_id); end; OnClock0000: addrid(0); if(BaseLevel < .min_lvl) end; getitem(.item_id, .amount); message(strcharinfo(0), "ท่านได้ของรางวัลเป็น " + .item_name + "."); } -
I don't think this is possible without a source code change, since there is no event to know when a specific mob is attacked by a player.
-
prontera,167,163,4 script Lotto Girl 72,{ mes "[ " + .npc_name$ + " ]"; mes "I'm " + .npc_name$ + "! I'll exchange"; mes "Random Prizes for every"; mes "^ff0000" + F_InsertComma(.pull_price) + " zeny^000000."; next; mes "[ " + .npc_name$ + " ]"; mes "Our Grand prize is:"; mes "^ff0000 x1 TCG Card^000000"; mes "^ff0000 x1 Costume set^000000"; mes "Consolations are:"; mes "^ff0000 x?? Gold Coin^000000"; mes "^ff0000 x?? Gold^000000"; mes "^ff0000 x?? Treasure Box^000000"; mes "^ff0000 x?? Oridecon^000000"; mes "^ff0000 x?? Elunium^000000"; mes "And many more!!"; next; mes "[ " + .npc_name$ + " ]"; mes "Do you want to pull?"; next; if(select("Sure!:No.") == 2) { mes "[ " + .npc_name$ + " ]"; mes "Come back if you change"; mes "your mind."; close; } mes "[ " + .npc_name$ + " ]"; mes "How many pulls do you want?"; next; .@range = input(.@pullAmt, .min_pulls, .max_pulls); if(.@range != 0) { mes "[ " + .npc_name$ + " ]"; mes "The " + ((.@range > -1) ? "maximum" : "minimum") + " number of pulls is " + ((.@range > -1) ? .max_pulls : .min_pulls) + "."; close; } if (Zeny < .pull_price * .@pullAmt) { mes "[ " + .npc_name$ + " ]"; mes "You don't have enough zeny."; close; } freeloop(1); for(.@i = 0; .@i < .@pullAmt; .@i++) { if (Weight * 100 / MaxWeight >= .weight_cap) { mes "[ " + .npc_name$ + " ]"; mes "You can't do anymore"; mes "pulls because you are"; mes "nearing your weight limit"; close; } Zeny -= .pull_price; .@priceNo = rand(0, getarraysize(.prices) - 1); .@priceIdx = .@priceNo * 4; if (rand(1, 100) <= .prices[.@priceIdx]) { .@itemId = .prices[.@priceIdx + 1]; .@itemAmt = rand(.prices[.@priceIdx + 2], .prices[.@priceIdx + 3]); if(.prices[.@priceIdx] <= .announce_limit) { announce("Hey! " + strcharinfo(0) + " just received " + getitemname(.@itemId) + " x " + .@itemAmt + " from " + .npc_name$ + "!", bc_all); specialeffect2(248); } } else { .@itemId = rand(.default[0], .default[1]); .@itemAmt = rand(.default[2], .default[3]); } getitem(.@itemId, .@itemAmt); } freeloop(0); mes "[ " + .npc_name$ + " ]"; mes "Here you go!"; close; OnInit: .npc_name$ = strnpcinfo(1); .pull_price = 50000; .announce_limit = 5; .weight_cap = 90; .min_pulls = 1; .max_pulls = 500; //<Chance in %>, <ItemID>, <MinAmount>, <MaxAmount> setarray(.prices[0], 1, 35031, 1, 1, // demoniac mid 1, 35081, 1, 1, // demoniac upper 1, 35099, 1, 1, // demoniac low 2, 7227, 1, 1, // tcg 5, 7539, 1, 2, // diablo coin 8, 969, 1, 3, // gold 10, 604, 1, 3, // deadbranch 8, 7444, 1, 3, // treasurebox 8, 12208, 1, 2, // battle manual 20, 985, 3, 8, // elu 25, 7063, 2, 5, // alice apron 25, 7047, 2, 5, // soft feather 20, 984, 3, 8, // ori 15, 748, 1, 3 // witherless ); //<MinItemID>, <MaxItemID>, <MinAmount>, <MaxAmount> setarray(.default[0], 901, 926, 5, 15); delwaitingroom; waitingroom("Try your Luck?", 0); }
-
prontera,167,163,4 script Lotto Girl 72,{ mes "[ " + .npc_name$ + " ]"; mes "I'm " + .npc_name$ + "! I'll exchange"; mes "Random Prizes for every"; mes "^ff0000" + F_InsertComma(.pull_price) + " zeny^000000."; next; mes "[ " + .npc_name$ + " ]"; mes "Our Grand prize is:"; mes "^ff0000 x1 TCG Card^000000"; mes "^ff0000 x1 Costume set^000000"; mes "Consolations are:"; mes "^ff0000 x?? Gold Coin^000000"; mes "^ff0000 x?? Gold^000000"; mes "^ff0000 x?? Treasure Box^000000"; mes "^ff0000 x?? Oridecon^000000"; mes "^ff0000 x?? Elunium^000000"; mes "And many more!!"; next; mes "[ " + .npc_name$ + " ]"; mes "Do you want to pull?"; next; if(select("Sure!:No.") == 2) { mes "[ " + .npc_name$ + " ]"; mes "Come back if you change"; mes "your mind."; close; } mes "[ " + .npc_name$ + " ]"; mes "How many pulls do you want?"; next; .@range = input(.@pullAmt, .min_pulls, .max_pulls); if(.@range != 0) { mes "[ " + .npc_name$ + " ]"; mes "The " + ((.@range > -1) ? "maximum" : "minimum") + " number of pulls is " + ((.@range > -1) ? .max_pulls : .min_pulls) + "."; close; } if (Zeny < .pull_price * .@pullAmt) { mes "[ " + .npc_name$ + " ]"; mes "You don't have enough zeny."; close; } freeloop(1); for(.@i = 0; .@i < .@pullAmt; .@i++) { if (Weight * 100 / MaxWeight >= .weight_cap) { mes "[ " + .npc_name$ + " ]"; mes "You can't do anymore"; mes "pulls because you are"; mes "nearing your weight limit"; close; } Zeny -= .pull_price; .@priceNo = rand(0, getarraysize(.prices) - 1); .@priceIdx = .@priceNo * 4; if (rand(1, 100) <= .prices[.@priceIdx]) { .@itemId = .prices[.@priceIdx + 1]; .@itemAmt = rand(.prices[.@priceIdx + 2], .prices[.@priceIdx + 3]); if(.prices[.@priceIdx] <= .announce_limit) { announce("Hey! " + strcharinfo(0) + " just received " + getitemname(.@itemId) + " x " + .@itemAmt + " from " + .npc_name$ + "!", bc_all); specialeffect2(248); } } else { .@itemId = rand(.default[0], .default[1]); .@itemAmt = rand(.default[2], .default[3]); } getitem(.@itemId, .@itemAmt); } freeloop(0); mes "[ " + .npc_name$ + " ]"; mes "Here you go!"; close; OnInit: .npc_name$ = strnpcinfo(1); .pull_price = 50000; .announce_limit = 5; .weight_cap = 90; .min_pulls = 1; .max_pulls = 500; //<Chance in %>, <ItemID>, <MinAmount>, <MaxAmount> setarray(.prices[0], 1, 35031, 1, 1, // demoniac mid 1, 35081, 1, 1, // demoniac upper 1, 35099, 1, 1, // demoniac low 2, 7227, 1, 1, // tcg 5, 7539, 1, 2, // diablo coin 8, 969, 1, 3, // gold 10, 604, 1, 3, // deadbranch 8, 7444, 1, 3, // treasurebox 8, 12208, 1, 2, // battle manual 20, 985, 3, 8, // elu 25, 7063, 2, 5, // alice apron 25, 7047, 2, 5, // soft feather 20, 984, 3, 8, // ori 15, 748, 1, 3 // witherless ); //<MinItemID>, <MaxItemID>, <MinAmount>, <MaxAmount> setarray(.default[0], 901, 926, 5, 15); delwaitingroom; waitingroom("Try your Luck?", 0); }
-
It isn't empty. Look at the Size it says 90.9 KB. Your problem is that you are in the tree view of the lub file. You need to switch to the raw view.
-
Why don't you update your client with kro lite patcher to get the latest client version and extract the AccessoryId.lub from the grf?