-
Posts
255 -
Joined
-
Days Won
9
Community Answers
-
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
-
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; }
-
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
-
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
-
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.
-
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
[email protected] = 5; [email protected] = (NextBaseExp * [email protected]) / 100; getexp2 [email protected],0; [email protected] = 5; [email protected] = ((NextBaseExp - BaseExp) * [email protected]) / 100; getexp2 [email protected],0;
-
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; [email protected] = inarray(.moblist[0], killedrid); if ([email protected] == -1) end; [email protected] = getelementofarray(getvariableofnpc(.tombid, "TheTomb"), [email protected]); debugmes "npcid: "[email protected]; getunitdata(killedgid, [email protected]); setunitdata([email protected], UNPC_MAPID, [email protected][UMOB_MAPID]); setunitdata([email protected], UNPC_X, [email protected][UMOB_X]); setunitdata([email protected], UNPC_Y, [email protected][UMOB_Y]); setunitdata([email protected], UNPC_LOOKDIR, 0); end; OnInit: setarray .moblist[0], 1002, 1003, 1004, 1005; [email protected] = getarraysize(.moblist); [email protected] = getvariableofnpc(.tombcount, "TheTomb"); if ([email protected] < [email protected]) { debugmes "The Tomb count isn't match with the mob count in list"; debugmes "Size of Mob List: "[email protected]+", NPC Tomb Count: "[email protected]; 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
-
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
-
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... [email protected] = getcharid(3); //[email protected] = [email protected][0]; //[email protected] = killerrid; //[email protected] = killergid; specialeffect3 EF_HIT1,AREA,[email protected];
-
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
-
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);
-
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.
-
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
-
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
-
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
-
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: [email protected] = getcharid(2); if ( [email protected] && getguildmaster([email protected]) && strcharinfo(3) == "guild_vs3" ) { atcommand "@guildrecall "+getguildname([email protected]); } else dispbottom "You are not authorized to use this commands"; end; } try this
-
Litro Endemic's post in Cant Compile with visual studio was marked as the answer
I'm sorry but the wiki is outdated, you need 2013 visual studio to compile
-
Litro Endemic's post in Need Help ! Giving Item to All players was marked as the answer
try this
// usage : // [npc:Sample]map#512#10 // [npc:Sample]all#512#123 - script Sample -1,{ OnWhisperGlobal: if( getgmlevel() >= 99 ){ // check map if( @whispervar0$ == "all" ) addrid 0; else if( @whispervar0$ == "map" ) addrid 1; else { dispbottom "Error, pick 'map' or 'all'"; end; } // check item set [email protected],atoi( @whispervar1$ ); set [email protected],atoi( @whispervar2$ ); if( getitemname( [email protected] ) == "null" || [email protected] < 1 ){ dispbottom "Enter valid item id and amount."; } if(checkvending() || checkchatting() || checkidle() >= 60 ) end; [email protected] = [email protected] + 1; getitem [email protected],[email protected]; dispbottom "Gave "[email protected]+" x "+getitemname( [email protected] )+" to "[email protected]+" Player(s)."; } end; }
-
Litro Endemic's post in Why isn't this script working? was marked as the answer
First you write close; as cloes; in the gm: label
2nd you didn't need end when closing dialog, close is enough
prontera,160,187,4 script MI 100,{ if(getgmlevel() < 50) { mes "[^FF0000MI^000000]"; mes "Hello, I'm NPC of Monster Invasion event."; mes "You can excpet me starting the event on (s) and (s) at 8:00 PM"; close; } mes "[^FF0000MI^000000]"; mes "Hello, GM, what can I do for you?"; close; }