Jump to content

Litro Endemic

Members
  • Posts

    283
  • Joined

  • Days Won

    10

Community Answers

  1. Litro Endemic's post in Is it possible to change only the appearance of a character to another job, without changing actual jobs and therefore skills? was marked as the answer   
    yes, use script command changelook
  2. Litro Endemic's post in Attach RandomOptionGroup directly to ALL monster drop EQUIPMENTS via db.yml was marked as the answer   
    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 ); }  
  3. Litro Endemic's post in R> Add 10 secs respawn time after player character death was marked as the answer   
    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);  
  4. Litro Endemic's post in How Normal PET can Autofeed like EvoPET? was marked as the answer   
    you have to include the pet egg on client side files system/PetEvolutionCln_true_E.lub too
  5. Litro Endemic's post in How to NAVI on Custom Map? was marked as the answer   
    for map you can set it in
    data\luafiles514\lua files\navigation\navi_map_krpri.lub  
  6. Litro Endemic's post in Little help with query_sql please was marked as the answer   
    DELETE FROM `achievement` WHERE `achievement`.`id` >= '400000' AND id <= '4000038'; is it me or there is really wrong number in the loop.
    concated value become like this:
    lower bound 40000+0 = 400.000, then upper bound 40000+38 = 4.000.038
  7. Litro Endemic's post in Can Produce Skill(BS) Make item with Random Option? was marked as the answer   
    yes its possible, just mod it on src side.
  8. Litro Endemic's post in Doubts cashshop was marked as the answer   
    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),  
  9. Litro Endemic's post in time check by ip was marked as the answer   
    use script command getcharip and create array of ip with permanent global variable, later on to check or set delay data, get the index of ip in array of ip with script command inarray if the ip exist you can check the delay data and set or update the delay data time.
    if (getarraysize(.Hunter$) >= .MaxPlayers) { mes "Atualmente a Sala está Cheia. Por favor, tente novamente mais tarde."; close; } .@ip$ = getcharip(); .@size = getarraysize($HuntRoomDelayIP$); if ((.@i = inarray($HuntRoomDelayIP$, .@ip$)) == -1) .@i = .@size; else if ($HuntRoomDelay[.@i] > gettimetick(2)) { set .@last, $HuntRoomDelay[.@i] - gettimetick(2); set .@min, .@last % ( 24 * 3600 ) % 3600 / (60); mes "Esperar por ^FF0000"+.@min+" Minutos^000000."; close; } $HuntRoomDelayIP$[.@i] = .@ip$; $HuntRoomDelay[.@i] = gettimetick(2) + ( .DelayMin * 60 ); set .Hunter$[getarraysize( .Hunter$ )],strcharinfo(0); set #FarmHunt,0; warp .Map$,0,0; end;  
  10. Litro Endemic's post in MVP reduce damage ( Green Aura ) was marked as the answer   
    on mob_db.yml find DamageTaken and delete all those

  11. Litro Endemic's post in sanctuary heal on emperium on "1" was marked as the answer   
    id is unit game id not mob id, the check is correct, if target is monster, then convert it to mob_data then check the target mob id if that monster is emperium. 
    if(target->type == BL_MOB) { struct mob_data *md = BL_CAST(BL_MOB, target); if (md->mob_id == MOBID_EMPERIUM) hp = 1; }  
  12. Litro Endemic's post in item_db - New flag_autoloot was marked as the answer   
    diff --git a/src/map/itemdb.cpp b/src/map/itemdb.cpp index a6777190b..b4ca490dd 100644 --- a/src/map/itemdb.cpp +++ b/src/map/itemdb.cpp @@ -652,6 +652,18 @@ uint64 ItemDatabase::parseBodyNode(const YAML::Node &node) { if (!exists) item->flag.dropEffect = DROPEFFECT_NONE; } + + if (this->nodeExists(flagNode, "NoAutoLoot")) { + bool active; + + if (!this->asBool(flagNode, "NoAutoLoot", active)) + return 0; + + item->flag.noautoloot = active; + } else { + if (!exists) + item->flag.noautoloot = false; + } } else { if (!exists) { item->flag.buyingstore = false; @@ -660,6 +672,7 @@ uint64 ItemDatabase::parseBodyNode(const YAML::Node &node) { item->flag.guid = false; item->flag.bindOnEquip = false; item->flag.broadcast = false; + item->flag.noautoloot = false; if (!(item->flag.delay_consume & DELAYCONSUME_TEMP)) item->flag.delay_consume = DELAYCONSUME_NONE; item->flag.dropEffect = DROPEFFECT_NONE; diff --git a/src/map/itemdb.hpp b/src/map/itemdb.hpp index 108cda7f7..70ff47c17 100644 --- a/src/map/itemdb.hpp +++ b/src/map/itemdb.hpp @@ -877,6 +877,7 @@ struct item_data bool broadcast; ///< Will be broadcasted if someone obtain the item [Cydh] bool bindOnEquip; ///< Set item as bound when equipped e_item_drop_effect dropEffect; ///< Drop Effect Mode + bool noautoloot; } flag; struct {// item stacking limitation uint16 amount; diff --git a/src/map/mob.cpp b/src/map/mob.cpp index 72bec7421..62df797fd 100644 --- a/src/map/mob.cpp +++ b/src/map/mob.cpp @@ -2190,7 +2190,7 @@ static void mob_item_drop(struct mob_data *md, struct item_drop_list *dlist, str sd = map_charid2sd(dlist->first_charid); if( sd == NULL ) sd = map_charid2sd(dlist->second_charid); if( sd == NULL ) sd = map_charid2sd(dlist->third_charid); - test_autoloot = sd + test_autoloot = sd && (itemdb_search(ditem->item_data.nameid))->flag.noautoloot == false && (drop_rate <= sd->state.autoloot || pc_isautolooting(sd, ditem->item_data.nameid)) && (flag?(battle_config.homunculus_autoloot?(battle_config.hom_idle_no_share == 0 || !pc_isidle_hom(sd)):0): (battle_config.idle_no_autoloot == 0 || DIFF_TICK(last_tick, sd->idletime) < battle_config.idle_no_autoloot));  
    Usage:
    - Id: 701 AegisName: Ora_Ora Name: Ora Ora Type: Etc Buy: 55000 Weight: 200 Flags: BuyingStore: true NoAutoLoot: true  
  13. Litro Endemic's post in warning map_setmapflag: reached the maximum number was marked as the answer   
    Use this update to clear that warning message https://github.com/rathena/rathena/commit/e2f1bca4010b26d9679fec7f249fe82c1a66e6c3#diff-95ec1891d78e6e9ffc6f68a5eb4803079621e9f9c4a2a43ffc9b70e7bedeb7be
  14. Litro Endemic's post in FluxCP notice was marked as the answer   
    <!-- Messages --> <?php if ($message=$session->getMessage()): ?> <p class="message"><?php echo htmlspecialchars($message) ?></p> <?php endif ?> put these code on header of your template.
  15. Litro Endemic's post in Item that gives a set EXP % was marked as the answer   
    According script doc
    BaseExp - Amount of base experience points. JobExp - Amount of job experience points. NextBaseExp - Amount of base experience points needed to reach the next level. NextJobExp - Amount of job experience points needed to reach the next level. since i didn't test it on game, i am not sure if NextBaseExp is full amount or has been reduced by BaseExp, if not reduced use the first one, if reduced use the 2nd one
    .@rate = 5; .@s = (NextBaseExp * .@rate) / 100; getexp2 .@s,0; .@rate = 5; .@s = ((NextBaseExp - BaseExp) * .@rate) / 100; getexp2 .@s,0;  
  16. Litro Endemic's post in How to make a NPC like MvP Tomb? was marked as the answer   
    yep, you are right the script crashed my test server, because the duplicate tomb is floating type npc, tested and worked...
    not entirely like tomb per see, because when the scenario 2 player killing same mob id from the list mob, the npc will move to the last killed mob
    ex: player a killed poring (1002) on prontera 150 150, then npc will spawned there, then after 10 seconds, player B kill poring (1002) too on prontera 180 180, the npc that spwaned after player A killed poring will move to player B killed poring
    you need many duplicate npc, to match exact number of your amount spawned mobs, or with src mod will be more easier
    btw here the tested script
    - script Main NPC -1,{ end; OnNPCKillEvent: if (.state != 1) end; .@inlist = inarray(.moblist[0], killedrid); if (.@inlist == -1) end; .@npcid = getelementofarray(getvariableofnpc(.tombid, "TheTomb"), .@inlist); debugmes "npcid: "+.@npcid; getunitdata(killedgid, .@md); setunitdata(.@npcid, UNPC_MAPID, .@md[UMOB_MAPID]); setunitdata(.@npcid, UNPC_X, .@md[UMOB_X]); setunitdata(.@npcid, UNPC_Y, .@md[UMOB_Y]); setunitdata(.@npcid, UNPC_LOOKDIR, 0); end; OnInit: setarray .moblist[0], 1002, 1003, 1004, 1005; .@moblistsize = getarraysize(.moblist); .@tombcount = getvariableofnpc(.tombcount, "TheTomb"); if (.@moblistsize < .@tombcount) { debugmes "The Tomb count isn't match with the mob count in list"; debugmes "Size of Mob List: "+.@moblistsize+", NPC Tomb Count: "+.@tombcount; end; } .state = 1; end; } - script TheTomb -1,{ end; OnInit: if (strnpcinfo(2) == "") end; .tombcount++; .tombid[.tombcount-1] = getnpcid(0); end; } prontera,0,0,0 duplicate(TheTomb) Tomb#1 112 prontera,0,0,0 duplicate(TheTomb) Tomb#2 112 prontera,0,0,0 duplicate(TheTomb) Tomb#3 112 prontera,0,0,0 duplicate(TheTomb) Tomb#4 112  
  17. Litro Endemic's post in Disable autopots was marked as the answer   
    for storage is fine, but for autopot with param it will cause problem, did thread starter using autopot command by script or src mod?
    and i think you got other misunderstanding your request, imo you want to make the autopot (process) will not active in some maps, not the usage of the autopot command, because even the autopot command is disabled in inside map, they can use it outside map, and the process of autopot is being activated and working as usual..
    if you use https://github.com/rathena/rathena/blob/master/npc/custom/etc/autopot.txt < this script
    add the condition check under OnStart Label
     
     
  18. Litro Endemic's post in specialeffect in mob unit was marked as the answer   
    you can try this...
    src\custom\script.inc
    BUILDIN_FUNC(specialeffect3) { struct block_list *bl = NULL; int id = 0; int type = script_getnum(st,2); enum send_target target = script_hasdata(st,3) ? (send_target)script_getnum(st,3) : AREA; if (script_hasdata(st,4)) { id = script_getnum(st,4); bl = map_id2bl(id); } else { bl = st->rid ? map_id2bl(st->rid) : map_id2bl(st->oid); } if(bl == NULL) return SCRIPT_CMD_SUCCESS; if( type <= EF_NONE || type >= EF_MAX ){ ShowError( "buildin_specialeffect: unsupported effect id %d\n", type ); return SCRIPT_CMD_FAILURE; } if (target == SELF) { TBL_PC *sd; if (script_rid2sd(sd)) clif_specialeffect_single(bl,type,sd->fd); } else { clif_specialeffect(bl, type, target); } return SCRIPT_CMD_SUCCESS; } src\custom\script_def.inc
    BUILDIN_DEF(specialeffect3,"i??"), usage example
    // GID examples... .@gid = getcharid(3); //.@gid = $@mobid[0]; //.@gid = killerrid; //.@gid = killergid; specialeffect3 EF_HIT1,AREA,.@gid;  
  19. Litro Endemic's post in NEED HELP - Failed adding ROBE item was marked as the answer   
    make an entry for your robe item in 
    data\luafiles514\lua files\transparentItem\transparentItem.lub  
  20. Litro Endemic's post in Doubts about adapting the Eff_Freeze limit. was marked as the answer   
    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);  
  21. Litro Endemic's post in Arrays: How to use them was marked as the answer   
    hmm... there is no need to declare an empty array, in case like java script you need declare array first before you use it later-on
    Also, an additional question, can we put an array inside an array? I was thinking of doing something like:
    setarray details[0],0,1,1,1,1,0; setarray rows[0],details; // when I call rows[0] then it will returns an array that contains 0,1,1,1,1,0 yes you can use coppyarray, maybe you need sometime to read documentation for scripting https://raw.githubusercontent.com/rathena/rathena/master/doc/script_commands.txt read this for reference, and for the example you can directly read inside
    *copyarray <destination array>[<first value>],<source array>[<first value>],<amount of data to copy>; This command lets you quickly shuffle a lot of data between arrays, which is in some cases invaluable. setarray @array[0], 100, 200, 300, 400, 500, 600; // So we have made @array[] copyarray @array2[0],@array[2],2; // Now, @array2[0] will be equal to @array[2] (300) and // @array2[1] will be equal to @array[3]. So using the examples above: @array[0] = 100 @array[1] = 200 @array[2] = 300 @array[3] = 400 @array[4] = 500 @array[5] = 600 New Array: @array2[0] = 300 @array2[1] = 400 @array2[2] = 0 @array2[3] = 0 Notice that @array[4] and @array[5] won't be copied to the second array, and it will return a 0.  
  22. Litro Endemic's post in How to import someone's item_db was marked as the answer   
    you can put it on import folder in db folder for every corresponding file, per-line you need
  23. Litro Endemic's post in Achievement System was marked as the answer   
    you only need to turn off achievement system on feature.conf on battle config https://github.com/rathena/rathena/blob/master/conf/battle/feature.conf#L69
    // Achievement (Note 1) // Requires: 2015-05-13aRagexe or later feature.achievement: on into
    // Achievement (Note 1) // Requires: 2015-05-13aRagexe or later feature.achievement: off  
  24. Litro Endemic's post in NPC Script Once Bought it Delete from the script was marked as the answer   
    try market shop https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L292
    prontera,150,150,1 marketshop Market Shop 112,501:100:10,502:100:1  
  25. Litro Endemic's post in GVG Script was marked as the answer   
    - script GuildMaster Commands -1,{ end; OnInit: bindatcmd "recallguild",strnpcinfo(3) + "::OnAtcommand"; end; OnAtcommand: .@gid = getcharid(2); if ( .@gid && getguildmaster(.@gid) && strcharinfo(3) == "guild_vs3" ) { atcommand "@guildrecall "+getguildname(.@gid); } else dispbottom "You are not authorized to use this commands"; end; } try this
×
×
  • Create New...