Jump to content

Litro Endemic

Members
  • Posts

    283
  • Joined

  • Days Won

    10

Litro Endemic last won the day on March 12 2023

Litro Endemic had the most liked content!

6 Followers

About Litro Endemic

  • Birthday 10/27/1991

Profile Information

Contact Methods

Recent Profile Visitors

5448 profile views

Litro Endemic's Achievements

Poporing

Poporing (4/15)

  • Problem Solver Rare
  • Reacting Well
  • First Post
  • Collaborator
  • Conversation Starter

Recent Badges

76

Reputation

28

Community Answers

  1. SC_S_LIFEPOTION (EFST_S_LIFEPOTION) desc: Increase HP each interval val1: if < 0 will be percentage. If > 0 is fixed HP heal value val2: Interval per seconds SC_L_LIFEPOTION (EFST_L_LIFEPOTION) desc: Increase HP each interval val1: if < 0 will be percentage. If > 0 is fixed HP heal value val2: Interval per seconds
  2. Yes, its possible, I still have old master goddameit mod patch from that can be used as reference, well it need adjustment to be usable. txtlogin.7z
  3. - script kickmap_guild#template -1,{ end; OnInit: .map$ = "prt_fild07"; setmapflag .map$, mf_loadevent; // fallthrough as first check upon script loaded OnTimer5000: // next timer after ini will run on 5 seconds after if (strnpcinfo(2) == "template") { // only this npc with hidden name "template" will do the timer .@gid = getcastledata("prtg_cas01", CD_GUILD_ID); .@num = getmapunits(BL_PC, .map$, .@name$[0]); freeloop(1); for (.@i = 0; .@i < .@num;.@i++) { if (getcharid(2, .@name$[.@i]) == .@gid) // still on the guild? skip it. continue; message .@name$[.@i], "YOU ARE NO LONGER WELCOME HERE, YOU WILL BE WARPED TO WHERE YOU BELONG!!!!"; warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]); } freeloop(0); initnpctimer; // reinit the timer tick } end; OnAgitStart: OnAgitStart2: OnAgitStart3: if (!agitcheck() && !agitcheck2() && !agitcheck3()) end; .@num = getmapunits(BL_PC, .map$, .@name$[0]); freeloop(1); for (.@i = 0; .@i < .@num;.@i++) { message .@name$[.@i], "Agit event has been started, You will be warped to Save Point"; warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]); } freeloop(0); end; OnPCLoadMapEvent: if (strcharinfo(3) != .map$) end; if (agitcheck() || agitcheck2() || agitcheck3()) end; .@gid = getcastledata("prtg_cas01", CD_GUILD_ID); if (getcharid(2) != .@gid) { mes "YOU ARE NOT ALLOWED HERE, GO BACK!!!!"; next; warp "SavePoint", 0, 0; } end; } I am leaving some comment for you there well take a look and improvise as you need.
  4. albeit fixed, 1 timer for each guild member will have many timer as many guild member, well.. you can use 1 timer for all npc and its duplicate, just iterate the town array in main npc, 1 timer for all well it is just about performance and memory resource that will be used on the timer generated, say there will be 3 town for guild town and each its guild have 72 member 72 * 3 timer if all them on town oh and this take 1 timer slot for it well you can just ignore this if your host server has huge memory
  5. the problem is on here .@num = getmapunits(BL_NPC, .map$, .@name$[0]); it should be BL_PC coz you are looking for player in that map. .@num = getmapunits(BL_PC, .map$, .@name$[0]); i made mistake copy paste-ing from script doc without adjusting what needed fully. if you look on name that used on getcharid like 'prtf017' that would be npc
  6. you can try this, https://gist.github.com/Litro/afd8799bbcc6384ba324e1bc7cbbb5d0 ugh what is wrong with comment editor, I can't use code block feature
  7. that because current pvp ranking system has it own point rank logic. suppose there is 2 player A & B currently in pvp map so the flow should go like.. - player A 5 point, rank 2/2 - player B 5 point, rank 2/2 - player A kill player B - player A 6 (5 + 1) point, rank 1/2 - player B 4 (5 - 1) point, rank 2/2 - player B warp out then goes back - player A 6 point, rank 1/2 - player B 5 point, rank 2/2 - player B kill player A - player B 6 (5 + 1) point, rank 1/2 - player A 4 (5 - 1) point, rank 2/2 - player A warp out then goes back - player B 6 point, rank 1/2 - player A 5 point, rank 2/2 anyway you can debug the code, to see the point acquired by player on map. /*========================================== * Update PVP rank for sd1 in cmp to sd2 *------------------------------------------*/ static int pc_calc_pvprank_sub(struct block_list *bl,va_list ap) { map_session_data *sd1,*sd2; sd1=(map_session_data *)bl; sd2=va_arg(ap,map_session_data *); if( pc_isinvisible(sd1) || pc_isinvisible(sd2) ) {// cannot register pvp rank for hidden GMs return 0; } + ShowDebug("pc_calc_pvprank_sub: player %s (%d:%d) %d pvp point.\n", sd1->status.name, sd1->status.account_id, sd1->status.char_id, sd1->pvp_point); + if( sd1->pvp_point > sd2->pvp_point ) sd2->pvp_rank++; return 0; } /*========================================== * Calculate new rank beetween all present players (map_foreachinallarea) * and display result *------------------------------------------*/ int pc_calc_pvprank(map_session_data *sd) { int old = sd->pvp_rank; struct map_data *mapdata = map_getmapdata(sd->bl.m); + ShowDebug("pc_calc_pvprank: player %s (%d:%d) %d pvp point.\n", sd->status.name, sd->status.account_id, sd->status.char_id, sd->pvp_point); + sd->pvp_rank=1; map_foreachinmap(pc_calc_pvprank_sub,sd->bl.m,BL_PC,sd); if(old!=sd->pvp_rank || sd->pvp_lastusers!=mapdata->users_pvp) clif_pvpset(sd,sd->pvp_rank,sd->pvp_lastusers=mapdata->users_pvp,0); return sd->pvp_rank; } though its bit weird pvp rank timer is allocated to each player in map instead run like dynamic mob, i mean the timer attached to map will run when there is player come to map (clif_parse_LoadEndAck ?) and stop when there is no one in map. albeit it will send 2 times the rank packet (clif_pvpset) when player come to map and timer executed at same time, but it should be no biggie. Oh or try use client command "/pvpinfo" in each player client to see current point, since rank is based point.
  8. You could use "OnInstanceDestroy" event label.
  9. CMIW it should be your iteminfo lua or lub file that broken that not having, view id entry.
  10. CMIW, if you want to disable that you should modify the client, iirc I have tried to disable that long time ago but failed, so I took another approach disabling code on that responding to packet send client when player clicking menu on that. You can disable the response of that menu on src/map/clif.cpp "clif_parse_Restart" Then about "automatically add a 10 secs respawn time after player character has been kill" you can increase the tick in code that used on pc_dead in file src/map/pc.cpp this code would auto respawn the dead in 1 second (1000), you can alter it to your need. sd->respawn_tid = add_timer(tick + 1000, pc_respawn_timer, sd->bl.id, 0);
  11. well it would skip if(.@menu$=="") since the generated string in variable .@menu$ would be like "::::::::" depending of size of the orbs. set .@menu$, ""; for (.@i = 0; .@i < getarraysize(.orbs); .@i++) { .@qty = countitem(.orbs[.@i]); if (.@qty) { .@avail = 1; .@menu$ += getitemname(.orbs[.@i])+" x"+.@qty+":"; } else .@menu$ += ":"; } if(!.@avail) { mes .npc$; mes "Hmm, you don't seem to have any enchantment orbs."; close; }
  12. What I see from the script code, when player click the npc it will go run script label OnInit to the end thats why NPC is not responding. You should move up the label OnTalk section. so it will respond. Also you should replace addtimer on OnInit label with initnpctimer, from what I see your NPC need is timer that not need to be attached to player.
  13. The only easy way with 1 random option group id to all equip dropped by monster is to mod the source diff --git a/conf/battle/feature.conf b/conf/battle/feature.conf index aa08ec4dd..49f9f64ab 100644 --- a/conf/battle/feature.conf +++ b/conf/battle/feature.conf @@ -175,3 +175,9 @@ feature.stylist: on // If this is allowed the "nosave" mapflag is still being respected // and may prevent players from warping back into the instance. //feature.instance_allow_reconnect: yes + +// Default random option group attached to all equipment +// This random option group id will be attached +// If the original drop entry on mob_db.yml +// Do not have RandomOptionGroup entry on it. +feature.default_randomopt_group: 1111 diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 908d67571..1b6f3f030 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -10476,6 +10476,8 @@ static const struct _battle_data { + { "feature.default_randomopt_group", &battle_config.default_randomopt_group, 0, 0, INT_MAX, }, + #include <custom/battle_config_init.inc> }; diff --git a/src/map/battle.hpp b/src/map/battle.hpp index 015249b5d..5b8b1063b 100644 --- a/src/map/battle.hpp +++ b/src/map/battle.hpp @@ -735,6 +735,8 @@ struct Battle_Config + int default_randomopt_group; + #include <custom/battle_config_struct.inc> }; diff --git a/src/map/mob.cpp b/src/map/mob.cpp index a4e73ea5d..b8bee338b 100644 --- a/src/map/mob.cpp +++ b/src/map/mob.cpp @@ -2124,6 +2124,16 @@ void mob_setdropitem_option(item *item, s_mob_drop *mobdrop) { std::shared_ptr<s_random_opt_group> group = random_option_group.find(mobdrop->randomopt_group); + if (group == nullptr && battle_config.default_randomopt_group) { + if (itemdb_isequip(item->nameid)) { + group = random_option_group.find(battle_config.default_randomopt_group); + if (group == nullptr) { + ShowWarning("Battle setting 'feature.default_randomopt_group' is disabled as random option group with id %d is not exist.\n", battle_config.default_randomopt_group); + battle_config.default_randomopt_group = 0; + } + } + } + if (group != nullptr) { group->apply( *item ); }
×
×
  • Create New...