Jump to content

Litro Endemic

Members
  • Posts

    283
  • Joined

  • Days Won

    10

Everything posted by Litro Endemic

  1. isn't this ghost script ? why you didn't use latest one, this is one of popular script beside pvp announcer of miss annie. i can't think the exact reason why it isn't firing the announcement... but looking at the code for(set .@i, 0; .@i < (getarraysize(.PvPMap$) - 1); set .@i, .@i + 1){ say you have 3 map listed, it will only check 2 of 3, so in your case of you only have one map to check so it didn't even do the job because size is 1 -1 = 0, imo it should fall through to the next line of code and the announcer will still come out, but well indeed it strange... try use the latest script or fix / change that line above into for(set .@i, 0; .@i < getarraysize(.PvPMap$); set .@i, .@i + 1){ or add dummy map name for the array of pvpmap, just for the sake of it setarray .PvPMap$, "dummy","guild_vs3"; //List all pvp maps here (Index 0:"All" to enable all maps) ghost script i found in the forum search
  2. this will need extra src, you can take src code of mobsearch or showmobs command, to make it compatible for your use with map name <> mob id match as query, you need to adjust the code for the map name.
  3. it's was showed there "its trying to read what isn't there", well untested code, you can try this one, untested too, but should be ok in : src/map/pc.cpp bool pc_authok(struct map_session_data *sd, uint32 login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers) find: // Request all registries (auth is considered completed whence they arrive) intif_request_registry(sd,7); return true; its where the registry loaded, so after this you can take the state of acc protect from registry change: // Request all registries (auth is considered completed whence they arrive) intif_request_registry(sd,7); if( pc_readaccountreg(sd, add_str("#BLOCKPASS")) > 0 ) sd->state.protection_acc = 1; return true;
  4. you need to save the value of protection_acc on somewhere (mysql?) so you didn't lost it when log off or changing character. on pc.cpp void pc_setnewpc(struct map_session_data *sd, uint32 account_id, uint32 char_id, int login_id1, t_tick client_tick, int sex, int fd) { add if( pc_readaccountreg(sd, add_str("#BLOCKPASS")) > 0 ) sd->state.protection_acc = 1; after //Required to prevent homunculus copuing a base speed of 0. sd->battle_status.speed = sd->base_status.speed = DEFAULT_WALK_SPEED; untested...
  5. how much damage output and damage diff you get from 2nd change mentioned by you above ? int ratio = (int64)(status_get_hp(src) / 10000) * tsc->data[SC_CRESCENTELBOW]->val1 * status_get_lv(target) / 125; if (ratio > 500) ratio = 500; // Maximum of 5000% ATK this is crazy, iirc usually i only cap the hp and lower max ratio of atk, let said player a have crescent elbow and player b hit him, player b has 300k hp, before nerf main damage = (300,000/100) * 5 * 255/ 125 = 30600 * 5000 / 10 = 15,300,000 after nerf, main damge = (300,000/10000) * 5 * 255/ 125 = 306 * 500 / 10 = 1,530,000 if you see the pattern multiply and division of factor damage variable that multiply it, you only need to make it sane enough
  6. from if (getmapxy(@mapa$,@mapx,@mapy,0,strcharinfo(0)) != 0) end; to if (getmapxy(@mapa$,@mapx,@mapy, BL_PC, strcharinfo(0)) != 0) end;
  7. the easier way is do what mabuhay told ya, but if you wanna do it on src, take a look at this part if( tsc && tsc->data[SC_CRESCENTELBOW] && wd->flag&BF_SHORT && rnd()%100 < tsc->data[SC_CRESCENTELBOW]->val2 ) { //ATK [{(Target HP / 100) x Skill Level} x Caster Base Level / 125] % + [Received damage x {1 + (Skill Level x 0.2)}] int64 rdamage = 0; int ratio = (int64)(status_get_hp(src) / 100) * tsc->data[SC_CRESCENTELBOW]->val1 * status_get_lv(target) / 125; if (ratio > 5000) ratio = 5000; // Maximum of 5000% ATK rdamage = battle_calc_base_damage(target,tstatus,&tstatus->rhw,tsc,sstatus->size,0); rdamage = (int64)rdamage * ratio / 100 + wd->damage * (10 + tsc->data[SC_CRESCENTELBOW]->val1 * 20 / 10) / 10; skill_blown(target, src, skill_get_blewcount(SR_CRESCENTELBOW_AUTOSPELL, tsc->data[SC_CRESCENTELBOW]->val1), unit_getdir(src), BLOWN_NONE); clif_skill_damage(target, src, gettick(), status_get_amotion(src), 0, rdamage, 1, SR_CRESCENTELBOW_AUTOSPELL, tsc->data[SC_CRESCENTELBOW]->val1, DMG_SKILL); // This is how official does clif_damage(src, target, gettick(), status_get_amotion(src)+1000, 0, rdamage/10, 1, DMG_NORMAL, 0, false); status_damage(target, src, rdamage, 0, 0, 0); status_damage(src, target, rdamage/10, 0, 0, 1); status_change_end(target, SC_CRESCENTELBOW, INVALID_TIMER); } and compare to this details https://irowiki.org/wiki/Crescent_Elbow, you can make head what you need to nerf from the formula used, there is a comment on how formula worked there... usually pitfall on high cap max level server is the stats go so high and make it dumb damage output.
  8. re configure number of time out param in your summon set @nTime, (300+rand(0,120))-getmonsterinfo(killedrid,1); summon "Ajudante "+getmonsterinfo(killedrid,0), killedrid, @nTime; *summon "monster name",<monster id>{,<Time Out>{,"event label"}}; Timeout is the time in milliseconds the summon lives, and is set default to 60000 (1 minute). Note that also the value 0 will set the timer to default, and it is not possible to create a spawn that lasts forever. If an event label is given, upon the monster being killed, the event label will run as if by 'donpcevent'. time out param is in milliseconds, of course your spawned monster almost disappear instantly, you set time out at range 300 ~ 420 - Monster Killed Level, that not even a second
  9. there is change on getmapxy function long ago you should update all getmapxy param type from 0 to BL_PC *getmapxy("<variable for map name>",<variable for x>,<variable for y>{,<type>,"<search value>"}) This function will locate a character object, NPC object or pet's coordinates and place their coordinates into the variables specified when calling it. It will return 0 if the search was successful, and -1 if the parameters given were not variables or the search was not successful. Type is the type of object to search for: BL_PC - Character object (default) BL_NPC - NPC object BL_PET - Pet object BL_HOM - Homunculus object BL_MER - Mercenary object BL_ELEM - Elemental object The search value is optional. If it is not specified, the location of the invoking character will always be returned for types BL_PC and BL_PET, the location of the NPC running this function for type BL_NPC. If a search value is specified, for types BL_PC and BL_NPC, the character or NPC with the specified name or GID will be located. If type is BL_PET/BL_HOM/BL_MER/BL_ELEM, the search will locate the current object of the character who's name/GID is given in the search value, it will NOT locate the object by name.
  10. it seem there is 2 type of button function, one is sending packet data and the other not, the like shortcut description and tipbox menu button is pure client side button function, well there is function clif_parse_open_ui but it only triger attendance
  11. Is there any way to modify function of client menu button for example i want to change menu button tips for refine ui?
  12. yes you can, create script command and call it from any npc script. this one based on clif_parse_cashshop_open_request ACMD_FUNC(opencashshop) { if (sd->state.cashshop_open) { clif_displaymessage(fd, "Cash Shop has been opened"); retrun -1; } sd->state.cashshop_open = true; sd->npc_shopid = -1; // Set npc_shopid when using cash shop from "cash shop" button [Aelys|Susu] bugreport:96 clif_cashshop_open( sd ); } ACMD_DEF(opencashshop),
  13. cap it to the desired value, use min or max or cap_value function
  14. - script Card Trader -1,{ getinventorylist; for(.@i = 0; .@i < @inventorylist_count; .@i++) { // check if this item type in inventory list is card if (getiteminfo(@inventorylist_id[.@i], 2) == 6) { // if it a card put in the list .@card_list[.@card_size] = @inventorylist_id[.@i]; .@card_size++; } } mes .@npc_name$ = "[Card Trader]"; mes "I can exchange 10 card to an Old Card Album"; mes "Each card need to be different from each other"; mes "Not accepting more than one of same card"; if (.@card_size < 9) close; // don't have 9 different card close. don't continue next; for (.@i = 0; .@i < 9; .@i++) // 10 cards from the list. delitem .@card_list[.@i], 1; // delete a card from each card getitem 616, 1; // 1x Old_Card_Album mes .@npc_name$; mes "Thanks for the exchange"; close; } Hope this can help you.
  15. oh, sorry about short answer
  16. " if your rate is anything above 80% itll only return 80% " isn't this same with cap value ? that should be included in code above when updating entry, in example wearing 2 garm card ? here the rate minimum is -100% and maximum is 80% it.rate = cap_value(it.rate + rate, -10000, 8000); when creating new entry, the first garm card, expalanation same with above entry.rate = cap_value(rate, -10000, 8000); try it in your local server or i didn't really get it what are you talking about.
  17. I want to collect item unique id from OnSellItem since it came out as string in script.cpp i can't make it work in npc.cpp
  18. make an entry for your robe item in data\luafiles514\lua files\transparentItem\transparentItem.lub
  19. you need to edit 2 place in that place the first one for when entry is edited, the second one is when new entry created, capped into 8000 (80%) for SC_FREEZE, better use SC_FREEZE instead 1 for comparison, so it will human readable for (auto &it : effect) { if (it.sc == sc && it.flag == flag) { if (sc == SC_FREEZE) it.rate = cap_value(it.rate + rate, -10000, 8000); else it.rate = cap_value(it.rate + rate, -10000, 10000); it.arrow_rate += arrow_rate; it.duration = umax(it.duration, duration); return; } } struct s_addeffect entry = {}; if (rate < -10000 || rate > 10000) ShowWarning("pc_bonus_addeff: Item bonus rate %d exceeds -10000~10000 range, capping.\n", rate); entry.sc = sc; if (sc == SC_FREEZE) entry.rate = cap_value(rate, -10000, 8000); else entry.rate = cap_value(rate, -10000, 10000); entry.arrow_rate = arrow_rate; entry.flag = flag; entry.duration = duration; effect.push_back(entry);
  20. you can try use this one, ref: https://rathena.org/board/topic/112186-faw-enchant-error-script/ moc_para01,179,27,0 script Valkyrie#FAWEnchant 403,{ disable_items; mes .@npc_name$ = "[^AA0000Valkyrie^000000]"; mes "I am here to enchant the", "magnificent ^000099Fallen Angel Wing^000000.", "Would you like to enchant yours?"; next; .@menu$ = select("Information:Enchant Fallen Angel Wing:Reset Enchantment"); switch(.@menu$) { default: case 1: break; case 2: callsub S_Check; .@ref = getequiprefinerycnt(EQI_GARMENT); .@card[0] = getequipcardid(EQI_GARMENT,0); .@card[1] = getequipcardid(EQI_GARMENT,1); .@card[2] = getequipcardid(EQI_GARMENT,2); .@card[3] = getequipcardid(EQI_GARMENT,3); // Check if enchantment slot is full here, do no need to continue if full. if(.@card[1] && .@card[2] && .@card[3]) { mes .@npc_name$, "Hmm.. it seems that all", "slots have already been enchanted."; close; } if ((.@card[1] && !.@card[2] && (.@ref < 7)) || (.@card[1] && .@card[2] && !.@card[3] && (.@ref < 9))) { mes .@npc_name$, "Sorry, but your", "^000099Fallen Angel Wing^000000's", "refinement level is too", "low to continue"; close; } if (.@ref > 8) .@enc_count = 3; else if (.@ref > 6 && .@ref < 9) .@enc_count = 2; else .@enc_count = 1; mes .@npc_name$; mes "You have a ^000099+"+.@ref+" Fallen Angel Wing^000000.", "It can have a total of "+.@enc_count+" enchantment"+(.@enc_count > 1? "s.":".")+" Please"; mes "select your preferred enchantment."; next; .@menu$ = ""; for (.@i = 0; .@i < getarraysize(.enchant_type$); .@i++) .@menu$ = .@menu$ + .enchant_type$[.@i]+":"; .@type = select(.@menu$); .@enc_stat = getd(".enc"+.@type+"["+callsub(S_ChanceType, .chance_type, .@card[1], .@card[2], .@card[3])+"]"); if(.enchant_cost) { if(Zeny < .enchant_cost) { mes .@npc_name$, "You don't have enough zeny."; close; } Zeny -= .enchant_cost; } delitem2 2589, 1, 1, .@ref, 0, .@card[0], .@card[1], .@card[2], .@card[3]; if(!.@card[1]) .@card[1] = .@enc_stat; else if(!.@card[2] && .@ref > 6) .@card[2] = .@enc_stat; else if(!.@card[3] && .@ref > 8) .@card[3] = .@enc_stat; getitem2 2589, 1, 1, .@ref, 0, .@card[0], .@card[1], .@card[2], .@card[3]; mes .@npc_name$, "Your ^000099Fallen Angel Wing^000000 has", "been enchanted with ^000099"+getitemname(.@enc_stat)+"^000000."; close; case 3: callsub S_Check; mes .@npc_name$, "This will cost you "+callfunc("F_InsertComma", .reset_cost)+"z.", "Are you sure?"; next; select("Yes"); mes .@npc_name$; if(Zeny < .reset_cost) { mes "You don't bring enough zeny."; close; } Zeny -= .reset_cost; .@ref = getequiprefinerycnt(EQI_GARMENT); .@card[0] = getequipcardid(EQI_GARMENT,0); .@card[1] = getequipcardid(EQI_GARMENT,1); .@card[2] = getequipcardid(EQI_GARMENT,2); .@card[3] = getequipcardid(EQI_GARMENT,3); delitem2 2589, 1, 1, .@ref, 0, .@card[0], .@card[1], .@card[2], .@card[3]; getitem2 2589, 1, 1, .@ref, 0, .@card[0], 0, 0, 0; mes "Your ^000099Fallen Angel Wing^000000's", "enchantments have been reset."; equip 2589; // didn't know it will work while npc set disable_items specialeffect2 261; specialeffect2 119; close; } mes .@npc_name$, "I can enchant your", "^000099Fallen Angel Wing^000000 for", (.enchant_cost ? callfunc("F_InsertComma",.enchant_cost)+"z":"free")+" to give it various.", "effects. In fact, I can do it", "twice if its refinement level is", "+7 ~ +8, and thrice if its", "+9 and above."; next; mes .@npc_name$, "The 3rd enchantment has a", "chance to be more powerful", "than the first two."; next; mes .@npc_name$, "There is no chance to", "fail, so enchant away", "as much as you like."; next; mes .@npc_name$, "But if you're not happy", "with the results, you can", "reset the enchantments", "for ^009900"+callfunc("F_InsertComma",.reset_cost)+"z^000000."; next; mes .@npc_name$, "That's about everything."; close; S_Check: if (getequipid(EQI_GARMENT) != 2589) { mes .@npc_name$; mes "Please equip your", "^000099Fallen Angel Wing^000000 if", "you want to have it enchanted."; close; } return; S_ChanceType: switch(getarg(0)) { case 1: //Decreasing Chance of Enchantment //60% low, 30% mid, 10% high for 1st & 2nd enchant slot //40% low, 30% mid, 20% high, 10% special for 3rd enchant slot .@rand = rand(1,10); if(getarg(2) && getarg(3)) { //For 3rd & 4th Card Slot aka 2nd & 3rd Enchant Slot if (.@rand < 5 ) .@x = 0; else if (.@rand < 7) .@x = 1; else if (.@rand < 9) .@x = 2; else .@x = 3; } else { //For 2nd Card slot aka 1st Enchant Slot if (.@rand < 7) .@x=0; else if (.@rand < 10) .@x = 1; else .@x = 2; } return .@x; case 0: if(getarg(2) && getarg(3)) return rand(0,3); else return rand(0,2); } OnInit: setarray .enchant_type$, "Fighting Enchant", "Magic Enchant", "Archer Enchant", "Critical/Fatal Enchant", "Max HP Enchant", "Max SP Enchant", "ASPD Enchant", "STR Enchant","AGI Enchant", "DEX Enchant", "VIT Enchant","INT Enchant","LUK Enchant"; setarray .enc1[0], 4809,4808,4820, 4821; //Fighting 3~5 setarray .enc2[0], 4812,4826,4827, 4828; //Magic 4~6 setarray .enc3[0], 4832,4833,4834, 4835; //Expert Arc 1~3 setarray .enc4[0], 4863,4864,4865, 4866; //Fatal 1~3 setarray .enc5[0], 4861,4862,4867, 4868; //MHPP 1~3% setarray .enc6[0], 4870,4800,4871, 4801; //MaxSP 25,50,75 setarray .enc7[0], 4869,4872,4873, 4807; //ASPD 1~3 // setarray .enc7[0], 4869,4872,4873, 4881; //ASPD 1~3 setarray .enc8[0], 4702,4703,4704, 4853; //STR 3~5 | Special Str setarray .enc9[0], 4731,4732,4733, 4854; //AGI 2~4 setarray .enc10[0], 4722,4723,4724, 4857; //DEX 3~5 setarray .enc11[0], 4742,4743,4744, 4855; //VIT 3~5 setarray .enc12[0], 4712,4713,4714, 4856; //INT 3~5 setarray .enc13[0], 4752,4753,4754, 4858; //LUK 3~5 // 1 = 60% low, 30% mid, 10% high for 1st & 2nd enchant slot && 40% low, 30% mid, 20% high, 10% special for 3rd enchant slot // 0 = Equal Chance .chance_type = 0; //Cost for Enchanting. It's free in iRO .enchant_cost = 1000000; //Cost to reset | Costs 1Mz in iRO .reset_cost = 5000000; end; }
  21. you can emulate achievement_get_reward from achievement.cpp
  22. for map you can set it in data\luafiles514\lua files\navigation\navi_map_krpri.lub
  23. no is out dated, for now mapflag has been simplified (click here for more info), if you want the same thing with the guide tutorial, now you can do it by following this add in src/map/map.hpp MF_YOUR_MAPFLAG, before MF_MAX add in src/map/script_constant.hpp export_constant(MF_YOUR_MAPFLAG); after export_constant(MF_SKILL_DURATION);
×
×
  • Create New...