summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-29 20:07:22 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-29 20:07:22 +0000
commit04190264ba7007c84a69b21ac65b3779841cc04b (patch)
tree1f330fd53e9557a34bf829f7f1ce2da30a2197b6
parentb8dca07266d170be982122e6f6e6397a97d14200 (diff)
downloadhercules-04190264ba7007c84a69b21ac65b3779841cc04b.tar.gz
hercules-04190264ba7007c84a69b21ac65b3779841cc04b.tar.bz2
hercules-04190264ba7007c84a69b21ac65b3779841cc04b.tar.xz
hercules-04190264ba7007c84a69b21ac65b3779841cc04b.zip
- Probably fixed the Segmentation Faults we've been having.
Description: A player quits and it's session is freed and set to NULL, but the char server already sent a packet with player information (registers, storage, ...). If a message is sent in consequence of updating that info, a segmentation fault happens because session[sd->fd] is already NULL. Fix: make shure the session of the target player is valid before processing the rest of the char server's message. - Some minor cleanups. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9366 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt7637
-rw-r--r--src/common/socket.c2720
-rw-r--r--src/common/socket.h352
-rw-r--r--src/common/strlib.c388
-rw-r--r--src/map/intif.c3153
5 files changed, 7132 insertions, 7118 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index cc3a74dea..9056251d2 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -1,3814 +1,3823 @@
-Date Added
-
-AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
-IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
-
-2006/11/29
- * Fixed the new npc parsing code not accounting for windows-style line
- terminators, which as a side effect messed up mapflag parsing if the file
- had windows-style terminators, which coincidentally was the case for the
- nopvp file, which unfortunately meant that all towns became pvp! [Skotlex]
- * HT_PHANTASMIC no longer knocks back even when it misses. [Skotlex]
- * Earned exp by dead homuns will now be lost (same treatment as earned exp
- from players that died) [Skotlex]
- * Now gvg_dungeon mapflag will activate the other mapflags which are
- required: pvp, pvp_nocalcrank and pvp_noparty/pvp_noguild (they are forced
- to off if gvg_dungeon is on and viceversa) [Skotlex]
- * Cleaned the pvp ranking code so that it takes effect even if
- pvp_nocalcrank is active WHEN the map is a gvg_dungeon one. [Skotlex]
- * Now homuncs and their masters are the only ones who can use support
- skills on them. [Skotlex]
- * Some cleaning on the homunc speed calculating code, so that it correctly
- uses the default walk speed if the player has no speed yet. [Skotlex]
-2006/11/28
- * Fixed a typo which made the wedding_ignore_palette setting not work when
- you log on with them equipped [Skotlex]
- * Applied The Ultra Mage's patch to use strict npc header formatting
- parsing. Updated the relevant stock scripts/mapflags that didn't conform to
- the standard. [Skotlex]
- * Moved the blocking of casting supportive skills on homunculus from
- battle_check_target to status_check_skilluse as bct is not invoked unless
- the skill is offensive (or party/guild only) [Skotlex]
- * Cleaned up status_calc_bl_sub_hom, fixed recasting dex/str/vit/int
- bonuses skills making their atk/def/mdef stack with itself over and over.
- [Skotlex]
- * Updated sql files [Playtester]
- * Changing setting the Guild Master from pc_authok to clif_parse_LoadEndAck
- so that it will not fail to set the gmaster flag when the first person of a
- guild to log on is the guild master. [Skotlex]
- * Modified the way Storm Gust freeze's counter works. Now it checks for the
- caster of the Storm Gust, if it's the same as the previous hit, the counter
- is increased, otherwise, the ID is updated and the counter is changed to 1.
- [Skotlex]
- * Fixed always receiving at least 1 bexp/jexp even when the mob gives no
- exp at all. [Skotlex]
- * Changed write to send as suggested by TheUltraMage in:
- http://www.eathena.ws/board/index.php?showtopic=105417
- Hopefully that will take care of the SIGPIPE problem in Debian and cygwin. [FlavioJS]
- * Server name in core.c skipping '\\' characters. [FlavioJS]
- * Memory allocation functions using file,line,func from the invoking functions. [FlavioJS]
- * Other minor malloc changes. [FlavioJS]
-2006/11/27
- * Now when a player's "attack once" request fails due to range, the client
- is told to move to the target to attack it. This sort of fixes the problem
- of the client SPAMMING the server with attack requests from afar without
- even approaching the icewall. [Skotlex]
- * Updated the status change field "option" to an int rather than short.
- This fixes the option values for xmas/sightblaster not getting set, which
- could explain why some people crash when equipping weapons while in xmas
- suit. [Skotlex]
- * Fixed the Homunculus hungry timer not starting on login. [Skotlex]
- * Added logging for standard GM commands (/mm /b /kick etc) [KarLaeda]
- * Some cleanups on the trade_additem function. When specifying a qty of 0,
- an ack will be returned to the client so it doesn't gets stuck. [Skotlex]
- * Update sql files [Toms]
- * Corrected the skill animation for Absorb Spirits [Skotlex]
- * Cleaned up a bit the implementation of how Gravity Field blocks the
- caster from moving. [Skotlex]
- * Mob class-changing will fail if the new class is the same as the previous
- one. [Skotlex]
-2006/11/24
- * Homunc's min matk is now always equal to max matk [Skotlex]
- * Fixed EDP's damage being 100% more than it should (should be 4x, not 5x
- on normal attacks) [Skotlex]
- * Self Destruction will only hit everyone and not just enemies when used by
- mobs (non marine spheres) unless the map is a versus map. [Skotlex]
- * Spider Web's duration is now halved on players (before it was halved in
- pvp maps only) [Skotlex]
- * Likely fixed Homunculus not disappearing the second their intimacy hit 0.
- [Skotlex]
- * Fixed uninitialized variable fd being used in WFIFOHEAD in a few clif
- functions. [Skotlex]
- * Fixed the fact that the TURBO code breaks when you attempt to handle more
- than one connection at a time within the same function. However this broke
- map-server compilation, therefore, don't use TURBO yet! [Skotlex]
- * While at it, cleaned a few packet implementations in the char/login
- servers which were not only ugly, but had some really stupid flaws within.
- [Skotlex]
-2006/11/23
- * Completed Reddozen's hanging mapwarp code to support party and old syntax. [Lance]
- * Updated sql files [Playtester]
- * Made WFIFOHEAD() check for available buffer size remaining on the
- connection, and when there's not enough space, it will increase it.
- [Skotlex]
- * Added define TURBO to the Makefile. It enables MouseJstr's socket access
- optimization which should speed up the code when accessing the write/read
- buffers repeatedly within a function. [Skotlex]
- * Fixed the functions where the RFIFOHEAD/WFIFOHEAD functions were used
- incorrectly (prevents TURBO enabled compilations from finishing) [Skotlex]
-2006/11/22
- * Modified slaves_inherit_speed and slaves_inherit_mode so you get better
- control of when to copy/remove modes/speed. See the conf changelog for
- details. [Skotlex]
- * Reenabled usage of mode MD_CHANGETARGET, so mobs with mode 0x200 will be
- able to switch targets while attacking. [Skotlex]
- * Some cleanups around usage of session[] in the map server, hoping that it
- may fix some not very likely crashes. [Skotlex]
- * Rewrote a few messy @ commands. [Skotlex]
- * Fixed the homunc hungry timer being started when the homun data is
- received from the char-server and the homunc is NOT 'active'. [Skotlex]
-2006/11/21
- * Fixed the Auto-Berserk giving you back defense when it triggers during
- berserk's HP penalty. [Skotlex]
- * Some small changes in the pet ai to make it more responsive. [Skotlex]
- * Rewrote the pet looting behaviour (taken from the mob's), pets are much
- more smarter now when looting from multiple possible items. [Skotlex]
- * Fixed pets/homunc trying to be deleted twice when they had 0 intimacy and
- their master logs out. [Skotlex]
- * Added support for specifying ammo type = 99 in the skill_require_db file,
- it can be used to specify that any kind of ammo can be used with the skill,
- but you NEED to have ammo equipped. [Skotlex]
- * Corrected GS_DISARM, it is now a normal attack, which, when it connects,
- has a chance to do strip weapon at a 3*lv% rate (modified by dex) [Skotlex]
- * Fixed GS_PIERCINGSHOT, it should ignore defense [Skotlex]
- * Corrected Gatling Fever costing SP when trying to turn it off. Also,
- speed increases bonuses won't take effect while it's active. [Skotlex]
- * Updated the main makefile with a new OPT line. It is commented by default
- since it only works with GCC 4.X, when unset, it will hide away a huge
- amount of warnings that have to do with stuff that is not gonna be
- corrected in eA anyway. [Skotlex]
- * Corrected TripleAction's damage. It should do 150%*3 instead of 100*3%
- damage. [Skotlex]
- * Updated GS_CRACKER's stun chance using Doddler's info as reference.
- [Skotlex]
- * GS_FLING won't reduce armor defense when used on players. [Skotlex]
- * Moved ignoreAll to state.ignoreAll so it saves some space. [Skotlex]
- * Cleaned up clif_parse_Wis to prevent crashes from forged packets
- [Skotlex]
- * Cleaned up the implementation of the ignore list so it's more efficient.
- [Skotlex]
-2006/11/20
- * Implemented NPC_DEFENDER. Reduces ranged Physical+Misc damage by 80%
- [Skotlex]
- * Improved the battle config reader so it accepts hexadecimal values.
- Updated the monster_ai description to make use of this [Skotlex]
- * Added monster_ai&0x200. When set, mob skill delays are shared. That is,
- if the mob has several lines with the same skill, when the skill is used,
- the delay will be set to all of them, not just the one entry used.
- [Skotlex]
- * Corrected NPC_BARRIER so it grants 100 def/mdef (and not just mdef)
- [Skotlex]
- * Weapon ATK bonuses will now only apply to watk and NOT watk2 on players
- (on players watk2 is refine bonus) [Skotlex]
- * Corrected NPC_KEEPING. it should give 90 def, not 100 [Skotlex]
- * You now can't use other skills while a skill-induced "window" is up
- (teleport, refining, etc). However, be warned that we aren't quite sure how
- the server will clear this out if you decide to hit cancel on the window,
- so skill-blockage is likely to happen (temporary solution: whenever you
- change maps or warp the state is reset server-side). [Skotlex]
- * Fixed itemskill variable being cleared before parsing the skill, this
- causes auto-casted teleport to fail to skip the skill menu. It is now
- cleared on castend_pos/id directly. [Skotlex]
- * Skills with state 'move_enable' will now do a "walk path" check between
- target cell/object and caster instead of a "shoot path" check, this would
- fix skills like snap or charge from letting you "teleport" across pits.
- [Skotlex]
- * Raised the amount of skills that can stack on a single cell before the
- "in-area/out-area" detection code breaks to 24 (from 8) [Skotlex]
- * Fixed a crash in clif_SkillInfoBlock if the passed player already
- disconnected. [Skotlex]
- * Added limiting drop rate to 100% from item-bonuses that depend on the
- mob's level so that "@autoloot 100" will catch them. [Skotlex]
-2006/11/19
- * Removed security check since source level patch is applied.
- * Reverted select(), created prompt().
- * Hack protection from packet monkeys in clif_parse_NpcSelectMenu. [Lance]
- * Added 'cancel' button parsing in buildin_select menu system. Now scripts will continue
- to load if 'cancel' is pressed and 255 will be returned. [Lance]
-
-2006/11/17
- * Corrected use of the party invitation reply packet, thanks to FlavioJS.
- [Skotlex]
- * Fixed potential hack by modifying packet of whispers. [Lance]
- * Fixed potential crash in IRC processing message with '%' using *printf. [Lance]
- * Fixed memory leaking caused by homun_data not freed when removed. [Lance]
- * Fixed client not validating the chat-kick-request packet, which can cause
- crashes. [Skotlex]
- * Updated map_quit to handle removing of players who are not even
- authenticated yet. [Skotlex]
- * New connection requests are now also blocked when there's a player
- already online but hasn't finished loading yet. [Skotlex]
- * Because of these changes, the friendlist notification when people join
- has been moved to LoadEndAck from pc_authok [Skotlex]
-2006/11/16
- * Updated sql files [Toms]
- * For the sake of avoiding confusion, all script events are named with prefix 'On'
- from now on. [Lance]
- * Edited atcommand and charcommand syntax. Now it doesn't need the useless
- character name and ":". [Lance]
- * Shadow Jump and Kirikage won't "move" you if you use them in GvG grounds.
- Fixed Kirikage so it first warps you, and then you unhide. [Skotlex]
- * Corrected Zeny Nage so the Zeny spent on the attack is always the exact
- same value as the damage you are dealing. Also corrected it so it does half
- damage when used on players. [Skotlex]
- * Overlapping song/dances will now cause dissonance/ugly-dance level 1
- instead of retaining the level of their song/dance. [Skotlex]
- * Fixed wrong check in @petrename, thanks to The Ultra Mage.[Skotlex]
-2006/11/14
- * Early Christmas present. 3 new "features" which were very easy to code,
- and should help scripters tremendously. Eapp is quite a way from being
- ready, so these can't hurt:
- * Implemented Karma: It turns out that when someone has karma, the client
- believes this character is "evil", and will give you a cursor sword on top
- of them automatically. So now the code will let characters with karma to
- fight each other. This enables duels and other types of restricted pvp
- where only the characters with karma can hit each others, and the rest of
- players with neutral karma cannot be affected. Note that Karma cannot be
- negative, and it can have any value between 0 and 256 (any non-zero value
- makes them appear evil on the client). For now, characters with karma can
- hit each other regardless of karma value, but perhaps it may be better to
- let them to hit each other ONLY if they have the same karma (the whole
- duel implementation COULD be cleaned up using Karma instead!)
- * Added mapflags partylock and guildlock, which lock the state of the
- parties/guilds on said maps:
- partylock: blocks user party requests to create/invite/leave/kick
- guildlock: blocks user guild requests to create/invite/leave/expel/
- make alliance/make opposition/delete alliance/delete opposition/
- break guild
-2006/11/13
- * Fixed a bug where the char-txt server was incorrectly saving memos,
- causing character data to be lost on restart. [Skotlex]
- * HP Conversion will fail when used at max SP. It should not display any
- errors to the client. [Skotlex]
- * Modified yet again the login procedure to enable character variables to
- work on item scripts. It SHOULD work crashless now. Please report any
- problems it may cause.
- * Volcano/Deluge/Violent Gale are now interchangeable, in the sense that
- as long as one of these is out, casting any of the three will not consume
- gems, and will use the remaining time of the previous one. In turn, Land
- Protector will now always consume gems on every cast. [Skotlex]
- * Small cleanup in the Land protector code which may fix it not blocking
- AoE skills. [Skotlex]
- * Fixed the interpretation of "head_dir". Removed setting head_dir to match
- character direction in the whole code. Now it is only reset to 0 (look
- forward) when unit_setpos is invoked, or when a character begins walking.
- Thanks to FlavioJS for figuring out how the client parses the head
- direction. [Skotlex]
- * Moved status_calc_pc back to pc_authok. [Lance]
-2006/11/11
- * Fixed debug message in login_sql [KarLaeda]
-2006/11/10
- * Deluge/Violent Gale/Volcano tiles will now fail to be placed on cells
- that are already ocuppied by anything else. [Skotlex]
- * status_is_immune will now return 0 or the amount of immunity of the
- target. In which cases it returns 100 for WoH and the GTB bonus when they
- have passed the gtb_sc_immunity setting. This enables targetted spells to
- not "fail silently" unless GTB's magic reduction is 100. [Skotlex]
- * Fixed Homunculus being spawned as soon as they arrive from the
- char-server even if the Master has not spawned on the map yet. [Skotlex]
- * AL_TELEPORT now fails when used on top of Land Protector. [Skotlex]
- * Some minor cleanings in pc_setpos, it may (or not) help fix that
- homunc-caused "map_addblock" error message. [Skotlex]
- * Corrected fog of wall, so that the deleted/doubled-duration effects are
- calculated on a cell-by-cell basis. [Skotlex]
- * Updated Land Protector: It will now delete/block effects of ALL ground
- skills EXCEPT: Song/Dances/Traps (encores are still blocked). Land skills
- blocked/deleted by LP also can't be casted on top of an existing LP. The
- code uses the inf2 value of the skill to determine if it is a
- song/dance/trap. [Skotlex]
- * Ganbantein, mimicking LP, will now also remove ensembles. [Skotlex]
- * Fog of Wall will fail when casted on top of a Volcano/Violent Gale
- [Skotlex]
- * Applied FlavioJS's fix to the npc whisper system. [Skotlex]
-2006/11/09
- * Fixed status-change loading not working. [Skotlex]
- * Fixed permanent mob-spawn script-events not working. [Skotlex]
- * AL_CURE won't confuse undead players. [Skotlex]
- * Corrected the Fog of Wall check so that it lasts 2x when it is placed on
- TOP of a suiton/deluge, not when the caster is on top of them. [Skotlex]
- * Updated status_check_skilluse so that when the caster has a disabling
- status change (stun/petrify/etc) it will block the skill in all cases
- EXCEPT on cast-end when the skill is ground-targetted. [Skotlex]
- * Fixed Health Conversion skill formula bug. [Lupus]
-2006/11/08
- * Fixed Desperado's hit-rate, now it behaves as it should. [Skotlex]
- * The GVG map-packet will now also be sent for guild dungeon maps.
- [Skotlex]
- * Added clif_gospel_info which displays info about the buffs you are
- receiving. Thanks to Rayce for the packet information. [Skotlex]
- * Fixed Spider Web not ending when hit by a fireelemental attack. [Skotlex]
- * Cast-time reductions from status changes will not be executed until right
- before casting, to prevent status changes from ending when attempting to
- cast and the attempt fails (invalid cells, not enough sp, wrong target,
- etc, etc) [Skotlex]
- * Added check to prevent Wand of Hermod from seeking for a partner to
- encore, since the partner is supposed to be the warp. [Skotlex]
- * Corrected the mob spawn reading code so that the event-name can be up to
- 50 characters long (which is the actual event length) and so that it can
- read spaces within them, it will also strip the leading/trailing quotes if
- you use them so that the event is actually found on mob-death (so you can
- do stuff like "My NPC::OnDead" as a valid event). [Skotlex]
- * Moved the homunc inherit speed from the master from status_calc_pc to
- LoadEndAck, since the hom's speed matches that of the master each time the
- master changes maps. [Skotlex]
-2006/11/07
- * Applied FlavioJs's patch which enables colored console output for Windows
- systems. It also includes a config setting called
- "stdout_with_ansisequence" with which you can turn off the color codes (in
- case you are logging all output) [Skotlex]
- * Added error reporting when the max number of ground unit cells has been
- reached (this may be the reason why sometimes it fails to recognize when
- you step out of a song/dance/encore) [Skotlex]
- * Added passing the Endure effect to other devoted people. Note that the
- "hit count" is individual for each character, and only when it ends on the
- Crusader himself will that force it to end on everyone else. It also will
- not transfer on gvg grounds, but it does transfer in pvp. [Skotlex]
- * Fixed Reflect-Shield triggering Auto-Guard instead on devoted chars.
- [Skotlex]
- * Added a check to prevent casting ground skills on a target and vice-versa
- when said skill use packets are received. It really shouldn't be
- exploitable, but doing that certainly makes the server print a lot of
- "unknown skill used!" messages. [Skotlex]
- * Fixed map_foreachiddb and map_foreachpc so they don't encapsulate the
- variable arguments into a double va_arg list. Thanks to the Ultra Mage for
- the tip. [Skotlex]
- * Cleaned up the clif_hate/mob_info functions with the correct fields/usage
- as explained by Rayce. [Skotlex]
- * Implemented clif_feel_hate_reset packet to properly display the Angel of
- the Sun/Moon/Stars, thanks again to Rayce for the relevant information.
- [Skotlex]
- * LP will again block all land-stuff from being placed down on top of it
- for the exception of Song/Dance/Encores. [Skotlex]
-2006/11/06
- * Reapplied 'fix equipment scripts which are based on character variables not
- working.' [Lance]
- * Multiple Gunslinger skill corrections, refer to
- http://ro.doddlercon.com/guides/gunslinger.html for information source:
- [Skotlex]
- - Corrected Ground Drift. Splash range of 3x3, stackable and placeable
- underneath others, cast time is 2 secs. It's considered ranged, and it's
- bonus damage increase is defense ignoring, always neutral.
- - Corrected Bull's Eye implementation, it should deal normal damage against
- non brute/demi-human targets.
- - GS_DUST is now considered a short-range attack.
- - Implemented Desperado's hit rate based on distance to caster as it's
- believed to behave.
- - GS_TRACKING's range is no longer affected by Snake Eye.
- - GS_FLING's defense reduction is now 5*lv%
- * Suiton's Speed/Agi penalty will affect everyone when used in versus maps.
- * Corrected Kaupe so it doesn't ends on the first part of Soul Destroyer.
- [Skotlex]
- * Applied some cleaning to the way Tatami Gaeshi knocks back. [Skotlex]
- * Cleaned up the way mobskill_use checks for the correct event. It should
- fix unlimited mob-skill-casting issues. [Skotlex]
- * Removed the return code entry when logging GM reload-GM requests
- (login-sql),it'll just be stored as zero. [Skotlex]
- * Added a fix on socket.c to not pick INADDR_ANY when choosing our own IP.
- [Skotlex]
- * Applied the correction on maprespawnguildid so that it parses ALL players
- and not just those on a map. [Skotlex]
- * TK_JUMPKICK now dispels normal aspd/speed potions (not berserk pitched
- ones) and Preserve will be unable to block this. [Skotlex]
- * Soul Linkers are now inmune to SA_DISPEL [Skotlex]
- * You can now place everything (except magic skills) on top of LPs.
- [Skotlex]
- * Corrected Ganbantein to not touch song/dance/ensembles. [Skotlex]
- * Status_calc_pc will refuse to execute if the player is still tagged as a
- "new connection" and the invocation is not meant to be the first one.
- [Skotlex]
- * Swapped the order of checks in status_isimmune so that Wand of Hermod
- skill blocking takes precedence over GTB's [Skotlex]
- * Client packets will all be ignored while a player is not on a map until
- the LoadEndAck packet is received. [Skotlex]
- * Reverted changes, moved status_calc_pc(sd,1) back to pc_authok
- since it causes problems. [Lance]
- * Temperory fixed stability issue caused by initial status_calc_pc
- being placed AFTER another status_calc_pc. [Lance]
-2006/11/05
- * Updated sql files [Toms]
- * Updated perl files acording to rev 9135 [Toms]
-2006/11/04
- * Readded duel code in map_quit. Why it has been removed!? [LuzZza]
- * Converted itemdb tables to use smallint. Credits to ALZ. [Lance]
-2006/11/01
- * Reverted LK_Berserk HP requirement, as everything, including kRO X.2 and
- pRO X.3, points that way. [Vicious]
-2006/10/31
- * Fixed song/dance/encore cells not being placed down when casted on top of
- a land Protector. [Skotlex]
- * Update homunc's speed when master's speed changes, should avoid homunc's
- speed = 0 on login (homunc's stats are calculated before master's stats) [Toms]
- * When Kaizel (or super novice rebirth skill) triggers, you get debuffed
- now. [Skotlex]
- * Modified the player_cloak_check_type and monster_cloak_check_type
- settings. 1 makes it check for walls, 2 makes cloaking NOT end on normal
- attacks, and 4 makes cloaking NOT end when using skills. The default
- setting for players is still 1, but for mobs the default has been changed
- to 4. [Skotlex]
- * Non-players can now use all skills while hidden. [Skotlex]
- * Added a check to prevent adding negative damage to the total accumulated
- damage in mob_damage. It could fix some exploits, even though mob_damage
- should never be invoked with negative damage anyway. [Skotlex]
- * Implemented the property where the first attacker get's double exp-share
- than the others. Due to the way exp calculation is done, this bonus will
- not apply when you use exp_calc_type 1 (damage/max_hp) instead of the
- default (damage/total-damage). For now this bonus is done after calculating
- who is the MVP character instead of before. [Skotlex]
-2006/10/30
- * Fixed a little bug in event enqueue code [Toms]
- * Updated the code so mobs can use ChainAction as a targetted skill.
- [Skotlex]
- * Added GroundDrift effects for Wind (Stun) and Fire (knockback). The
- knockback value is unknown, so 3 is used for now. [Skotlex]
- * Cleaned up some more the steal code, now you can't steal the last slot
- regardless of skill level used. [Skotlex]
- * Added consideration of Chain Action when cloning GunSlingers. [Skotlex]
- * Modified battle_calc_return_damage to take the skill id as well, now
- magic damage return will not work on skills tagged as ground or self
- targetted. [Skotlex]
- * Fixed Gank not working at all with the default max steal tries setting.
- [Skotlex]
- * Soul Drain won't work with skills tagged as self-targetted. [Skotlex]
- * Improved the Suiton code so that the walk/agi penalty only applies to
- enemies of whoever casted the skill. [Skotlex]
- * Moved the initial status_calc_pc call to when you finish loading the map,
- should fix equipment scripts which are based on character variables not
- working. [Skotlex]
- * Fixed getcharid according to samples and docs. [Lupus]
- Thanks to joshuaali for pointing it out. eAPP has no such bug
-2006/10/27
- * Fixed mob-skill event "skillused" not triggering at all. [Skotlex]
- * Summoned mobs will only be removed from a map if their master is also
- removed (dynamic mobs) [Skotlex]
-2006/10/26
- * Updated sql files [Playtester]
- * Experimental tweak to npc_parse_function - Overwrite existing functions. [Lance]
-2006/10/25
- * Cleaned up some more the event dequeue code, it will no longer clear out
- the npc_id if there's no events waiting to be executed (why does it clears
- the npc_id anyway?) [Skotlex]
- * Because of possible conflicts with this change and the on-login script,
- now the on-login script is executed when the player has finished loading
- into their start-up map rather than as soon as receiving the registry
- variables from the char-server. [Skotlex]
- * Some cleaning of the pc_eventtimer and pc enqueue code, it should fix
- some memory leaks when the event counter does not matches with the actual
- number of queued timers during logout. [Skotlex]
- * Fixed "skill_sp_override_grffile: yes" causing crashes when parsing
- Homuncuus/Guild skills. [Skotlex]
- * Made the exp bonus settings be adjustable: [Skotlex]
- - exp_bonus_attacker: Indicates how much additional exp a mob gives per
- additional attacker (eg: 10 -> +10%*attacker)
- - exp_bonus_max_attacker: Indicates at which number of attackers the bonus
- is capped (eg: 5 -> 5 attackers, so a mob yield the same exp whether 5 or
- 10 people attack it)
- - Changed the way the party_even_share_bonus setting works. It now uses a
- simple linear bonus increase (eg: 10 -> +10%*party member)
- - The defaults are as explained by Tharis: +25%/attacker, capped at 12
- attackers, no party bonus. The first two can be found in exp.conf, the last
- one was left in party.conf
- * MG_STONECURSE and NPC_PETRIFYATTACK now use time1 to specify the
- "petrifying time". This value has been set to 5 seconds. [Skotlex]
- * Now when SC_STONE is triggered from status-change cards, it's petrifying
- duration will be passed as 0, causing the minimum (1 sec) to be used.
- [Skotlex]
- * Got rid of clones in src: old Novice Grounds map -> new_zone0? [Lupus]
-2006/10/24
- * Removed again your mdef reducing "petrifying" time as apparently it can't
- be reduced by mdef. [Skotlex]
- * Cleaned up the "show_steal_in_party" setting so it only takes effect when
- the item was successfully stolen (there was no point in telling you the
- item couldn't be stolen due to being overweight) [Skotlex]
- * Cleaned up the pc_steal_item implementation (again). It now uses a more
- random, simple approach in each steal attempt. [Skotlex]
- * Changed the way the skill_steal_max_tries work. Now it actually MEANS the
- max number of steal tries, use 0 to disable (unlimited tries). [Skotlex]
-2006/10/23
- * Added a bunch of important indexes when dealing with the log tables.
- Added upgrade_svn9050.sql which adds these indexes as well. [Skotlex]
- * Expanded the family check to work as it should, exp-share-range is
- respected, and the child is not considered for it (thanks to TheUltraMage
- for the investigation) [Skotlex]
- * Double Casting will no longer fail when used. [Skotlex]
- * Modified SC_STONE so that the duration of the "petrifying" time is 5 secs
- reduced by your natural resistance to petrify (which is mdef%) [Skotlex]
- * Modified the meaning of the third column in the skill_require_db. Instead
- of MaxHP, this is now called MaxHPTrigger. This column (which was
- previously unused by all skills) signals the limit HP% that you can have to
- be able to use the skill. For example, setting it to 20 means the skill is
- unusable if you have more than 20% life (note that this is merely a
- threshold setting, it won't actually substract HP when used!) [Skotlex]
- * Adjusted LK_BERSERK so you can only use it when you have 20% or less
- life. [Skotlex]
- * Removed NJ_TOBIDOUGU adding damage to W_HUUMA weapons which somehow got
- readded. [Skotlex]
- * When nonplayers use Cloaking, it will be forced to level 10 since mobs
- shouldn't have movement/attack restrictions while walking cloaked.
- [Skotlex]
-2006/10/20
- * Made HAMI_CASTLE use clif_slide rather than clif_fixpos. This should
- fix clientside problems when castling between two positions the (client)
- path finding can't find a walkable bath between anymore. [blackhole89]
- * Fixed the Homunc not spawning next to you after receiving it's data from
- the char-server. [Skotlex]
- * Fixed Charge Atk being able to go through chasm/pits. [Skotlex]
- * Moved the homunculus DB information from the player structure to the
- homun structure. Modified the homunculus creation packets to hold this
- information during creation, also, all initial values are handled by the
- map-server, the char server only assigns it a homun ID. [Skotlex]
- WARNING: This is yet untested! It's very possible something could had
- broken after changing the format/size of the homunc creation packets.
- * Added config setting "summon_flora_setting", which it you can decide now
- two things: a. Whether or not players can harm your floras outside versus
- grounds, and b. Whether or not you can summon out and mix different types
- of plants at the same time. [Skotlex]
- * Likely fixed pc_steal_item always failing to steal (it was attempting to
- steal random item IDs...) [Skotlex]
- * Cleaned up a bit the mob on-death event so that when the killer is a
- homunculus, it's master will be taken. Also, the variable killerrid will be
- set before running the script to specify who delivered the final blow. If
- the killerrid matches with the script attached player, you can be sure your
- player did the final blow to the mob, otherwise, the attached player is who
- did the most damage to the mob. [Skotlex]
-2006/10/19
- * Cleaned up the log.c file. [Skotlex]
- * Fixed log_chat not recording anything if the server is compiled in SQL
- mode and sql_logs is turned off (it should then record to a plain txt file)
- [Skotlex]
- * Fixed SG_FRIEND, it should be triggering when Monks do Combo Finish (not
- triple blows), and the trigger rate increase should be based on your known
- level of SG_FRIEND, not TK_COUNTER. [Skotlex]
- * Phantasmic arrow now knockbacks even if it misses. [Skotlex]
- * Adjusted the way Monk combo times work. The combo time is now always
- 300ms (adjusted by combo_delay_rate) which takes effect inmediately AFTER
- your current skill's canact-delay (which is why the particular skill delays
- were moved to skillcast_db) [Skotlex]
- * Modified skill_delayfix so it performs the can-act reduction from agi/dex
- for combos there. [Skotlex]
- * Modified pc_steal_item so that it behaves more closely to the way it does
- on Aegis. [Skotlex]
-2006/10/18
- * Added a overflow check when calculating party exp share. [Skotlex]
-2006/10/16
- * Adjusted UTSUSEMI/BUNSINJYUTSU so that they block range/melee weapon
- attacks and only melee misc attacks. This isn't 100% correct, but it's a
- better approximation to the way these skills behave. [Skotlex]
- * Emergency call &16 (disable skill from nowarpto maps) will now NOT block
- Emergency Call if that map is also a gvg-castle map. Makes it safe to turn
- on this option to prevent usage from special maps (like Lhz3) without
- crippling the skill during WoE. [Skotlex]
- * Applied most of Mpeg's work on Ninja Skills. For information see:
- http://gpegon.free.fr/ea/ninja_10-15-06_mpeg.txt [Skotlex]
- * When reinvoking a combo-time, the previous combo time will be terminated.
- This could fix the ongoing difficulties pulling off Monk combos. [Skotlex]
- * Fixed Esma-state not ending after casting it. [Skotlex]
- * Fixed @hominfo displaying intimacy on a 1/10k scale. [Skotlex]
-2006/10/14
- * Homun info window to show crit value. As default, homun does NOT crit,
- as monsters do not crit. This is purely for display purpose for players
- to identify their homon's luk value. [Vicious]
-2006/10/13
- * Base attack for non players is now calculated as str + [str/10]^2 (it
- does not has +dex/5+luk/5 which players do have) [Skotlex]
- * Fixed the char-sql server trying to read the gms off a "gm_db" config
- setting stead of "login_db" [Skotlex]
- * Corrected Throw Arrow/Musical Strike's damage formula [Skotlex]
- * Altered Trick Dead. It doesn't prevents skills from being casted on you
- now, but damage-based skills will do no damage. [Skotlex]
- * Made the battle_config.attack_attr_none apply to pets when using the
- "fixed damage" pet skill scripts. [Skotlex]
-2006/10/12
- * made @killmonster make the mobs drop items again. [Skotlex]
- * Added a temporary message when Angel of the Sun, Moon and Stars trigger
- so you know it triggered. [Skotlex]
- * When slaves_inherit_speed is set (which is also the default), homun will
- have the same speed of their master when spawned. [Skotlex]
- * When using Hatred and you already have a hate target, your current hate
- target is displayed now. [Skotlex]
-2006/10/11
- * Cleaned up the char-server code when the last point of a player is not
- found. First it'll check if there's any mapserver online, and then, if
- there is, it'll look for the major cities. If this fails, then the player
- will be told server is closed instead of trying to send him to a "random
- map". Will fix the char-server printing the misleading message "map
- server not found, sending to major city" when in reality there just
- aren't any map servers connected. [Skotlex]
- * Corrected the mob damagelog structure so that you can't exploit it by
- switching characters. [Skotlex]
-2006/10/09
- * Fixed crash when char-server sends to a "random" map-server online on
- connect. Thanks to TheUltraMage for pointing it out. [Skotlex]
- * Should have fixed being petrified not reducing your defense and
- increaseing your mdef. [Skotlex]
- * Fixed SC_NOCHAT printing the "skills are now available" message twice on
- natural expiration. [Skotlex]
-2006/10/08
- * Updated sql files [Playtester]
-2006/10/06
- * Updated Land Protector to block absolutely every land-based skills with
- the exception of Encores/Dances. [Skotlex]
- * Disabling status abnormalities will now reset a mob's target. [Skotlex]
- * Mob morphing also resets their target now. [Skotlex]
- * Monk combos no longer can ignore skill delay (delay skill for all their
- combo-related skills is ASPD) [Skotlex]
- * Now you can trade while in a chatroom. [Skotlex]
- * Fixed homun-txt reading when the file has DOS line-type delimiters (\r\n)
- [Skotlex]
-2006/10/05
- * skill_blown will now trigger on-touch npcs on the landing tile. [Skotlex]
- * Max trade distance has been reduced from 5 to 2. [Skotlex]
- * Undisguising will now resend the cart-contents. [Skotlex]
- * Added function npc_unload_duplicates(), it unloads all npcs that are a
- duplicate of the passed one. For use with @unloadnpc to prevent crashes
- when you unload the npc that has duplicates. [Skotlex]
-2006/10/04
- * Bowling bash now always hits twice regardless of situation. [Skotlex]
- * Added an underflow check to prevent sending to the client negative mdef2
- value (for Frenzy'ed characters) [Skotlex]
- * Modified pc_jobchange so that it automatically removes
- peco/falcon/cart/homun if the new job you are changing to does not possess
- the required skill for them. [Skotlex]
-2006/10/03
- * Fixed a possible crash with @reloadmobdb due to pet loot timers.
- [Skotlex]
- * Fixed a possible crash and a memory leak on the login-SQL server when
- parsing unban requests. [Skotlex]
- * Renamed setting delay_dependon_dex to delay_dependon_agi, the delay of
- skills is reduced now (when enabled) by AGI instead of DEX, which makes a
- lot more sense than DEX. [Skotlex]
-2006/10/02
- * Modified item-granded status resistance reduction to behave as explained
- by Vicious (Ragnarok Monthly magazine) [Skotlex]
- * Added the opt3 values to Eske [Skotlex]
- * Fixed the txt->sql converter only saving the very first character
- permanent variable. [Skotlex]
- * Fixed the txt->sql converter saving account-wide variables as
- character-wide ones. [Skotlex]
- * Renamed nopenalty mapflag to noexppenalty. Using nopenalty will turn
- on/off both noexppenalty and nozenypenalty now. [Skotlex]
-2006/10/01
- * Removed the speed adjustment per level of Increase/Decrease Agility
- [Skotlex]
- * Fixed humunculi skill exploit, thanks to mr.rkit [Lupus]
-2006/09/30
- * Rewrote the txt->sql converter. It now links directly to the char server
- files so that it should get auto-updated with any code changes in the
- later. [Skotlex]
- * The converter will now also convert: account-wide variables, parties,
- guilds, guild storage and guild castles. At this point the only two things
- not converted are login-server-wide account variables (##, they belong to
- the login converter) and homunculus (the SQL save function is messy and
- doesn't lends itself to be integrated with the converter the way all the
- other functions are). [Skotlex]
- * misceffect2 will no longer cause the effect on top of the source object
- when it is the fake npc. [Skotlex]
- * Added check so that Frost Nova doesn't hides hitting animation on
- targets. [Skotlex]
- * Added the missing brackets around the trade logs condition check, thanks
- to Coltaro. [Skotlex]
-2006/09/29
- * Spurt state will now trigger on Soul Linkers as well. [Skotlex]
- * Added a check un unit_run when unit_walktoxy fails. Should fix running
- getting you stuck sometimes when running on diagonals near obstacles.
- [Skotlex]
-2006/09/28
- * Merged the necessary changes to make the script engine support negative
- constants (db/const.txt). Thanks to Rayce (from jA) for the code. [Skotlex]
- * Cleaned up the skill.c code to take into account when skill_unitsetting
- returns null (skill failed), fixes a possible crash with Wand of Hermode
- [Skotlex]
-2006/09/27
- * Cleaned up status_get_party/guild_id, it should also fix a possible crash
- when invoking such a functio on a masterless pet. [Skotlex]
- * Sharp-Shooting will now display a skill animation. [Skotlex]
- * The no_spawn_on_player setting will now also work for static mobs, but
- only if the setting is set to 100 or higher. [Skotlex]
-2006/09/26
- * Yet again messed with the packet sent during a splash attack, but this
- time taking into account the packets that eA was using some many revisions
- ago. Tests are needed to see if Magnum Break/Grimtooth don't spam the skill
- animation anymore, and to see if GrandCross didn't break it's animation as
- well. [Skotlex]
- * Added function skill_dance_switch which handles converting overlapping
- song/dances to dissonance/ugly dance. It should make the overlapping area
- now behave completely like the mentioned song/dances (taking into account
- interval and target type changes). [Skotlex]
- * Updated battle_check_target so that non-offensive skills cannot be used
- on a homun except for the homun and it's master. [Skotlex]
- * Steal zeny won't work on treasure chests now. [Skotlex]
-2006/09/25
- * Added an ugly check so that Heal will display 0 when healing a berserked
- character (and it will again display full heal amount when healing a player
- who's at full life) [Skotlex]
- * Disabled again client-self-muting since it's causing too much trouble.
- [Skotlex]
- * Merged FlavioJS's script patch which should fix stuff like "mes ();"
- causing crashes. [Skotlex]
- * Item group reading will now complain when a line doesn't has enough
- fields. [Skotlex]
- * Fixed #baselevelup adding instead of substracting status points when used
- with negative levels. Also made it reset your stats if there wasn't enough
- to substract from. [Skotlex]
- * Applied FlavioJS's suggestion of expanding WFIFOPOS to also take the
- direction. This had the side effect of fixing the direction missing from
- the mob spawn packet, which explains why all npcs face north when you are
- within sight while doing a @reloadscript. [Skotlex]
- * Changed the order of packets in TK_HIGHJUMP, may fix the reports of
- getting stuck when jumping into a warp. [Skotlex]
- * Changed a bit the code of marionette control, where a redefined local
- variable may be the cause of mob-targetted Marionette Control stacking
- stats up. [Skotlex]
-2006/09/24
- * When the code auto-guesses that a skill should require ammo, it will
- accept any type of ammo for using it instead of only arrows. Fixes Magnum
- Break usage on Gunslingers. [Skotlex]
-2006/09/22
- * Probably fixed a signed/unsigned mismatch warning on the new socket code.
- [Skotlex]
- * Fixed the "map server claims to have char online, but this other map
- server also has it tagged as online" message triggering in some cases where
- it shouldn't. [Skotlex]
- * Fixed some maps in db/mapindex.txt being under the wrong id and added comments
- so this will not happen again. [Zephiris]
- --- ATTENTION! ---
- People running TXT servers will have to tell their players to redo their /memo
- points since the map ids of the old file were wrong.
-2006/09/21
- * Fixed a bug on "select" when skipping empty entries when the selected
- entry is the last. [Skotlex]
- * Improved a bit RFIFOFLUSH as suggested by Harbin. [Skotlex]
-2006/09/20
- * A mob's HP is set temporarily to 0 before invoking it's on-death script,
- prevents said scripts being able to "rekill" the mob indefinitely (if stuff
- like killmonster is used within) [Skotlex]
- * Some small cleanups in chat.c [Skotlex]
- * Fixed party_sub_count (TK_POWER) failing when the idle_no_share setting
- was disabled. [Skotlex]
- * Enabled Star Gladiators and Soul Linkers to do /doridori [Skotlex]
-2006/09/19
- * Fixed nocommand mapflag causing the "you can't use commands on this map"
- message to trigger one very single chat, instead of only for actual @/#
- command invocation. [Skotlex]
- * Added support for skipping empty string menu entries for the select()
- command (just as `menu` has it already) [Skotlex]
- * Fixed pc_set_hate_mob letting you place mobs on any of the three
- positions regardless of size [Skotlex]
- * The double continuation error will now display both scripts that
- triggered it. [Skotlex]
- * Loading the storage from the char-server will fail if player is already
- tagged in final save state. [Skotlex]
- * Removed setting ban_spoof_namer, sending invalid global-talk packets will
- now just kick the player out of the server. [Skotlex]
- * Added echoing messages back to self when using @/# commands on whispers
- and party/guild messages, to prevent the client from muting yourself.
- [Skotlex]
- * Fixed some gcc4 warnings [Toms]
-2006/09/18
- * Fixed Spider Web fire damage bonus. [Skotlex]
- * Made Global chat always reply back to you even on @/# commands, this
- prevents the client from muting yourself due to "hack". However, this same
- fix isn't easily applicable to @ commands invoked from whispers or
- party/guild messages, those are still pending. [Skotlex]
- * Merged Meruru's update to socket.c, which includes a rewritten parse
- function, which should hopefully be more efficient than the previous code.
- [Skotlex]
- * The new code includes support for two config settings
- (packet_athena.txt): frame_size, which can be used to alter the logic
- packet-size allowed by the code, and mode_neg, which when set to yes, sets
- TCP_NODELAY on all connections (defaults to yes). [Skotlex]
- * High-Jump is usable everywhere now, except that on maps where it
- previously failed, now will just make you jump in place. [Skotlex]
- * Fixed TK_RUN as per packets provided by AuronX. [Skotlex]
- * Moved the equipment/card resistances to status ailments outside of
- status_get_sc_def, so that they are applied only to rate, not duration.
- [Skotlex]
- * Modified the Asura code (again), hopefully movement sprite issues are
- fixed now [Skotlex]
- * @reloadscript scripts will no longer eliminate mobs with no respawn data.
- But watch out for possible bugs (I think someone mentioned 1 extra
- treasure box will spawn when you use it? This needs testing!) [Skotlex]
- * Made speed_add_rate a linearly stacking increase. [Skotlex]
- * Corrected a possible overflow when using show_mob_info to display the
- mob's up as a percent. [Skotlex]
- * Corrected the documentation for checkoption/checkoption1/checkoption2
- [Skotlex]
- * Reenabled client requesting to self mute, as the whole knockback packet
- issues of the past which were causing players to mute themselves when being
- knockback is no longer there. [Skotlex]
-2006/09/17
- * Fixed NPC_INVISIBLE's cloak ending after attacking once. [Skotlex]
- * Fixed SG_FUSION being castable without Soul Link state. [Skotlex]
- * Moved the item-use restriction SC checks from clif.c to pc_use_item,
- fixed Gravitation blocking potion usage on it's area of effect. [Skotlex]
- * Sphere Marines and Summoned Flora are now inmune to class-changing.
- [Skotlex]
-2006/09/16
- * Added monster_ai&256. When set, a monster will pick a random starting
- position to begin checking versus it's skills, otherwise, it will always
- begin checking from the beginning. [Skotlex]
- * Fixed the status change duration reduction equation was was totally
- wrong, thanks to k3dt [Skotlex]
-2006/09/15
- * Now mobs won't do a distance check to lose their target on every ai
- iteration, but only when they finish walking (unless you set monster_ai&1)
- [Skotlex]
- * The chase distance before a mob gives up following a player has been
- increased from view-size (range2) to min-chase (range3). [Skotlex]
- * Reverted the Summon Flora change where all plants were being summoned in
- one go. [Skotlex]
- * Moved the weapon repair effect to where it belongs (after successfully
- repairing an item) [Skotlex]
- * Added config setting "friend_auto_add" (battle/player.conf), if set, when
- you accept someone as your friend, both characters will show up on each
- other's friend list. [Skotlex]
-2006/09/14
- * Changed Extremity Fist's code to make you actually walk past your target,
- which displays a much more correct "animation" for the skill. Thanks to
- HiddenDragon for the information and code. [Skotlex]
- * Updated the item_db search functions so that when returning the
- dummy-item, it first updates the nameid to match the requested one, this
- prevents pc_additem later on giving you an item with ID 500 instead of the
- ID requested. [Skotlex]
- * Added a clif_skill_nodamage packet when using Repair Weapon, just to see
- what happens. [Skotlex]
- * Likely fixed "half" of the alliance being saved, which ends up in guilds
- that can attack another, but not viceversa. [Skotlex]
- * Added deleting of saved Status changes on character delete for the
- Char-TXT server. [Skotlex]
- * Fixed the can-act delay never being checked when requesting to use
- Homunculus Skills. [Skotlex]
- * Fixed warmth skills draining SP of the target, not the caster. [Skotlex]
- * When TK_DODGE triggers, it will no longer delay your attack or movement.
- [Skotlex]
- * Estimation /Sense/ whatever will no longer hide the vit bonus to mdef2,
- as reported by Playtester. [Skotlex]
- * Updated Summon Flora to summon the max number of possible plants on one
- cast. It will consume as many bottles as monsters summoned. Also cleaned up
- the function to be usable by non players. [Skotlex]
- * Shadow Jump no longer goes over walls. [Skotlex]
- * battle_calc_gvg_damage will be invoked in gvg maps regardless of woe
- time. [Skotlex]
- * NPC_MENTALBREAKER now zaps matk*lv SP based on observations by Tharis.
- [Skotlex]
- * md->class_ will be changed on mob-class-change to fix all class-change
- related bugs. On respawn, the spawn data will be used to revert to the
- original class. [Skotlex]
- * Improved the pet skillbonus timer for "eternal bonuses" cases where the
- bonus delay is 0. [Skotlex]
-2006/09/13
- * SC_CHANGE cannot override itself anymore. This fixes being able to
- "recast" the skill while it's still active to lengthen the duration AND
- reheal the target. [Skotlex]
- * Changed a bit the dnsbl lookup in the login servers to make it faster.
- [Skotlex]
- * Moved the pc rate modifiers from items
- (hp/sp/matk/hit/flee/cri/flee2/def2/mdef2/def/def2/speed) from
- status_calc_bl_sub_pc to status_calc_pc, as it simplifies code vastly, and
- also fixes Osiris card not applying to said bonuses. [Skotlex]
- * Fixed pc_damage_delay_rate not working, thanks to Orn. [Skotlex]
- * Modified the nocommand mapflag so you can specify the GM range that is
- blocked from using commands (eg: "prontera.gat mapflag nocommand 40"
- disables commands to characters in the GM range 0~39) [Skotlex]
- * Modified the char-server TXT whisper system to use the online_db to know
- to which map server forward whispers, instead of just sending the whisper
- to every map server. [Skotlex]
- * Readded the setting TCP_NODELAY on socket.c to see if it fixes the
- walk-lag issue. [Skotlex]
-2006/09/12
- * Modified the login SQL server so that case insensitive lookups use "where
- name = BINARY 'name'" instead of "where BINARY name = 'name'", since this
- way the name index should be used, and performance will no longer be
- heavily affected. [Skotlex]
- * Modified main.sql to add 4 missing indexes (thanks to ErkDog): char_id on
- the tables memo/friends, and online/name on the char table. Added
- upgrade_svn8728.sql to add these indexes to already existing tables.
- [Skotlex]
- * Updated convert_engine.sql to use TYPE instead of ENGINE to be compatible
- with Mysql 4 installations. [Skotlex]
- * Moved the morph restrictions from skill_additional_effect to
- mob_class_change, so that SA_MONOCELL will not convert clones, emperium, or
- treasure boxes. [Skotlex]
- * Fixed 'range' might be used uninitialized warning [Toms]
- * Added Jaguar's sql script to convert all tables to MyISAM. It's located
- in sql-files/convert_engine.sql WARNING: Using MyISAM is much faster than
- InnoDB, but you are strongly recommended to backup your database before
- switching engines since we don't know if eA is fully coded to work
- correctly with MyISAM yet. [Skotlex]
- * Added manual deletion of sc_data entries when deleting a character
- (char-SQL) [Skotlex]
- * Updated main.sql to use pure MyISAM tables, removed all foreign keys.
- [Skotlex]
- * Updated battle_switch to use strncmpi instead of strcmpi, it makes it so
- using "yessir" will match "yes", this is actually needed because if you set
- a config setting to "yes " (notice the trailing space), then the map config
- engine fails to read it right, and will set the config setting to 0 (no).
- [Skotlex]
- * Some corrections to hate_mob cleanup when triggering the Angel stuff. [Skotlex]
- * Updated the show_mob_info setting to add another space to the separating
- pipes, so that each field is separated by " | " instead of " |". [Skotlex]
- * Homunculus intimacy will go back to 500 on evolution. [Skotlex]
- * Baphomet splash damage will now hit nearby enemies regardless of flee
- (but the initial attack still has to connect for the splash to trigger)
- [Skotlex]
-2006/09/11
- * Modified set_nonblocking and setsocketoptions in socket.c, using eApp's
- code as reference. Hopefully should improve performance somewhat. [Skotlex]
- * Added a comment explaining what a comment is to login/char/map config
- files, as well as the main script config file. [Skotlex]
- * Modified SG_FEEL so that it works the same way that in Aegis
- (packet-wise) [Skotlex]
- * Added a comment to explain how to "remove" a string variable from the
- msg_athena entries. [Skotlex]
- * Summoned and slave mobs won't show up on @showmobs anymore. [Skotlex]
- * Moved Spider Web damage bonus from battle_calc_damage to battle_attr_fix,
- so that damage will be doubled based on the actual attack element.
- [Skotlex]
- * Adjusted autospell cards to trigger only on physical weapon attacks.
- [Skotlex]
- * Adjusted a bit the heal code, it should now show either the full heal
- amount, or 0, depending on whether the target was healed at all or not
- (this also means it shows 0 if you try to heal a full-life character.. but
- it's the closest I've gotten to make it display 0 on Berserked chars)
- [Skotlex]
- * Memorize will be consumed even on instant cast spells now. [Skotlex]
- * Berserk will end now if hit and remaining hp is less or equal to 100.
- [Skotlex]
- * Guild Aura will be removed on sc-load to prevent Guild Masters from
- getting that bonus from the old implementation. [Skotlex]
- * Added D-Kalck's fix of the TXT -> SQL converter [Playtester]
-2006/09/10
- * Thanks to KarLaeda, added missing function in @showmobs [Lupus]
- - Script function 'query_sql': In the TXT version it doesn't fill the array
- and always return -1. Added for scripts compatibility. Your scripts
- won't crash in TXT version. They can work it around.
- I suggest we need a function getversion()
- * Updated item_db.sql and mob_db.sql [Playtester]
-2006/09/09
- * Added a crash protection in case mapfreeblock unlock tries to free a null
- pointer. [Skotlex]
- * Moved perfect_hiding from state to special_state, so that it clears out
- when you remove your pet. [Skotlex]
- * Probably fixed the Taekwon Rest skills. [Skotlex]
- * Fixed a npc-timer memory leak on npc_unload ("[Warning]: ers_obj_destroy:
- X entries missing, continuing destruction. Manager for entries of size
- 16.") [Skotlex]
-2006/09/08
- * Unified the rest and ganster paradise code into a single function.
- [Skotlex]
- * Moved the Happy State trigger to the regen function, it now triggers at
- the same time SPTIME does. [Skotlex]
- * Cleaned up SG_HATE, hope it works now. [Skotlex]
- * Removed sg_miracle_skill_duration, replaced it with
- sg_miracle_skill_min_duration and sg_miracle_skill_max_duration, to specify
- a range for the duration of the skill. [Skotlex]
- * Added upgrade_svn8675.sql in case, for some reason, your guild table
- still has the emblem_data field as a 'blob' with "NOT NULL" specified.
- [Skotlex]
- * Fixed alliance/opposition making not cancelling out map-server-side when
- the guild already had max number of alliances/oppositions (thanks to k3dt)
- [Skotlex]
-2006/09/07
- * Fixed SC_BERSERK setting Hp to 100 when dispelled by unnatural means (eg:
- wand of hermod) [Skotlex]
- * Cleaned up the doridori parse clif function. [Skotlex]
- * Merged some of mpeg's work on NJ skills [Skotlex]
- * Removed the Warmth "stacking" code. [Skotlex]
- * Added back the effect of /doridori to skill-SP regen [Skotlex]
- * Implemented a rough version of Angel of the Sun/Moon/Stars, it has a low
- chance of triggering on doridori-boosted SP-regen events. However, it has
- no client-side messages yet (need to add these in) [Skotlex]
- * Added sg_angel_skill_ratio to specify rate at which the Angel skill
- triggers. [Skotlex]
- * Added unit_cancel_combo which takes care of ending a combo time and
- resuming normal attack 'inmediately' [Skotlex]
- * Cleaned up some the SG_HATE code, you can't change hate targets anymore.
- [Skotlex]
-2006/09/06
- * Fixed the memset in status_calc_pc, corrects some mysterious bugs such as
- item-drop bonuses suddenly not working anymore. [Skotlex]
- * Corrected SC_INCREASEAGI and SC_DECREASEAGI speed-change formula.
- [Skotlex]
- * Fixed Aex Aeterna ending on Soul Breaker's first half. [Skotlex]
- * Applied Orn's modification on speed increases/reductions with increase/
- decrease agi [Toms]
-2006/09/05
- * Removed setting mob_show_hp, it's been replaced now by mob_show_info,
- which can be used to specify what kind of info should be displayed from a
- mob. Current options are two different formats for Hp display, and current
- level (monster.conf). [Skotlex]
- * Fixed Signum Crucis Def reduction being 10+2*lv% instead of 10+4*lv%
- [Skotlex]
- * Applied the Ultra Mage's suggestion to have the map server strip trailing
- spaces/comments from the config files. It will also now print out when an
- unknown config setting is found. [Skotlex]
- * Fixed status change resistance not being invoked at all for pretty much
- all cases. [Skotlex]
- * Corrected SC_INTRAVISION not starting. [Skotlex]
- * Fixed crash when attempting to read a Label as a string on a script
- (thanks to End of Exam) [Skotlex]
- * Fixed possible crash when changing a chat-room's owner (thanks to End of
- Exam) [Skotlex]
- * Fixed dispell removing SC_NOCHAT [Skotlex]
- * Small fix which should correct skill_attack damaging hidden characters
- when it shouldn't. [Skotlex]
- * Fixed connect_until field being a smallint rather than int in the login
- table (upgrade with upgrade_svn8630.sql) [Skotlex]
-2006/09/04
- * Fixed crash when using Adaptation during an Encore. [Skotlex]
- * Should have fixed manner being reset to 0 on logout while muted.
- [Skotlex]
- * Removed status_get_sc_tick, duration and chance are now both handled by
- status_get_sc_def (this means status change duration and success rate
- both will always follow the very same formula) [Skotlex]
- * Fixed mob-kill experience getting screwed up when characters who did
- damage die/logout at the moment the mob dies. [Skotlex]
- * Should have fixed "sleep", thanks to Lance for figuring out the error.
- [Skotlex]
- * SC_REFLECTSHIELD will now be passed to devoted characters at cast-time.
- [Skotlex]
- * Added a check to make a mob's level 1 if the read level from the db is
- less than it. [Skotlex]
- * status_calc_misc will now be invoked in status_calc_bl even on the first
- call, since status could have gone up due to skill bonuses. [Skotlex]
- * Moved max HP/SP calculations to before invoking status_calc_misc
- [Skotlex]
- * Simplified distance and check_distance to use "aegis" methods (greater of
- dx/dy = distance), there's a new define in map.h called CIRCULAR_AREA, when
- set, the previous method is used, and "for each in range" calls will also
- check for distances, making most ground skills and battle system use real
- circles instead of squares. [Skotlex]
-2006/09/03
- * Fixed SC_BERSERK's no regen penalty lasting pretty much forever.
- [Skotlex]
-2006/09/02
- * SC_REGENERATION's val4 now holds the RGN flag of what is blocked rather
- than blocking all types of regen. [Skotlex]
- * LK_BERSERK will now only block natural regen on state-end. [Skotlex]
- * SC_EXTREMITYFIST/SC_DANCING/SC_EXPLOSIONSPIRITS will only block natural
- sp regen and not skill regen [Skotlex]
- * SC_REGENERATION blocking will be cancelled on logout now. [Skotlex]
- * Corrected SCB_LUK not updating SCB_BATK as well. [Skotlex]
-2006/09/01
- * Corrected script_commands description of getequipid, it returns -1, not 0
- on fail. [Skotlex]
- * Fixed the mob-id check during pet_db loading, it will also now print when
- a pet is not loaded due to having an invalid mob class specified. [Skotlex]
- * The "delete_timer error/no such timer" report will now print the related function [Toms]
- * The Clearing unused stack report will now print the related NPC [Toms]
- * The duplicate npc report will now print the related file name [Toms]
- * Added config setting "partial_name_scan", which specifies whether @ given
- names should use a partial string lookup or absolute name lookup. Defaults
- to no (gm.conf) [Skotlex]
- * Expanded status_calc_misc so it may also calculate the batk of characters
- as well as their regen data (if they have it) [Skotlex]
- * Fixed a memory leak when using charsave_method:1 [Skotlex]
- * Soul Breaker will now be affected by Lex Aeterna on both parts of the
- attack. [Skotlex]
- * Status changes with no skill and no SCB* data will now go through if they
- have an SI* icon. This should fix SC_MIRACLE [Skotlex]
- * Reverted switching a mob's adelay/amotion when the later is longer than
- the former, now both get updated to amotion. [Skotlex]
-2006/08/31
- * Moved the intimacy penalty of HFLI_SBR44 and HVAN_EXPLOSION to
- skill_counter_additional_effect [Skotlex]
- * Simplified skillnotok_hom by using an invocation to skillnotok [Skotlex]
- * Hopefully fixed BD_ADAPTATION [Skotlex]
- * Homun won't lose any intimacy on death now. [Skotlex]
- * Homun will be saved together with the master now (as long as the homun is
- active) [Skotlex]
- * Modified the error reporting in map_freeblock_unlock so that when there's
- an error, the reported line number is the file's linenumber plus the
- object's type *10000. This is for debug information to help track down the
- already-freed error. [Skotlex]
- * pc_adopt will now preserve the kid's job/job-level/experience. This means
- that if you adopt a Swordman level 45, it will become a baby-swordman level
- 45, with the exact same exp as before. [Skotlex]
- * Fixed new mob's name not sent to the client when the mob is morphed [Toms]
- * Added setting attack_walk_delay which specifies whether a character
- should (or not) be able to move inmediately after starting a normal attack
- (battle.conf). Defaults to 0 since that's what Aegis uses. [Skotlex]
- * Fixed @summon's delete timer being screwed up. [Skotlex]
- * Cleaned up a bit the summon script command. [Skotlex]
- * Fixed the clone script command's delete-timer being screwed up. [Skotlex]
-2006/08/30
- * Skill required-state will now only be checked on cast-begin, not
- cast-end. [Skotlex]
- * Added a check in status_calc_pc to prevent player rate adjustments from
- from going below 0. [Skotlex]
- * Removed sending normal-damage packets instead of skill packets for
- splash-damaged skills, since... well, that's how Aegis does it. [Skotlex]
- * Updated HLIF_CHANGE to work as explained by Tharis -> It now adds 30*lv
- vit and 20*lv int, is dispelled on warp, and can-act delay is 5+5*lv
- minutes. Hp/Sp is no longer set to 10 after a forced expiration. [Skotlex]
- * Fixed up char-sql compilation. [Skotlex]
- * Added a message to @clearweather stating when climate changes will
- dispel. [Skotlex]
- * Corrected @hidenpc saying that it's command name was "@npcoff" [Skotlex]
- * Updated itemdb reading on the char-sql server so that it reads both
- item_db and item_db2 files (totally untested yet) [Skotlex]
-2006/08/29
- * Added printing out whenever the irc-module attempts to connect, to debug
- whether the map-server lag is due to this or not. [Skotlex]
- * Mobs will now always chase players using hard-path seeks. [Skotlex]
- * monster_ai&1 now only signals whether mobs should update their target
- cell while chasing more frequently (rather than being state-driven like
- Aegis) [Skotlex]
- * Changed the defaults of view_range_rate and chase_range_rate to 120 to
- aproximate better Aegis's view ranges (which are square areas and not
- circles) [Skotlex]
- * Applied Mpeg's work on GS [Toms]
- ( http://gpegon.free.fr/ea/gunslinger_08-29-06_mpeg.txt )
- * Fixed a syntax error in @showmobs [Toms]
- * Added @showmobs. It shows selected mobs on your mini-map (excluding
- mini-bosses & MVP) thanks to KarLaeda for the command [Lupus]
-2006/08/28
- * Modified the dancing code and Moonlit Petals in particular, so that it is
- treated as an ensemble like any other, it will just knockback people when
- they step into it. [Skotlex]
- * The memory leak reports will now print out in the logs also the revision
- they belong to. [Skotlex]
- * Cleaned up the scriptable npc-shop code, it should be crash-proof now.
- [Skotlex]
- * Added TK level-up buffs to SG too, and extended them to 10 min [DracoRPG]
- * Added "Barefeet Mastery" effect to TK_RUN (thanks Tharis for both) [DracoRPG]
- * Changed the produce_db format, now there's a skill-lv column right after
- the skill-id column to specify required skill-level to craft this item.
- [Skotlex]
- * Modified the skill produce_db code to take into account the new skill-lv
- requirement. [Skotlex]
- * Fixed exp bonuses applying twice for the job-exp [Skotlex]
- * @reloadbattleconf will now also update the ragsrvinfo table on the
- char-server. [Skotlex]
- * Fixed homun hp/sp growth rates stacking with HP/SP passive increasing
- skills. [Skotlex]
-2006/08/27
- * Fixed undefined reference to 'malloc_set' in log.c [Toms]
- * Updated svn-revision reading, now it can read the new svn file system [Toms]
- * Fixed a bug with homunc which could spawn on a non-walkable cell [Toms]
-2006/08/26
- * Optional macro MEMSET_TURBO for faster low-level memory initializations. [Lance]
- * Small bug fix in read_homunculus_expdb (a warning was always displayed) [Toms]
- * Small adjustment on the mob_ai code which could fix mobs not chasing you
- if you hit them from the maximum possible diagonal distance. [Skotlex]
-2006/08/25
- * Cleaned some the skill unit removal added flag so that it signals whether
- the skill is being force-removed, or it has "naturally expired". [Skotlex]
- * The following skills will display a normal attack animation now:
- NPC_WATERATTACK, NPC_GROUNDATTACK, NPC_FIREATTACK, NPC_WINDATTACK,
- NPC_POISONATTACK, NPC_HOLYATTACK, NPC_DARKNESSATTACK,
- NPC_TELEKINESISATTACK, NPC_SPLASHATTACK
- * Skills that require a weapon and consume spirit spheres will no longer be
- auto-tagged to require ammo. [Skotlex]
- * Now MISC skills with delay 0 will also use the attack delay (if the skill
- is tagged to do damage) [Skotlex]
- * Added script commands roclass/eaclass to enable scripts to access eA's
- job format. Read script_commands.txt and ea_job_system.txt for a more
- complete explanation of how this job system works. [Skotlex]
- * Added a flag to skill_delunitgroup, skill_delunit & skill_unit_onlimit.
- If 1 is passed, it will avoid UNT_WARP_ACTIVE to be transformed in
- UNT_WARP_WAITING and will destroy it. [Toms]
- ( To avoid such crash : http://www.eathena.ws/board/index.php?showtopic=114102
- when the code need an empty slot and the oldest one is UNT_WARP_ACTIVE )
-2006/08/24
- * Little cleanup on homunc's code [Toms]
- * Modified @reloadmobdb & @reloadskilldb to reload homunc's db too [Toms]
- * Now when a mob's adelay is set to be less than the amotion, both values
- will be swapped (this is an attempt to understand how those mobs actually
- work on aegis) [Skotlex]
- * script command "isrefine" will no longer return always false for equip
- positions above 6 (this has not been needed since the addition of the
- refine column to tbe item_db many months ago) [Skotlex]
- * Added NPC_CRITICALSLASH to the list of skills that display as a normal
- attack. [Skotlex]
- * Reverted the previous change, changed the pet capture code to try to
- capture a mob based on their view class rather than actual class.
- [Skotlex]
- * Fixed the md->class_ variable not being updated when a mob's class is
- changed. [Skotlex]
- * Added setting clear_skills_on_warp to specify when a character's
- land-based skills are deleted when the caster changes maps. Defaults to all
- types. [Skotlex]
- * Should have fixed Brandish Spear not passing the flag to skill_attack,
- causing it to do miserable damage. [Skotlex]
- * Warp Portal will no longer be removed when caster steps through it (this
- is left to the new clear_skills_on_warp setting) [Skotlex]
- * Cleaned up status_percent_change to switch equations when the target has
- high hp to prevent overflows, also it will directly take hp/maxhp when a
- rate of 100 or higher is passed to prevent calculations. [Skotlex]
- * Traps and Land Elemental fields are no longer automatically removed on
- map change (handled now by clear_skills_on_warp) [Skotlex]
- * traps_setting &2 no longer does anything (handled now by blah blah)
- [Skotlex]
- * Applied some change from mpeg on Ninja Skills [Toms]
- * Put HVAN_Explosion based on max_hp instead of current hp [Toms]
-2006/08/23
- * Fixed mob_clone_spawn completely ignoring the mode variable. [Skotlex]
- * Fixed Energy Coat reducing and consuming more than it should when you
- have 100% SP [Skotlex]
- * Cleaned up getmapxy script function, also added support for type 4 so
- that it returns a player's homunculus position if such exists. [Skotlex]
- * SC_ARMOR_ELEMENT looks like gone away from status_change_start since ... rev 6791.
- Try to reimplement it. [Toms]
- * Fixed HVAN_EXPLOSION [Skotlex]
- * Frost Nova won't display a nodamage skill packet (still need to sort out
- a way to fix the splash damaged packets) [Skotlex]
- * Fixed a possible SIGSEGV on buildin_maprespawnguildid if the map is unknown [Toms]
- * Added debug on "Inifity loop" to know which script is making this loop [Toms]
-2006/08/22
- * More fixes to the splash code. Kamaitachi and Sharpshooting should
- display correctly now. [Skotlex]
- * Fixed a crash on the mobspawn script command. [Skotlex]
- * Made SC_FLEET increase batk as well as watk. [Skotlex]
- * Fixed gcc warning [Toms]
- * Fixed AM_REST not closing the homunc status window [Toms]
- * Fixed SC_NEN according to Mpeg [Toms]
- * Added a ShowStatus("Terminating...\n") on login-server_sql [Toms]
- * Some corrections to make Tatami Gaeshi work correctly. [Skotlex]
- * Fixed SBR44 doing 100% more damage than it should. [Skotlex]
- * Some more work on the splash skill code. Now splash-damaged enemies
- should show no animation at all, just the damage-number, while only the
- targetted character should still display the full skill animation.
- [Skotlex]
- * Modified the homun-txt file-save format to separate the name from the
- rest of fields with tabs (like character saving does), this may fix homun
- save/loading when using non-latin characters on the name, but be warned
- that it also means the previous homun-data files are lost! (unless you
- replace the comma before the start of a name with a tab) [Skotlex]
- * getnameditem will now also work on stackable items [Skotlex]
- * Corrected battle_calc_weapon_attack so that all skills ignore your
- left-hand weapon, and that the Katar's double-attack damage bonus for the
- offhand damage applies ONLY on normal attacks. [Skotlex]
- * Fixed Resurrect Homunculus's % to 20*lv% [Skotlex]
- * Added SQL update which should remove \' from guild names [Toms]
- * Added option to disable character deletion of certain levels [Lupus]
- check char_athena.conf for this option format
-2006/08/21
- * Some more cleaning up of the splash skill code. Now the passed hit value
- for the splash targetted mobs is 9 instead of 5, this allows multi-hitting
- splash skills to display the number of hits correctly. [Skotlex]
- * Fixed call homunc bug when the homunc was vapo and the master has change
- of map [Toms]
- * Fixed SQL-Guild Creation, guild name was escaped 2 times [Toms]
- * Some cleaning of the splash skills. Updated skill-attack to enable again
- passing of flag 0xF000 which signals that the skill level sent to the
- client should be -1 (no skill name shouted). Should (hopefully) clear/clean
- up a bunch of splash damage skill animation-related packets. [Skotlex]
- * Homun saving won't cap hp/sp to max hp/sp since a homun can have higher
- hp/sp than the one stated in the db (due to skill bonuses or status
- changes) [Skotlex]
- * Cleaned up some more the regen_data structure, so that
- skill/sitting-skill related data is optional (since only players have it).
- [Skotlex]
- * Fixed AM_RESURRECTION, thanks to RockmanEXE for %HP values [Toms]
- * Fixed HAMI_CASTLE, HAMI_DEFENCE & HLIF_AVOID [Toms]
- * Adjusted Glittering's success rate to 20+10*lv% [Skotlex]
- * Corrected isequipped() so that cards will not be tagged as "used up"
- unless all the specified items were found. [Skotlex]
- * Fixed a confusion in skill_attack using the src instead of dsrc for some
- calls, which was causing some problems with the KAITE check from AoE
- spells. [Skotlex]
- * Fixed ASC_BREAKER's misc damage part not having the ignore-element flag
- set. [Skotlex]
- * Moved homunc battle conf from misc.conf to homunc.conf [Toms]
- * Some cleaning in skill.c in regard to homun skills. [Skotlex]
- * Madness Canceller now stacks with other aspd bonuses, just like Berserk
- does. [Skotlex]
- * Removed config setting "muting_players", and expanded the manner_system
- config to specify how having negative manner (mute) affects a player (see
- battle/misc.conf). [Skotlex]
- * Expanded the pk_mode setting from no/yes to 0/1/2. 1 is normal pk_mode,
- if 2 is used, it makes killing players give you a loss of 5 manner points.
- [Skotlex]
- * Fixed WS_WEAPONREFINE always failing when at less than job 50. [Skotlex]
- * Fixed the Autosave routine not working when there's only one player
- online. [Skotlex]
- * Disabled command @rain since the client no longer supports it anyway.
- [Skotlex]
- * Fixed delitem not checking for the first slot's card, also optimized it
- so that it doesn't checks on the other slots. [Skotlex]
-2006/08/20
- * Added a check during mob_db loading so that the six basic stats, max hp
- and max sp are never below 1, as this could cause crashes when using
- certain skills. [Skotlex]
- * Gravitation now only blocks the caster from using potions. [Skotlex]
- * Corrected Madness Canceller letting you walk while the effect lasts.
- [Skotlex]
- * Splitted yet again ASC_BREAKER into a two-part attack. This time the
- int-based damage is a MISC type attack, and gets reduced by skills as such.
- [Skotlex]
- * Fixed "int format, long unsigned int arg" warning [Toms]
- * Fixed a warning when using cap_value(x, 0, x) on an unsigned value [Toms]
- * Added clif_skill_fail for homunc to skill_castend_id & skill_castend_pos [Toms]
- * Fixed homunc skill 8016 not considered as homunc skill [Toms]
- * @useskill will now cause your homun to use the skill instead of you if
- the skill is a Homun skill and you have an active homunculus. [Skotlex]
- * Reduced the Success Chance of GS_FLING to 10+10*lv% (Playtester told me
- that Vicious told him the chance was much lower like that) [Skotlex]
- * Fixed some Homunc issues with HR servers (capping some values) [Toms]
- * Added @hominfo command to obtain real values (not capped ones) [Toms]
-2006/08/19
- * Fixed @homlvup bug [Toms]
- * Fixed AM_REST & AM_RESU consumming SP if they fail [Toms]
- * Fixed homunc spawning bug (they was spawned after an AM_REST + master warp for example)[Toms]
- * Fixed GS_GROUNDDRIFT [Skotlex]
- * Increased chance of GS_DESPERADO connecting to 20% [Skotlex]
- * Fixed battle_calc_base_damage being called for the left hand even for
- non-dual-wielding attacks. left-hand damage was being set to 0 later
- anyway, so no exploit existed. [Skotlex]
- * Moved the weapon_atk_rate bonus to battle_calc_base_damage so that it'll
- apply correctly when dual-wielding different types of weapons. [Skotlex]
- * Fixed job-mask 0x100000 in the item_db enabling Dancers/Bards to use the
- items (0x80000 should be for them and 0x100000 should be currently unused)
- [Skotlex]
- * Fixed a possible sigsegv when deleting lif under Mental Change [Toms]
- * Fixed HAMI_CASTLE [Toms]
- * Fixed HLIF_CHANGE [Toms]
- * Updated HLIF_BRAIN skill [Toms]
- * Fixed homunculus intimacy on feeding [Toms]
- * Added homunculus_friendly_rate battle config [Toms]
- * Some compilation warnings fixed [Toms]
- * Added skill's required item check on homunc skills [Toms]
- * Add Condensed Red Potion as a required item for HLIF_HEAL [Toms]
-2006/08/18
- * Little code cleanup on last fix [Toms]
- * Fixed HLIF_HEAL healing the homunc instead of the master [Toms]
- * Fixed HLIF_AVOID not increasing walk speed of master [Toms]
- * Fixed the atk_rate (Turtle General Card) bonus not working on
- dual-wielders. [Skotlex]
- * Made HLIF_HEAL a self skill that auto-selects target to caster's master.
- [Skotlex]
- * Implemented SC_BLOODLUST and SC_CHANGE, cleaned up HLIF_CHANGE [Skotlex]
- * Applied a correction to HVAN_EXPLOSION [Skotlex]
- * Fixed Homun ASPD calculation being able to underflow and give you min
- speed. [Skotlex]
- * Added monster_ai&128 to make aggressive mobs ignore that behaviour of
- always picking Homun targets above player targets regardless of who is
- closer. [Skotlex]
- * Fixed homun info packet being unable to display HP/SP correctly once the
- values are above 32k. [Skotlex]
- * Applied Mpeg's work on ninja [Toms]
- * Fixed @homlvup [Toms]
- * Added guild_aura (skill.conf) setting so you can specify when it works
- and if it works on the guild-master itself. Defaults to working all the
- time on everyone except GM. [Skotlex]
- * Little code cleanup [Toms]
- * Cleaned merc_hom_evolution to avoid free'ing/realloc'ing [Toms]
- * Fixed "args of aFree is freed pointer" on Homunc deletion [Toms]
- * Changed unit_free so that it receives which cleartype should be used when
- the character is still on a map. Used this on status_damage so that mobs
- that do not respawn when killed will properly display the death animation.
- [Skotlex]
- * Fixed Energy Coat consuming 10x less SP per hit than it should.
- * Fixed signed/unsigned comparison issues with natural heal system [Toms]
-2006/08/17
- * Vaporize will no fail when the homun is dead. [Skotlex]
- * Corrected thhe double free issue that occurs when a homun dies and has no
- intimacy left. [Skotlex]
- * Fixed the charsave_method:1 saving/loading exp as signed ints rather than
- unsigned. [Skotlex]
- * Applied use of structure regen_data for a unified regen module. Natural
- and skill-heal is handled by this structure, while sitting-skill-heal is
- still player dependant (mostly because the other object types can't sit)
- [Skotlex]
- * Cleaned up the status calc code for homun by moving it from
- status_calc_bl_sub_homun to status_calc_homun (where it should had always
- been) [Skotlex]
- * Updated SQL files [Playtester]
- * Corrected map_random_dir algorithm [Toms]
- * Fixed homunc natural heal and little code cleanup [Toms]
- * Changed AM_CALLHOMUN Skill to spawn the homunc at 1 cell from his master [Toms]
-2006/08/16
- * Fixed being unable to recast Adrenaline Rush to reset the duration
- timers. [Skotlex]
- * Cleaned up skill_get_range2 so that using range 0 for non-self skills
- uses the caster's attack range. [Skotlex]
- * Fixed AM_CALLHOMUN checking for an embryo when you have a vaporized
- homun. [Skotlex]
- * Spirit of Wizard will now consume an item 7321 each time it blocks
- reflected magic. [Skotlex]
- * Added script command jobname, retrieves a given's class name as per the
- appropiate msg_athena.txt entry (this command should had been added years
- ago) [Skotlex]
- * Fixed null-pointer crash on Evolving a homunculus. [Skotlex]
- * @produce now can make any kind of equipment [Skotlex]
- * Made HLIF_AVOID and HAMI_DEFENCE cause the status change on both caster
- and target. [Skotlex]
- * AM_REST shouldn't be checking for a range now (since it's a self skill)
- [Skotlex]
- * Updated mob_ai so that mobs will use their rude-attacked skill when they
- can't reach their current target. [Skotlex]
- * Fixed the default txt config making pets be saved to the homun file
- instead of to the pet file. [Skotlex]
- * Now arrow-consuming skills where your main weapon is a whip or musical
- instrument WILL count as arrow-type attacks, using the atk of the arrow and
- all related bonuses. [Skotlex]
- * Fixed some homun timer initialization code. [Skotlex]
-2006/08/15
- * Applied multiple fixes which should take care of making homun save/load
- work on TXT now. [Skotlex]
- * Added Gatling Fever's batk bonus. [Skotlex]
- * Some cleaning in status_damage which should prevent trying to free
- already free'd pointers when unit_remove_map invokes unit_free (when
- status_damage was going to invoke unit_free anyway) [Skotlex]
- * Delete homunc's skills from sql when the homunc is destroyed [Toms]
- * Homunc Timers should be disabled when the homunc is vaporized or dead an re-enabled on call/resu [Toms]
- * Updated vc-project files to compile with the new int_homun files.
- [Skotlex]
- * Hopefully fixed the crash when using charsave_method = 1 [Skotlex]
- * Moved s_pet structure from map_session_data to pet_data, this enabled the
- removal of a few redundant values in the pet_data structure (name, class,
- equip) [Skotlex]
- * Cleaned up some of the pet related @/# commands, same for some script
- commands. [Skotlex]
- * Pet offensive skills who's inf value is self will be casted on the pet
- now (for stuff like Grand Cross) [Skotlex]
- * Added homun saving/loading support to char-TXT. Note that this is
- completely untested, so it may be as good as broken. [Skotlex]
- * Added a crash-fix on status_calc_bl_sub_homun to abort in case the homun
- has no master (need to clean up this function later) [Skotlex]
- * Tested char-txt load/save, it seems to be working fine, but you should
- STILL backup, as I only launched the server (read old character format),
- closed it down (saved into the new format) and relaunch it (read the new
- format) and it didn't give problems (but there's still the possibility of
- some field being read in the incorrect offset or such). [Skotlex]
- * Updated the char save structure for char-TXT servers so that the homun id
- will be saved, now also the map info (last point, save point, memo maps)
- are now saved using the mapindex rather than the string. BACKUP BEFORE
- UPDATING since this code isn't yet tested. [Skotlex]
- * Cleaned up a bit the char-saving code, added overflow crash prevention in
- case there are more memos than the max-allowed saved. [Skotlex]
- * AM_CALLHOMUN can now be used to recall vaporized homuns. [Skotlex]
- * AM_RESURRECTHOMUN will now fail when the homun is vaporized. [Skotlex]
- * Added SCB_DYE which marks which status-changes need a forced cloth dye
- change to 0 due to sprite issues. Currently only NJ_BUNSINJYUTSU's status
- uses it. [Skotlex]
- * Asura Strike now moves you to the target on fail always (unless the
- target does not exists or is in another map or there's a obstacle on the
- way) [Skotlex]
- * Corrected skill_attack_area hitting dead characters on it's splash range.
- [Skotlex]
- * Swapped the values for OPTION_XMAS and OPTION_FLYING. This should enable
- SG to show the fly animation again, even if sometimes others will see him
- as Santa. As for xmas cloth, it shouldn't make much of a difference since
- the view class is changed to christmas anyway. [Skotlex]
- * Made AM_CALLHOMUN and AM_RESURRECTHOMUN be like the wedding skills, where
- they automatically pick a spot around you. [Skotlex]
- * Cleaned up some the AM_RESURRECTHOMUN code. Hopefully it works now.
- [Skotlex]
- * Cleaned up some the hom evolution code. [Skotlex]
- * Fixed SIGSEGV with homunc save [Toms]
-2006/08/14
- * Removed support for negative autosave intervals, instead added a
- minsave_interval setting which specifies which is the minimum time between
- character saves. Default to 100ms (map_athena.conf). [Skotlex]
- * Sacrifice no longer shows damage to self. [Skotlex]
- * When Asura fails, the skill display will still come off. [Skotlex]
- * Lots of cleaning of the Homun-code. Perhaps the crashes as of late will
- be fixed now (reusing AM_CALLHOMUN seems to be the cause of them)
- [Skotlex]
- * Increased Run's walk speed bonus to 25->50% [Skotlex]
- * Modified emergency_call setting to allow for more specific configuration
- (woe/non-woe, gvg-grounds/non-gvg-grounds, disable from nowarpto maps), see
- skill.conf for details. [Skotlex]
- * Fixed script engine allowing scripts to set a player's zeny to negative
- values. [Skotlex]
- * Fixed setting hide_woe_damage making even "miss" attacks seem to connect.
- [Skotlex]
- * When readjusting the fame-list, the last entry's id is also reset (may
- fix characters appearing more than once on it?) [Skotlex]
-2006/08/13
- * Removed @itemcheck as it was totally pointless. [Skotlex]
- * Corrected states killer/killable being easily dispellable. [Skotlex]
- * Fixed the totally wrong text messages being used for @killer/@killable
- related atcommands, added appropiate entries to msg_athena [Skotlex]
- * Magic and Misc attacks will now get type "flee" when they do less than 1
- damage, this blocks them from causing additional status effects when they
- are blocked. [Skotlex]
- * Cleaned up a bit the Basilica code, it should now properly end when you
- walk. [Skotlex]
- * Fixed some logs not working when you enabled all logs. [Skotlex]
- * Corrected unmute being a level 60 command by default (should be 80)
- [Skotlex]
- * Corrected the mapif_parse_PartyChangeMap function to correctly update
- level-range when someone logs on/off, fixes being unable to set even-share
- on once it's been broken even when the characters out of range logoff.
- [Skotlex]
-2006/08/11
- * Fixed Kagebunshin no Jutsu crashing for dyes > 0; though this solution
- might seem hackish (changing clothes colour to 0 when it starts while
- storing original colour back in val4, restoring original dye upon
- end), I believe this is the best way there currently is to solve
- the issue. [blackhole89]
- * Fixed Dancers/Bards being able to use normal attacks while performing.
- [Skotlex]
-2006/08/10
- * Fixed the item group bonus not working. [Skotlex]
- * Fixed songs/dances always being considered overlapped with themselves.
- [Skotlex]
- * Added some additional song/dance overlap code that should correctly
- change the effect of songs/dances when they overlap. [Skotlex]
- * Added a check so that the status-change packet is always send to self
- when the inflicted char is a player disguised. [Skotlex]
- * Code cleanup on homunc, they stay in memory until player disconnect or
- homunc destruction [Toms]
- * Corrected Advanced Jobs HP bonus from 30% -> 25% [Skotlex]
- * Hopefully fixed family-party-even-share not breaking when a member logs
- out. [Skotlex]
- * Should have fixed the login-sql crash when passed user-name's length is
- beyond the limit. [Skotlex]
- * Changed setting attack_attr_none to affect all neutral-element attacks.
- Basicly, this setting is now used to determine who can hit for full damage
- always when using neutral-attacks (defaults to non-players) [Skotlex]
- * Fixed two instances in the login-sql server where the ip in the log-login
- table was being stored backwards. [Skotlex]
- * Now when a skill's range is 0 and the skill is NOT casted on self, it
- will take the basic weapon's range (without Vulture/Snake Eye bonus).
- [Skotlex]
- * Now when a duration is not specified, sc_start/sc_start2/sc_start4 will
- try to guess the duration by extracting it from the skill_db (it uses
- skill_get_time on whatever skill is associated to the status-change using
- val1 as skill-level) [Skotlex]
- * Some cleanups on trade_tradeaccept to prevent packets being resent when
- they shouldn't. [Skotlex]
- * Fixed syntax error in 'guild' create table statement [Toms]
-2006/08/09
- * Fixed Asura not wasting all SP away when it fails on cast-end. [Skotlex]
- * Fixed homunc skill up bug [Toms]
- * Adjusted some the dance/song/encore code so that the source of an
- ensemble will always get checked, so that walking out of an ensemble skill
- should make it end now. However, it's likely this is not completely solved
- yet and will require further tweaking. [Skotlex]
- * Added crash protection to the mob_db txt reading when the mob_db file has
- lines with insufficient number of columns. [Skotlex]
- * Moved the class-change code from battle_calc_weapon_attack to
- skill_additional_effect. Alchemist summons now also have a chance of
- triggering polymorphing. [Skotlex]
- * Removed the code which was auto-setting attacks that do no damage to type
- FLEE, since that was disabling status-effects which should incur even when
- the damage was blocked. [Skotlex]
- * Trade requests will now fail when either character is unable to act
- (character in storage, vending, interacting with an npc, petrified, etc)
- [Skotlex]
- * Heard skotlex voice, changed all msg_table[] into msg_txt() in atcommand.c [Toms]
-2006/08/08
- * Fixed the char-server not invoking the party_calc_state function when the
- third party-member is added to a party, hence failing to check for families
- and disabling even share from them unless all three relog first (state is
- correctly calculated when party is first loaded). [Skotlex]
- * Crash-protections in the mail-checking function. [Skotlex]
- * Some additional parenthesis on equipment check in pc_equipitem, seems to
- have fixed the mid/lower headgear-sprites not showing up. [Skotlex]
- * Added back missing state set to prevent Ankle-Snare from being retrieved
- after the target dies. [Skotlex]
- * Fixed compilation warning [Toms]
- * Added a check to handle Spider Web as a targetted skill. If there's more
- than one character on the targetted cell, a different one may get trapped,
- but it will mostly do as it is now. [Skotlex]
- * Added check to Asura so that it will move you to the target when it fails
- ONLY when you can cast the skill on the target (not stunned, asleep, target
- not hidden, etc) [Skotlex]
- * Changed the map_freeblock_unlock code so that when there's an "already
- free'd pointer" error, the memory manager will print out the invoking
- function rather than map_freeblock_unlock, this should help fix it up next
- time it happens and is reported. [Skotlex]
- * Casting Kaensin will clear out Suiton and viceversa now. [Skotlex]
- * Fixed drop-rates (@whodrops) getting duplicates when you use @reloadmobdb
- [Skotlex]
- * Fixed unjailing not sending characters to Prontera. [Skotlex]
- * Fixed yet again AS_SPLASHER doing full damage on all characters. Now you
- can use the NK split damage value in the skill_db if you want damage
- divided by the amount of targets rather than by 2. [Skotlex]
- * Fixed crash on the battle_drain functions. [Skotlex]
- * Cleaned up HAMI_CASTLE, HLIF_AVOID, HAMI_DEFENCE so that it's usable by
- other types of objects other than Homunculus. [Skotlex]
- * Cleaned up the Asura Strike code so that the SP/Spheres/States is not
- consumed when the skill fails due to Fog of Wall. [Skotlex]
- * When a negative delay for a skill is specified, this delay is now added
- on top of the character's amotion rather than adelay [Skotlex]
- * Modified main.sql to make the guild table allow NULL on the emblem data.
- [Skotlex]
- * Added file conf-tmpl/Changelog.txt to log config changes. [Skotlex]
-2006/08/07
- * Fixed the login-sql server replying to the change-sex packet with the
- wrong gender, causing the char-server to screw-up job-change updates.
- [Skotlex]
- * Cleaned up the apparent mess that is pc_skill. Hopefully it SHOULD work as
- described on the docs now, this should also fix adopting not correctly
- giving the family-related skills. The flag value of skill should be: 0 to
- set the skill (if skill level is 0, this removes a learned skill), 1 grants
- the skill as an item bonus which is temporary, and 2 will add a skill bonus
- like 1, except the skill level adds up to whatever level already known of
- that skill. [Skotlex]
- * Fixed EQP_WEAPON related code messing up with both weapon AND shield.
- [Skotlex]
- * Cleaned up the Asura code so that when the skill fails your
- SP/Spheres/Fury are all taken away always, as well as moving you next to
- the target (as long as the target still exists within a reachable path from
- your position) [Skotlex]
- * SC_GUILDAURA is now removed on logout. [Skotlex]
- * Fixed Venom Splasher doing half-damage instead of full-damage to the
- "exploding" character. [Skotlex]
- * Hopefully fixed the party_even_share cast-overflow bug as reported by
- Adobe. [Skotlex]
- * Standarized the autosave interval setting to be always in seconds
- regardless of type. [Skotlex]
- * Moved the "bosses can't be knockback" logic from battle_calc_* functions
- and placed it on skill_blown. [Skotlex]
- * Some parenthesis cleanup before invoking battle_calc_base_damage, could
- be fixing the current issue with arrow attacks not adding the arrow damage.
- [Skotlex]
- * Fixed the map_search_freecell error which was making mobs fail to
- respawn. [Skotlex]
- * Added in Lupus's suggestion of not making multi-slot headgears set all
- slot view-ids, which supposedly causes the client to re-draw the headgear
- multiple times on characters. [Skotlex]
- * Fixed HT_BLITZBEAT hitting neutral characters when it auto-triggers.
- [Skotlex]
- * Simplified the Tatami Gaeshi code. [Skotlex]
- * Fixed AS_SPLASHER doing full damage on everyone except targetted char
- instead of the other way around. [Skotlex]
- * Fixed KAENSIN clearing out SUITON cells and viceversa. [Skotlex]
- * The spawn area is now seen as range rather than absolute for mob spawn
- lines. This means that x,y,10,10 will spawn the mob on a 21x21 grid around
- the given x,y point. [Skotlex]
- * Some clean up of the mob-spawn code. Now you can specify negative areas,
- so that a spawn location such as 100,150,0,-1 will spawn a mob always on
- x=100, but any Y value of the current map. [Skotlex]
- * Reflected damage will now also have a chance of draining hp/sp. [Skotlex]
- * Adjusted the order in which option/sc change packets are sent to match
- Aegis's [Skotlex]
- * Added script command getpartyleader through which you can retrieve
- various information of a party's leader. See doc/script_commands.txt for
- further information. [Skotlex]
- * mpeg's Ninja work [Vicious]
- * Adjusted Battle_check_target so that alchemist summoned mobs are
- targetted by everyone as long as 1. The top-level master is a player and 2.
- the actual attacker is not a mob-type. [Skotlex]
- * Added config force_random_spawn which overrides the spawn-files defined
- coordinates to make all mobs always spawn randomly on the map. [Skotlex]
- * SC_SPEEDUP0 is no longer dispellable by SA_DISPEL [Skotlex]
-2006/08/06
- * Updated item_db.sql & mob_db.sql to latest. [Toms]
- * Little fixes on homunc (hp/sp are now saved and init stats changed) [Toms]
-2006/08/04
- * Added a commented piece of code at the end of clif_parse_LoadEndAck which
- will update your direction to wherever you were facing before warping.
- Should this be the default? Nearby people DO see you facing on the same
- direction before warping, it's only your client that will always see you
- facing north on spawn (the spawn packet does contain direction
- information). [Skotlex]
- * Updated @mobinfo to display slots in the drop information. [Skotlex]
- * Fixed flag.elefix not being respected in battle_calc_misc_damage.
- [Skotlex]
- * Some code cleanups in battle_calc_damage. [Skotlex]
- * Modified bAddItemHealRate so it can receive both item-id and item-group
- values (since the first item-id is +500, there's no risk of mixing them
- up). [Skotlex]
- * Removed settings enemy_critical_rate, homun_critical_rate. Added settings
- enable_critical (defaults to specify only players), mob_critical_rate and
- critical_rate. The last applies to all non-mobs and non-players
- (battle/battle.conf) [Skotlex]
- * Removed settings mob_npc_warp, mob_warpportal. Replaced with setting
- mob_warp which specifies which types of warp can a mob step into
- (battle/monster.conf) [Skotlex]
- * Enabled Mastery damage on Soul Breaker again, moved adv katar mastery out
- of the mastery function so that it may apply to all skills except Soul
- Breaker. [Skotlex]
- * Changed name of the setting log_pick to log_filter since that's what it
- does now. [Skotlex]
- * Modified enable_logs so that instead of a 0/1 setting, you can specify
- which kind of events to log (so you can use a combination), see log_athena
- for the bitmask configuration. [Skotlex]
- * Cleaned a bit the contents of log_athena.conf
- * Hide/Chasewalk will again stop screaming skill name. [Skotlex]
- * Soul Breaker will no longer receive Mastery damage. [Skotlex]
- * Fixed warning:'type' might be used uninitialized in this function [Toms]
-2006/08/03
- * Added a check to skip the experience share of characters who are dead or
- on another map. [Skotlex]
- * Reverted the previous change, chasewalk has no icon, only the str-bonus
- has that fist icon now. [Skotlex]
- * Allowed chase-walk to display a skill animation when using it. [Skotlex]
- * Readjusted the Chasewalk icon to be as it should be. [Skotlex]
- * GS_DESPERADO is now a short-range attack skill. [Skotlex]
- * Changed the Battle-Orders icon to be the Strength Up icon (for
- Chasewalk's str bonus). [Skotlex]
- * Fixed using the right-hand weapon's size modifiers regardless of which
- weapon's damage was being calculated in regards to. [Skotlex]
- * Simplified the ignore-size check by making the Weapon Perfection check be
- done when specifying the flag, also moved the size-fix property of riding
- spear-knights to status_calc_pc. [Skotlex]
- * Changed SI_CHASEWALK value to 119 as concluded by LoneWolf [Skotlex]
- * Corrected clif.c sending the raw mdef2 value to the client instead of
- first substracting the "secret vit/2" bonus from it. [Skotlex]
- * Added a damage cap to CR_ACIDDEMONSTRATION of INT_MAX/2 to prevent
- overflows. It is not capped to INT_MAX because damage increasing skills
- would cause it to still overflow afterwards. [Skotlex]
- * Fixed NPC_CRITICALSLASH not being considered as a Critical hit by the
- code. [Skotlex]
- * Added RUDE_ATTACKED_COUNT so you can easily adjust how many rude-attacks
- should happen before a mob uses the rude-attacked skill. Value has been set
- to 2 for now. [Skotlex]
- * Now when a mob changes target (to someone they can hit) their
- rude-attacked count won't be reset, but instead will be reduced by one.
- [Skotlex]
- * SC_SPEEDUP0 can now stack with the other speed raising buffs. [Skotlex]
- * Some adjustments so that the last-skill-used will be correctly cleared
- when your combo-time ends. [Skotlex]
- * Fix a bug in atcommand_charspeed [Toms]
- * Fixed a logic error preventing from cooking anything [DracoRPG]
- * Cleaned up the last NJ update code. [Skotlex]
- * Added @ command `charspeed` [Skotlex]
- * Fixed @jailfor using MAP_PRONTERA as jail instead of MAP_JAIL [Skotlex]
- * Removed case for GS_SPREADATTACK on damage packets to see if the skill
- displays correctly now. [Skotlex]
- * Corrected Deluge/Volcano/V. Gale overlaps so that the placing tiles are
- removed, NOT the ones who were already placed. [Skotlex]
- * Made SC_SPEEDUP0 and SC_SPEEDUP1 use different icon IDs, to fix
- icon-confusion when both are enabled at a time. [Skotlex]
- * Mob rude-attacked count is not reset now on picking a new char (gotta
- investigate this further) [Skotlex]
- * Changed atoi to strtoul for guild-experience's field [Toms]
- * Fixed a bug in int_storage.c, temp array doesn't have the good size [Toms]
-2006/08/02
- * Modified yet again SC_SILENCE after iRO tests from Entwined on IRC.
- Silence now ONLY blocks skills from being used, it will not stop on-going
- casts. [Skotlex]
- * Updated status_cast_cancel to also include silence (so the cast bar is
- cancelled if you are silenced during it) [Skotlex]
- * Updated the way SC_SILENCE works. From what I remember (from previous
- forum discussions) it: 1- Always blocks skills from being used. 2- Will
- only block a skill when the cast-bar ends IF the skill is targetted. If
- anyone wants to debate to get this changed, make an appropiate forum topic
- in the svn development area to discuss. [Skotlex]
- * Added a check in the walking code when triggering skills.
- NPC_SELFDESTRUCTION will no longer cancel walking, it will instead resend
- the walk packet, this effectively causes the mob to start walking
- (clientside) while the cast-bar is showing. [Skotlex]
- * Fixed a logic error on battle_get_master which was causing infinite
- loops.. [Skotlex]
- * Fixed homunculus error message [Toms]
- * Rewrote pc_payzeny to not use doubles, it may more accurately prevent
- charging a player more zeny than they can withhold. [Skotlex]
- * Fixed failing to create Deadly Poison Bottles damaging 50% of your max
- life instead of 25% [Skotlex]
- * Added the missing status-change flags to SC_FREEZE to signal it should
- modify def and magic def [Skotlex]
- * Little add on NJ_HUUMA [Toms]
- * Merged Mpeg's work on Ninja skills [Toms]
- * Fixed Martyr's Reckoning having a cap damage of 32k. [Skotlex]
- * Now you can teleport in Thanatos Boss room, but you can't respawn there [Playtester]
- * Fixed Defender Raising Walk speed instead of diminishing it. [Skotlex]
- * Added a check on status-change load to prevent loading speed-affecting
- status when their speed adjustment is 0 (prevents division by zero)
- [Skotlex]
- * Code cleanup & optimization on guild part of char-server [Toms]
- * Fixed script code data not being free'd if a player quits in the middle
- of a script. [Skotlex]
- * Modified run_script so that when there are leaks, it will report the
- place where run_script was called from as source rather than the inner code
- of run_script (for debugging purposes) [Skotlex]
- * Made recursive master check the default (otherwise it messes skill -> pet
- -> player kind of herarchies) and cleaned up some the battle_get_master
- code to prevent infinite loops in the weird case someone specifies that
- their master is itself. [Skotlex]
- * Recoded the GuildAura code to use val3 & val4, allowing much greater stat
- bonuses (in case someone wants to get Guild Skill level 20 or something
- crazy like that) [Skotlex]
- * Updated battle_check_target so that all alchemist summoned mobs can be
- target by everyone. [Skotlex]
- * Cleaned up skill_check_condition_mob_master_sub, it will now count both
- total number of summoned mobs and amount that belong to the same type.
- [Skotlex]
- * Corrected AM_CANNIBALIZE so it will fail if you already have plants of
- another type out. [Skotlex]
- * Using NPC_SELFDESTRUCTION no longer will make the caster stop walking.
- [Skotlex]
- * Removed SI_GUILDAURA, and replaced it with SI_LANDENDOW, now
- Volcano/Deluge/V. Gale will get that funky icon instead. [Skotlex]
- * Changed clif_hominfo to receive both sd and hd as parameters
- * Some redundancy cleaning in mercenary.c [Skotlex]
- * Moved updating of sd->mercenary.hp from merc_damage to pc_makesavestatus.
- [Skotlex]
-2006/08/01
- * Miscellanous fixes which make the Marine Sphere self destruction work as
- best as I can. It only has one flaw: It self-destructs instantly after
- walking because if I make it use self-destruction with a cast-bar,
- client-side the object stops moving inmediately... [Skotlex]
- * Modified unit_walktoxy and NPC_RUN to enable running even when the caster
- does not has the MD_CANMOVE bit on. [Skotlex]
- * PF_MINDBREAKER will now silently fail if you try to use it on someone who
- already has the status active. [Skotlex]
- * Cleaned up yet again skill_landprotector, now new cells of
- Deluge/Volcano/V.Gale will delete previous cells when they are recasted on
- top of each other. [Skotlex]
- * Summoned Marine Spheres no longer get the MD_CANMOVE bit. [Skotlex]
- * Cleaned up some more the SC_JAILED code [Skotlex]
- * merged in atcommands jailfor, jailtime, charjailtime. Thanks to Meruru
- and Coltaro for the code. [Skotlex]
- * Cleaned the code of atcommands jail and unjail [Skotlex]
- * Be warned that the code MAY contain bugs as I adjusted it to save the
- character's position before jailing, allowing the automatic unjailing to
- warp you back to the exact spot you were at before being jailed. [Skotlex]
- * Should have fixed the cooking sets not displaying all cooking available
- items. [Skotlex]
- * Figured out and fixed the issue with Volcano/Deluge/Violent Gale not
- really working. Thanks to Mpeg for noting it out. [Skotlex]
- * Modified Self Destruction, so that Marine Spheres in non-versus maps will
- hurt only enemies, while in all other situations this skill will hurt
- everyone around them. [Skotlex]
- * Expanded setting debuff_on_logout so that &1 removes negative buffs and
- &2 removes positive buffs. [Skotlex]
- * Food status boosts will no longer end on death, but they will end when
- you respawn or logout. [Skotlex]
- * Added battle config file status.conf, moved some settings from skill.conf
- and battle.conf to it since they are entirely Status-Change related.
- [Skotlex]
- * Added the missing lines to enable script command "kickwaitingroomall"
- [Skotlex]
- * Magic Rod's can-act delay will no longer be applied when you absorb a
- spell. [Skotlex]
- * Fixed Don't Forget Me increasing speed instead of decreasing it. [Skotlex]
- * Modified setlabel so that the script engine barks when you are trying to
- use the same label name as a constant or variable name. [Skotlex]
-2006/07/31
- * Fixed the subnet 0 mask being reset to 0 when someone goes up on the fame
- rankings. [Skotlex]
- * Updated Poison React chance to counter and number of counters as per
- skill description updates. [Skotlex]
- * Fixed Sharpshooting being counted as a magic attack, and hence, using
- your MATK as base damage. [Skotlex]
- * Fixed NPC_STOP id value in skill_cast_db [Skotlex]
- * Bladestop will no longer stop when you push either of the characters
- around. [Skotlex]
- * Fixed Enchant Poison having a near 100% chance of poisoning target on
- attack. [Skotlex]
- * Little fix on duel [Toms]
- * Added possibility to restrict duel usage to same map [Toms]
- * Merged mpeg's fix on ninja skills [Toms]
- * Corrected a status_get_race call which should be status_get_race2 in misc
- attacks. [Skotlex]
- * Moved the Devotion code to the top of the SC list in status_damage,
- meaning that now stuff like being asleep or confused won't end if you are
- hit, but the damage is absorbed by devotion. [Skotlex]
- * Added the Soul Link of Rogue speed bonus to Chase-Walk. Since there's no
- information of how much the bonus should be, it currently is a conservative
- 10%. [Skotlex]
- * Fixed a possible crash in the main script engine when restoring previous
- script. [Skotlex]
- * Fixed sleep.tick not being set back to 0 before resuming execution, which
- leads to scripts that are continously executed even when they already ended
- (they do nothing but waste resources) [Skotlex]
- * Fixed a pair of free -> aFree used on stacks, which would lead to memory
- manager reporting leaks where there aren't. [Skotlex]
- * Removed incorrect "Waterball range+1 when standing on suiton" feature.
- [Skotlex]
- * Corrected the Speed update code to prevent sending "walk to xy" packets
- twice when the affected character is a player. [Skotlex]
- * Expanded mob can't move warning to print out where this mob was stuck at
- (map, x,y) [Skotlex]
- * Fixed segmentation fault in status_change_end, vd wasn't initialized [Toms]
-2006/07/30
- * NPC_INVISIBLE will now use Cloaking of a level +9 of the used skill
- level, so that at level 1 they can attack, use skills and receive no
- walking penalty. [Skotlex]
- * Mob casted Sanctuary will no longer always heal it's targets regardless
- of element/race [Skotlex]
- * Status change packets will now use as criteria for sending the actual
- view_class instead of player/not-player. This will fix status-changes
- displaying improperly on clones, and also possible crashes with disguised
- players. [Skotlex]
- * Merged mpeg's fix on ninja skills and SA_VOLCANO,SA_DELUGE,SA_VIOLENTGALE [Toms]
- * Added bNoMiscDamage setting so you can specify misc-damage blocking from
- skills. Modified battle_calc_damage so that even Pressure and similar
- skills will be affected by this setting. [Skotlex]
- * GS skill updates/fixes [Vicious]
- * Force all users offline in sql when char-server starts [Toms]
-2006/07/29
- * Removed ugly struct cast in login.c [Toms]
- * New version of buildin_query_sql which accept more than one column and
- can return the number of rows. See script_commands.txt for more details. [Toms]
- * Fixed nullpo in merc_hom_skillup [Toms]
- * Added a return value to buildin_rid2name if rid is invalid [Toms]
- * Made the SQL ping interval default to 7 hours. [Skotlex]
- * Made skill_unitsetting remove the group when no unit-cells were placed
- down. basicly this means that if landprotector blocks all tiles, the group
- will be removed from memory, preventing said group from counting to the
- total number of skills you can set. [Skotlex]
- * Fixed segmentation fault in script engine when calling something which is not a function [Toms]
- * Fixed segmentation fault in script engine when activating DEBUG_RUN flag [Toms]
-2006/07/28
- * Added Ishizu's code to check ammo type on attack. No more using Grenade
- rounds with Guns. [Skotlex]
- * offensive heal/sanctuary will only happen when the source of the heal is
- a player, mob/pet casted heal will now always heal regardless of target.
- [Skotlex]
- * Shield Chain will now ignore the 'ice-pick' defense piercing bonus.
- [Skotlex]
- * Self destruction will now hit all characters in range, not just enemies.
- [Skotlex]
- * Cleaned up the NJ update code: [Skotlex]
- - Restored code which was removed (stuff like SC_SKA)
- - Fixed possible crashes on some NJ skills if used by non-players.
- - Fixed most NJ magic spells doing more damage than they should.
- - Fixed ZenyNage being able to do more damage than zeny you have.
- - Cleaned up skill setting code for Suiton and Kaensin
- * Some cleaning of battle_drain, Evil Druid card should work now. [Skotlex]
- * Made status_damage allow damaging of objects not on a map, this should
- fix pet-catching making the mob never respawn again. [Skotlex]
- * Casted nothl to (unsigned int) in sprintf functions, IP is 32bits and sql field the same :) [Toms]
- * Fixed "warning: `list' might be used uninitialized in this function" in char/char.c@3032 [Toms]
- * Fixed "uninitialized local variable 'i' used" in skill.c and "warning: suggest explicit braces to avoid ambiguous `else'" in battle.c [Toms]
- * Fixed "warning: long unsigned int format, unsigned int arg" in parse_login (login_sql\login.c) [Toms]
- * Fixed sign warnings in login/login.c [Toms]
- * Fixed "conversion from 'double' to 'int', possible loss of data" [Toms]
- * Fixed "warning: redefinition of [ushort/uint/ulong]" [Toms]
- * Fixed duplicate case value on NJ_SUITON [Toms]
-2006/07/27
- * Fixed a memory leak when there exists more than one user function with
- the same name, added the appropiate warning when this happens. [Skotlex]
- * Added reporting source file when an npc shops item's price is
- exploitable. [Skotlex]
- * The picklog will now record negative values for items sold to npcs.
- [Skotlex]
- * Added inmediate position and hp-bar update when a character joins a
- party. [Skotlex]
- * Added missing SC information to NPC_CHANGEUNDEAD [Skotlex]
- * Added config setting party_update_interval so you can specify how often
- the party-mate minidots should be updated (defaults to 1 sec). [Skotlex]
- * Removed a bunch of broken comments in skill.c [Skotlex]
- * Synced the script.c file with as much data as possible from jA's:
- [Skotlex]
- - A lot of functions were moved around, a bunch of indentation and
- space-usage changes were done to make it easier to diff against their
- files.
- - Miscellanous addition and corrections were applied.
- - Largest one is likely a restructuring of run_script_main, which hopes to
- solve the memory leaks.
- - script engine now uses the setjmp functions to restore memory state when
- there's an error parsing scripts, which means that script errors won't
- cause the map-server to inmediately bail out anymore.
- - NOTE that the amount of changes is pretty extensive, so DON'T USE THIS on
- a live server. Update only to help test and debug to see if the script
- engine memory leaks are gone.
- * Added a cleanup routine on shutdown to remove all characters from memory
- for whom the save ack has not returned from the char-server yet. [Skotlex]
- * Now when you set the guardian's HP, if the guardian is spawned, it's HP
- will be updated accordingly (and if you set it to 0, the guardian is
- killed) [Skotlex]
- * Added functions status_set_hp/status_set_sp to set hp/sp to a given
- value. Applied usage of these on the Berserk and Soul Change code.
- [Skotlex]
- * Added config setting "party_hp_mode" (battle/party.conf) which determines
- method to use to update party-mate hp bars. Aegis style is to update HP
- bars whenever HP changes, while eAthena style is to update it together with
- the map party dots. Defaults to aegis style. [Skotlex]
- * Fixed packet 0x22a having the manner and opt3 packets in inverted
- offsets. [Skotlex]
- * Readded the check which prevents Cloaking from activating when your
- learned level is less than 3 and you aren't next to a wall. [Skotlex]
- * Some cleanups to the Frenzy/Berserk status change, it should probably
- work correctly now. [Skotlex]
- * Removed a redeclared variable i in the parsing of the fame list (char-sql
- server) which seems to be the cause of the random memory corruptions.
- [Skotlex]
- * Updated item_db.sql to latest. [Toms]
- * Fix homunc & code cleanup [Toms]
- - Timer problems on delete_timer
- - Intimacy problem (overflow & new values)
- - Homunc deleted if intimacy < 0
- - base exp is now given to master
- - Homunc sometimes not saved
-2006/07/26
- * Fixed a memory leak when reading the item_db txt. [Skotlex]
- * Applied the necessary changes to make @partyoption reflect it's changes
- on the alt+p window. [Skotlex]
- * Modified party_item_share_type config setting so that using 1 disables
- item-sharing from non-mob loot (player dropped items or pet loot) and 2
- enables round-robin instead of random sharing. Using 3 obviously is
- enabling both 1 and 2. [Skotlex]
- * Added battle_get_master which returns the master bl of a given object.
- [Skotlex]
- * Recoded battle_check_target to use battle_get_master, the src/target
- switch has been split into two, so that actual target and master target are
- seperately treated (same for source). [Skotlex]
- * Added support for "sc_end -1" which will clear all status changes. Added
- the constant SC_ALL so you can use in scripts "sc_end SC_ALL;" instead.
- [Skotlex]
- * @pettalk will now fail when muted. [Skotlex]
- * Enabled changing of equipment while stunned/asleep/petrified/etc [Skotlex]
-2006/07/25
- * Cleaned up run_script_main to properly free previous stack-data when
- running scripts. Note that scripts may still leak memory when run by
- non-players and they don't reach the "END" state, however I am not sure how
- this case should be handled, so it's left as it is for now. [Skotlex]
- * Added a missing ntohl call in the loginlog code. [Skotlex]
- * Added a check when buying from npcs to allow buying of item_avail items.
- [Skotlex]
- * Fixed duel accept invite sending the packet before the duel data is set
- (resulting in a packet that noone receives). Thanks to Toms for finding it
- out. [Skotlex]
- * Fixed a possible crash when you dual-wield and the total damage is 0.
- [Skotlex]
- * Added Toms's perl scripts item_db.pl and mob_db.pl (they are in tools/),
- they convert the txt databases into sql. [Skotlex]
- - Usage: "script" < "input file" > "output file". eg: ./tools/item_db.pl < db/item_db.txt > sql-files/item_db.sql
- * Updated the sql files since now it's quick [Skotlex]
-2006/07/24
- * Re-updated the mob_db.sql to latest. [Skotlex]
- * Cleaned up the skill_landprotector function to correctly block only magic
- skills from being placed on land protectors. [Skotlex]
- * Corrected itemdb_group so that it will not return the random item givers
- (should give priority to actual item groups, so that the item heal bonuses
- work correctly) [Skotlex]
- * Cleaned up the Mistress Card related code so that the no-gemstone bonus
- reduces item requirements by one rather than totally skip them. [Skotlex]
- * Cleaned up the logs "can log"function to use the IT constants. Also
- corrected the "only log large amounts" setting not working on negative
- values (trades). [Skotlex]
- * Adjusted skill_castfix_sc so that Suffragium will get consumed even on
- instant cast skills, but Memorize won't. [Skotlex]
- * BladeStop will now end when either of the characters is moved (knocked
- out?) around. [Skotlex]
- * Moved the Zeny penalty code from respawn to pc_dead. [Skotlex]
- * Added a check to prevent Deluge/Volcano/Violent Gale from being placed on
- top of each other. Reverted the previous 'fix' where atk was being
- increased based on armor element rather than element of attack. [Skotlex]
- * Removed the noreturn mapflag check from script command warp. [Skotlex]
- * Homuculus cleanup [DracoRPG]
- - Replaced nullpo's in parse functions by silent checks
- - Removed server-side effect for menu option 0 (view status window...
- why does the client send us the packet since we don't care? -_-)
- - Rewrote intimacy underflow checks so they are really effective (no
- need to check if an unsigned is < 0, it won't work... check before!)
- * fixed unban unblocking players as well. [Skotlex]
- * Fixed Volcano/Deluge/Violent Gale increasing damage based on element of
- attack instead of defense element of attacker. [Skotlex]
- * Cleaned up the code of Magic Rod, fixed it not giving SP. [Skotlex]
- * Moved the code of Hermod and Basilica to castend_pos2 so it should work
- now. [Skotlex]
- * Modified the code of Ankle Snare so the status ends on unit's time-limit
- rather than when the snared object moves away. [Skotlex]
- * Re-worded the water check of ST_WATER skills. [Skotlex]
- * Allowed sc-cast reductions to be processed even when cast-time is instant
- (to let suffragium end even on instant-cast skills) [Skotlex]
-2006/07/23
- * Modified setting skillrange_by_weapon (skill.conf) to be a
- per-object-type setting instead of yes/no. The default now is that
- weapon-based skills will take the attacker's range for non-players.
- [Skotlex]
- * Changed the default of skillrange_by_distance to include homunculus.
- [Skotlex]
- * Fixed buildin_isequip not working correctly with non-cards. [Skotlex]
-2006/07/22
- * Updated mob_db.sql to latest. [Skotlex]
- * Applied Toms's suggested corrections to homun code. [Skotlex]
- * Corrected Cannibalize/Marine Sphere ignoring the selected summon spot.
- [Skotlex]
- * Fixed looting pets ignoring the item pick-up priority of other players.
- [Skotlex]
- * Should have fixed a signess warning in login txt. [Skotlex]
-2006/07/21
- * Added blocking of @me when muted or in berserk status. [Skotlex]
- * Corrected the @follow timer not being deleted on logout. [Skotlex]
- * Applied the homunculus code fixes provided by Toms. [Skotlex]
- * battle_check_target will now tag homunculus as invalid target when the
- source is a skill-type object. [Skotlex]
- * Added a check on pc_equipitem so that when the client specifies to equip
- a weapon on the right hand when the left hand is available, the weapon will
- be sent to the left hand instead (when dual-wielding is possible,
- obviously). Same for the left/right accessories. [Skotlex]
- * Added the necessary checks so that Suiton makes Fogwall have double
- duration, and to make water-requiring skills to consume their cells.
- [Skotlex]
- * Corrected the loadmap event description to specify that the mapflag
- required is actually "loadevent", NOT "loadmap"! [Skotlex]
- * Now when the char-txt server does not finds a requested party, it will
- clear out said party id of all characters (will help prevent massive
- spamming/overhead when for some reason the party file needs to be deleted).
- [Skotlex]
- * Combo skills (inf = self, inf2 = no target self) no longer check range if
- you use them while your attack-timer is still active. [Skotlex]
- * Added back a map_freeblock call in skill_delunitgroup which caused a
- memory leak when removed... [Skotlex]
- * Added a check to prevent Blind from ending while standing on a fog of
- wall. [Skotlex]
- * The mob Slave ai will be executed now even when the slave has a target.
- This will allow for "instant" warping to the master when it changes maps or
- teleports. if the slave has a target already, it won't unlock it and chase
- back to the master or anything like that. [Skotlex]
- * Removed a couple of checks that prevents item ids above 20000. However,
- remember that the max id is still ~32k or the client is the one who's gonna
- crash! [Skotlex]
-2006/07/20
- * Added source reporting when you do an invalid int&str or str&int
- operation on a script. [Skotlex]
- * Fixed the intif party creation packet having the incorrect size sent,
- hence causing the leader's level to be read as garbage (which caused the
- "impossible to even share" bug). [Skotlex]
- * Added pc_check_weapontype to do a proper skill weapon check that takes
- into account dual-wielding. That is, if a skill can be used with
- daggers/axes, you'll be able to use the skill when dual-wielding them.
- [Skotlex]
- * Corrected Cloaking level 1-2 not letting you move across walls. [Skotlex]
- * updated cloaking code so that when you set "enable cloaking without
- walls", the code will consider you as "always next to a wall", thus you get
- the wall-speed bonus always. [Skotlex]
- * Applied the fix to homunculus name saving... [Skotlex]
- * Added battle config settings agi_penalty_target and vit_penalty_target,
- they define which object types will get vit/flee reductions when
- multi-targetted and defaults to only players (battle/battle.conf) [Skotlex]
- * Added the dummy intravision case for the changeoption packet 0x229
- [Skotlex]
- * Corrected Fog of Wall so that all targetted offensive skills (not only
- those who do damage) will fail on cast-end 75% of the time. [Skotlex]
- * corrected @homlevel up and one entry in the homun exp table as reported
- on the forums by Albator. [Skotlex]
- * Added the SQL fix to Homunculus skill learning/saving bug [DracoRPG]
- * Added a status_check_skilluse on skill_attack_area call to prevent splash
- damage skills from hitting hidden/trickdead/etc characters. [Skotlex]
- * Corrected fog of wall to behave as best known currently: [Skotlex]
- - Only takes effect when targetting a character inside it
- - -50hit/-75% damage when using normal-ranged attacks
- - -25% damage from all damage skills
- - 75% chance of all targetted damage skills of failing.
- * Should have fixed @refine applying multiple times to equipment that uses
- multiple equip slots. [Skotlex]
-2006/07/19
- * Fixed the inf code update breakage which was blocking all offensive
- skills. [Skotlex]
- * Added battle setting homun_critical_rate (defaults to 0) [Skotlex]
- * Removed enemy_str/pet_str/enemy_perfect_flee and replaced them with
- enable_perfect_flee which specifies which objects can have perfect flee and
- enable_baseatk which specifies which objects can have a base attack value
- (both in battle.conf) [Skotlex]
- * Modified the targetted skill logic to enable offensive skills to be
- targetted at party/guild members if the appropiate inf2 value is set.
- [Skotlex]
- * Added checks to make adding items to inventory/cart fail when a char is
- in finalsave state. [Skotlex]
- * Fixed parse_names on irc.c crashing when receiving a null argument.
- [Skotlex]
- * Modified the parsing of the names line, since some servers will send @
- instead of = when separating the information. [Skotlex]
- * Fixed the homun creation sql statement. Why noone else did so before?
- [Skotlex]
- * When enabling/disabling hiding/unhiding an npc, if the npc is a warp, it
- will use clearchar and spawn packets instead of changeoption. Thanks to
- Toms for the fix. [Skotlex]
- * Corrected Trim chars to block 'enter', as explained by the Ultra mage.
- [Skotlex]
- * When the client passes account version 0, the login server will set it to
- 1 now. [Skotlex]
- * Corrected the HP bar scaling when HP is above Short Max. It should
- display fine for any HP value now. [Skotlex]
- * Added a check when the mob's adelay is shorter than the amotion, in which
- case the adelay will be changed to the amotion value. [Skotlex]
- * Some minor mapflag changes. [MasterOfMuppets]
-2006/07/18
- * Added atcommand @partyoption, lets you alter the party item-distribution
- type on the go. Usage is "@partyoption <pickup share> <item distribution>",
- where both arguments can be 0/1, yes/no, etc. [Skotlex]
- * Updated @changeleader and @partyoption to use msg_Athena entries.
- [Skotlex]
- * Added character 013 (enter) to the list of characters that are always
- removed from new character names. [Skotlex]
- * Fixed a crash when trying to extend TK's infinite combo feature. [Skotlex]
- * Corrected Poison React to counter regardless of distance, and to use the
- skill's 50+5*lv% counter chance (instead of 100%). [Skotlex]
- * Corrected Venom splasher's splash damage [Skotlex]
- * You now can't move/attack/use-skills when using Cloaking of a level less
- than 3 [Skotlex]
- * Fixed compilation of mercenary.c [Skotlex]
- * Corrected Fog of Wall's "targetted spells fail 75% of the time" feature
- by making it behave like GTB, that is, you just get a skill-failed on
- cast-end, no skill-animation at all. [Skotlex]
- * Added a proper check to make aggressive mobs never override homun targets
- regardless of distance. [Skotlex]
- * Removed a bunch of homun-related variables that are not needed at all.
- The alive condition is removed, now the code checks for the hp value to
- know if the homun is alive or not. [Skotlex]
- * Cleaned up a bit the skill-id function, homun skill checks (such as delay
- and skill-lv learned) should be correct now. [Skotlex]
- * Added a proper check to make aggressive mobs never override homun targets
- regardless of distance. [Skotlex]
- * Fixed giving the 100% damage bonus when no-splash-targets are found in
- the blown path to Grandcross instead of Bowling Bash. Bowling Bash damage
- equation becomes then +50*lv% rather than +40*lv% when there's no
- splash-damage (the 50*lv% figure is custom, all we know is that level 10
- does 600% instead of 500% damage). [Skotlex]
-2006/07/17
- * Updated mob_db.sql to current mob_db.txt data. [Skotlex]
- * The char-server will allow off-line character saves when said char is
- tagged for final-save (this is the scenario when the char-map reconnect).
- [Skotlex]
- * Should have fixed the Cart Termination damage code to be scaled correctly
- when you change the max cart weight. Thanks to The Ultra Mage for the error
- clarification. [Skotlex]
- * Implemented Grandcross weird property where if there's noone on the path
- it'll hit twice for the skill's reported damage, and when there is (or you
- can't knockback the target) it'll do a splash attack that hits twice for
- 500% to all affected targets. [Skotlex]
- * Some cleaning of the combo code. TK Rankers will now get their combo-time
- extended each time they trigger a kick, enabling them to do "unlimited
- combos". [Skotlex]
- * Modified the autosave function to use a sweep across the player db
- instead of across connected clients. This will cause non-connected players
- (like autotraders) to also be saved on a regular interval, may help with
- possible data-loss from said characters on unclean shutdowns. [Skotlex]
- * Removed the code that forces aggressive mobs to go after a Homun instead
- of their master (no reason why there should be such a condition). [Skotlex]
- * Some sign quest map flag updates [MasterOfMuppets]
- * atcommand_follow is now more verbose. [Adam]
- * Manually added int_homun.c to the VS8 char_sql project, *should* work [DracoRPG]
- * Orn's fix to the very critical skill level up bug [DracoRPG]
- * Updated mob_db.sql to current mob_db.txt data. [Skotlex]
- * Added Orn's lil fix on homun [Vicious]
- * Added Homunculus system, enjoy! [orn aka Nylou]
- - WARNING: This currently only works with the SQL version, as the TXT char-server
- has no code for it at the moment. You TXT server won't break, but the char-server
- will complain of an unknown packet if you try to get an Homunculus
- * Updated nomemo mapflags based on info from http://ro.doddlercon.com/images/memo.jpg [Poki#3]
-
-2006/07/15
- * Small change in conf/battle/player.conf to say that 199 is max aspd allowed
- (Haplo says that there are many reports of having over 200 is giving errors) [Evera]
-2006/07/13
- * Kaahi no longer shows the heal effect to everyone. [Skotlex]
- * Eska no will cause defense to change randomly every second. [Skotlex]
- * Tuned up some more NJ_KAENSIN based on Tharis's information. [Skotlex]
- * Corrected NJ_KAENSIN as per description. [Skotlex]
- * Fixed a leaking map_freeblocklock on skill_del_unitgroup. [Skotlex]
- * Changed the default save interval to 5 minutes. Added support for
- specifying fixed save-intervals by using negative values. [Skotlex] EG:
- - Save interval set to 300 (5 minutes): all characters will be saved in
- equal time-slots, so that everyone is saved every 5 minutes regardless of
- number of players online.
- - Save interval set to -1000 (1000 ms): One character will be saved every
- second, regardless of amount of characters online.
- The new fixed-time-slots method is meant for larger servers, so that they
- can control the saving-induced stressed on the char-server.
- * Fixed @storeall and @charstoreall failing when the target character
- already had the storage open. [Skotlex]
- * Reverted temporarily the Cart Termination equation until it can be
- fixed... [Skotlex]
- * Fixed script command "recovery". [Skotlex]
-2006/07/12
- * Fixed a small typo in my code [Zido]
- * Added negative value in bonus exploit fix for more stat bonuses [Zido]
- * Fixed exploit in pc_bonus there are no checks that check that the value being
- added onto a status don't make it go below zero, which means if you have a mineral
- card and reset stats it reduces your base attack to lower than zero, making it
- go up to 64000. Fixed by adding a check for SP_BASE_ATK, although i recommend
- doing it for other status bonuses also [Zido]
- * Recoded NJ_BAKUENRYU to behave as I understand it best from the
- skill-description (since Haplo told me this skill doesn't really has video
- information or anything...) [Skotlex]
- * Fixed NJ_TATAMIGAESHI to use ground-tiles rather than "for each in path"
- calls. The skill should be working correctly now, except for the fact that
- the correct "unit id" is missing (this is what would give the ground tile
- it's correct display). Temporarily it is using 0xba until the correct value
- is found. [Skotlex]
- * Added back the undead check to turn undead/resurrection to prevent
- damaging non-undead targets, removed it from the battle damage section.
- [Skotlex]
- * Resurrection will now silently fail when used on non-undead + not-dead
- characters. [Skotlex]
- * Poem of bragi/magic String's base delay reduction at level 10 (or above)
- is now 50% instead of 3*lv%. [Skotlex]
- * status_damage will no longer fail when the target is not on a map AND the
- flag is 2 (charge rather than damage). Fixes SP-draining status changes
- ending suddenly when in-between maps. [Skotlex]
- * Fixed the IP value being apparently incorrectly casted before inserting
- into the loginlog table on "connect success" events. [Skotlex]
- * Fixed Cart Termination's damage. [Skotlex]
- * Added the missing check to remove character from memory when logging out
- and using the charsave_method which saves character map-server-side.
- [Skotlex]
-2006/07/11
- * Fixed inverted check which was preventing you from buying more than 1
- from any stackable item.... [Skotlex]
- * Should have fixed the crash in intif gm message... [Skotlex]
- * Fixed GTB card only working while you had a status-change active.
- [Skotlex]
- * Fixed being unable to compound cards in armor. [Skotlex]
- * Made @monsterignore be an universal ignore. Means you cannot be targetted
- as an enemy by anything. Also added alias "@battleignore" which does the
- same as monsterignore. [Skotlex]
- * Fixed magic power setting your min matk as max-matk. [Skotlex]
- * Modified the packets involved in @fakename in hopes it'll refresh
- correctly on nearby clients now. [Skotlex]
- * Fixed clif_parse not checking for func_parse before sending data to the
- connected clients. This in turn required various code-rewrites in: [Skotlex]
- - duel related messaging functions (added clif targets DUEL/DUEL_WOS).
- - intif whisper to gm function
- - day/night timers
- - Rewrote the parse_console function to stop allocating/deallocating memory
- on every call.
- - Modified chrif_charselectreq to receive the player's ip among the data.
- * Added function clif_disp_message, which is the same as
- clif_disp_onlyself, except you can specify the targets (it sends a
- guild-chat packet) [Skotlex]
- * Fixed the subele bonus (elemental reduction) being applied to the element
- of the attacker instead of the element of the attack. [Skotlex]
- * mob skills now won't trigger on unit_stopwalking calls. [Skotlex]
- * Coded @reset. [Skotlex]
- * Reenabled @changesex [Skotlex]
- * Added function pet_create_egg which handles creating pet eggs correctly
- (when passed item id is indeed a valid petegg). Applied this on @createitem
- and getitem. [Skotlex]
- * Cleaned up code of @item [Skotlex]
- * Cleaned up the itemdb_isequip functions. itemdb_isequip will now return
- if the item is equipable by players, itemdb_isstackable returns if the item
- can be stacked, and itemdb_isidentified returns if the item should drop
- identified. [Skotlex]
- * Added defines CARD0_PET/CARD0_FORGE/CARD0_CREATED to identify if a given
- item has "invalid" cards, added define function itemdb_isspecial to
- simplify this check. [Skotlex]
- * Removed itemdb.c considering item ids above 20000 as invalid. [Skotlex]
- * Cleaned up script commands getitem and card-counting related ones.
- [Skotlex]
- * Cleaned up a bit more pc_isequip [Skotlex]
- * Added script function warpportal(x,y,targetmap$,targetx,targety).
- This creates warp portals as in the skill unit as a volatile alternative
- to static warp portals. [blackhole89]
- * Modified the login-sql server to do the ip-ban check only on the
- auth-packets instead of on every packet. [Skotlex]
-2006/07/10
- * Corrected Warp Portal being unable to warp people who are standing on it
- on the moment it triggers. [Skotlex]
- * Fixed @follow stopping the moment you are warped. [Skotlex]
- * Fixed pc_additem messing with the equip field of the passed item data.
- Fixes the famous "equip stuff on your arrow slot" bug. [Skotlex]
- * Fixed cart-termination crashing the server if you used level 16 of it.
- [Skotlex]
- * Fixed check_connect_login_server check in char-sql server. Fixes
- char-server not reconnecting to the login server. [Skotlex]
- * Login-sql server will no longer change an account's state to "7" when
- banning a player. This should fix being able to use @ban to clear out a
- @blocked player. Players will now be identified as banned only through the
- banned-until timestamp. [Skotlex]
- * Fixed a crash when using Gospel... [Skotlex]
- * The on-place function won't be invoked on setting ground skills if the
- group's tick is greater than the current tick. As Buuyo pointed out, this
- should fix Sanctuary and Gospel taking effect inmediately instead of after
- "x" amount of ms as they should. [Skotlex]
- * Added login-char packet 0x2737. Sets all characters offline (login-server
- side). [Skotlex]
- * Cleaned up char server "set all offline" implementation to remove only
- characters from the map-server from which the packet was invoked. It will
- also now correctly kick/set-character offline from the map-server if they
- are connected. [Skotlex]
- * Cleaned up the char-sql reconnect code. It no longer sets everyone to
- offline. [Skotlex]
- * Removed setting "kick_on_disconnect", servers will no longer kick
- characters out when there's a disconnection. Instead, it'll use the most
- logical approach: Set characters into a "lost" state when there's a
- disconnection, on reconnect, resent the list of online-characters, do a
- sync, and let the difference be characters to be removed. Also, the
- map-server won't release character data until it's saved and the ack
- returns from the char-server to prevent data loss (all this data is resent
- on reconnect for saving anyway). [Skotlex]
- * Added a check in pc_equipitem so that when switching weapons and you have
- the skill_range_by_weapon setting active, the skill info block (which
- includes range) will be resent when the new weapon to equip has a range
- different than the previous one. [Skotlex]
- * One closer inspection, removed that clear in itemdb_reload for a foreach
- call again. And modified itemdb_load to scrap the dummy item entry from the
- item_db and replace it with proper data for the item. [Skotlex]
- * itemdb_reload will clear the itemdb before reloading info instead of only
- clearing the scripts now. [Skotlex]
- * Some cleaning of skill_castend_pos2, fixed Gospel, and a
- map_freeblock_unlock misplacement. [Skotlex]
- * Sense/Estimation will now display the mob info window to all party
- members in the same map. [Skotlex]
-2006/07/08
- * Fixed the new addeff structure not working well with SC_STONE (because
- SC_STONE is 0, which was by default not handled as a valid value).
- [Skotlex]
- * Added back the TF_MISS walking speed bonus to assassin type classes (how
- did that got lost?) [Skotlex]
- * Fixed mobinfo displaying exp as signed ints rather than unsigned.
- [Skotlex]
- * Added status_check_visibility to check if an object is within range of
- view of another. Nothing more, nothing less. It's used by unit movement to
- check whether you can continue chasing your target or not when the "chase
- target" directive is given. [Skotlex]
- * Fixed the char table having party/guild_id as smallint when they need int
- there. Thanks to hermematon for pointing it out (use svn_ugprade7580.sql)
- [Skotlex]
- * Applied k3dt fixes to pet-hatching, ice-wall check, and wedding skills.
- [Skotlex]
- * Fixed endow skills calling the skill no damage packet twice. [Skotlex]
- * Fixed a crash on warpwaitingpc when the chat-room is empty. [Skotlex]
-2006/07/07
- * Fixed the Warm Skills [Skotlex]
- * Removed the debug message when a player logs out and is removed from
- memory, it is working fine (tested normal logging off and autotrade). [Skotlex]
- * Corrected the pet-armor field of the pet not being updated on
- equip/unequip of accessories, making them not show up inmediately. [Skotlex]
- * Status_calc_bl will no longer stop you from attacking/walking when the
- mode is changed unless the new mode no longer includes
- "can-attack"/"can-move" respectively. [Skotlex]
- * Should have fixed clif_item_sub to properly store pet egg/armor data.
- There should be no more "random refine levels" bugs related to these.
- [Skotlex]
- * itemdb_exists will now return NULL for item_id 0. [Skotlex]
- * Added a check to free a character from memory when changing map servers.
- [Skotlex]
- * Okay, added a chrif_save_ack packet to the char-server so now the map
- server will know once a character was "final saved", and only then the
- character will be removed from memory. On char-server reconnection, all
- chars that are in final-save state are resent to save (if they are still in
- memory, it's because the ack hasn't gotten here from the char-server). This
- should effectively block all dupe problems due to heavy inter-server lag,
- however as it's untested, it currently prints some debug messages when
- people are saved and then removed from memory. Need testers so this can be
- debugged and merged to stable! [Skotlex]
- * Now, when the login-char connection is cut, the char-server won't set
- everyone offline on reconnect, instead it will send the list of online
- accounts to the login server. [Skotlex]
- * Modified the error on the char-sql server to set chars online when it
- receives a save packet from a character tagged as offline (until it can be
- figured out why this is happening) [Skotlex]
- * Fixed signed/unsigned comparison issues in the char txt/sql server.
- [Skotlex]
- * Fixed the cooking success chances. Thanks to Ishizu Chan. [Skotlex]
- * Added a temporary band-aid to prevent executing the script of non-arrows
- when they are equipped on the arrow-slot (until the actual cause of why
- pc_unequipitem is not working correctly is discovered/fixed) [Skotlex]
-2006/07/06
- * Modified the party_data structure on the map server to remove some
- redundant data. Added a party_data structure on the char-server to hold a
- more complete set of information about parties. Added to the party_member
- structure the class of each member so that the map server can do the
- appropiate checks even if the character is on another mapserver/offline.
- Due to the format changes in the party structure, txt servers will have to
- wipe their party file... (sql save format has not been changed) [Skotlex]
- * Added function char_family to check if there's a family state given the
- three character ids, instead of doing individual checks all the time.
- [Skotlex]
- * Rewrote all the item restriction functions so that they will take into
- account slotted card restrictions as well. [Skotlex]
- * Added no_skill_delay setting, when set, affected object types will have
- the minimum skill delay for all skills. Defaults to mobs, since they
- don't have skill delays. [Skotlex]
- * Cleaned up pc_equipitem. When dual wielding or equipping accessories, if
- the client actually specifies one of the two positions, it will be taken
- into account (now, does the client actually does this?) [Skotlex]
- * Fixed GrandCross and similar skills. [Skotlex]
- * FogWall will now also affect the caster. [Skotlex]
-2006/07/05
- * Updated NJ_KAENSIN by Saycyber21 [Vicious]
- * Updated @refine to take account of MAX_REFINE, thanks to Omega... GM
- Designer. [Skotlex]
- - Also optimized the @refine loop for better performance.
-2006/07/04
- * Fixed compile issue for NJ_BAKUENRYU, by Saycyber21. [Vicious]
- * Implemented Saycyber21's some NJ work. Untested. :D [Vicious]
- * Implemented cooking chances. Chance of success is 70% - 7*(dish-lv)% +
- 12*(cooking set-lv)%. Exception: When using the legendary cooking set,
- success chance is 100% regardless of dish. [Skotlex]
- * Added battle config setting emergency_recall, specifies behaviour of that
- skill (skill.conf): 0 - Disabled. 1 - can't be used in nowarpto maps. 2 -
- Can be used everywhere. [Skotlex]
- * Removed the NPC/Dance/Song inf2 check of AbraCadabra. whether a skill can
- come out or not is entirely decided by the abra db file now. [Skotlex]
- * Added structure s_addeffect to handle status change additions. Cleaned up
- relevant code. It is now possible to specify ANY status change, not just
- the basic ones. NOTE that the code is proof-read, but untested! [Skotlex]
- * Added support for bonus3 bAddEff/bAddEffWhenHit as follows: [Skotlex]
- bonus3 bAddEff/bAddEffWhenHit, <SC value>, <rate>, <target flag>.
- Target flag is 0: Self. 1: Enemy. 2: Both.
- * Added these descriptions to doc/item_bonus.txt [Skotlex]
- * Added a check when joining a chat to make sure the target object is of
- type BL_CHAT. [Skotlex]
-2006/07/03
- * Cleared up the bAutoSpellWhenHit description in doc/item_bonus.txt
- [Skotelx]
- * Fixed Phantasmic Arrow and Magical Bullet not being correctly tagged as a
- ranged arrow-type attack. [Skotlex]
- * Updated help.txt and help2.txt, thanks to Inuyasha for providing the
- updated files. [Skotlex]
- * Char-server SQL won't perform the reconnect cleanup routines when
- kick_on_disconnect is disabled. [Skotlex]
- * Renamed summons_inherit_effects to summons_trigger_autospells as the
- setting now only makes the attacks of the slaves trigger the autospells of
- the master (as it should be). [Skotlex]
- * Corrected code capping no_spawn_on_player to 50 when the max should be
- 100. [Skotlex]
- * Warmth will dispel when warping now (or else the effect is left on the
- ground) [Skotlex]
- * Fixed reading of the refine_db not working right when MAX_REFINE is
- increased from 10. [Skotlex]
- * Some more cleaning to the implementation of Abracadabra [Skotlex]
- * Fixed a compile warning in login sql/txt [Skotlex]
- * Fixed pc_makesavestatus not setting your logout position. [Skotlex]
- * Fixed two dances becoming BA_DISSONANCE instead of DC_UGLYDANCE.
- [Skotlex]
- * Added the missing +100% damage modifier of Enchant Deadly Poison.
- [Skotlex]
- * Fixed SkillStatusChangeTable not working correctly for Homun/Guild
- skills. [Skotlex]
-2006/06/30
- * Fixed a typo in msg_athena.conf, "This item cannot be drop" -> "This item cannot be dropped" [MasterOfMuppets]
- * Added a check to prevent equipped items from being traded. [Skotlex]
- * Added UF_SONG (0x400) to differentiate songs from dances. [Skotlex]
- * Added preliminar support for making a Song+Dance turn into BA_DISSONANCE
- cells. Beware of potential bugs as it's untested. [Skotlex]
- * Added mapflag "nochat" to prevent chatting rooms from being created.
- [Skotlex]
- * Corrected some of the sleep checks when the char id does not matches with
- the char-id expected by the script engine. [Skotlex]
- * Cleanup in itemheal related code, fixed the item heal group bonus not
- working on Groups beyond 7. [Skotlex]
- * Fixed pet's loot not being moved to your inventory on logout. [Skotlex]
-2006/06/29
- * Made the map server send list of characters online to the char-server on
- reconnection regardless of "kick_on_disconnect" setting, as otherwise, a
- temporary disconnection would make the char-server tag all characters
- offline and refuse to save them afterwards. [Skotlex]
- * Fixed guild storage being "eternally in use" if you quit/logout before
- closing it. [Skotlex]
- * Ending SC_CLOAK/SC_HIDE/SC_CHASEWALK will now trigger ontouch npcs.
- [Skotlex]
- * [Fixed]
- - Scripting system screwing up script position after mixing timers with menus.
- - NPC attached AI mobs display as alive when dead.
- - View data not updating after buildin_unitdeadsit.
- [Improved]
- - NPCE_LOADMAP to execute after all (area) objects are sent to the player.
- - Simplified scripting system. sd will now use pointer to the script state itself.
- [Lance]
-
-2006/06/28
- * changed:
- dynamic_pass_failure_ban_how_many:from 3 to 7
- dynamic_pass_failure_ban_how_long:from 60 to 5
- as in official servers. [Musashiden]
- * Added a check in script command "set_option" so that invoking
- "set_option(0)" removes Cart/Peco/Falcon, as expected by scripts. [Skotlex]
- * Added trade-range check on trade start. [Skotlex]
- * Added inf2 4096 (INF2_ALLOW_ENEMY) which is to be used in conjunction
- with INF2_PARTY_ONLY/INF2_GUILD_ONLY when said skill should ALSO be allowed
- to be used on enemies. [Skotlex]
- * Cleaned up a bit the code for @item [Skotlex]
- * Fixed character/storage being sent to be saved TWICE when you logged out
- while the storage is opened. [Skotlex]
- * Added save_settings map config. Specifies after which events do
- characters get saved (defaults to all): 1 - Trade successful, 2 - Vending
- transaction, 4 - Closing storage/guild storage, 8 - hatching a pet.
- [Skotlex]
- * Changed the mob drop rate adjust function to receive a signed int
- argument. Probably will fix those drops with 0% becoming 100% [Skotlex]
- * Corrected Musical Strike having a different damage equation from Throw
- Arrow. [Skotlex]
- * Added state rewarp to players. It gets set when a pc_setpos call is
- triggered while the player is changing maps so that when the player finish
- loading the map, it is inmediately rewarped to where it has been
- rewarped/recalled to. [Skotlex]
-2006/06/27
- * Map server will now resent the whole list of online characters to
- char-server on reconnect when the kick_on_disconnect setting is active.
- [Skotlex]
- * Cleaned up and optimized the IP sync code. New login_athena config
- setting sync_ip_interval specifies how often to sync the ip. The default is
- 0 (disabled). [Skotlex]
- * Added mapflag "loadevent", now load-map script events will ONLY trigger
- on maps with this mapflag on, rather than every map. [Skotlex]
- * High Jump can now be used in all versus maps. [Skotlex]
- * Added Kaite's opt3 value, taken from jA [Skotlex]
- * Added state dirty == 2 to storages. Signals when a storage was sent for
- final saving. Said storage is removed from memory after the ack from the
- char-server, and they are sent to save if the map/char servers reconnect
- before the ack arrives. In short: they are guaranteed to be saved after a
- char logs out. [Skotlex]
- * Put pay_arche.gat in the "no experience lost" mapflag file. [MasterOfMuppets]
-2006/06/26
- * Corrected the element of hunter traps. [Skotlex]
- * Deadly Poison now also reduces def2 by 25% [Skotlex]
- * Cleaned up a bit skill_moonlit, Moonlit Petals should work correctly now.
- [Skotlex]
- * Fixed @mi displaying always 0 instead of the mob's class. [Skotlex]
- * Rough implementation of Ground Drift according to description and jA
- info. [Skotlex]
- * Implemented Tatami Gaeshi using skill description and jA implementation
- for reference. [Skotlex]
- * Merged Mitternacht's max_heal/max_heal_lv config settings. [Skotlex]
- * Removed support of packet 0xc3 on the new packet versions. Thanks to
- Meruru for pointing out they aren't being used anymore. [Skotlex]
- * Autospells will now again check for the skill's nk value, so that skills
- tagged "nodamage" skills will not trigger autospells. [Skotlex]
- * Corrected clif_item_sub so that pet eggs will correctly be sent as
- equipment (fixes them showing up "broken" and with random refine levels)
- [Skotlex]
- * [Added]:
- - buildin_unitkill just for kicks. [Lance]
-
-2006/06/23
- * [Optimized]:
- - Setting of variables with defined scope in some frequently executed script
- events.
- [Added]:
- - Missing script_require_trigger flags for some power hungry events.
- * Updated mob_db.sql and item_db.sql to latest. [Skotlex]
- * Modified pc_setoption so that it will correctly update sprite AND clothes
- color when mounting/unmounting changing into/from xmas/wedding sprites.
- [Skotlex]
- * Allowed itemdb_exists to return the dummy item. Enables "invalid" items
- to be sold, traded, dropped, etc. [Skotlex]
- * Corrected ASC_BREAKER. Int-based damage is applied after attribute fixes
- and before card reductions. The skill now completely disregards left
- hand weapon. [Skotlex]
- * Standarized PF_MEMORIZE to be 50% cast time on all skills (instead of
- -50% for targetted skills and -66% for ground skills >.>) [Skotlex]
- * Cleared up the comment on what item_check does and how it works.
- [Skotlex]
- * Changed setting for skill_nocast flag 16. It is no longer a "pk-mode map"
- setting, it's now a clone-forbidden skill. That is, skills with the flag 16
- will never be copied by clones. If you use a PK-mode server, use flag 2 now
- to forbid skills from common maps. [Skotlex]
- * Default skills from not being cloned are Magnus Exorcism and Turn Undead.
- * The map search free cell will now use the size of the map # of tries
- before giving up when the spawn area is the whole map. Added a check to
- inmediately give up when the number of spawn retries has reached the max
- specified (no_spawn_onplayer = 100). [Skotlex]
- * Cleaned up a bit the clone code to account for the unit flags
- UF_NOPC/UF_NOMOB when the skill is not ground-based (accounts for self
- skill that causes a ground-tile to be placed, like Dances). [Skotlex]
- * Added pc_bonus_autospell_del, gives support for removing autospell
- effects. When a negative rate is specified, it will decrease the chance of
- casting (eg: You have two different cards with autospell Heal +20% each,
- then do autospell -30. The second card will be cancelled, and the first one
- will become Heal +10%) [Skotlex]
- * npc_timers now will not restore the previous timer data when there's no
- players attached (when it's strictly an npc timer). This should reenable
- the old behaviour of getnpctimer returning the total ellapsed time since
- "startnpctimer" even after the last label has been reached. However, this
- behaviour won't apply to player-attached timers. [Skotlex]
- * [Fixed]:
- - MAPREGSQL overloading SQL table with temperory map registries.
- - Incorrect perfomance calculation for MAPREGSQL loading and saving. [Lance]
-
-2006/06/22
- * Guessed and added support for the packets 0x22a (idle) and 0x22b (spawn).
- This should complete the required packets for PACKETVER 7. [Skotlex]
- * Added support for the PACKETVER 7 packets in the "dummy" current
- intravision implementation. [Skotlex]
- * Fixed @autoloot being off by 0.01% when entering a manual value.
- [Skotlex]
- * Restored the "Secret" behaviour of Blast Mine and Claymore Trap where
- each target is hit N times (where N is the number of mobs in the splash
- area at the moment of triggering). [Skotlex]
- * Updated the tools/stackdump script to also handle sig-plugin generated
- backtraces. Now it will also auto-determine whether the exe needs a .exe at
- the end or not. Help me test it as I want this script on stable NOW :X
- [Skotlex]
- * Usage is "stackdump <login/char/map> <txt/sql> [number]". When a number
- is given, sig-plugin stackdumps are assumed, otherwise it parses the normal
- stackdump as before. [Skotlex]
- * Corrected autoloot so that you can specify rate with decimal precision
- ("@autoloot 0.01" should work) [Skotlex]
-2006/06/21
- * [Removed]:
- - Redundant mob name copying. (it's already copied in mob_parse_dataset) [Lance]
- * [Fixed]:
- - Compilation warnings and errors.
- [Improved]:
- - Changed and moved IP sync status messages to elaborate more. [Lance]
- * Tested and fixed resolve_hostbyname. Applied said function around most of
- the code where needed. Removed includes for the OS/network system pretty
- much from every file (our socket.c file should handle this) [Skotlex]
- * Made the GM mute request bypass the manner_system setting. [Skotlex]
- * Applied use of parse_hostbyname() in chrif.c to fix compilation errors.
- [Skotlex]
- * status_percent_change will now account for when the target's max hp/sp is
- above INT_MAX. [Skotlex]
- * [Added]:
- - DNS (WAN) sync for those pesky disconnections (dynamic ip renewal). [Lance]
-2006/06/20
- * Some cleaning up of OPTION related code. OPTION_XMAS and OPTION_FLYING
- really ARE the same value clientside! (totally stupid), therefore I've
- opted from removing the flying animation since it really just displays as
- Xmas for others (and the correct fix involves adding a bunch of
- class-change packets...) [Skotlex]
- * Updated skill_require_db to place the Zeny requirements of ZenyNage and
- Fling. [Skotlex]
- * Fixed crash when non-players use ZenyNage. Added the correct Zeny check
- in skill_check_condition, fixed the skill so that it's damage is based on
- whatever zeny is specified in skill_require_db. [Skotlex]
- * Can-act delay will not be reset when warping now. [Skotlex]
- * Fixed Quagmire not altering walking-speed. [Skotlex]
- * Silence now blocks skills both on begin/end casting. [Skotlex]
- * Updated status_calc_bl so that when walking speed changes, the character
- is made to rewalk so that the new speed takes effect inmediately. [Skotlex]
-2006/06/19
- * Added Ayothaya to nopenalty and nopvp mapflags. [Evera]
- * Combo-used Skills with State "move_enable" will now override the "can't
- move delay". Fixes Break-Fall -> Jump-Kick. [Skotlex]
- * Some more cleanups of battle_calc_damage to account for absorbed damage
- reductions. [Skotlex]
- * Moved back Soul Drain code from mob_dead to skill_counter_additional_effect.
- Now we are back to where the skill animation does not shows, but you DO
- get SP T.T' [Skotlex]
- * Some cleanups and corrections in battle.c to account for negative
- (absorbed) damage. [Skotlex]
- * Fixed fame-list updating crashing char-sql server when the given char-id
- just got into ranking. [Skotlex]
- * Added missing Arunafeltz maps with information from NLZ [Evera]
-2006/06/18
- * [Fixed]:
- - Typo in status.c add_sc() using 'skill' instead of 'sk' as index, resulting in
- filling the SkillStatusChangeTableArray with junk data.
- - > NEEDS CONFIRMATION < Ends casting if player is knocked with freezing/stun/whatever
- - Typo in parse_frommap. [Lance]
- * [Fixed]:
- - clif_initialstatus using SHRT_MAX instead of USHRT_MAX for status_point.
- * [Temperory Fixed]:
- - Crashing of SQL char-server in parse_frommap case 0x2b01. [Lance]
- * [Removed]:
- - Large part of scripted mob control commands are removed.
- - Large part of scripted player control commands are removed.
- - Scripted mob slaves changing master ID.
- [Added]:
- - Unit control commands.
- - CALLBACK_NPCCLICK for scripted mobs, added this to db/const.txt too.
- - Macro RECURSIVE_MASTER_CHECK in battle.c
- [Modified]:
- - buildin_skilluseid and buildin_skillusepos -> buildin_unitskilluseid
- and buildin_unitskillusepos.
- - md->callback_flag to short (double word). [Lance]
-
-2006/06/17
- * Devotion absorbed damage will now appear to come from oneself (instead of
- the original attacker changing directions towards the Crusader) [Skotlex]
- * Updated clif_refres to send inventory, cart, and weight info. [Skotlex]
- * Fixed intif_guild_memberinfoshort to not leave a dangling pointer when
- someone logs out <.< [Skotlex]
- * Changed some mapflags related to the eye of hellion quest. [MasterOfMuppets]
- * [Added]:
- - buildin_checkcell, buildin_mobwarp, buildin_pcattack.
- [Improved]:
- - buildin_skilluseid and buildin_skillusepos to accept a few more arguments.
- - mob_script_callback to return sucess value [Lance]
- * Fixed the party HP packets to send max HP 10000 and scale HP accordingly
- when the player's HP doesn't fits in the packet's field. Fixes HP bars not
- correctly displaying the % of life when max HP is above 32k. [Skotlex]
-
-2006/06/16
- * Fixed option value being reset'ed on login (fixes cart/peco/falcon being
- lost) [Skotlex]
- * Corrected @speed to alter your base speed instead of battle one. Means
- the change remains for much longer (until status_calc_pc is invoked, which
- could be due to equipping/unequipping stuff) [Skotlex]
- * Modified the bNoMagicDamage/bNoWeaponDamage bonuses to be a 0-100
- setting. Meaning you can do bonus bNoMagicDamage,50; To make all magic
- damage be reduced by half. This bonus stack, so two cards with
- bNoMagicDamage,50 will give magic immunity. [Skotlex]
- * Removed setting gtb_pvp_only and replaced it with gtb_sc_immunity which
- specifies the threshold before the bNoMagicDamage starts blocking support
- statuses as well. ie: gtb_sc_imunity: 75 will mean that "bonus
- bNoMagicDamage,70;" reduces magic damage by 70%, but does not blocks heal
- or support status, while "bonus bNoMagicDamage,80;" does. [Skotlex]
- * Removed db_tables.sql as it's no longer used. [Skotlex]
- * the mvp_sd is removed when the mob is the emperium and there's no
- killer/exp-awarded (assumed killed by script), this prevents the on-kill
- event from triggering and giving the castle to whoever damaged the most the
- emperium without destroying it. [Skotlex]
- * [Added]:
- - Custom slave mobs to inherit the callback_flag.
- - Added option #25 to buildin_setmobdata to set the callback_flag. [Lance]
- * [Improved]:
- - Cleaned up Custom Mob Script Callback codes. Looks much better now :B. [Lance]
-
-2006/06/15
- * [Fixed]:
- - intif_parse_RenamePetOk for not compatible with ANSI-C initialzation specification.
- [Lance]
- * Added indexes for loginlog and ipbanlist as they did not have any.
- (note, someone already put the index on loginlog on trunk.) [Euph]
- * Merged Adam's patch to let the char-server handle validation of
- pet-name-change requests through the allowed char letters config. [Skotlex]
- * Fixed "wedding_ignore_palette: yes" not working when relogging with the
- gear already equipped. [Skotlex]
- * Added blocking of the Kick skills when you are a Soul Linker. [Skotlex]
- * Added enabling to turn off a kick-stance regardless of class. [Skotlex]
- * Altered a bit how status_set_viewdata behaves in regards to Wedding/Xmas
- options. [Skotlex]
- * Added back OPTION_XMAS, but the actual value is missing! [Skotlex]
- * Corrected chrif_save so that the player is not set offline on map-change.
- [Skotlex]
- * Added change-look support in pc_setoption when specifying OPTION_XMAS
- [Skotlex]
- * Fixed clif_parse_RemoveOption removing all options instead of just
- Falcon/Cart/Peco [Skotlex]
- * Fixed clif_send not sending packets to SELF when specifying AREA if the
- source is not on the map yet. [Skotlex]
- * Fixed and cleaned up script command 'equip' [Skotlex]
- * Fixed 'autoequip' items. [Skotlex]
- * Fixed Aspd not being updated in your status window after Agi/Dex
- increasing statuses take effect. [Skotlex]
-2006/06/14
- * Fixed map_nick2sd so that searching for "Adam" will not match a char
- named "Adam Smith". Thanks to Adam for reporting it out. [Skotlex]
- * Modified how luk reduces status changes by reducing the gap. Eg: resist =
- vit; resist += (max - resist)*luk/300; [Skotlex]
- * Added battle settings pc_max_sc_luk/mob_max_sc_luk to handle which is the
- luk threshold at which you gain inmunity (defaults to 300). [Skotlex]
- * Fixed buildin_getmobdata. It was trying to handle the first parameter as the
- array to fill in. [blackhole89]
- * Blocked again skill usage during marionette. [Skotlex]
- * Fixed main.sql adding a key on char_id rather than account_id for the
- char table. [Skotlex]
- * Cleaned up character saving in char-sql, it no longer needs to query the
- database to see if the player exists on each char-save, instead it checks
- the received data against the online-players db. No such fix is required
- for char-txt. [Skotlex]
- * Added an error message on the char-server when the received player data
- size does not matches with the expected size (should avoid the crash that
- happens on such a memcpy). [Skotlex]
- * [Improved]:
- - script_save_mapreg for MapregSQL Saving to display perfomance only in slow
- queries. [Lance]
-2006/06/13
- * Updated mob_db.sql and item_db.sql to latest. [Skotlex]
- * Added account_id index to char table. Thanks to Buuyo for reporting it.
- Sql users apply upgrade_svn7146.sql NOW. [Skotlex]
- * Marionette and Devotion will now check raw distance and ignore obstacles
- and the like. [Skotlex]
- * Added irc_channel_pass setting and prevent crashing when irc server
- lookup by host fails. Thanks to Trancid for the details. [Skotlex]
- * [Fixed]:
- - clif_parse_GetCharNameRequest displaying false alarm for legitimate GM snooping.
- [Lance]
- * Added support for reading correctly status change data from Guild and
- Homun skills. [Skotlex]
- * Added support for reading Homun skill data (which means the HM skills are
- now safe to add to skill_db, skill_require_db, etc) [Skotlex]
- * Oppositions can't be made during WoE now. [Skotlex]
- * Fixed a few compiler warnings from VC [Skotlex]
- * Commented out the Homunculus Skills<->Status Change link which was
- causing some memory corruptions. [Skotlex]
-2006/06/12
- * [Fixed]:
- - buildin_npcshopitem not allocating extra 1 block of terminator.
- [Added]:
- - Modified versions of Dj-Yhn's buildin_npcshopdelitem and buildin_npcshopadditem
- [Lance]
- * Updated clif_disp_onlyself to not use dynamic memory and write directly
- to the player's buffer. [Skotlex]
- * Updated @noask to also tell the user what he has just rejected (added
- msg_athena entries for each of the different requests). Also updated it to
- use clif_disp_onlyself. [Skotlex]
- * Fixed a pair of missing initializers in the clif storage functions.
- [Skotlex]
- * @heal no longer displays a healing animation. Fixes the client believing
- you couldn't be healed more than 32K. [Skotlex]
- * Now you can use any skills (except encore/dancing ones) while under
- Longing for Freeding. [Skotlex]
- * Now you can use any skills while under Marionette Control. [Skotlex]
- * Fixed npc_checknear's distance check returning the opposite of what it
- should (false when the range is correct and viceversa) [Skotlex]
- * Added a warning on item loading when an item is of equippable type but
- has no equippable position. [Skotlex]
- * Turning an alliance to an opposition won't work now during WoE [Skotlex]
- * Slaves can summon other mobs now. The only ones who can't do this are
- player summoned mobs. [Skotlex]
- * Merged the following functions for faster processing of items: [Skotlex]
- clif_storageitemlist + clif_storageequiplist = clif_storagelist
- clif_guildstorageitemlist + clif_guildstorageequiplist = clif_guildstoragelist
- clif_itemlist + clif_equiplist = clif_inventorylist
- Note that the changes are a bit substantial and need proper testing!
- * Increased max knockback value support to 25. [Skotlex]
- * [Optimized]:
- - buildin_npcshopitem memory allocation to calculate before reallocating.
- [Lance]
- * Made guild member exp an unsigned int. [Skotlex]
- * Various cleanups to the npc clicking related functions. Should fix quite
- some possible crashes from crafted packets. [Skotlex]
- * Added overflow checks for bonus settings mdef_rate/def_rate. [Skotlex]
- * Added missing update of INT after a buf. [Skotlex]
- * Small cleanup of how SC_BLEEDING works. [Skotlex]
- * Fixed party_foreach_samemap invoking the function on the CASTER instead
- of on the party members. [Skotlex]
- * Modified clif_parse_NpcClicked to handle the different situations with
- different bl-objects (attack on players/mobs, click on npcs or mobs with
- npc attached) [Skotlex]
-2006/06/09
- * [Fixed]
- - Compilation warnings on guild.c and int_guild.c [Lance]
- * Added structure party_data and party_member_data to the map server to
- hold party-specific required information about parties including
- Monk/TK/SG/SN states and party member count. Family information is still
- missing, and handling of the state should probably be done by the
- char-server, too... [Skotlex]
- * party Hp updates are no longer done each time the Hp is modified, but
- together with the party xy timer. It means HP-bars will be a bit delayed
- before being updated, but packet consumption should be much less during
- heated battles. [Skotlex]
- * Fixed MoM's typo [Vicious]
- * Fixed map_readafm missing strcpy(afm_name, m->name). [Skotlex]
- * [Improved]:
- - npc_click interception on BL_MOB and BL_PC to let sd act accordingly.
- [Lance]
- * [Fixed]:
- - Execution of sleep/sleep2 more than once will hang the script_state.
- [Lance]
- * Fixed @mapinfo displaying incorrectly maps with nosave which send you
- back to your last savepoint. [Skotlex]
- * Moved guild_exp_rate from a mapserver battle config setting to a char
- server config. It no longer modifies the total taxed exp as seen on the
- guild information window, but directly modifies the exp that the guild
- earns. [Skotlex]
- * Added an error report and correction when the map server receives a guild
- from the char-server with more guild members than MAX_GUILD. [Skotlex]
- * Changed the interval between waterballs back to 125 [MasterOfMuppets]
- * Fixed a typo in char_sql/char.c, thanks to Euph [MasterOfMuppets]
-2006/06/08
- * Modified guild exp to be an unsigned int rather than a signed one.
- [Skotlex]
- * Fixed @skilltree printing out Unknown job for most targets used.
- [Skotlex]
- * Cleaned clif_pvpset to not send the packet to nearby characters when the
- source is GM-hidden. May help fix the crash on PvP with gm-hidden
- characters. [Skotlex]
- * Modified map_freeblock_unlock so that aFree errors will report the
- file/line that INVOKED the function rather than the function itself.
- [Skotlex]
- NOTE: Do NOT disable the memory manager as that will break this change.
- This change is to be temporarily set until the afree'd error can be
- resolved.
- * Updated mob_npc_warp to a three-state config switch. 0 disables. 1 enable
- only on warps that don't lead to nobranch maps. 2 - enable on all warps.
- [Skotlex]
- * Adjusted Don't Forget Me, Defender, Longing to use all val entries, and
- to hold the speed adjustment value rather than speed penalty (eg: 125
- instead of 25). [Skotlex]
- * Cleaned up status_calc_speed so that speed penalties are correctly
- handled (eg: 25% penalty is speed*100/75, not +speed*25/100). Thanks to
- Euph for pointing it out and Belle for the speed mechanics. [Skotlex]
-2006/06/07
- * Fixed Sense using mdef instead of mdef2 [Skotlex]
- * Fixed item-skills not showing up on login. [Skotlex]
- * Cleaned up clif_parseLoadEndAck, by testing which packets are required
- only on first-login and which ones are required on all map-changes.
- Skill-tree, Exp, Skill Points and most of the basic status are no longer
- sent on map-change (items, cart data and zeny still need to be sent one
- very map-change). [Skotlex]
- * Fixed the mob state not being set to Berserk/Angry correctly after the
- mob reaches the target's location. [Skotlex]
- * Added config setting mob_npc_warp, when set to yes, enables mobs to be
- warped between maps when stepping on a npc-warp. [Skotlex]
- * Added monster_ai setting &64, when enabled makes a mob run to any nearby
- npc-warp when their current target has switched maps. [Skotlex]
- * Added pc_calcexp to calculate individual exp bonuses acquired from exp's
- source (race bonus cards, SG Exp skills, pk-mode higher level exp) [Skotlex]
- * pc_gain_exp now also receives the source of the exp, when said source
- exists, bonuses are applicated as needed. [Skotlex]
- * Added status_kill when capturing a mob, should take care of the mob not
- respawning after caputed. [Skotlex]
- * Fixed item info not displaying the found item id [Skotlex]
- * Fixed item info not displaying the weight value properly. [Skotlex]
- * Adjusted status resistances and durations taking as base Viccious's info
- from the kro guidebook. [Skotlex]
- * Moved souldrain code from skill_counter_additional_effect to mob_dead. It
- should display the skill animation correctly now. [Skotlex]
- * Adjusted several sc rate/time reductions as pointed out by Playtester.
- [Skotlex]
- - Luk now plays a luk/10 reduction role rather than a luk/3 one.
- * Removed char_nick2id from char-sql server as it's no longer needed.
- [Skotlex]
- * Fixed quitting the map server not properly saving the storage before
- deleting it. Thanks to Adam for pointing it out. [Skotlex]
- * Cleaned status_get_sc_tick/status_get_sc_def to use the status_data
- function. [Skotlex]
- * SC_STOP's chance and duration can't be reduced anymore. [Skotlex]
- * Storm Gust no longer has a 100% chance to freeze by passing mdef, now it
- has a 300% base chance reduced by mdef and the like as explained out by
- Tharis. [Skotlex]
- * Frost Diver/Frost Nova's base freezing chance is no longer affected by
- target's int. [Skotlex]
- * [Improved]:
- - mob_dead not to remove script controlled monsters with player sprites.
- [Added]:
- - buildin_mobdeadsit :D [Lance]
- * [Fixed]:
- - temp++ gets issued before if(mvp_damage<(unsigned int)md->dmglog[i].dmg) in
- mob_damage. Thanks to seahorsix. [Lance]
- * [Fixed]:
- - Corrected login-server SQL to use *((ulong *)p) instead of (ulong)p [Lance]
- * [Optimized]:
- - list and size not being initialized (size get intialized in default: switch case)
- Eliminated default case and initialized list and size at the beginning. [Lance]
-2006/06/06
- * Hopefully fixed for sure mobs getting extra stats when changing-class due
- to the mobs level up setting. [Skotlex]
- * Removed a piece of code that should no longer be needed due to the
- combo-skill setting (inf = self, inf2 = no-target-self) which is blocking
- self-skills from being used on others (pets/mobs should be allowed to do
- that) [Skotlex]
- * Added a status_check_skilluse call in Sightblaster to prevent it from
- hitting hidden/cloaked/act-dead/etc players. [Skotlex]
- * Fixed firewall counter going down by 2 each hit rather than 1. [Skotlex]
- * Fixed Soul Burn not zapping away all SP. [Skotlex]
- * The monsters can level up setting will not take effect when the mob's
- level is LESS than their db counter-part (should prevent under-leveling
- causing underflows and semi-immortal mobs) [Skotlex]
- * Fixed mvp-exp calculations being messed up with more than one attacker.
- [Skotlex]
- * Changed the mob exp race bonus so that each player gets their own bonus,
- rather than the killer's bonus applying to everyone. Still not the
- "correct" way, but one step closer to it. [Skotlex]
- * [Fixed]:
- - Allocation of event_list in guild_npc_request_info to aCalloc so
- memcpy(ev->name,event,strlen(event)) will have a null terminator. [Lance]
-2006/06/05
- * Fixed a crash when using SL_SMA and the "combo" ain't ready. [Skotlex]
- * Hopefully fixed changing a mob's class causing them to get all sort of
- stat bonuses due to the mobs-level-up setting. [Skotlex]
- * Changed hit, flee, cri, flee2, def2 and mdef2 to signed short, def, mdef
- to signed char to correctly account for cards with penalties in said stats.
- [Skotlex]
- * Fog of Wall won't affect the caster now in any way. [Skotlex]
- * Added clif_fixpos packets before attacking for the first time to clear
- any position sync issues with the client. [Skotlex]
- * Fixed skill_unitsetting using layout->count for the for instead of
- group->count [Skotlex]
- * Added SC_INCDEXRATE/SC_INCAGIRATE. NPC_POWERUP/NPC_AGIUP now correctly
- increase dex/agi by 40% per level. [Skotlex]
- * Fixed char-sql server not deleting character variables when deleting a
- char. [Skotlex]
- * Corrected cloaking not ending on attack if you are near a wall. [Skotlex]
- * Updated pc_bonus to use cap_value on all status_data modifiers to prevent
- overflows/underflows. [Skotlex]
-2006/06/03
- * Fixed @mi/@mobinfo not showing the name collumns correcly [shadow]
- * Solved the bug that made firewalls only castable a few times until [MasterOfMuppets]
- you relogged. Thanks to Euph for the fix.
- * Added variable other_mapserver_count to chrif.c which holds total count
- of connected map-servers. By using this we prevent sending unnecessary
- packets to the char-server when there's no more map-servers connected.
- [Skotlex]
- - Affected packets are whispers, announces, party messages, guild messages.
-2006/06/02
- * Fixed Visual Studio 7.1 Solution File (Login TXT and Map TXT were removed)
- * Fixed a bug in unit_can_reach_bl which breaks path seeking when the
- target is near obstacles. [Skotlex]
- * Updated offensive use of Sanctuary to function like on the official servers [MasterOfMuppets]
- * Changed the interval between waterballs from 150 to 250 milliseconds [MasterOfMuppets]
- * Corrected clif_parse_takeitem to ALWAYS return a NAK packet when it
- fails. Fixes cases where the client gets "stuck" and refuses to let you
- pick any items. [Skotlex]
- * Removed the walk delay from firewall and changed its knockback [MasterOfMuppets]
- to 1 tile to make it act more like in the official servers.
- * Some cleaning of the mob slave ai. [Skotlex]
- * Corrected Brandish Spear to work on levels above 10. [Skotlex]
- * Updated Two-HandQuicken, One-HandQuicken to give 30 +2*lv% aspd-rate for
- skill levels above 10 (meant for boss casted skills) [Skotlex]
- * Fixed Spear-Quicken messing with the calc_flag [Skotlex]
- * Fixed Freeze/Stone/Benedictio not changing your elemental LEVEL to 1.
- [Skotlex]
- * [Fixed]
- - Yet another compilation warning. [Lance]
-2006/06/01
- * Altered status_calc_pc so that equipment scripts are ran before
- card-scripts. [Skotlex]
- * Fixed pc_bonus to not underflow/overflow when adjusting def/mdef.
- [Skotlex]
- - These two together, should fix Tao Gunka Card.
- * npc_debug_warps() will now be invoked if warp_point_debug is set.
- [Skotlex]
- * Updated item_db.sql/mob_db.sql to current. [Skotlex]
- * Fixed NPC_SELFDESTRUCTION not showing nor dealing damage. [Skotlex]
- * NPC_TRANSFORMATION/NPC_METAMORPHOSIS will now preserve the original mob
- without removing it when the skill level is greater than one. [Skotlex]
- * Added SC_DANCING declaration in the Status Change tables to signal it
- modifies Walk speed. [Skotlex]
- * Fixed pc_damage setting your canlog_tick even if the damage has no source
- (eg: poison, berserk) [Skotlex]
- * Berserk's aspd bonus now stacks with other aspd bonuses, but is still
- affected by Quagmire/Forget-me-not. [Skotlex]
- * Corrected setting slaves_inherit_mode to not apply to morphosis skills.
- [Skotlex]
- * Corrected pc_setoption to invoke status_calc_pc when getting/removing the
- cart. [Skotlex]
- * Fixed @mobinfo displaying the wrong element. [Skotlex]
- * Fixed Autoblitz taking into account target's luck rather than attacker's
- [Skotlex]
- * Fixed slaves warping endlessly to their master when the master-slave
- distance exceeds 30. [Skotlex]
- * SC_ORCISH will now be dispelled on logout (if debufF_on_logout is set)
- [Skotlex]
- * Removed attackrange/attackrange_ from TBL_PC, corrected clif.c using the
- incorrect range variable. [Skotlex]
- * You can now equip/unequip stuff while the storage is open. [Skotlex]
-2006/05/31
- * Fixed Soul Drain not really giving you SP [Skotlex]
- * [Fixed]:
- - Suppressed compilation warning in chrif.c [Lance]
- * [Fixed]:
- - Guys can't go across map-servers :( [Lance]
- * [Fixed]:
- - Restoration and saving of sd->npc_id must be done every time. [Lance]
- * Added back the Freeze/Petrify adjustments of -50%def and +25%mdef (when
- where these lost?). Thanks to Buuyo for pointing it out. [Skotlex]
- * Corrected the mob_ai&2 setting triggering rude-attacked due to can't walk
- delay. [Skotlex]
- * Made the char_name_option char_athena.conf setting apply to parties and
- guilds as well. It cannot be applied to pets yet without adding a
- change-name-request interserver packet. [Skotlex]
- * Moved the JOB_* defines from map.h to mmo.h, update char.c to use them.
- [Skotlex]
- * Added function char_read_fame_list for famelist reading. Invoked it on
- init, and made it be sent automatically to connecting map servers.
- [Skotlex]
- * Some cleaning of the fame-list reading code. [Skotlex]
- * Some cleaning of the fame-update code, fixed a logic bug which made the
- ranking list fail to display the correct ranker names. [Skotlex]
- * Removed typedef bool from socket.h and included cbasetypes.c instead.
- [Skotlex]
- * Cleaned up and corrected the calculation of hit/flee/cri/lucky dodge in
- status_calc_bl. [Skotlex]
- * [Fixed]:
- - Incorrect SQL syntax in login.c (missing collumn) [Lance]
- * [Improved]:
- - SQL upgrade file for the new loginlog. Thanks to ultramage. [Lance]
- * [Fixed]:
- - nullpo in pet.c caused by equipping without checking if the pet is available.
- [Lance]
- * [Fixed]:
- - Latest client support completed! [Lance]
- * [Fixed]:
- - Missing #include for cbasetypes.h in login server SQL.
- - Logic errors in run_script [Lance]
- * [Added]:
- - Partial support for latest login packet. But it seems to have a new security
- module. [Lance]
-2006/05/30
- * [Improved]:
- - Fake NPC interface to use real NPCs.
- - Scripting interface to restore and save sd->npc_id. [Lance]
- * Added function pc_check_skilltree for checking if you unlocked new
- tree-skills when raising non-passive skills. [Skotlex]
- * Fixed flee/hit calculation in status_calc_bl to account for bonuses from
- the base status. [Skotlex]
- * [Fixed]:
- - Compatibility problems in login.c [Lance]
- * Fixed pets ignoring can-act delays for skill usage. [Skotlex]
- * [Added]:
- - Mercenary.c in VS.NET 2005 project files
- [Improved]:
- - loginlog using unsigned long `ip` field.
- (Please check for compatibility problems). [Lance]
- * Fixed status_calc_pc not zero'ing ALL vars it should, allowing certain
- bonuses (like effect-on-hit) to stack. [Skotlex]
- * slaves inherit speed setting will now work regardless of whether the
- slave or master has the MD_CANMOVE mode bit. [Skotlex]
- * Call Slave now invokes slaves on a 5x5 area around master. [Skotlex]
- * AL_TELEPORT will fail when used by slave mobs. [Skotlex]
- * Added NPC_ENERGYDRAIN, NPC_MENTALBREAKER to the list of undodgeable
- attacks. [Skotlex]
- * Fixed status_damage not setting your HP to 0 when you died [Skotlex]
- * Fixed the pcbonus2 warnings using the wrong value before printing the
- invalid Element error. [Skotlex]
- * Fixed underflow issues when calculating dmotion. [Skotlex]
- * Fixed Absorb Spirit Spheres [Skotlex]
- * Added battle_config min_chat_delay (default 0, battle/client.conf)
- specifies in ms what is the min delay between player sent chats
- (whisper/global/party/guild). Messages that exceed this threshold are
- silently ignored for now (perhaps need to add a "DON'T SPAM" reply to the
- player?) [Skotlex]
- * [Fixed]:
- - signed/usigned problem in sprintf and fscanf @ mercenary.c [Lance]
- * Rewrote/cleaned up @petfriendly. [Skotlex]
- * Cleaned up final part of status_calc_pc (flags 2/4 do not exist) [Skotlex]
- * Updated attr_fix_table reading code to account for ELE_MAX (will
- correctly read bigger elemental tables if ELE_MAX is changed) [Skotlex]
- * Aggressive mobs will now use battle_check_range rather than mob_can_reach
- to decide whether to lock-on or not to a target within sight-range. [Skotlex]
- * Added warnings in mob_readdb when the mob's element is invalid. [Skotlex]
- * Added error messages in pc_bonus* functions when an invalid element is
- passed to the relevant bonuses. [Skotlex]
- * [Optimized]:
- - clif_specialeffect to use the enums.
- [Improved]:
- - buildin_specialeffect and buildin_specialeffect2 to accept effect area
- definition. [Lance]
- * [Added]:
- - Visual Studio .NET 2003 includes for mercenary.c [Lance]
- * Removed the on-die specific code from unit_remove_map and placed it on
- the corresponding *_dead functions. unit_remove_map should never assume the
- char died, it is just a "remove from map" function. [Skotlex]
- * Updated status_damage to handle the general death code (clearing status
- changes, clearing skill related data, sending death packet, etc). The
- return value from the *_dead functions will tell it what to do or not with
- the object (death aborted, clear it from map/memory, etc) [Skotlex]
- * Cleaned up pc_dead to take advantage of the fact that status changes are
- not ended until after the function. [Skotlex]
- * Disabled ontouch npcs triggering on hidden/chase-walk characters.
- [Skotlex]
- * Updated/adapted current Homun code to use the status_data update.
- [Skotlex]
- * Updated map-server Makefile to compile mercenary.* files. [Skotlex]
- * [Fixed]:
- - Pets attacking even master is dead. [Lance]
- * Fixed battle_calc_weapon_attack damage capping damage to a minimum of 0
- (negative values should be allowed when attack is absorbed by target's
- element) [Skotlex]
-2006/05/29
- * [Fixed]:
- - Missing ';' in item #4358 [Lance]
- * [Fixed]:
- - Missing maps in map index database. [Lance]
- * [Fixed]:
- - Battle mechanics in battle_check_target [Lance]
- * [Fixed]:
- - Typo in mob_dead causing crash. Thanks to reddozen and his gang for testing.
- [Lance]
- * Cleaned up friend list saving and fixed loading of friends.txt file
- (char-txt) [Skotlex]
- * Added the Arunafeltz maps, not tested yet [Playtester]
- - someone with an up-to-date client should test them
- * Fixed pc_gainexp resetting your exp to 0 rather than adding it in...
- [Skotlex]
- * Corrected aspd calculation code to avoid negative overflows. [Skotlex]
- * Fixed battle_check_target check on BCT_ALL to check versus BL_CHAR
- instead of BL_PC and BL_MOB [Skotlex]
- * [Fixed]:
- - Declaration of int map_getcellp(struct map_data*,int,int,cell_t); [Lance]
- * Removed Undead being inmune to poison status. [Skotlex]
- * Removed speed penalty from SC_SKA [Skotlex]
- * Fixed SC_SPURT triggering on Soul Linkers. [Skotlex]
- * SC_DODGE won't be dispelled on death now. [Skotlex]
- * [Fixed]:
- - pc_follow_timer possible triggering crash.
- - pc_reg_received to use battle_status.hp instead of status.hp
- [Added]:
- - macro map_id2index for non-cyptic mapid to mapindex conversion. [Lance]
- * Added a division by zero check in mob_dead to prevent the (impossible)
- case where a mob dies with received damage of zero. [Skotlex]
- * Modified skill_get_range2 to return range 9 for skills with range 0 for
- Non-Players. This usually signals Self skills, and mobs/pets should be able
- to use them in other characters. [Skotlex]
- * Optimized a bit the SC_PROVOKE code (to use val3/val4) [Skotlex]
- * Fixed draining when the amount drained is negative (invoke zap rather
- than heal) [Skotlex]
- * Implemented GS_FLING as per the current skill description. [Skotlex]
- * Fixed pc_readparam/pc_setparam to use battle_status.hp/sp rather than
- status.hp/sp, fixes scripts reading the wrong Hp/Sp values [Skotlex]
- * Added some missing SC_* entries on the initial listing (potion related
- and speed up ones) [Skotlex]
- * Fixed function declaration of map_getcellp() [Skotlex]
- * [Fixed]:
- - status.c:920: warning: 'mbl' might be used uninitialized in this function
- - skill.c:6648: warning: 'matk_min' might be used uninitialized in this function
- - skill.c:6648: warning: 'matk_max' might be used uninitialized in this function
- - skill.c:2826: warning: 'sid' might be used uninitialized in this function [Lance]
- * [Optimized]:
- - Removed unused variable (account_id) in storage_guild_storagesaved.
- * [Optimized]:
- - Removed unused checks for unsigned data type and possible logic error for
- char type (gcc treats char as unsigned). [Lance]
- * [Fixed]:
- - Relogging in with 0 HP didn't trigger dead event. [Lance]
-2006/05/28
- * Added functions status_revive, pc_revive and mob_revive to handle revival
- (it doesn't handles player respawning, though). Fixed reviving @ commands.
- [Skotlex]
- * Added SC_BLADESTOP to the skill enum at the beginning of status.c (fixes
- Bladestop causing an unknown status change message). [Skotlex]
- * Fixed MSS_DEAD state skills not triggering. [Skotlex]
- * Changed undeads to by default always sustain 100% of the damage from firewalls [MasterOfMuppets]
- * [Fixed]:
- - script functions that doesn't pass references, thanks to End_of_exam. [Lance]
- * [Protected]:
- - clif_parse_LGMmessage from possible hacks [Lance]
- * Fixed unable to store n items into storage unless n was the total amount
- of items you had. [Skotlex]
- * Suppressed compilation warnings (unsigned and signed mismatches) [Lance]
-2006/05/27
- * Added structure status_data which holds status-related information (str,
- agi, etc, speed, amotion, adelay, dmotion, weapon-damage, race, size, etc)
- and weapon_atk structure with the weapon specific info (atk, atk2, element)
- to be used by all combat structures (TODO: Homun needs to be updated to use
- it). This in change involves a LOT of changes throughout the code and many
- optimizations were done as well. Partial list (see svn changelog for complete
- changes): [Skotlex]
- - NOTE: Changes are substantial! I tested a bunch of stuff and all the
- skills I changed the most, but it is possible there are unnoticed bugs
- remaining to fix!
- - Cleaned up TBL_PC, TBL_MOB, TBL_PC and mob_db structures to use status_data.
- - Split damage received functions into pc_damage/pc_dead and mob_damage/mob_dead
- - Added status functions to deal with damage and healing (status_damage,
- status_heal, status_percent_change) and a bunch of defines for easier
- handling of them (status_percent_heal, status_percent_damage,
- status_fix_damage, status_kill, etc). Objects must be hurt/healed through
- THIS, pc_damage/mob_damage most no longer be directly invoked!
- - Rewrote and cleaned up battle_calc_misc_attack
- - Merged config options pc_attack_attr_none, mob_attack_attr_none,
- pet_attack_attr_none into attack_attr_none (type 4)
- - Removed config options player_defense_type, monster_defense_type,
- pet_defense_type in favor of weapon_defense_type
- - Modified skill_calc_heal to take into account the MEDITATION bonus.
- - Modified Slim Pitcher so it will work when casted by non-players. Will
- now also work with SP-healing items.
- - Rewrote Freedom of Cast code to use function status_freecast_switch to
- switch adelay/speed when cast begins/ends.
- - Modified Magic Power to store amplified MATK/MATK2 in val3/val4 for
- easier updating when used in conjunction with ground skills.
- - Fixed Asura Strike being usable from within a combo regardless of combo skill.
- - Added status_calc_bl which does status-change related calculations using
- as base the base_status of the bl object and the SCB_* flag passed. This is
- invoked on status changes, and status_calc_pc will no longer be invoked
- (which results on much faster status-change calculations).
- - pc_clean_skilltree will now also remove item-granted skills.
- - Learning skills will now only invoke status_calc_pc when the skill is passive.
- - Cleaned up pc_check_base/job_lvup to only invoke the lv-up related
- packets and functions ONCE regardless of skill-levls earned.
- - Cleaned up pc_ regen related functions.
- - Made player-sprite mobs have item pickup animation and walkdelay when taking items.
- - Clones will copy a player's base status rather than battle status (so
- status-change alterations are not cloned)
-2006/05/26
- * Part B of the homunculus code. [blackhole89]
- While most of the homunculus handling functions are in now, it still lacks
- code required for players to create it.
- Given I haven't screwed up, you could master yourself one through the DB though.
- * Fixed crashing in mob.c [Lance]
- * Patches to allow everything to work right. + 1 more sample script. [Lance]
- * Mob control engine tested 99% working so far. [Lance]
- * Change scripting engine's NPC scope vars to dot (.) style.
- * Improved and (should be fully) fixed the mob control engine. [Lance]
- * Fixed typos in char.c [Lance]
- * Rewrote fame rank lists system to reduce char-server load, as requested by
- Skotlex: now it has a copy of those lists, and updates only the proper one
- when needed instead of rebuilding all from saves everytime (which required
- to always save the character before rebuilding the lists) [DracoRPG]
- - Note it hasn't been compiled nor tested with SQL, please do it for me
-2006/05/25
- * Simplified ASC_BREAKER by making it a BF_WEAPON attack with an additional
- int-based damage component (which is added right before elemental
- modifiers) as described by AuronX. Pending further refining. [Skotlex]
- * Resolved differences between Stable/Trunk msg_athena.conf. [Lupus]
- Fixed atcommand @request MSG numbers accordinly.
- On adding new MSG strings, plzm reserve them in STABLE msg_athena.conf, too
- * Added NoVending mapflag. You may disable vending in the streets [Lupus]
- * Increased capacity for Account Variables to 64 [Skotlex]
- * Reverted Intravision implementation to that of stable's. [Skotlex]
- * Corrected Login Server taking it's first argument as both login config
- and lan config. [Skotlex]
- * Fixed mob control commands.
- * Fixed memory leak in scripts (again). Still have a few lying. [Lance]
-2006/05/24
- * Fix to the slave AI problem. [erKURITA], by [Skotlex], reported by Niktout.
- * Item sharing now shares the same rules as exp sharing (no sharing when
- dead, or idle, etc) [Skotlex]
- * Fixed summoned slaves being able to cast onspawn summon-skills (slaves
- aren't supposed to be able to call minions) [Skotlex]
- * The clif_skill_poseffect packet will not be invoked in Snap unless the
- skill was successful. May fix the client-position lag. [Skotlex]
- * Merged item_db.sql from stable (the one from stable was more recent than
- the one of trunk...) [Skotlex]
- * Corrected SL KA* spells not working on other Soul Linkers. [Skotlex]
- * Corrected a pair of incorrect sql query parsing logic in the login-sql
- ban request packet. [Skotlex]
-2006/05/23
- * Corrected mob angry mode, now it only "restores" itself after being hit
- when the mob has no target within their range of sight rather than on
- picking a new target. [Skotlex]
- * Fixed wedding sprite where it would stay active after unequipping. [Zido]
- * Some cleanup of run_script, should fix the memory leak there. [Skotlex]
- * the charname request hack message has been downgraded to only include
- GM-invisible characters. [Skotlex]
- * corrected clif_charnameack to send negative ID when a disguised player
- asks for it's own disguised name. [Skotlex]
- * Cleaned up the disguised target-id checks taking into considering that
- the only character that sees a negative ID is the same disguised character.
- [Skotlex]
- * Modified battle_calc_weapon_attack to use new flags pdef/pdef (pierce
- defense), Investigate and Icepick will now use the final def/vit-def values
- rather than the base ones. [Skotlex]
- * The move-enable condition checks for skills are now checked for only when
- on skill use, not at cast-end time. [Skotlex]
- * Corrected clif parse name request failing on disguised characters [Skotlex]
- * Corrected Soul Drain draining from all non-ground-based skills including
- non-magic attacks. [Skotlex]
- * Corrected pc_setoption to change the option and then change class.
- changing option-wedding will automatically convert the view-class as well.
- [Skotlex]
- * Corrected the 15% drop rate increase when killing higher level mobs in
- pk-mode triggering for all mobs with lower level than yourself. Thanks to
- Vayu. [Skotlex]
- * Fixed typo (this time it's not my fault) in script_reload() clearing the same
- db each time o_o [Lance]
- * Fixed sleep command. [Lance]
- * Added 'setd' support for local NPC scope (') variables. [Lance]
- * [Scripting Engine Update] New variables are ready to be used. [Lance]
-2006/05/22
- * Updated skill_delayfix to return 0 for mobs since they have no skill
- delay other than the one specified in mob_skill_db [Skotlex]
- * Corrected the 20 lvl diff 15% exp bonus on pk_mode servers. Thanks to
- Vayu for pointing it out. [Skotlex]
- * status_get_sc_tick will now use directly Stun's formula rather than
- invoking the status sc chance once. [Skotlex]
- * Fixed a possible null pointer in script command misc_effect [Skotlex]
- * Modified Investigate to take into consideration final def/vit-def rather
- than base values for damage adjustment. [Skotlex]
- * WARNING: New scripting system contains memory leak
- TODO: Free all scripts using script_free_code() instead of old methods. [Lance]
- * Excluded idle and auto-trade party members from TK_POWER list. [Lance]
- * Fixed compilation errors.
- Tidy up jobmaster for easy debugging. [Lance]
-2006/05/21
- * Part A of the Homunculus code.
- This only features the structures, status_* and clif_* (packets) and is
- not functional yet in any conventional way, but doesn't interfere
- with present functionality either.
- Main purpose is helping me to keep my work organized. [blackhole89]
- * Fixed the "fake" mute status bug. [Zido]
- * Speed up array size calculation and deletion. [Lance]
- * Player must learn the skill before doing auto-spell [Lance]
- * Exploit prevention in clif_parse_NpcStringInput [Lance]
- * SC_SPEARSQUICKEN -> SC_SPEARQUICKEN normalized enum name [Lupus]
- * Thanks to damirych & Falcon for [2006/04/30] STEAL skill [Lupus]
-2006/05/20
- * grfio_final moved back if any of GRF overriding is enabled so servers
- with such configuration will not have different values after reloading. [Lance]
- * jA1983 script.c buildin_menu fix. Thanks to End_of_exam. [Lance]
- * Abit of alterations to login-server. [Lance]
-2006/05/19
- * Minor unsigned/signed alteration in pc_additem to shut the compiler up. [Lance]
- * Small change in pc_additem that could be fixing the current bug with new
- items not getting added. [Skotlex]
- * Fixed loginlog definition in main.sql, thanks to Tempesta [Skotlex]
- * Likely fixed the mob-skill random picking behaviour causing infinite
- loops sometimes. [Skotlex]
- * Modified mobskill_use behaviour to pick a random starting point and check
- skills from that, rather than always checking from first to last. Fixes
- skills with high priority blocking skills lower down in the list from
- triggering. [Skotlex]
- * Updated mob ai behaviour so that mobs use IDLE state skills when their
- current target cannot be reached for melee fighting. [Skotlex]
-2006/05/18
- * Added 5 config settings to adjust damage in pk-mode servers (misc.conf)
- [Skotlex]
- * Fixed mob_max_skilllvl being capped to 11! [Skotlex]
- * Rewrote/cleaned up several functions in storage.c [Skotlex]
- * Optimized pc_additem comparisons to account for items with more than four
- slots. [Skotlex]
- * Updated clif.c to enable retrieval of items from cart/storage while
- trading. Exception is retrieving items from the cart while vending.
- [Skotlex]
- - The reasoning is that an ongoing trade will not get "corrupted" if you
- earn items before it is commited (only if you lose items from your
- inventory), and it is an annoyance when you realize the stuff you want to
- trade is on the cart/storage.
- * skill reiteration code now does not checks for the trigger-area of the
- skill in the case of non-players, which means mobs can now place traps in
- cells adjacent to each other. [Skotlex]
- * Applied an experimental weather code that should lower bandwidth usage to
- near-none, which's only disadvantage should be the weather not clearing out
- until moving to another map (even when the mapflag is removed from the
- current map). Please test and report if there's any anomalies with it.
- [Skotlex]
- * NPC_AGIUP will now give movement boost of 50% [Skotlex]
- * Fixed WZ_WATERBALL number of hits when used by non-players. [Skotlex]
- * MO_BODYRELOCATION will send the slide packet with the actual src's
- coordinates rather than selected tile. [Skotlex]
-2006/05/17
- * Modified mob_can_changetarget to return true always when the new target
- is the provoked-by character. Fixes provoke not making the mob change
- target when it already is locked on another player. [Skotlex]
- * Added check to clear previous skill when combo time ends. Should fix TK
- Rankers being unable to initiate a combo with the same kick their previous
- combo was finished with. [Skotlex]
- * Power Up and Agi Up now increase Hit/Flee by 20%/lv [Skotlex]
-2006/05/16
- * Modified "hide woe damage" to send the number of hits rather than 1 as
- damage Because when the damage is less than the number of hits, the client
- will display MISS. [Skotlex]
- * Fire Pillar will now do 200%MATK damage per hit when level is >10.
- [Skotlex]
- * Blood Drain always hits now. [Skotlex]
- * Fixed Mob Area Skills not updating their use-time (rendering their skill
- delay useless) [Skotlex]
- * Search free cell will now skip picking the center-tile as target
- location. Will prevent slaves from walking on top of their master, or mobs
- placing stuff right under themselves with the "around" target conditions
- among other things. [Skotlex]
-2006/05/15
- * Small changes to the skill.conf
- - Monsters now can place ground skills on top of each other by default
- - Land_Skill_Limit format changed and set to "Only Players" by default
- * When reading mapflags, when a map is set to be pvp or gvg, the other will
- be turned off (disables pvp mapflags in gvg maps for pk-servers) [Skotlex]
- * Firepillar's damage per hit is now 100% MATK (rather than 20%) when the
- skill level is above 10. [Skotlex]
- * Sorted out the item_data structure, getiteminfo should work correctly
- now. [Skotlex]
- * KA* skills can now be casted on other Soul Linkers as well without the
- Spirit requirement. [Skotlex]
- * Soul Drain will now show the SP drained regardless of drain display
- settings. [Skotlex]
- * SC_COMBO state will now end in skill_attack rather than
- skill_check_condition (as it is required there to apply damage bonuses
- based on combo-casted skills) [Skotlex]
- * Fixed Option_Wedding in const.txt (0x1000 won't work, it has to be 4096)
- [Skotlex]
- * Fixed the nocast flag 2 (not usable in pvp) returning true in pk-mode
- servers. [Skotlex]
- * When removing a castle's owning guild, the char servers will erase the
- guardian data now. [Skotlex]
- * Changed the behaviour of immobile mobs when they can't chase their
- target. Rather than using a longrange skill and then unlocking, they will
- use an attack/angry state skill and then unlock. [Skotlex]
- * Some adjustments of how disguising + gm-hiding work together. [Skotlex]
- * Fixed clif_GlobalMessage being the exact same function as clif_message
- (the first should send to ALL_CLIENT and the later should send to
- AREA_CHAT_WOS). Should fix globalmes script command. [Skotlex]
- * Added SC_BLADESTOP to the switch listing in status_change_start [Skotlex]
- * Characters in vending are now always considered "idle" if the
- idle_no_share setting is active. [Skotlex]
- * Players with OPTION_INVISIBLE should not be sent to clients. [Lance]
- * Remaining fixes for item scripts. [Lance]
- * Added NPC event deprecated warnings to ease debugging old scripts. [Lance]
-
-2006/05/12
- * Supplied fake NPC ID in sd->npc_id for item scripts. [Lance]
- * Bugfix on fake npc [Lance]
- * Fixed mob_once_spawn not working for non-random coordinates. [blackhole89]
- * Reverted again the change that stuns the caster on Ske, Ska, Swoo when
- the target is a nonplayer (rather than always) [Skotlex]
- * Modified mob_spawn_once so that coordinates -1,-1 are "random around the
- player" while 0,0 are random around the whole map (regardless of whether
- there's a player attached or not) [Skotlex]
- * Knockback will no longer work on traps during woe. [Skotlex]
-2006/05/11
- * Fixed the definition of the KEY in the loginlog, thanks to TheUltraMage
- [Skotlex]
- * NPC_POWERUP and NPC_AGIUP now cause a increase in hit/flee (respectively)
- of 40% per level. [Skotlex]
- * Changed a bit the MAX_ZENY checks in trade.c to prevent overflows.
- [Skotlex]
- * Rewrote npc_selllist for a more proper-clean implementation. [Skotlex]
- * Increased NPC_POWERUP's dex bonus to +25*lv [Skotlex]
- * Moved TK_DOWNKICK's stun time from time to time2 [Skotlex]
- * Added TK_TURNKICK's stun to splash-pushed mobs. Duration is 2secs (time2)
- [Skotlex]
- * Merged the code for Ska, Ske, Swoo together. Swoo stun duration is now 10
- secs (reducable) if you target a mob that already has Swoo active. [Skotlex]
- * Added the missing semi-comma from the upgrade_svn6533.sql file. Thanks to
- Tanaous [Skotlex]
- * Added back the missing code that substracts arrows when normal-attacking.
- [Skotlex]
-2006/05/10
- * Changed the state of Asura back to explosionspirits, added a hardcoded
- move_enable check when invoking Asura and NOT while in BladeStop or a
- Combo. [Skotlex]
- * Added back SC_XMAS to status.c, it got lost sometime during all the
- previous reworkings. [Skotlex]
- * Changed wedding costumes to use setoption rather than changebase.
- [Skotlex]
- * Modified setoption so that flag 1 or no flag adds an option, and flag 0
- removes it. [Skotlex]
- * Updated script_commands with the new behaviour. [Skotlex]
- * Updated mob_db2.txt and mob_db2.sql to have only 10 drop slots rather
- than 15. [Skotlex]
- * Users are now able to use their own dnsbl servers (login_athena) [Zido]
-
-2006/05/09
- * Rewrote/cleaned up trade.c for a more clean trading implementation.
- [Skotlex]
- * Added @request commands, sends a request to all connected GMs of
- lowest_gm_level or above as a whisper message. Defaults to gm level 20
- users (UNTESTED). [Skotlex]
- * Modified @commands to use Meruru's code which is faster and does a fair
- attempt at tabulating the commands presented. [Skotlex]
- * Updated SKA to return a random value between 0 and 99 each time
- status_get_def is invoked. [Skotlex]
- * Updated Making Arrow to not include unidentified items in the list.
- [Skotlex]
- * Reduced drop slots from 15 to 10. [Skotlex]
- * Updated mob_db.sql with the current data. [Skotlex]
- * Updated setoption script command to receive a second (optional) argument
- flag. If the flag is 1, the option is added to what the player currently
- has; likewise using flag 2 removes only that option. No flag (or any other
- value) is the older behaviour of removing all other options and setting
- specificly what is passed. [Skotlex]
- * Updated script_commands information for setoption due to this change.
- [Skotlex]
- * Small fix in npc-created chat rooms to properly include the terminating 0
- on the chat's event. [Skotlex]
- * Fixed Fog of Wall's symmetry in respect to Misc attacks, they no longer
- get reduced by 50% regardless of who is standing on the fog. [Skotlex]
- * monster_ai&2 will now trigger the rude-attacked skill when the mob can't
- move and the attacker is out of it's attack range. [Skotlex]
- * Added missing icon for Joint Beat [Skotlex]
- * Mob-search functions will now skip enemies with no exp/job_exp. [Skotlex]
- * Treasure chests will now be excluded from the mob-drop listings
- (@whodrops) [Skotlex]
- * Fix on pc_skill which fixes overlapping when one gets more than one bonus
- for the same skill. [Skotlex]
- * Updated main.sql's loginlog table structure. [Skotlex]
- * Added svn_update6533.sql to update the loginlog structure as suggested by
- theultramage. [Skotlex]
- * Cleaned up somewhat the implementation of BladeStop. [Skotlex]
- * Fixed the head_bottom (pet-armor) position in packet 0x22c (walk packet)
- when crafted for non-players. [Skotlex]
- * Script commands sc_start, sc_start2 and sc_start4 will now start
- regardless of sc defense of the target player (that is, they cannot be
- avoided/blocked) [Skotlex]
- * Fixed a possible counter overflow in attacked_count, changed the var size
- to unsigned char since the code can handle the overflow now. [Skotlex]
- * Multiple targets again reduces armor defense, as reported by Tharis.
- [Skotlex]
- * Increased dex bonus of NPC_POWERUP to +20 per level. [Skotlex]
- * Fog of Wall's -50 hit reduction is now only for ranged attacks. [Skotlex]
-2006/05/08
- * Reverted the change that was making ES skills stun the caster always.
- [Skotlex]
- * Removed the fixpos packet which is sent whenever you are hit while moving
- as Aegis doesn't sends this packet neither. [Skotlex]
- * ES magic will now put the caster on stun for 0.5 secs regardless of
- whether the skill-target is a mob or not. [Skotlex]
- * Added function clif_party_join_info which sends packet 0x1e9 each time a
- party-member joins. This packet (as redundant info as it has) should also
- contain the field for "adoptability", but that needs to be coded in yet.
- [Skotlex]
- * Added clif_ParseAdoptRequest which does the basic adoption handling. More
- checks and the reply packets still need to be coded in. [Skotlex]
- * Happy State and TK stances won't dispel on death now. [Skotlex]
- * Cleaned up combo-skill implementation, SC_COMBO is automatically ended in
- skill_check_condition now. [Skotlex]
- * Modified TK-ranker infinite combos to behave as described by AuronX.
- Refer to his thread in the development section for details. [Skotlex]
- * Made all Soul Link Spirit skills not be castable on self. [Skotlex]
- * Changed rate of NPC status effect skills to 50+10*lv% base chance
- (guessed, but better than 100% for all levels) [Skotlex]
- * Changed max level of NPC status effect skills to 5 [Skotlex]
- * Increased max number of tries to find a random spot in maps to 1000 since
- some maps have so many non-walkable tiles it's hard to find one in just 100
- tries. [Skotlex]
- * status_set_viewdata will remove the Wedding Option status when you set a
- class that is not wedding. [Skotlex]
- * hide_gvg_damage will now send 1 instead of -1 as damage. [Skotlex]
- * idletime will now be updated on attack-request, not on sit/standup
- [Skotlex]
- * Party members sitting will no longer be considered idle. [Skotlex]
- * Removed SP_DISGUISE from the bonus list (onequip/onunequip should be used
- with the disguise/undisguise script commands instead). [Skotlex]
- * Moved Sharp Shooting display to the block with Auto-Counter (since that's
- the other skill that can show critical as well) [Skotlex]
- * Corrected some fields in the standing still packet (guild emblem being
- stored as a Long when it should be Short) [Skotlex]
- * Modified most fields of view_data to be unsigned shorts rather than
- signed ones. [Skotlex]
- * On-Touch NPCs will now make you stop walking when you trigger them.
- [Skotlex]
- * ShadowJump/JumpKick will make you land on the target's cell now.
- [Skotlex]
- * Fixed Kaahi triggering only once per skill duration. [Skotlex]
-2006/05/07
- * Fixed readme/changelog.html [KillerBox]
- * Removed old logs. [Lupus]
- TODO: 1. Add produce logging into PICKLOG 2. Replace map names with map index
-2006/05/05
- * Optimized clif.c clif_scriptmenu/input/inputstr to check for sd->state.using_fake_npc
- before sending one (as it's not required to send twice).
- * Reinitialize sd->state.using_fake_npc in clif_parse_LoadEndAck (for scripts that warps
- players and still continues execution to work). [Lance]
- * Updated item_db.sql to current. [Skotlex]
- * Fixed a bug in @commands, most likely the reason some people were still
- getting crashes. [Skotlex]
- * Fixed @commands not showing the last available commands (unless the total
- amount of commands is divisible by ten) [Skotlex]
- * Added a npc-script-event cache to avoid looking up event-scripts every
- time they need to be executed. Events cached are all those defined in
- script_config (on login, logout, mapchange, death, kill, level up) [Skotlex]
- - Since the cache holds direct pointers to the npcs/events, do NOT unload
- the related NPCs or you'll get dangling pointer crashes. However,
- @reloadscript will work fine.
- - Set the etc_log to on to see a summary of npcs/events loaded for script
- execution on startup.
- * The Rest bonus activated by using /doridori while in rest should now
- trigger with all the class tree (TK/SL/SG) [Skotlex]
- * Fixed Kaupe always triggering when the one who was under Kaupe was a
- player rather than the one attacking... [Skotlex]
- * /doridori now won't double the HP/SP regen of TKs, it only activates
- their "happy" state. [Skotlex]
- * Added the -50 hit penalty when standing on Wall of Fog. [Skotlex]
- * Uncommented the status_calc_mdef2 call in status_calc_pc. [Skotlex]
- * Being in Enjoyable Rest state will now also trigger the HP/SP Time skills
- (even if there's no other TK around). [Skotlex]
- * Added battle config settings view_range_rate and chase_range_rate to
- adjust the view-range and chase-range (range2/range3) of the mob_db without
- having to manually change them (battle/monster.conf) [Skotlex]
- * Kaupe now will only block all skills of players, for non-players, only
- normal attacks can be missed. [Skotlex]
- * Moved the Kaite spell-reflect code after the damage calculation function,
- so the reflected damage is exactly the damage the original target would
- have received. Will only trigger if the damage to be reflected is above 0.
- [Skotlex]
- * OnEquip scripts will now trigger on log-on. [Skotlex]
- * Infinite Endure will no longer give mdef bonus. [Skotlex]
- * Removed bInfiniteEndure bonus, Eddga card now uses onequip/onunequip to
- start/end infinite endure. [Skotlex]
- * Fixed Kaahi's SP cost per heal. [Skotlex]
- * Now when walkdelay is set to 0, characters will stop walking when hit,
- but will not have any walk delay. (previously setting walk delay to 0 would
- not even stop characters from walking when hit) [Skotlex]
-2006/05/04
- * Some people think its sexy to declare variables after blocks of code. Fixed. [Zido]
- * Fixed a possible infinite loop in skill_clear_unit_group [Skotlex]
- * Some clean-ups in the mob_ai [Skotlex]
- * Improved atcommand autoloot, now displays droprate in percents and notices
- player if autoloot is already on or off. Also simplified the code [Harbin, Kain],
- commited by erKURITA
- * Added one grace range in the mob_loot search function which should fix
- mob_can_reach failing when invoked with the same distance that distance_bl
- returned. [Skotlex]
- * Stun time for using ES magic on non-mobs reduced to 0.5 secs. [Skotlex]
- * Eska is now usable on bosses. [Skotlex]
- * Swoo will stun you if attempted on an already 'swooned' enemy. [Skotlex]
- * clif_skill_failed will print out a debug line with the skill_id (since
- the current null_po does not helps at all to fix it) [Skotlex]
- * Applied TheUltraMage's suggested fixes to the grfio module. [Skotlex]
- * Rewrote Kaahi to behave as it should. It will heal whatever amount of
- damage accumulates in the time2 interval (500ms by default) after being
- hit. [Skotlex]
- * Changed skill_unit_move_unit_group to enable moving of all types of
- ground-skills except ensembles (fixes warmth not following you) [Skotlex]
-2006/05/03
- * Kaahi now triggers every 500ms rather than on every hit (but it only
- heals if in those 500ms an attack that would previously trigger Kaahi has
- taken effect). In other words, it works just like before, except damage
- gets "buffered" into 500ms slots. [Skotlex]
- * Kaite, Kaute will now show a skill effect when they trigger. [Skotlex
- * Knowledge will now only trigger if you logon to the memorized map, not
- walk into it. [Skotlex]
- * Corrected @whomap directly invoking msg_table[] rather than msg_txt()
- [Skotlex]
- * Guessed where the pet data goes in spawn packet 0x7c. This may be wrong
- and not fix the pet issue, but I doubt it'll cause any problems that won't
- be fixed by making the pet move. [Skotlex]
- * Updated Charge Attack's state from none to move_enable. [Skotlex]
- * Made tomahawk an NPC_SKILL so that it may not be plagiarized. [Skotlex]
-2006/05/02
- * Fixed standing up not really standing you up. [Skotlex]
- * Moved battle_consume_ammo to the end of skill_castend_damage_id,
- skill_castend_nodamage_id and skill_castend_pos2 rather than
- battle_calc_weapon_attack. They will trigger when the player's arrow_atk
- state is active and a ground skill was not invoked. It should fix all
- issues with splash/ground skills consuming ammo per target rather than once
- per skill use. [Skotlex]
- * Added structure state to the ground skills, their fields are magic_power,
- into_abyss and ammo_consume to indicate the states that were previously
- stored in val3. [Skotlex]
- * Implemented desperado as explained by Rockman-EXE. The skill-effect is
- not showing up though, I'll need some logged packets to see what's missing.
- [Skotlex]
- * Removed the unit_can_move checks in skill cast-end, they should be
- performed in skill_check_require when the skill's state is move_enabled.
- [Skotlex]
- * Changed extremity fist's state to move_enabled, the explosion spirits
- check is now hardcoded. [Skotlex]
- * Absorb Spirit Sphere now gives +10SP per sphere as per discussions with
- Haplo. [Skotlex]
- * Changed a <= into a < in pc_steal_item. This means drops with 0.01% are
- impossible to steal unless you have at least 100% steal-rate (where steal
- rate is dex - opponent dex + skill_lv*3% + 10%) [Skotlex[
- * Cleaned up clif_parse_action_request to enable sitting/standing while in
- shops, interacting with npcs, etc. [Skotlex]
- * Kaite now works against all types of spells. [Skotlex]
- * Kaupe now works against all skills. [Skotlex]
- * Sanctuary now won't damage non-enemies. [Skotlex]
- * Blessing now will always give you bonus stats even if you are wearing
- undead armor. [Skotlex]
- * Modified how Rogue's treasure works so that you get +1% to your steal
- rate rather than +0.01% to the final rate. [Skotlex]
- * Rewrote Warmth to use ground-skill-units, it should behave now like in
- officials (implementation is not quite the same, but it should yield the
- same effects while consuming less bandwidth). "Stacking", as it's called,
- is possible now, but limited to eA's minimum timer skill interval (100ms).
- [Skotlex]
- * Modified NPC_POWERUP so that it gives +10 dex * skill level rather than
- +5+lv to all stats (as explained by Playtester and Tharis on how the skill
- behaves). [Skotlex]
- * Allowed SG_FEEL memorizing the same map for all three. [Skotlex]
- * SC_FUSION won't end when you die now. [Skotlex]
-2006/05/01
- * Added knockback when you run into a wall during running. However
- position is not being refreshed on the client yet... [Skotlex]
- * Fixed pc_disguise not allowing you to "redisguise". [Skotlex]
- * Corrected a crash when sd is null in npc_event [Skotlex]
- * After testing to make sure it works properly, I'm including
- new battle conf options to limit MVP drops. [Reddozen]
- * Removed OPTION_XMAS, it seems to not exist.... [Skotlex]
- * Added SC_SMA to handle "ready to use SMA" status (rather than SC_COMBO)
- since it has a visual effect to use. [Skotlex]
- * Corrected the value of OPTION_FLYING [Skotlex]
- * Using SG_FUSION ends Soul Linked effect. [Skotlex]
- * status_setviewdata will set your option accordingly when the previous/new
- view-class is wedding or xmas suit. [Skotlex]
- * Added function map_foreachinshootrange, behaves the same way as
- map_foreachinrange, but it also performs a "shoot-path" check before
- invoking the function. Used in the skill subtimer function if
- skill_wall_check is defined. [Skotlex]
- * Fixed AL_WARP displaying "Unknown Area" selections when you don't have
- all memo points used up. [Skotlex]
- * Fixed alive_count not being reset on skill unitsetting, which leads to
- some groups not being cleared once all their units expire. [Skotlex]
- * Optimized Kaahi/Kahai, will now only show the amount of HP healed. Moved
- to skill_counter additional effect so it may trigger even on miss. [Skotlex]
- * SKA no longer blocks skills. [Skotlex]
- * Optimized fake npc system. Added npc_checknear back to npc_buysellsel. [Lance]
+Date Added
+
+AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
+IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+
+2006/11/29
+ * Probably fixed the Segmentation Faults we've been having. [FlavioJS]
+ Description: A player quits and it's session is freed and set to NULL,
+ but the char server already sent a packet with player information
+ (registers, storage, ...). If a message is sent in consequence of
+ updating that info, a segmentation fault happens because
+ session[sd->fd] is already NULL.
+ Fix: make shure the session of the target player is valid before
+ processing the rest of the char server's message.
+ * Some minor cleanups. [FlavioJS]
+ * Fixed the new npc parsing code not accounting for windows-style line
+ terminators, which as a side effect messed up mapflag parsing if the file
+ had windows-style terminators, which coincidentally was the case for the
+ nopvp file, which unfortunately meant that all towns became pvp! [Skotlex]
+ * HT_PHANTASMIC no longer knocks back even when it misses. [Skotlex]
+ * Earned exp by dead homuns will now be lost (same treatment as earned exp
+ from players that died) [Skotlex]
+ * Now gvg_dungeon mapflag will activate the other mapflags which are
+ required: pvp, pvp_nocalcrank and pvp_noparty/pvp_noguild (they are forced
+ to off if gvg_dungeon is on and viceversa) [Skotlex]
+ * Cleaned the pvp ranking code so that it takes effect even if
+ pvp_nocalcrank is active WHEN the map is a gvg_dungeon one. [Skotlex]
+ * Now homuncs and their masters are the only ones who can use support
+ skills on them. [Skotlex]
+ * Some cleaning on the homunc speed calculating code, so that it correctly
+ uses the default walk speed if the player has no speed yet. [Skotlex]
+2006/11/28
+ * Fixed a typo which made the wedding_ignore_palette setting not work when
+ you log on with them equipped [Skotlex]
+ * Applied The Ultra Mage's patch to use strict npc header formatting
+ parsing. Updated the relevant stock scripts/mapflags that didn't conform to
+ the standard. [Skotlex]
+ * Moved the blocking of casting supportive skills on homunculus from
+ battle_check_target to status_check_skilluse as bct is not invoked unless
+ the skill is offensive (or party/guild only) [Skotlex]
+ * Cleaned up status_calc_bl_sub_hom, fixed recasting dex/str/vit/int
+ bonuses skills making their atk/def/mdef stack with itself over and over.
+ [Skotlex]
+ * Updated sql files [Playtester]
+ * Changing setting the Guild Master from pc_authok to clif_parse_LoadEndAck
+ so that it will not fail to set the gmaster flag when the first person of a
+ guild to log on is the guild master. [Skotlex]
+ * Modified the way Storm Gust freeze's counter works. Now it checks for the
+ caster of the Storm Gust, if it's the same as the previous hit, the counter
+ is increased, otherwise, the ID is updated and the counter is changed to 1.
+ [Skotlex]
+ * Fixed always receiving at least 1 bexp/jexp even when the mob gives no
+ exp at all. [Skotlex]
+ * Changed write to send as suggested by TheUltraMage in:
+ http://www.eathena.ws/board/index.php?showtopic=105417
+ Hopefully that will take care of the SIGPIPE problem in Debian and cygwin. [FlavioJS]
+ * Server name in core.c skipping '\\' characters. [FlavioJS]
+ * Memory allocation functions using file,line,func from the invoking functions. [FlavioJS]
+ * Other minor malloc changes. [FlavioJS]
+2006/11/27
+ * Now when a player's "attack once" request fails due to range, the client
+ is told to move to the target to attack it. This sort of fixes the problem
+ of the client SPAMMING the server with attack requests from afar without
+ even approaching the icewall. [Skotlex]
+ * Updated the status change field "option" to an int rather than short.
+ This fixes the option values for xmas/sightblaster not getting set, which
+ could explain why some people crash when equipping weapons while in xmas
+ suit. [Skotlex]
+ * Fixed the Homunculus hungry timer not starting on login. [Skotlex]
+ * Added logging for standard GM commands (/mm /b /kick etc) [KarLaeda]
+ * Some cleanups on the trade_additem function. When specifying a qty of 0,
+ an ack will be returned to the client so it doesn't gets stuck. [Skotlex]
+ * Update sql files [Toms]
+ * Corrected the skill animation for Absorb Spirits [Skotlex]
+ * Cleaned up a bit the implementation of how Gravity Field blocks the
+ caster from moving. [Skotlex]
+ * Mob class-changing will fail if the new class is the same as the previous
+ one. [Skotlex]
+2006/11/24
+ * Homunc's min matk is now always equal to max matk [Skotlex]
+ * Fixed EDP's damage being 100% more than it should (should be 4x, not 5x
+ on normal attacks) [Skotlex]
+ * Self Destruction will only hit everyone and not just enemies when used by
+ mobs (non marine spheres) unless the map is a versus map. [Skotlex]
+ * Spider Web's duration is now halved on players (before it was halved in
+ pvp maps only) [Skotlex]
+ * Likely fixed Homunculus not disappearing the second their intimacy hit 0.
+ [Skotlex]
+ * Fixed uninitialized variable fd being used in WFIFOHEAD in a few clif
+ functions. [Skotlex]
+ * Fixed the fact that the TURBO code breaks when you attempt to handle more
+ than one connection at a time within the same function. However this broke
+ map-server compilation, therefore, don't use TURBO yet! [Skotlex]
+ * While at it, cleaned a few packet implementations in the char/login
+ servers which were not only ugly, but had some really stupid flaws within.
+ [Skotlex]
+2006/11/23
+ * Completed Reddozen's hanging mapwarp code to support party and old syntax. [Lance]
+ * Updated sql files [Playtester]
+ * Made WFIFOHEAD() check for available buffer size remaining on the
+ connection, and when there's not enough space, it will increase it.
+ [Skotlex]
+ * Added define TURBO to the Makefile. It enables MouseJstr's socket access
+ optimization which should speed up the code when accessing the write/read
+ buffers repeatedly within a function. [Skotlex]
+ * Fixed the functions where the RFIFOHEAD/WFIFOHEAD functions were used
+ incorrectly (prevents TURBO enabled compilations from finishing) [Skotlex]
+2006/11/22
+ * Modified slaves_inherit_speed and slaves_inherit_mode so you get better
+ control of when to copy/remove modes/speed. See the conf changelog for
+ details. [Skotlex]
+ * Reenabled usage of mode MD_CHANGETARGET, so mobs with mode 0x200 will be
+ able to switch targets while attacking. [Skotlex]
+ * Some cleanups around usage of session[] in the map server, hoping that it
+ may fix some not very likely crashes. [Skotlex]
+ * Rewrote a few messy @ commands. [Skotlex]
+ * Fixed the homunc hungry timer being started when the homun data is
+ received from the char-server and the homunc is NOT 'active'. [Skotlex]
+2006/11/21
+ * Fixed the Auto-Berserk giving you back defense when it triggers during
+ berserk's HP penalty. [Skotlex]
+ * Some small changes in the pet ai to make it more responsive. [Skotlex]
+ * Rewrote the pet looting behaviour (taken from the mob's), pets are much
+ more smarter now when looting from multiple possible items. [Skotlex]
+ * Fixed pets/homunc trying to be deleted twice when they had 0 intimacy and
+ their master logs out. [Skotlex]
+ * Added support for specifying ammo type = 99 in the skill_require_db file,
+ it can be used to specify that any kind of ammo can be used with the skill,
+ but you NEED to have ammo equipped. [Skotlex]
+ * Corrected GS_DISARM, it is now a normal attack, which, when it connects,
+ has a chance to do strip weapon at a 3*lv% rate (modified by dex) [Skotlex]
+ * Fixed GS_PIERCINGSHOT, it should ignore defense [Skotlex]
+ * Corrected Gatling Fever costing SP when trying to turn it off. Also,
+ speed increases bonuses won't take effect while it's active. [Skotlex]
+ * Updated the main makefile with a new OPT line. It is commented by default
+ since it only works with GCC 4.X, when unset, it will hide away a huge
+ amount of warnings that have to do with stuff that is not gonna be
+ corrected in eA anyway. [Skotlex]
+ * Corrected TripleAction's damage. It should do 150%*3 instead of 100*3%
+ damage. [Skotlex]
+ * Updated GS_CRACKER's stun chance using Doddler's info as reference.
+ [Skotlex]
+ * GS_FLING won't reduce armor defense when used on players. [Skotlex]
+ * Moved ignoreAll to state.ignoreAll so it saves some space. [Skotlex]
+ * Cleaned up clif_parse_Wis to prevent crashes from forged packets
+ [Skotlex]
+ * Cleaned up the implementation of the ignore list so it's more efficient.
+ [Skotlex]
+2006/11/20
+ * Implemented NPC_DEFENDER. Reduces ranged Physical+Misc damage by 80%
+ [Skotlex]
+ * Improved the battle config reader so it accepts hexadecimal values.
+ Updated the monster_ai description to make use of this [Skotlex]
+ * Added monster_ai&0x200. When set, mob skill delays are shared. That is,
+ if the mob has several lines with the same skill, when the skill is used,
+ the delay will be set to all of them, not just the one entry used.
+ [Skotlex]
+ * Corrected NPC_BARRIER so it grants 100 def/mdef (and not just mdef)
+ [Skotlex]
+ * Weapon ATK bonuses will now only apply to watk and NOT watk2 on players
+ (on players watk2 is refine bonus) [Skotlex]
+ * Corrected NPC_KEEPING. it should give 90 def, not 100 [Skotlex]
+ * You now can't use other skills while a skill-induced "window" is up
+ (teleport, refining, etc). However, be warned that we aren't quite sure how
+ the server will clear this out if you decide to hit cancel on the window,
+ so skill-blockage is likely to happen (temporary solution: whenever you
+ change maps or warp the state is reset server-side). [Skotlex]
+ * Fixed itemskill variable being cleared before parsing the skill, this
+ causes auto-casted teleport to fail to skip the skill menu. It is now
+ cleared on castend_pos/id directly. [Skotlex]
+ * Skills with state 'move_enable' will now do a "walk path" check between
+ target cell/object and caster instead of a "shoot path" check, this would
+ fix skills like snap or charge from letting you "teleport" across pits.
+ [Skotlex]
+ * Raised the amount of skills that can stack on a single cell before the
+ "in-area/out-area" detection code breaks to 24 (from 8) [Skotlex]
+ * Fixed a crash in clif_SkillInfoBlock if the passed player already
+ disconnected. [Skotlex]
+ * Added limiting drop rate to 100% from item-bonuses that depend on the
+ mob's level so that "@autoloot 100" will catch them. [Skotlex]
+2006/11/19
+ * Removed security check since source level patch is applied.
+ * Reverted select(), created prompt().
+ * Hack protection from packet monkeys in clif_parse_NpcSelectMenu. [Lance]
+ * Added 'cancel' button parsing in buildin_select menu system. Now scripts will continue
+ to load if 'cancel' is pressed and 255 will be returned. [Lance]
+
+2006/11/17
+ * Corrected use of the party invitation reply packet, thanks to FlavioJS.
+ [Skotlex]
+ * Fixed potential hack by modifying packet of whispers. [Lance]
+ * Fixed potential crash in IRC processing message with '%' using *printf. [Lance]
+ * Fixed memory leaking caused by homun_data not freed when removed. [Lance]
+ * Fixed client not validating the chat-kick-request packet, which can cause
+ crashes. [Skotlex]
+ * Updated map_quit to handle removing of players who are not even
+ authenticated yet. [Skotlex]
+ * New connection requests are now also blocked when there's a player
+ already online but hasn't finished loading yet. [Skotlex]
+ * Because of these changes, the friendlist notification when people join
+ has been moved to LoadEndAck from pc_authok [Skotlex]
+2006/11/16
+ * Updated sql files [Toms]
+ * For the sake of avoiding confusion, all script events are named with prefix 'On'
+ from now on. [Lance]
+ * Edited atcommand and charcommand syntax. Now it doesn't need the useless
+ character name and ":". [Lance]
+ * Shadow Jump and Kirikage won't "move" you if you use them in GvG grounds.
+ Fixed Kirikage so it first warps you, and then you unhide. [Skotlex]
+ * Corrected Zeny Nage so the Zeny spent on the attack is always the exact
+ same value as the damage you are dealing. Also corrected it so it does half
+ damage when used on players. [Skotlex]
+ * Overlapping song/dances will now cause dissonance/ugly-dance level 1
+ instead of retaining the level of their song/dance. [Skotlex]
+ * Fixed wrong check in @petrename, thanks to The Ultra Mage.[Skotlex]
+2006/11/14
+ * Early Christmas present. 3 new "features" which were very easy to code,
+ and should help scripters tremendously. Eapp is quite a way from being
+ ready, so these can't hurt:
+ * Implemented Karma: It turns out that when someone has karma, the client
+ believes this character is "evil", and will give you a cursor sword on top
+ of them automatically. So now the code will let characters with karma to
+ fight each other. This enables duels and other types of restricted pvp
+ where only the characters with karma can hit each others, and the rest of
+ players with neutral karma cannot be affected. Note that Karma cannot be
+ negative, and it can have any value between 0 and 256 (any non-zero value
+ makes them appear evil on the client). For now, characters with karma can
+ hit each other regardless of karma value, but perhaps it may be better to
+ let them to hit each other ONLY if they have the same karma (the whole
+ duel implementation COULD be cleaned up using Karma instead!)
+ * Added mapflags partylock and guildlock, which lock the state of the
+ parties/guilds on said maps:
+ partylock: blocks user party requests to create/invite/leave/kick
+ guildlock: blocks user guild requests to create/invite/leave/expel/
+ make alliance/make opposition/delete alliance/delete opposition/
+ break guild
+2006/11/13
+ * Fixed a bug where the char-txt server was incorrectly saving memos,
+ causing character data to be lost on restart. [Skotlex]
+ * HP Conversion will fail when used at max SP. It should not display any
+ errors to the client. [Skotlex]
+ * Modified yet again the login procedure to enable character variables to
+ work on item scripts. It SHOULD work crashless now. Please report any
+ problems it may cause.
+ * Volcano/Deluge/Violent Gale are now interchangeable, in the sense that
+ as long as one of these is out, casting any of the three will not consume
+ gems, and will use the remaining time of the previous one. In turn, Land
+ Protector will now always consume gems on every cast. [Skotlex]
+ * Small cleanup in the Land protector code which may fix it not blocking
+ AoE skills. [Skotlex]
+ * Fixed the interpretation of "head_dir". Removed setting head_dir to match
+ character direction in the whole code. Now it is only reset to 0 (look
+ forward) when unit_setpos is invoked, or when a character begins walking.
+ Thanks to FlavioJS for figuring out how the client parses the head
+ direction. [Skotlex]
+ * Moved status_calc_pc back to pc_authok. [Lance]
+2006/11/11
+ * Fixed debug message in login_sql [KarLaeda]
+2006/11/10
+ * Deluge/Violent Gale/Volcano tiles will now fail to be placed on cells
+ that are already ocuppied by anything else. [Skotlex]
+ * status_is_immune will now return 0 or the amount of immunity of the
+ target. In which cases it returns 100 for WoH and the GTB bonus when they
+ have passed the gtb_sc_immunity setting. This enables targetted spells to
+ not "fail silently" unless GTB's magic reduction is 100. [Skotlex]
+ * Fixed Homunculus being spawned as soon as they arrive from the
+ char-server even if the Master has not spawned on the map yet. [Skotlex]
+ * AL_TELEPORT now fails when used on top of Land Protector. [Skotlex]
+ * Some minor cleanings in pc_setpos, it may (or not) help fix that
+ homunc-caused "map_addblock" error message. [Skotlex]
+ * Corrected fog of wall, so that the deleted/doubled-duration effects are
+ calculated on a cell-by-cell basis. [Skotlex]
+ * Updated Land Protector: It will now delete/block effects of ALL ground
+ skills EXCEPT: Song/Dances/Traps (encores are still blocked). Land skills
+ blocked/deleted by LP also can't be casted on top of an existing LP. The
+ code uses the inf2 value of the skill to determine if it is a
+ song/dance/trap. [Skotlex]
+ * Ganbantein, mimicking LP, will now also remove ensembles. [Skotlex]
+ * Fog of Wall will fail when casted on top of a Volcano/Violent Gale
+ [Skotlex]
+ * Applied FlavioJS's fix to the npc whisper system. [Skotlex]
+2006/11/09
+ * Fixed status-change loading not working. [Skotlex]
+ * Fixed permanent mob-spawn script-events not working. [Skotlex]
+ * AL_CURE won't confuse undead players. [Skotlex]
+ * Corrected the Fog of Wall check so that it lasts 2x when it is placed on
+ TOP of a suiton/deluge, not when the caster is on top of them. [Skotlex]
+ * Updated status_check_skilluse so that when the caster has a disabling
+ status change (stun/petrify/etc) it will block the skill in all cases
+ EXCEPT on cast-end when the skill is ground-targetted. [Skotlex]
+ * Fixed Health Conversion skill formula bug. [Lupus]
+2006/11/08
+ * Fixed Desperado's hit-rate, now it behaves as it should. [Skotlex]
+ * The GVG map-packet will now also be sent for guild dungeon maps.
+ [Skotlex]
+ * Added clif_gospel_info which displays info about the buffs you are
+ receiving. Thanks to Rayce for the packet information. [Skotlex]
+ * Fixed Spider Web not ending when hit by a fireelemental attack. [Skotlex]
+ * Cast-time reductions from status changes will not be executed until right
+ before casting, to prevent status changes from ending when attempting to
+ cast and the attempt fails (invalid cells, not enough sp, wrong target,
+ etc, etc) [Skotlex]
+ * Added check to prevent Wand of Hermod from seeking for a partner to
+ encore, since the partner is supposed to be the warp. [Skotlex]
+ * Corrected the mob spawn reading code so that the event-name can be up to
+ 50 characters long (which is the actual event length) and so that it can
+ read spaces within them, it will also strip the leading/trailing quotes if
+ you use them so that the event is actually found on mob-death (so you can
+ do stuff like "My NPC::OnDead" as a valid event). [Skotlex]
+ * Moved the homunc inherit speed from the master from status_calc_pc to
+ LoadEndAck, since the hom's speed matches that of the master each time the
+ master changes maps. [Skotlex]
+2006/11/07
+ * Applied FlavioJs's patch which enables colored console output for Windows
+ systems. It also includes a config setting called
+ "stdout_with_ansisequence" with which you can turn off the color codes (in
+ case you are logging all output) [Skotlex]
+ * Added error reporting when the max number of ground unit cells has been
+ reached (this may be the reason why sometimes it fails to recognize when
+ you step out of a song/dance/encore) [Skotlex]
+ * Added passing the Endure effect to other devoted people. Note that the
+ "hit count" is individual for each character, and only when it ends on the
+ Crusader himself will that force it to end on everyone else. It also will
+ not transfer on gvg grounds, but it does transfer in pvp. [Skotlex]
+ * Fixed Reflect-Shield triggering Auto-Guard instead on devoted chars.
+ [Skotlex]
+ * Added a check to prevent casting ground skills on a target and vice-versa
+ when said skill use packets are received. It really shouldn't be
+ exploitable, but doing that certainly makes the server print a lot of
+ "unknown skill used!" messages. [Skotlex]
+ * Fixed map_foreachiddb and map_foreachpc so they don't encapsulate the
+ variable arguments into a double va_arg list. Thanks to the Ultra Mage for
+ the tip. [Skotlex]
+ * Cleaned up the clif_hate/mob_info functions with the correct fields/usage
+ as explained by Rayce. [Skotlex]
+ * Implemented clif_feel_hate_reset packet to properly display the Angel of
+ the Sun/Moon/Stars, thanks again to Rayce for the relevant information.
+ [Skotlex]
+ * LP will again block all land-stuff from being placed down on top of it
+ for the exception of Song/Dance/Encores. [Skotlex]
+2006/11/06
+ * Reapplied 'fix equipment scripts which are based on character variables not
+ working.' [Lance]
+ * Multiple Gunslinger skill corrections, refer to
+ http://ro.doddlercon.com/guides/gunslinger.html for information source:
+ [Skotlex]
+ - Corrected Ground Drift. Splash range of 3x3, stackable and placeable
+ underneath others, cast time is 2 secs. It's considered ranged, and it's
+ bonus damage increase is defense ignoring, always neutral.
+ - Corrected Bull's Eye implementation, it should deal normal damage against
+ non brute/demi-human targets.
+ - GS_DUST is now considered a short-range attack.
+ - Implemented Desperado's hit rate based on distance to caster as it's
+ believed to behave.
+ - GS_TRACKING's range is no longer affected by Snake Eye.
+ - GS_FLING's defense reduction is now 5*lv%
+ * Suiton's Speed/Agi penalty will affect everyone when used in versus maps.
+ * Corrected Kaupe so it doesn't ends on the first part of Soul Destroyer.
+ [Skotlex]
+ * Applied some cleaning to the way Tatami Gaeshi knocks back. [Skotlex]
+ * Cleaned up the way mobskill_use checks for the correct event. It should
+ fix unlimited mob-skill-casting issues. [Skotlex]
+ * Removed the return code entry when logging GM reload-GM requests
+ (login-sql),it'll just be stored as zero. [Skotlex]
+ * Added a fix on socket.c to not pick INADDR_ANY when choosing our own IP.
+ [Skotlex]
+ * Applied the correction on maprespawnguildid so that it parses ALL players
+ and not just those on a map. [Skotlex]
+ * TK_JUMPKICK now dispels normal aspd/speed potions (not berserk pitched
+ ones) and Preserve will be unable to block this. [Skotlex]
+ * Soul Linkers are now inmune to SA_DISPEL [Skotlex]
+ * You can now place everything (except magic skills) on top of LPs.
+ [Skotlex]
+ * Corrected Ganbantein to not touch song/dance/ensembles. [Skotlex]
+ * Status_calc_pc will refuse to execute if the player is still tagged as a
+ "new connection" and the invocation is not meant to be the first one.
+ [Skotlex]
+ * Swapped the order of checks in status_isimmune so that Wand of Hermod
+ skill blocking takes precedence over GTB's [Skotlex]
+ * Client packets will all be ignored while a player is not on a map until
+ the LoadEndAck packet is received. [Skotlex]
+ * Reverted changes, moved status_calc_pc(sd,1) back to pc_authok
+ since it causes problems. [Lance]
+ * Temperory fixed stability issue caused by initial status_calc_pc
+ being placed AFTER another status_calc_pc. [Lance]
+2006/11/05
+ * Updated sql files [Toms]
+ * Updated perl files acording to rev 9135 [Toms]
+2006/11/04
+ * Readded duel code in map_quit. Why it has been removed!? [LuzZza]
+ * Converted itemdb tables to use smallint. Credits to ALZ. [Lance]
+2006/11/01
+ * Reverted LK_Berserk HP requirement, as everything, including kRO X.2 and
+ pRO X.3, points that way. [Vicious]
+2006/10/31
+ * Fixed song/dance/encore cells not being placed down when casted on top of
+ a land Protector. [Skotlex]
+ * Update homunc's speed when master's speed changes, should avoid homunc's
+ speed = 0 on login (homunc's stats are calculated before master's stats) [Toms]
+ * When Kaizel (or super novice rebirth skill) triggers, you get debuffed
+ now. [Skotlex]
+ * Modified the player_cloak_check_type and monster_cloak_check_type
+ settings. 1 makes it check for walls, 2 makes cloaking NOT end on normal
+ attacks, and 4 makes cloaking NOT end when using skills. The default
+ setting for players is still 1, but for mobs the default has been changed
+ to 4. [Skotlex]
+ * Non-players can now use all skills while hidden. [Skotlex]
+ * Added a check to prevent adding negative damage to the total accumulated
+ damage in mob_damage. It could fix some exploits, even though mob_damage
+ should never be invoked with negative damage anyway. [Skotlex]
+ * Implemented the property where the first attacker get's double exp-share
+ than the others. Due to the way exp calculation is done, this bonus will
+ not apply when you use exp_calc_type 1 (damage/max_hp) instead of the
+ default (damage/total-damage). For now this bonus is done after calculating
+ who is the MVP character instead of before. [Skotlex]
+2006/10/30
+ * Fixed a little bug in event enqueue code [Toms]
+ * Updated the code so mobs can use ChainAction as a targetted skill.
+ [Skotlex]
+ * Added GroundDrift effects for Wind (Stun) and Fire (knockback). The
+ knockback value is unknown, so 3 is used for now. [Skotlex]
+ * Cleaned up some more the steal code, now you can't steal the last slot
+ regardless of skill level used. [Skotlex]
+ * Added consideration of Chain Action when cloning GunSlingers. [Skotlex]
+ * Modified battle_calc_return_damage to take the skill id as well, now
+ magic damage return will not work on skills tagged as ground or self
+ targetted. [Skotlex]
+ * Fixed Gank not working at all with the default max steal tries setting.
+ [Skotlex]
+ * Soul Drain won't work with skills tagged as self-targetted. [Skotlex]
+ * Improved the Suiton code so that the walk/agi penalty only applies to
+ enemies of whoever casted the skill. [Skotlex]
+ * Moved the initial status_calc_pc call to when you finish loading the map,
+ should fix equipment scripts which are based on character variables not
+ working. [Skotlex]
+ * Fixed getcharid according to samples and docs. [Lupus]
+ Thanks to joshuaali for pointing it out. eAPP has no such bug
+2006/10/27
+ * Fixed mob-skill event "skillused" not triggering at all. [Skotlex]
+ * Summoned mobs will only be removed from a map if their master is also
+ removed (dynamic mobs) [Skotlex]
+2006/10/26
+ * Updated sql files [Playtester]
+ * Experimental tweak to npc_parse_function - Overwrite existing functions. [Lance]
+2006/10/25
+ * Cleaned up some more the event dequeue code, it will no longer clear out
+ the npc_id if there's no events waiting to be executed (why does it clears
+ the npc_id anyway?) [Skotlex]
+ * Because of possible conflicts with this change and the on-login script,
+ now the on-login script is executed when the player has finished loading
+ into their start-up map rather than as soon as receiving the registry
+ variables from the char-server. [Skotlex]
+ * Some cleaning of the pc_eventtimer and pc enqueue code, it should fix
+ some memory leaks when the event counter does not matches with the actual
+ number of queued timers during logout. [Skotlex]
+ * Fixed "skill_sp_override_grffile: yes" causing crashes when parsing
+ Homuncuus/Guild skills. [Skotlex]
+ * Made the exp bonus settings be adjustable: [Skotlex]
+ - exp_bonus_attacker: Indicates how much additional exp a mob gives per
+ additional attacker (eg: 10 -> +10%*attacker)
+ - exp_bonus_max_attacker: Indicates at which number of attackers the bonus
+ is capped (eg: 5 -> 5 attackers, so a mob yield the same exp whether 5 or
+ 10 people attack it)
+ - Changed the way the party_even_share_bonus setting works. It now uses a
+ simple linear bonus increase (eg: 10 -> +10%*party member)
+ - The defaults are as explained by Tharis: +25%/attacker, capped at 12
+ attackers, no party bonus. The first two can be found in exp.conf, the last
+ one was left in party.conf
+ * MG_STONECURSE and NPC_PETRIFYATTACK now use time1 to specify the
+ "petrifying time". This value has been set to 5 seconds. [Skotlex]
+ * Now when SC_STONE is triggered from status-change cards, it's petrifying
+ duration will be passed as 0, causing the minimum (1 sec) to be used.
+ [Skotlex]
+ * Got rid of clones in src: old Novice Grounds map -> new_zone0? [Lupus]
+2006/10/24
+ * Removed again your mdef reducing "petrifying" time as apparently it can't
+ be reduced by mdef. [Skotlex]
+ * Cleaned up the "show_steal_in_party" setting so it only takes effect when
+ the item was successfully stolen (there was no point in telling you the
+ item couldn't be stolen due to being overweight) [Skotlex]
+ * Cleaned up the pc_steal_item implementation (again). It now uses a more
+ random, simple approach in each steal attempt. [Skotlex]
+ * Changed the way the skill_steal_max_tries work. Now it actually MEANS the
+ max number of steal tries, use 0 to disable (unlimited tries). [Skotlex]
+2006/10/23
+ * Added a bunch of important indexes when dealing with the log tables.
+ Added upgrade_svn9050.sql which adds these indexes as well. [Skotlex]
+ * Expanded the family check to work as it should, exp-share-range is
+ respected, and the child is not considered for it (thanks to TheUltraMage
+ for the investigation) [Skotlex]
+ * Double Casting will no longer fail when used. [Skotlex]
+ * Modified SC_STONE so that the duration of the "petrifying" time is 5 secs
+ reduced by your natural resistance to petrify (which is mdef%) [Skotlex]
+ * Modified the meaning of the third column in the skill_require_db. Instead
+ of MaxHP, this is now called MaxHPTrigger. This column (which was
+ previously unused by all skills) signals the limit HP% that you can have to
+ be able to use the skill. For example, setting it to 20 means the skill is
+ unusable if you have more than 20% life (note that this is merely a
+ threshold setting, it won't actually substract HP when used!) [Skotlex]
+ * Adjusted LK_BERSERK so you can only use it when you have 20% or less
+ life. [Skotlex]
+ * Removed NJ_TOBIDOUGU adding damage to W_HUUMA weapons which somehow got
+ readded. [Skotlex]
+ * When nonplayers use Cloaking, it will be forced to level 10 since mobs
+ shouldn't have movement/attack restrictions while walking cloaked.
+ [Skotlex]
+2006/10/20
+ * Made HAMI_CASTLE use clif_slide rather than clif_fixpos. This should
+ fix clientside problems when castling between two positions the (client)
+ path finding can't find a walkable bath between anymore. [blackhole89]
+ * Fixed the Homunc not spawning next to you after receiving it's data from
+ the char-server. [Skotlex]
+ * Fixed Charge Atk being able to go through chasm/pits. [Skotlex]
+ * Moved the homunculus DB information from the player structure to the
+ homun structure. Modified the homunculus creation packets to hold this
+ information during creation, also, all initial values are handled by the
+ map-server, the char server only assigns it a homun ID. [Skotlex]
+ WARNING: This is yet untested! It's very possible something could had
+ broken after changing the format/size of the homunc creation packets.
+ * Added config setting "summon_flora_setting", which it you can decide now
+ two things: a. Whether or not players can harm your floras outside versus
+ grounds, and b. Whether or not you can summon out and mix different types
+ of plants at the same time. [Skotlex]
+ * Likely fixed pc_steal_item always failing to steal (it was attempting to
+ steal random item IDs...) [Skotlex]
+ * Cleaned up a bit the mob on-death event so that when the killer is a
+ homunculus, it's master will be taken. Also, the variable killerrid will be
+ set before running the script to specify who delivered the final blow. If
+ the killerrid matches with the script attached player, you can be sure your
+ player did the final blow to the mob, otherwise, the attached player is who
+ did the most damage to the mob. [Skotlex]
+2006/10/19
+ * Cleaned up the log.c file. [Skotlex]
+ * Fixed log_chat not recording anything if the server is compiled in SQL
+ mode and sql_logs is turned off (it should then record to a plain txt file)
+ [Skotlex]
+ * Fixed SG_FRIEND, it should be triggering when Monks do Combo Finish (not
+ triple blows), and the trigger rate increase should be based on your known
+ level of SG_FRIEND, not TK_COUNTER. [Skotlex]
+ * Phantasmic arrow now knockbacks even if it misses. [Skotlex]
+ * Adjusted the way Monk combo times work. The combo time is now always
+ 300ms (adjusted by combo_delay_rate) which takes effect inmediately AFTER
+ your current skill's canact-delay (which is why the particular skill delays
+ were moved to skillcast_db) [Skotlex]
+ * Modified skill_delayfix so it performs the can-act reduction from agi/dex
+ for combos there. [Skotlex]
+ * Modified pc_steal_item so that it behaves more closely to the way it does
+ on Aegis. [Skotlex]
+2006/10/18
+ * Added a overflow check when calculating party exp share. [Skotlex]
+2006/10/16
+ * Adjusted UTSUSEMI/BUNSINJYUTSU so that they block range/melee weapon
+ attacks and only melee misc attacks. This isn't 100% correct, but it's a
+ better approximation to the way these skills behave. [Skotlex]
+ * Emergency call &16 (disable skill from nowarpto maps) will now NOT block
+ Emergency Call if that map is also a gvg-castle map. Makes it safe to turn
+ on this option to prevent usage from special maps (like Lhz3) without
+ crippling the skill during WoE. [Skotlex]
+ * Applied most of Mpeg's work on Ninja Skills. For information see:
+ http://gpegon.free.fr/ea/ninja_10-15-06_mpeg.txt [Skotlex]
+ * When reinvoking a combo-time, the previous combo time will be terminated.
+ This could fix the ongoing difficulties pulling off Monk combos. [Skotlex]
+ * Fixed Esma-state not ending after casting it. [Skotlex]
+ * Fixed @hominfo displaying intimacy on a 1/10k scale. [Skotlex]
+2006/10/14
+ * Homun info window to show crit value. As default, homun does NOT crit,
+ as monsters do not crit. This is purely for display purpose for players
+ to identify their homon's luk value. [Vicious]
+2006/10/13
+ * Base attack for non players is now calculated as str + [str/10]^2 (it
+ does not has +dex/5+luk/5 which players do have) [Skotlex]
+ * Fixed the char-sql server trying to read the gms off a "gm_db" config
+ setting stead of "login_db" [Skotlex]
+ * Corrected Throw Arrow/Musical Strike's damage formula [Skotlex]
+ * Altered Trick Dead. It doesn't prevents skills from being casted on you
+ now, but damage-based skills will do no damage. [Skotlex]
+ * Made the battle_config.attack_attr_none apply to pets when using the
+ "fixed damage" pet skill scripts. [Skotlex]
+2006/10/12
+ * made @killmonster make the mobs drop items again. [Skotlex]
+ * Added a temporary message when Angel of the Sun, Moon and Stars trigger
+ so you know it triggered. [Skotlex]
+ * When slaves_inherit_speed is set (which is also the default), homun will
+ have the same speed of their master when spawned. [Skotlex]
+ * When using Hatred and you already have a hate target, your current hate
+ target is displayed now. [Skotlex]
+2006/10/11
+ * Cleaned up the char-server code when the last point of a player is not
+ found. First it'll check if there's any mapserver online, and then, if
+ there is, it'll look for the major cities. If this fails, then the player
+ will be told server is closed instead of trying to send him to a "random
+ map". Will fix the char-server printing the misleading message "map
+ server not found, sending to major city" when in reality there just
+ aren't any map servers connected. [Skotlex]
+ * Corrected the mob damagelog structure so that you can't exploit it by
+ switching characters. [Skotlex]
+2006/10/09
+ * Fixed crash when char-server sends to a "random" map-server online on
+ connect. Thanks to TheUltraMage for pointing it out. [Skotlex]
+ * Should have fixed being petrified not reducing your defense and
+ increaseing your mdef. [Skotlex]
+ * Fixed SC_NOCHAT printing the "skills are now available" message twice on
+ natural expiration. [Skotlex]
+2006/10/08
+ * Updated sql files [Playtester]
+2006/10/06
+ * Updated Land Protector to block absolutely every land-based skills with
+ the exception of Encores/Dances. [Skotlex]
+ * Disabling status abnormalities will now reset a mob's target. [Skotlex]
+ * Mob morphing also resets their target now. [Skotlex]
+ * Monk combos no longer can ignore skill delay (delay skill for all their
+ combo-related skills is ASPD) [Skotlex]
+ * Now you can trade while in a chatroom. [Skotlex]
+ * Fixed homun-txt reading when the file has DOS line-type delimiters (\r\n)
+ [Skotlex]
+2006/10/05
+ * skill_blown will now trigger on-touch npcs on the landing tile. [Skotlex]
+ * Max trade distance has been reduced from 5 to 2. [Skotlex]
+ * Undisguising will now resend the cart-contents. [Skotlex]
+ * Added function npc_unload_duplicates(), it unloads all npcs that are a
+ duplicate of the passed one. For use with @unloadnpc to prevent crashes
+ when you unload the npc that has duplicates. [Skotlex]
+2006/10/04
+ * Bowling bash now always hits twice regardless of situation. [Skotlex]
+ * Added an underflow check to prevent sending to the client negative mdef2
+ value (for Frenzy'ed characters) [Skotlex]
+ * Modified pc_jobchange so that it automatically removes
+ peco/falcon/cart/homun if the new job you are changing to does not possess
+ the required skill for them. [Skotlex]
+2006/10/03
+ * Fixed a possible crash with @reloadmobdb due to pet loot timers.
+ [Skotlex]
+ * Fixed a possible crash and a memory leak on the login-SQL server when
+ parsing unban requests. [Skotlex]
+ * Renamed setting delay_dependon_dex to delay_dependon_agi, the delay of
+ skills is reduced now (when enabled) by AGI instead of DEX, which makes a
+ lot more sense than DEX. [Skotlex]
+2006/10/02
+ * Modified item-granded status resistance reduction to behave as explained
+ by Vicious (Ragnarok Monthly magazine) [Skotlex]
+ * Added the opt3 values to Eske [Skotlex]
+ * Fixed the txt->sql converter only saving the very first character
+ permanent variable. [Skotlex]
+ * Fixed the txt->sql converter saving account-wide variables as
+ character-wide ones. [Skotlex]
+ * Renamed nopenalty mapflag to noexppenalty. Using nopenalty will turn
+ on/off both noexppenalty and nozenypenalty now. [Skotlex]
+2006/10/01
+ * Removed the speed adjustment per level of Increase/Decrease Agility
+ [Skotlex]
+ * Fixed humunculi skill exploit, thanks to mr.rkit [Lupus]
+2006/09/30
+ * Rewrote the txt->sql converter. It now links directly to the char server
+ files so that it should get auto-updated with any code changes in the
+ later. [Skotlex]
+ * The converter will now also convert: account-wide variables, parties,
+ guilds, guild storage and guild castles. At this point the only two things
+ not converted are login-server-wide account variables (##, they belong to
+ the login converter) and homunculus (the SQL save function is messy and
+ doesn't lends itself to be integrated with the converter the way all the
+ other functions are). [Skotlex]
+ * misceffect2 will no longer cause the effect on top of the source object
+ when it is the fake npc. [Skotlex]
+ * Added check so that Frost Nova doesn't hides hitting animation on
+ targets. [Skotlex]
+ * Added the missing brackets around the trade logs condition check, thanks
+ to Coltaro. [Skotlex]
+2006/09/29
+ * Spurt state will now trigger on Soul Linkers as well. [Skotlex]
+ * Added a check un unit_run when unit_walktoxy fails. Should fix running
+ getting you stuck sometimes when running on diagonals near obstacles.
+ [Skotlex]
+2006/09/28
+ * Merged the necessary changes to make the script engine support negative
+ constants (db/const.txt). Thanks to Rayce (from jA) for the code. [Skotlex]
+ * Cleaned up the skill.c code to take into account when skill_unitsetting
+ returns null (skill failed), fixes a possible crash with Wand of Hermode
+ [Skotlex]
+2006/09/27
+ * Cleaned up status_get_party/guild_id, it should also fix a possible crash
+ when invoking such a functio on a masterless pet. [Skotlex]
+ * Sharp-Shooting will now display a skill animation. [Skotlex]
+ * The no_spawn_on_player setting will now also work for static mobs, but
+ only if the setting is set to 100 or higher. [Skotlex]
+2006/09/26
+ * Yet again messed with the packet sent during a splash attack, but this
+ time taking into account the packets that eA was using some many revisions
+ ago. Tests are needed to see if Magnum Break/Grimtooth don't spam the skill
+ animation anymore, and to see if GrandCross didn't break it's animation as
+ well. [Skotlex]
+ * Added function skill_dance_switch which handles converting overlapping
+ song/dances to dissonance/ugly dance. It should make the overlapping area
+ now behave completely like the mentioned song/dances (taking into account
+ interval and target type changes). [Skotlex]
+ * Updated battle_check_target so that non-offensive skills cannot be used
+ on a homun except for the homun and it's master. [Skotlex]
+ * Steal zeny won't work on treasure chests now. [Skotlex]
+2006/09/25
+ * Added an ugly check so that Heal will display 0 when healing a berserked
+ character (and it will again display full heal amount when healing a player
+ who's at full life) [Skotlex]
+ * Disabled again client-self-muting since it's causing too much trouble.
+ [Skotlex]
+ * Merged FlavioJS's script patch which should fix stuff like "mes ();"
+ causing crashes. [Skotlex]
+ * Item group reading will now complain when a line doesn't has enough
+ fields. [Skotlex]
+ * Fixed #baselevelup adding instead of substracting status points when used
+ with negative levels. Also made it reset your stats if there wasn't enough
+ to substract from. [Skotlex]
+ * Applied FlavioJS's suggestion of expanding WFIFOPOS to also take the
+ direction. This had the side effect of fixing the direction missing from
+ the mob spawn packet, which explains why all npcs face north when you are
+ within sight while doing a @reloadscript. [Skotlex]
+ * Changed the order of packets in TK_HIGHJUMP, may fix the reports of
+ getting stuck when jumping into a warp. [Skotlex]
+ * Changed a bit the code of marionette control, where a redefined local
+ variable may be the cause of mob-targetted Marionette Control stacking
+ stats up. [Skotlex]
+2006/09/24
+ * When the code auto-guesses that a skill should require ammo, it will
+ accept any type of ammo for using it instead of only arrows. Fixes Magnum
+ Break usage on Gunslingers. [Skotlex]
+2006/09/22
+ * Probably fixed a signed/unsigned mismatch warning on the new socket code.
+ [Skotlex]
+ * Fixed the "map server claims to have char online, but this other map
+ server also has it tagged as online" message triggering in some cases where
+ it shouldn't. [Skotlex]
+ * Fixed some maps in db/mapindex.txt being under the wrong id and added comments
+ so this will not happen again. [Zephiris]
+ --- ATTENTION! ---
+ People running TXT servers will have to tell their players to redo their /memo
+ points since the map ids of the old file were wrong.
+2006/09/21
+ * Fixed a bug on "select" when skipping empty entries when the selected
+ entry is the last. [Skotlex]
+ * Improved a bit RFIFOFLUSH as suggested by Harbin. [Skotlex]
+2006/09/20
+ * A mob's HP is set temporarily to 0 before invoking it's on-death script,
+ prevents said scripts being able to "rekill" the mob indefinitely (if stuff
+ like killmonster is used within) [Skotlex]
+ * Some small cleanups in chat.c [Skotlex]
+ * Fixed party_sub_count (TK_POWER) failing when the idle_no_share setting
+ was disabled. [Skotlex]
+ * Enabled Star Gladiators and Soul Linkers to do /doridori [Skotlex]
+2006/09/19
+ * Fixed nocommand mapflag causing the "you can't use commands on this map"
+ message to trigger one very single chat, instead of only for actual @/#
+ command invocation. [Skotlex]
+ * Added support for skipping empty string menu entries for the select()
+ command (just as `menu` has it already) [Skotlex]
+ * Fixed pc_set_hate_mob letting you place mobs on any of the three
+ positions regardless of size [Skotlex]
+ * The double continuation error will now display both scripts that
+ triggered it. [Skotlex]
+ * Loading the storage from the char-server will fail if player is already
+ tagged in final save state. [Skotlex]
+ * Removed setting ban_spoof_namer, sending invalid global-talk packets will
+ now just kick the player out of the server. [Skotlex]
+ * Added echoing messages back to self when using @/# commands on whispers
+ and party/guild messages, to prevent the client from muting yourself.
+ [Skotlex]
+ * Fixed some gcc4 warnings [Toms]
+2006/09/18
+ * Fixed Spider Web fire damage bonus. [Skotlex]
+ * Made Global chat always reply back to you even on @/# commands, this
+ prevents the client from muting yourself due to "hack". However, this same
+ fix isn't easily applicable to @ commands invoked from whispers or
+ party/guild messages, those are still pending. [Skotlex]
+ * Merged Meruru's update to socket.c, which includes a rewritten parse
+ function, which should hopefully be more efficient than the previous code.
+ [Skotlex]
+ * The new code includes support for two config settings
+ (packet_athena.txt): frame_size, which can be used to alter the logic
+ packet-size allowed by the code, and mode_neg, which when set to yes, sets
+ TCP_NODELAY on all connections (defaults to yes). [Skotlex]
+ * High-Jump is usable everywhere now, except that on maps where it
+ previously failed, now will just make you jump in place. [Skotlex]
+ * Fixed TK_RUN as per packets provided by AuronX. [Skotlex]
+ * Moved the equipment/card resistances to status ailments outside of
+ status_get_sc_def, so that they are applied only to rate, not duration.
+ [Skotlex]
+ * Modified the Asura code (again), hopefully movement sprite issues are
+ fixed now [Skotlex]
+ * @reloadscript scripts will no longer eliminate mobs with no respawn data.
+ But watch out for possible bugs (I think someone mentioned 1 extra
+ treasure box will spawn when you use it? This needs testing!) [Skotlex]
+ * Made speed_add_rate a linearly stacking increase. [Skotlex]
+ * Corrected a possible overflow when using show_mob_info to display the
+ mob's up as a percent. [Skotlex]
+ * Corrected the documentation for checkoption/checkoption1/checkoption2
+ [Skotlex]
+ * Reenabled client requesting to self mute, as the whole knockback packet
+ issues of the past which were causing players to mute themselves when being
+ knockback is no longer there. [Skotlex]
+2006/09/17
+ * Fixed NPC_INVISIBLE's cloak ending after attacking once. [Skotlex]
+ * Fixed SG_FUSION being castable without Soul Link state. [Skotlex]
+ * Moved the item-use restriction SC checks from clif.c to pc_use_item,
+ fixed Gravitation blocking potion usage on it's area of effect. [Skotlex]
+ * Sphere Marines and Summoned Flora are now inmune to class-changing.
+ [Skotlex]
+2006/09/16
+ * Added monster_ai&256. When set, a monster will pick a random starting
+ position to begin checking versus it's skills, otherwise, it will always
+ begin checking from the beginning. [Skotlex]
+ * Fixed the status change duration reduction equation was was totally
+ wrong, thanks to k3dt [Skotlex]
+2006/09/15
+ * Now mobs won't do a distance check to lose their target on every ai
+ iteration, but only when they finish walking (unless you set monster_ai&1)
+ [Skotlex]
+ * The chase distance before a mob gives up following a player has been
+ increased from view-size (range2) to min-chase (range3). [Skotlex]
+ * Reverted the Summon Flora change where all plants were being summoned in
+ one go. [Skotlex]
+ * Moved the weapon repair effect to where it belongs (after successfully
+ repairing an item) [Skotlex]
+ * Added config setting "friend_auto_add" (battle/player.conf), if set, when
+ you accept someone as your friend, both characters will show up on each
+ other's friend list. [Skotlex]
+2006/09/14
+ * Changed Extremity Fist's code to make you actually walk past your target,
+ which displays a much more correct "animation" for the skill. Thanks to
+ HiddenDragon for the information and code. [Skotlex]
+ * Updated the item_db search functions so that when returning the
+ dummy-item, it first updates the nameid to match the requested one, this
+ prevents pc_additem later on giving you an item with ID 500 instead of the
+ ID requested. [Skotlex]
+ * Added a clif_skill_nodamage packet when using Repair Weapon, just to see
+ what happens. [Skotlex]
+ * Likely fixed "half" of the alliance being saved, which ends up in guilds
+ that can attack another, but not viceversa. [Skotlex]
+ * Added deleting of saved Status changes on character delete for the
+ Char-TXT server. [Skotlex]
+ * Fixed the can-act delay never being checked when requesting to use
+ Homunculus Skills. [Skotlex]
+ * Fixed warmth skills draining SP of the target, not the caster. [Skotlex]
+ * When TK_DODGE triggers, it will no longer delay your attack or movement.
+ [Skotlex]
+ * Estimation /Sense/ whatever will no longer hide the vit bonus to mdef2,
+ as reported by Playtester. [Skotlex]
+ * Updated Summon Flora to summon the max number of possible plants on one
+ cast. It will consume as many bottles as monsters summoned. Also cleaned up
+ the function to be usable by non players. [Skotlex]
+ * Shadow Jump no longer goes over walls. [Skotlex]
+ * battle_calc_gvg_damage will be invoked in gvg maps regardless of woe
+ time. [Skotlex]
+ * NPC_MENTALBREAKER now zaps matk*lv SP based on observations by Tharis.
+ [Skotlex]
+ * md->class_ will be changed on mob-class-change to fix all class-change
+ related bugs. On respawn, the spawn data will be used to revert to the
+ original class. [Skotlex]
+ * Improved the pet skillbonus timer for "eternal bonuses" cases where the
+ bonus delay is 0. [Skotlex]
+2006/09/13
+ * SC_CHANGE cannot override itself anymore. This fixes being able to
+ "recast" the skill while it's still active to lengthen the duration AND
+ reheal the target. [Skotlex]
+ * Changed a bit the dnsbl lookup in the login servers to make it faster.
+ [Skotlex]
+ * Moved the pc rate modifiers from items
+ (hp/sp/matk/hit/flee/cri/flee2/def2/mdef2/def/def2/speed) from
+ status_calc_bl_sub_pc to status_calc_pc, as it simplifies code vastly, and
+ also fixes Osiris card not applying to said bonuses. [Skotlex]
+ * Fixed pc_damage_delay_rate not working, thanks to Orn. [Skotlex]
+ * Modified the nocommand mapflag so you can specify the GM range that is
+ blocked from using commands (eg: "prontera.gat mapflag nocommand 40"
+ disables commands to characters in the GM range 0~39) [Skotlex]
+ * Modified the char-server TXT whisper system to use the online_db to know
+ to which map server forward whispers, instead of just sending the whisper
+ to every map server. [Skotlex]
+ * Readded the setting TCP_NODELAY on socket.c to see if it fixes the
+ walk-lag issue. [Skotlex]
+2006/09/12
+ * Modified the login SQL server so that case insensitive lookups use "where
+ name = BINARY 'name'" instead of "where BINARY name = 'name'", since this
+ way the name index should be used, and performance will no longer be
+ heavily affected. [Skotlex]
+ * Modified main.sql to add 4 missing indexes (thanks to ErkDog): char_id on
+ the tables memo/friends, and online/name on the char table. Added
+ upgrade_svn8728.sql to add these indexes to already existing tables.
+ [Skotlex]
+ * Updated convert_engine.sql to use TYPE instead of ENGINE to be compatible
+ with Mysql 4 installations. [Skotlex]
+ * Moved the morph restrictions from skill_additional_effect to
+ mob_class_change, so that SA_MONOCELL will not convert clones, emperium, or
+ treasure boxes. [Skotlex]
+ * Fixed 'range' might be used uninitialized warning [Toms]
+ * Added Jaguar's sql script to convert all tables to MyISAM. It's located
+ in sql-files/convert_engine.sql WARNING: Using MyISAM is much faster than
+ InnoDB, but you are strongly recommended to backup your database before
+ switching engines since we don't know if eA is fully coded to work
+ correctly with MyISAM yet. [Skotlex]
+ * Added manual deletion of sc_data entries when deleting a character
+ (char-SQL) [Skotlex]
+ * Updated main.sql to use pure MyISAM tables, removed all foreign keys.
+ [Skotlex]
+ * Updated battle_switch to use strncmpi instead of strcmpi, it makes it so
+ using "yessir" will match "yes", this is actually needed because if you set
+ a config setting to "yes " (notice the trailing space), then the map config
+ engine fails to read it right, and will set the config setting to 0 (no).
+ [Skotlex]
+ * Some corrections to hate_mob cleanup when triggering the Angel stuff. [Skotlex]
+ * Updated the show_mob_info setting to add another space to the separating
+ pipes, so that each field is separated by " | " instead of " |". [Skotlex]
+ * Homunculus intimacy will go back to 500 on evolution. [Skotlex]
+ * Baphomet splash damage will now hit nearby enemies regardless of flee
+ (but the initial attack still has to connect for the splash to trigger)
+ [Skotlex]
+2006/09/11
+ * Modified set_nonblocking and setsocketoptions in socket.c, using eApp's
+ code as reference. Hopefully should improve performance somewhat. [Skotlex]
+ * Added a comment explaining what a comment is to login/char/map config
+ files, as well as the main script config file. [Skotlex]
+ * Modified SG_FEEL so that it works the same way that in Aegis
+ (packet-wise) [Skotlex]
+ * Added a comment to explain how to "remove" a string variable from the
+ msg_athena entries. [Skotlex]
+ * Summoned and slave mobs won't show up on @showmobs anymore. [Skotlex]
+ * Moved Spider Web damage bonus from battle_calc_damage to battle_attr_fix,
+ so that damage will be doubled based on the actual attack element.
+ [Skotlex]
+ * Adjusted autospell cards to trigger only on physical weapon attacks.
+ [Skotlex]
+ * Adjusted a bit the heal code, it should now show either the full heal
+ amount, or 0, depending on whether the target was healed at all or not
+ (this also means it shows 0 if you try to heal a full-life character.. but
+ it's the closest I've gotten to make it display 0 on Berserked chars)
+ [Skotlex]
+ * Memorize will be consumed even on instant cast spells now. [Skotlex]
+ * Berserk will end now if hit and remaining hp is less or equal to 100.
+ [Skotlex]
+ * Guild Aura will be removed on sc-load to prevent Guild Masters from
+ getting that bonus from the old implementation. [Skotlex]
+ * Added D-Kalck's fix of the TXT -> SQL converter [Playtester]
+2006/09/10
+ * Thanks to KarLaeda, added missing function in @showmobs [Lupus]
+ - Script function 'query_sql': In the TXT version it doesn't fill the array
+ and always return -1. Added for scripts compatibility. Your scripts
+ won't crash in TXT version. They can work it around.
+ I suggest we need a function getversion()
+ * Updated item_db.sql and mob_db.sql [Playtester]
+2006/09/09
+ * Added a crash protection in case mapfreeblock unlock tries to free a null
+ pointer. [Skotlex]
+ * Moved perfect_hiding from state to special_state, so that it clears out
+ when you remove your pet. [Skotlex]
+ * Probably fixed the Taekwon Rest skills. [Skotlex]
+ * Fixed a npc-timer memory leak on npc_unload ("[Warning]: ers_obj_destroy:
+ X entries missing, continuing destruction. Manager for entries of size
+ 16.") [Skotlex]
+2006/09/08
+ * Unified the rest and ganster paradise code into a single function.
+ [Skotlex]
+ * Moved the Happy State trigger to the regen function, it now triggers at
+ the same time SPTIME does. [Skotlex]
+ * Cleaned up SG_HATE, hope it works now. [Skotlex]
+ * Removed sg_miracle_skill_duration, replaced it with
+ sg_miracle_skill_min_duration and sg_miracle_skill_max_duration, to specify
+ a range for the duration of the skill. [Skotlex]
+ * Added upgrade_svn8675.sql in case, for some reason, your guild table
+ still has the emblem_data field as a 'blob' with "NOT NULL" specified.
+ [Skotlex]
+ * Fixed alliance/opposition making not cancelling out map-server-side when
+ the guild already had max number of alliances/oppositions (thanks to k3dt)
+ [Skotlex]
+2006/09/07
+ * Fixed SC_BERSERK setting Hp to 100 when dispelled by unnatural means (eg:
+ wand of hermod) [Skotlex]
+ * Cleaned up the doridori parse clif function. [Skotlex]
+ * Merged some of mpeg's work on NJ skills [Skotlex]
+ * Removed the Warmth "stacking" code. [Skotlex]
+ * Added back the effect of /doridori to skill-SP regen [Skotlex]
+ * Implemented a rough version of Angel of the Sun/Moon/Stars, it has a low
+ chance of triggering on doridori-boosted SP-regen events. However, it has
+ no client-side messages yet (need to add these in) [Skotlex]
+ * Added sg_angel_skill_ratio to specify rate at which the Angel skill
+ triggers. [Skotlex]
+ * Added unit_cancel_combo which takes care of ending a combo time and
+ resuming normal attack 'inmediately' [Skotlex]
+ * Cleaned up some the SG_HATE code, you can't change hate targets anymore.
+ [Skotlex]
+2006/09/06
+ * Fixed the memset in status_calc_pc, corrects some mysterious bugs such as
+ item-drop bonuses suddenly not working anymore. [Skotlex]
+ * Corrected SC_INCREASEAGI and SC_DECREASEAGI speed-change formula.
+ [Skotlex]
+ * Fixed Aex Aeterna ending on Soul Breaker's first half. [Skotlex]
+ * Applied Orn's modification on speed increases/reductions with increase/
+ decrease agi [Toms]
+2006/09/05
+ * Removed setting mob_show_hp, it's been replaced now by mob_show_info,
+ which can be used to specify what kind of info should be displayed from a
+ mob. Current options are two different formats for Hp display, and current
+ level (monster.conf). [Skotlex]
+ * Fixed Signum Crucis Def reduction being 10+2*lv% instead of 10+4*lv%
+ [Skotlex]
+ * Applied the Ultra Mage's suggestion to have the map server strip trailing
+ spaces/comments from the config files. It will also now print out when an
+ unknown config setting is found. [Skotlex]
+ * Fixed status change resistance not being invoked at all for pretty much
+ all cases. [Skotlex]
+ * Corrected SC_INTRAVISION not starting. [Skotlex]
+ * Fixed crash when attempting to read a Label as a string on a script
+ (thanks to End of Exam) [Skotlex]
+ * Fixed possible crash when changing a chat-room's owner (thanks to End of
+ Exam) [Skotlex]
+ * Fixed dispell removing SC_NOCHAT [Skotlex]
+ * Small fix which should correct skill_attack damaging hidden characters
+ when it shouldn't. [Skotlex]
+ * Fixed connect_until field being a smallint rather than int in the login
+ table (upgrade with upgrade_svn8630.sql) [Skotlex]
+2006/09/04
+ * Fixed crash when using Adaptation during an Encore. [Skotlex]
+ * Should have fixed manner being reset to 0 on logout while muted.
+ [Skotlex]
+ * Removed status_get_sc_tick, duration and chance are now both handled by
+ status_get_sc_def (this means status change duration and success rate
+ both will always follow the very same formula) [Skotlex]
+ * Fixed mob-kill experience getting screwed up when characters who did
+ damage die/logout at the moment the mob dies. [Skotlex]
+ * Should have fixed "sleep", thanks to Lance for figuring out the error.
+ [Skotlex]
+ * SC_REFLECTSHIELD will now be passed to devoted characters at cast-time.
+ [Skotlex]
+ * Added a check to make a mob's level 1 if the read level from the db is
+ less than it. [Skotlex]
+ * status_calc_misc will now be invoked in status_calc_bl even on the first
+ call, since status could have gone up due to skill bonuses. [Skotlex]
+ * Moved max HP/SP calculations to before invoking status_calc_misc
+ [Skotlex]
+ * Simplified distance and check_distance to use "aegis" methods (greater of
+ dx/dy = distance), there's a new define in map.h called CIRCULAR_AREA, when
+ set, the previous method is used, and "for each in range" calls will also
+ check for distances, making most ground skills and battle system use real
+ circles instead of squares. [Skotlex]
+2006/09/03
+ * Fixed SC_BERSERK's no regen penalty lasting pretty much forever.
+ [Skotlex]
+2006/09/02
+ * SC_REGENERATION's val4 now holds the RGN flag of what is blocked rather
+ than blocking all types of regen. [Skotlex]
+ * LK_BERSERK will now only block natural regen on state-end. [Skotlex]
+ * SC_EXTREMITYFIST/SC_DANCING/SC_EXPLOSIONSPIRITS will only block natural
+ sp regen and not skill regen [Skotlex]
+ * SC_REGENERATION blocking will be cancelled on logout now. [Skotlex]
+ * Corrected SCB_LUK not updating SCB_BATK as well. [Skotlex]
+2006/09/01
+ * Corrected script_commands description of getequipid, it returns -1, not 0
+ on fail. [Skotlex]
+ * Fixed the mob-id check during pet_db loading, it will also now print when
+ a pet is not loaded due to having an invalid mob class specified. [Skotlex]
+ * The "delete_timer error/no such timer" report will now print the related function [Toms]
+ * The Clearing unused stack report will now print the related NPC [Toms]
+ * The duplicate npc report will now print the related file name [Toms]
+ * Added config setting "partial_name_scan", which specifies whether @ given
+ names should use a partial string lookup or absolute name lookup. Defaults
+ to no (gm.conf) [Skotlex]
+ * Expanded status_calc_misc so it may also calculate the batk of characters
+ as well as their regen data (if they have it) [Skotlex]
+ * Fixed a memory leak when using charsave_method:1 [Skotlex]
+ * Soul Breaker will now be affected by Lex Aeterna on both parts of the
+ attack. [Skotlex]
+ * Status changes with no skill and no SCB* data will now go through if they
+ have an SI* icon. This should fix SC_MIRACLE [Skotlex]
+ * Reverted switching a mob's adelay/amotion when the later is longer than
+ the former, now both get updated to amotion. [Skotlex]
+2006/08/31
+ * Moved the intimacy penalty of HFLI_SBR44 and HVAN_EXPLOSION to
+ skill_counter_additional_effect [Skotlex]
+ * Simplified skillnotok_hom by using an invocation to skillnotok [Skotlex]
+ * Hopefully fixed BD_ADAPTATION [Skotlex]
+ * Homun won't lose any intimacy on death now. [Skotlex]
+ * Homun will be saved together with the master now (as long as the homun is
+ active) [Skotlex]
+ * Modified the error reporting in map_freeblock_unlock so that when there's
+ an error, the reported line number is the file's linenumber plus the
+ object's type *10000. This is for debug information to help track down the
+ already-freed error. [Skotlex]
+ * pc_adopt will now preserve the kid's job/job-level/experience. This means
+ that if you adopt a Swordman level 45, it will become a baby-swordman level
+ 45, with the exact same exp as before. [Skotlex]
+ * Fixed new mob's name not sent to the client when the mob is morphed [Toms]
+ * Added setting attack_walk_delay which specifies whether a character
+ should (or not) be able to move inmediately after starting a normal attack
+ (battle.conf). Defaults to 0 since that's what Aegis uses. [Skotlex]
+ * Fixed @summon's delete timer being screwed up. [Skotlex]
+ * Cleaned up a bit the summon script command. [Skotlex]
+ * Fixed the clone script command's delete-timer being screwed up. [Skotlex]
+2006/08/30
+ * Skill required-state will now only be checked on cast-begin, not
+ cast-end. [Skotlex]
+ * Added a check in status_calc_pc to prevent player rate adjustments from
+ from going below 0. [Skotlex]
+ * Removed sending normal-damage packets instead of skill packets for
+ splash-damaged skills, since... well, that's how Aegis does it. [Skotlex]
+ * Updated HLIF_CHANGE to work as explained by Tharis -> It now adds 30*lv
+ vit and 20*lv int, is dispelled on warp, and can-act delay is 5+5*lv
+ minutes. Hp/Sp is no longer set to 10 after a forced expiration. [Skotlex]
+ * Fixed up char-sql compilation. [Skotlex]
+ * Added a message to @clearweather stating when climate changes will
+ dispel. [Skotlex]
+ * Corrected @hidenpc saying that it's command name was "@npcoff" [Skotlex]
+ * Updated itemdb reading on the char-sql server so that it reads both
+ item_db and item_db2 files (totally untested yet) [Skotlex]
+2006/08/29
+ * Added printing out whenever the irc-module attempts to connect, to debug
+ whether the map-server lag is due to this or not. [Skotlex]
+ * Mobs will now always chase players using hard-path seeks. [Skotlex]
+ * monster_ai&1 now only signals whether mobs should update their target
+ cell while chasing more frequently (rather than being state-driven like
+ Aegis) [Skotlex]
+ * Changed the defaults of view_range_rate and chase_range_rate to 120 to
+ aproximate better Aegis's view ranges (which are square areas and not
+ circles) [Skotlex]
+ * Applied Mpeg's work on GS [Toms]
+ ( http://gpegon.free.fr/ea/gunslinger_08-29-06_mpeg.txt )
+ * Fixed a syntax error in @showmobs [Toms]
+ * Added @showmobs. It shows selected mobs on your mini-map (excluding
+ mini-bosses & MVP) thanks to KarLaeda for the command [Lupus]
+2006/08/28
+ * Modified the dancing code and Moonlit Petals in particular, so that it is
+ treated as an ensemble like any other, it will just knockback people when
+ they step into it. [Skotlex]
+ * The memory leak reports will now print out in the logs also the revision
+ they belong to. [Skotlex]
+ * Cleaned up the scriptable npc-shop code, it should be crash-proof now.
+ [Skotlex]
+ * Added TK level-up buffs to SG too, and extended them to 10 min [DracoRPG]
+ * Added "Barefeet Mastery" effect to TK_RUN (thanks Tharis for both) [DracoRPG]
+ * Changed the produce_db format, now there's a skill-lv column right after
+ the skill-id column to specify required skill-level to craft this item.
+ [Skotlex]
+ * Modified the skill produce_db code to take into account the new skill-lv
+ requirement. [Skotlex]
+ * Fixed exp bonuses applying twice for the job-exp [Skotlex]
+ * @reloadbattleconf will now also update the ragsrvinfo table on the
+ char-server. [Skotlex]
+ * Fixed homun hp/sp growth rates stacking with HP/SP passive increasing
+ skills. [Skotlex]
+2006/08/27
+ * Fixed undefined reference to 'malloc_set' in log.c [Toms]
+ * Updated svn-revision reading, now it can read the new svn file system [Toms]
+ * Fixed a bug with homunc which could spawn on a non-walkable cell [Toms]
+2006/08/26
+ * Optional macro MEMSET_TURBO for faster low-level memory initializations. [Lance]
+ * Small bug fix in read_homunculus_expdb (a warning was always displayed) [Toms]
+ * Small adjustment on the mob_ai code which could fix mobs not chasing you
+ if you hit them from the maximum possible diagonal distance. [Skotlex]
+2006/08/25
+ * Cleaned some the skill unit removal added flag so that it signals whether
+ the skill is being force-removed, or it has "naturally expired". [Skotlex]
+ * The following skills will display a normal attack animation now:
+ NPC_WATERATTACK, NPC_GROUNDATTACK, NPC_FIREATTACK, NPC_WINDATTACK,
+ NPC_POISONATTACK, NPC_HOLYATTACK, NPC_DARKNESSATTACK,
+ NPC_TELEKINESISATTACK, NPC_SPLASHATTACK
+ * Skills that require a weapon and consume spirit spheres will no longer be
+ auto-tagged to require ammo. [Skotlex]
+ * Now MISC skills with delay 0 will also use the attack delay (if the skill
+ is tagged to do damage) [Skotlex]
+ * Added script commands roclass/eaclass to enable scripts to access eA's
+ job format. Read script_commands.txt and ea_job_system.txt for a more
+ complete explanation of how this job system works. [Skotlex]
+ * Added a flag to skill_delunitgroup, skill_delunit & skill_unit_onlimit.
+ If 1 is passed, it will avoid UNT_WARP_ACTIVE to be transformed in
+ UNT_WARP_WAITING and will destroy it. [Toms]
+ ( To avoid such crash : http://www.eathena.ws/board/index.php?showtopic=114102
+ when the code need an empty slot and the oldest one is UNT_WARP_ACTIVE )
+2006/08/24
+ * Little cleanup on homunc's code [Toms]
+ * Modified @reloadmobdb & @reloadskilldb to reload homunc's db too [Toms]
+ * Now when a mob's adelay is set to be less than the amotion, both values
+ will be swapped (this is an attempt to understand how those mobs actually
+ work on aegis) [Skotlex]
+ * script command "isrefine" will no longer return always false for equip
+ positions above 6 (this has not been needed since the addition of the
+ refine column to tbe item_db many months ago) [Skotlex]
+ * Added NPC_CRITICALSLASH to the list of skills that display as a normal
+ attack. [Skotlex]
+ * Reverted the previous change, changed the pet capture code to try to
+ capture a mob based on their view class rather than actual class.
+ [Skotlex]
+ * Fixed the md->class_ variable not being updated when a mob's class is
+ changed. [Skotlex]
+ * Added setting clear_skills_on_warp to specify when a character's
+ land-based skills are deleted when the caster changes maps. Defaults to all
+ types. [Skotlex]
+ * Should have fixed Brandish Spear not passing the flag to skill_attack,
+ causing it to do miserable damage. [Skotlex]
+ * Warp Portal will no longer be removed when caster steps through it (this
+ is left to the new clear_skills_on_warp setting) [Skotlex]
+ * Cleaned up status_percent_change to switch equations when the target has
+ high hp to prevent overflows, also it will directly take hp/maxhp when a
+ rate of 100 or higher is passed to prevent calculations. [Skotlex]
+ * Traps and Land Elemental fields are no longer automatically removed on
+ map change (handled now by clear_skills_on_warp) [Skotlex]
+ * traps_setting &2 no longer does anything (handled now by blah blah)
+ [Skotlex]
+ * Applied some change from mpeg on Ninja Skills [Toms]
+ * Put HVAN_Explosion based on max_hp instead of current hp [Toms]
+2006/08/23
+ * Fixed mob_clone_spawn completely ignoring the mode variable. [Skotlex]
+ * Fixed Energy Coat reducing and consuming more than it should when you
+ have 100% SP [Skotlex]
+ * Cleaned up getmapxy script function, also added support for type 4 so
+ that it returns a player's homunculus position if such exists. [Skotlex]
+ * SC_ARMOR_ELEMENT looks like gone away from status_change_start since ... rev 6791.
+ Try to reimplement it. [Toms]
+ * Fixed HVAN_EXPLOSION [Skotlex]
+ * Frost Nova won't display a nodamage skill packet (still need to sort out
+ a way to fix the splash damaged packets) [Skotlex]
+ * Fixed a possible SIGSEGV on buildin_maprespawnguildid if the map is unknown [Toms]
+ * Added debug on "Inifity loop" to know which script is making this loop [Toms]
+2006/08/22
+ * More fixes to the splash code. Kamaitachi and Sharpshooting should
+ display correctly now. [Skotlex]
+ * Fixed a crash on the mobspawn script command. [Skotlex]
+ * Made SC_FLEET increase batk as well as watk. [Skotlex]
+ * Fixed gcc warning [Toms]
+ * Fixed AM_REST not closing the homunc status window [Toms]
+ * Fixed SC_NEN according to Mpeg [Toms]
+ * Added a ShowStatus("Terminating...\n") on login-server_sql [Toms]
+ * Some corrections to make Tatami Gaeshi work correctly. [Skotlex]
+ * Fixed SBR44 doing 100% more damage than it should. [Skotlex]
+ * Some more work on the splash skill code. Now splash-damaged enemies
+ should show no animation at all, just the damage-number, while only the
+ targetted character should still display the full skill animation.
+ [Skotlex]
+ * Modified the homun-txt file-save format to separate the name from the
+ rest of fields with tabs (like character saving does), this may fix homun
+ save/loading when using non-latin characters on the name, but be warned
+ that it also means the previous homun-data files are lost! (unless you
+ replace the comma before the start of a name with a tab) [Skotlex]
+ * getnameditem will now also work on stackable items [Skotlex]
+ * Corrected battle_calc_weapon_attack so that all skills ignore your
+ left-hand weapon, and that the Katar's double-attack damage bonus for the
+ offhand damage applies ONLY on normal attacks. [Skotlex]
+ * Fixed Resurrect Homunculus's % to 20*lv% [Skotlex]
+ * Added SQL update which should remove \' from guild names [Toms]
+ * Added option to disable character deletion of certain levels [Lupus]
+ check char_athena.conf for this option format
+2006/08/21
+ * Some more cleaning up of the splash skill code. Now the passed hit value
+ for the splash targetted mobs is 9 instead of 5, this allows multi-hitting
+ splash skills to display the number of hits correctly. [Skotlex]
+ * Fixed call homunc bug when the homunc was vapo and the master has change
+ of map [Toms]
+ * Fixed SQL-Guild Creation, guild name was escaped 2 times [Toms]
+ * Some cleaning of the splash skills. Updated skill-attack to enable again
+ passing of flag 0xF000 which signals that the skill level sent to the
+ client should be -1 (no skill name shouted). Should (hopefully) clear/clean
+ up a bunch of splash damage skill animation-related packets. [Skotlex]
+ * Homun saving won't cap hp/sp to max hp/sp since a homun can have higher
+ hp/sp than the one stated in the db (due to skill bonuses or status
+ changes) [Skotlex]
+ * Cleaned up some more the regen_data structure, so that
+ skill/sitting-skill related data is optional (since only players have it).
+ [Skotlex]
+ * Fixed AM_RESURRECTION, thanks to RockmanEXE for %HP values [Toms]
+ * Fixed HAMI_CASTLE, HAMI_DEFENCE & HLIF_AVOID [Toms]
+ * Adjusted Glittering's success rate to 20+10*lv% [Skotlex]
+ * Corrected isequipped() so that cards will not be tagged as "used up"
+ unless all the specified items were found. [Skotlex]
+ * Fixed a confusion in skill_attack using the src instead of dsrc for some
+ calls, which was causing some problems with the KAITE check from AoE
+ spells. [Skotlex]
+ * Fixed ASC_BREAKER's misc damage part not having the ignore-element flag
+ set. [Skotlex]
+ * Moved homunc battle conf from misc.conf to homunc.conf [Toms]
+ * Some cleaning in skill.c in regard to homun skills. [Skotlex]
+ * Madness Canceller now stacks with other aspd bonuses, just like Berserk
+ does. [Skotlex]
+ * Removed config setting "muting_players", and expanded the manner_system
+ config to specify how having negative manner (mute) affects a player (see
+ battle/misc.conf). [Skotlex]
+ * Expanded the pk_mode setting from no/yes to 0/1/2. 1 is normal pk_mode,
+ if 2 is used, it makes killing players give you a loss of 5 manner points.
+ [Skotlex]
+ * Fixed WS_WEAPONREFINE always failing when at less than job 50. [Skotlex]
+ * Fixed the Autosave routine not working when there's only one player
+ online. [Skotlex]
+ * Disabled command @rain since the client no longer supports it anyway.
+ [Skotlex]
+ * Fixed delitem not checking for the first slot's card, also optimized it
+ so that it doesn't checks on the other slots. [Skotlex]
+2006/08/20
+ * Added a check during mob_db loading so that the six basic stats, max hp
+ and max sp are never below 1, as this could cause crashes when using
+ certain skills. [Skotlex]
+ * Gravitation now only blocks the caster from using potions. [Skotlex]
+ * Corrected Madness Canceller letting you walk while the effect lasts.
+ [Skotlex]
+ * Splitted yet again ASC_BREAKER into a two-part attack. This time the
+ int-based damage is a MISC type attack, and gets reduced by skills as such.
+ [Skotlex]
+ * Fixed "int format, long unsigned int arg" warning [Toms]
+ * Fixed a warning when using cap_value(x, 0, x) on an unsigned value [Toms]
+ * Added clif_skill_fail for homunc to skill_castend_id & skill_castend_pos [Toms]
+ * Fixed homunc skill 8016 not considered as homunc skill [Toms]
+ * @useskill will now cause your homun to use the skill instead of you if
+ the skill is a Homun skill and you have an active homunculus. [Skotlex]
+ * Reduced the Success Chance of GS_FLING to 10+10*lv% (Playtester told me
+ that Vicious told him the chance was much lower like that) [Skotlex]
+ * Fixed some Homunc issues with HR servers (capping some values) [Toms]
+ * Added @hominfo command to obtain real values (not capped ones) [Toms]
+2006/08/19
+ * Fixed @homlvup bug [Toms]
+ * Fixed AM_REST & AM_RESU consumming SP if they fail [Toms]
+ * Fixed homunc spawning bug (they was spawned after an AM_REST + master warp for example)[Toms]
+ * Fixed GS_GROUNDDRIFT [Skotlex]
+ * Increased chance of GS_DESPERADO connecting to 20% [Skotlex]
+ * Fixed battle_calc_base_damage being called for the left hand even for
+ non-dual-wielding attacks. left-hand damage was being set to 0 later
+ anyway, so no exploit existed. [Skotlex]
+ * Moved the weapon_atk_rate bonus to battle_calc_base_damage so that it'll
+ apply correctly when dual-wielding different types of weapons. [Skotlex]
+ * Fixed job-mask 0x100000 in the item_db enabling Dancers/Bards to use the
+ items (0x80000 should be for them and 0x100000 should be currently unused)
+ [Skotlex]
+ * Fixed a possible sigsegv when deleting lif under Mental Change [Toms]
+ * Fixed HAMI_CASTLE [Toms]
+ * Fixed HLIF_CHANGE [Toms]
+ * Updated HLIF_BRAIN skill [Toms]
+ * Fixed homunculus intimacy on feeding [Toms]
+ * Added homunculus_friendly_rate battle config [Toms]
+ * Some compilation warnings fixed [Toms]
+ * Added skill's required item check on homunc skills [Toms]
+ * Add Condensed Red Potion as a required item for HLIF_HEAL [Toms]
+2006/08/18
+ * Little code cleanup on last fix [Toms]
+ * Fixed HLIF_HEAL healing the homunc instead of the master [Toms]
+ * Fixed HLIF_AVOID not increasing walk speed of master [Toms]
+ * Fixed the atk_rate (Turtle General Card) bonus not working on
+ dual-wielders. [Skotlex]
+ * Made HLIF_HEAL a self skill that auto-selects target to caster's master.
+ [Skotlex]
+ * Implemented SC_BLOODLUST and SC_CHANGE, cleaned up HLIF_CHANGE [Skotlex]
+ * Applied a correction to HVAN_EXPLOSION [Skotlex]
+ * Fixed Homun ASPD calculation being able to underflow and give you min
+ speed. [Skotlex]
+ * Added monster_ai&128 to make aggressive mobs ignore that behaviour of
+ always picking Homun targets above player targets regardless of who is
+ closer. [Skotlex]
+ * Fixed homun info packet being unable to display HP/SP correctly once the
+ values are above 32k. [Skotlex]
+ * Applied Mpeg's work on ninja [Toms]
+ * Fixed @homlvup [Toms]
+ * Added guild_aura (skill.conf) setting so you can specify when it works
+ and if it works on the guild-master itself. Defaults to working all the
+ time on everyone except GM. [Skotlex]
+ * Little code cleanup [Toms]
+ * Cleaned merc_hom_evolution to avoid free'ing/realloc'ing [Toms]
+ * Fixed "args of aFree is freed pointer" on Homunc deletion [Toms]
+ * Changed unit_free so that it receives which cleartype should be used when
+ the character is still on a map. Used this on status_damage so that mobs
+ that do not respawn when killed will properly display the death animation.
+ [Skotlex]
+ * Fixed Energy Coat consuming 10x less SP per hit than it should.
+ * Fixed signed/unsigned comparison issues with natural heal system [Toms]
+2006/08/17
+ * Vaporize will no fail when the homun is dead. [Skotlex]
+ * Corrected thhe double free issue that occurs when a homun dies and has no
+ intimacy left. [Skotlex]
+ * Fixed the charsave_method:1 saving/loading exp as signed ints rather than
+ unsigned. [Skotlex]
+ * Applied use of structure regen_data for a unified regen module. Natural
+ and skill-heal is handled by this structure, while sitting-skill-heal is
+ still player dependant (mostly because the other object types can't sit)
+ [Skotlex]
+ * Cleaned up the status calc code for homun by moving it from
+ status_calc_bl_sub_homun to status_calc_homun (where it should had always
+ been) [Skotlex]
+ * Updated SQL files [Playtester]
+ * Corrected map_random_dir algorithm [Toms]
+ * Fixed homunc natural heal and little code cleanup [Toms]
+ * Changed AM_CALLHOMUN Skill to spawn the homunc at 1 cell from his master [Toms]
+2006/08/16
+ * Fixed being unable to recast Adrenaline Rush to reset the duration
+ timers. [Skotlex]
+ * Cleaned up skill_get_range2 so that using range 0 for non-self skills
+ uses the caster's attack range. [Skotlex]
+ * Fixed AM_CALLHOMUN checking for an embryo when you have a vaporized
+ homun. [Skotlex]
+ * Spirit of Wizard will now consume an item 7321 each time it blocks
+ reflected magic. [Skotlex]
+ * Added script command jobname, retrieves a given's class name as per the
+ appropiate msg_athena.txt entry (this command should had been added years
+ ago) [Skotlex]
+ * Fixed null-pointer crash on Evolving a homunculus. [Skotlex]
+ * @produce now can make any kind of equipment [Skotlex]
+ * Made HLIF_AVOID and HAMI_DEFENCE cause the status change on both caster
+ and target. [Skotlex]
+ * AM_REST shouldn't be checking for a range now (since it's a self skill)
+ [Skotlex]
+ * Updated mob_ai so that mobs will use their rude-attacked skill when they
+ can't reach their current target. [Skotlex]
+ * Fixed the default txt config making pets be saved to the homun file
+ instead of to the pet file. [Skotlex]
+ * Now arrow-consuming skills where your main weapon is a whip or musical
+ instrument WILL count as arrow-type attacks, using the atk of the arrow and
+ all related bonuses. [Skotlex]
+ * Fixed some homun timer initialization code. [Skotlex]
+2006/08/15
+ * Applied multiple fixes which should take care of making homun save/load
+ work on TXT now. [Skotlex]
+ * Added Gatling Fever's batk bonus. [Skotlex]
+ * Some cleaning in status_damage which should prevent trying to free
+ already free'd pointers when unit_remove_map invokes unit_free (when
+ status_damage was going to invoke unit_free anyway) [Skotlex]
+ * Delete homunc's skills from sql when the homunc is destroyed [Toms]
+ * Homunc Timers should be disabled when the homunc is vaporized or dead an re-enabled on call/resu [Toms]
+ * Updated vc-project files to compile with the new int_homun files.
+ [Skotlex]
+ * Hopefully fixed the crash when using charsave_method = 1 [Skotlex]
+ * Moved s_pet structure from map_session_data to pet_data, this enabled the
+ removal of a few redundant values in the pet_data structure (name, class,
+ equip) [Skotlex]
+ * Cleaned up some of the pet related @/# commands, same for some script
+ commands. [Skotlex]
+ * Pet offensive skills who's inf value is self will be casted on the pet
+ now (for stuff like Grand Cross) [Skotlex]
+ * Added homun saving/loading support to char-TXT. Note that this is
+ completely untested, so it may be as good as broken. [Skotlex]
+ * Added a crash-fix on status_calc_bl_sub_homun to abort in case the homun
+ has no master (need to clean up this function later) [Skotlex]
+ * Tested char-txt load/save, it seems to be working fine, but you should
+ STILL backup, as I only launched the server (read old character format),
+ closed it down (saved into the new format) and relaunch it (read the new
+ format) and it didn't give problems (but there's still the possibility of
+ some field being read in the incorrect offset or such). [Skotlex]
+ * Updated the char save structure for char-TXT servers so that the homun id
+ will be saved, now also the map info (last point, save point, memo maps)
+ are now saved using the mapindex rather than the string. BACKUP BEFORE
+ UPDATING since this code isn't yet tested. [Skotlex]
+ * Cleaned up a bit the char-saving code, added overflow crash prevention in
+ case there are more memos than the max-allowed saved. [Skotlex]
+ * AM_CALLHOMUN can now be used to recall vaporized homuns. [Skotlex]
+ * AM_RESURRECTHOMUN will now fail when the homun is vaporized. [Skotlex]
+ * Added SCB_DYE which marks which status-changes need a forced cloth dye
+ change to 0 due to sprite issues. Currently only NJ_BUNSINJYUTSU's status
+ uses it. [Skotlex]
+ * Asura Strike now moves you to the target on fail always (unless the
+ target does not exists or is in another map or there's a obstacle on the
+ way) [Skotlex]
+ * Corrected skill_attack_area hitting dead characters on it's splash range.
+ [Skotlex]
+ * Swapped the values for OPTION_XMAS and OPTION_FLYING. This should enable
+ SG to show the fly animation again, even if sometimes others will see him
+ as Santa. As for xmas cloth, it shouldn't make much of a difference since
+ the view class is changed to christmas anyway. [Skotlex]
+ * Made AM_CALLHOMUN and AM_RESURRECTHOMUN be like the wedding skills, where
+ they automatically pick a spot around you. [Skotlex]
+ * Cleaned up some the AM_RESURRECTHOMUN code. Hopefully it works now.
+ [Skotlex]
+ * Cleaned up some the hom evolution code. [Skotlex]
+ * Fixed SIGSEGV with homunc save [Toms]
+2006/08/14
+ * Removed support for negative autosave intervals, instead added a
+ minsave_interval setting which specifies which is the minimum time between
+ character saves. Default to 100ms (map_athena.conf). [Skotlex]
+ * Sacrifice no longer shows damage to self. [Skotlex]
+ * When Asura fails, the skill display will still come off. [Skotlex]
+ * Lots of cleaning of the Homun-code. Perhaps the crashes as of late will
+ be fixed now (reusing AM_CALLHOMUN seems to be the cause of them)
+ [Skotlex]
+ * Increased Run's walk speed bonus to 25->50% [Skotlex]
+ * Modified emergency_call setting to allow for more specific configuration
+ (woe/non-woe, gvg-grounds/non-gvg-grounds, disable from nowarpto maps), see
+ skill.conf for details. [Skotlex]
+ * Fixed script engine allowing scripts to set a player's zeny to negative
+ values. [Skotlex]
+ * Fixed setting hide_woe_damage making even "miss" attacks seem to connect.
+ [Skotlex]
+ * When readjusting the fame-list, the last entry's id is also reset (may
+ fix characters appearing more than once on it?) [Skotlex]
+2006/08/13
+ * Removed @itemcheck as it was totally pointless. [Skotlex]
+ * Corrected states killer/killable being easily dispellable. [Skotlex]
+ * Fixed the totally wrong text messages being used for @killer/@killable
+ related atcommands, added appropiate entries to msg_athena [Skotlex]
+ * Magic and Misc attacks will now get type "flee" when they do less than 1
+ damage, this blocks them from causing additional status effects when they
+ are blocked. [Skotlex]
+ * Cleaned up a bit the Basilica code, it should now properly end when you
+ walk. [Skotlex]
+ * Fixed some logs not working when you enabled all logs. [Skotlex]
+ * Corrected unmute being a level 60 command by default (should be 80)
+ [Skotlex]
+ * Corrected the mapif_parse_PartyChangeMap function to correctly update
+ level-range when someone logs on/off, fixes being unable to set even-share
+ on once it's been broken even when the characters out of range logoff.
+ [Skotlex]
+2006/08/11
+ * Fixed Kagebunshin no Jutsu crashing for dyes > 0; though this solution
+ might seem hackish (changing clothes colour to 0 when it starts while
+ storing original colour back in val4, restoring original dye upon
+ end), I believe this is the best way there currently is to solve
+ the issue. [blackhole89]
+ * Fixed Dancers/Bards being able to use normal attacks while performing.
+ [Skotlex]
+2006/08/10
+ * Fixed the item group bonus not working. [Skotlex]
+ * Fixed songs/dances always being considered overlapped with themselves.
+ [Skotlex]
+ * Added some additional song/dance overlap code that should correctly
+ change the effect of songs/dances when they overlap. [Skotlex]
+ * Added a check so that the status-change packet is always send to self
+ when the inflicted char is a player disguised. [Skotlex]
+ * Code cleanup on homunc, they stay in memory until player disconnect or
+ homunc destruction [Toms]
+ * Corrected Advanced Jobs HP bonus from 30% -> 25% [Skotlex]
+ * Hopefully fixed family-party-even-share not breaking when a member logs
+ out. [Skotlex]
+ * Should have fixed the login-sql crash when passed user-name's length is
+ beyond the limit. [Skotlex]
+ * Changed setting attack_attr_none to affect all neutral-element attacks.
+ Basicly, this setting is now used to determine who can hit for full damage
+ always when using neutral-attacks (defaults to non-players) [Skotlex]
+ * Fixed two instances in the login-sql server where the ip in the log-login
+ table was being stored backwards. [Skotlex]
+ * Now when a skill's range is 0 and the skill is NOT casted on self, it
+ will take the basic weapon's range (without Vulture/Snake Eye bonus).
+ [Skotlex]
+ * Now when a duration is not specified, sc_start/sc_start2/sc_start4 will
+ try to guess the duration by extracting it from the skill_db (it uses
+ skill_get_time on whatever skill is associated to the status-change using
+ val1 as skill-level) [Skotlex]
+ * Some cleanups on trade_tradeaccept to prevent packets being resent when
+ they shouldn't. [Skotlex]
+ * Fixed syntax error in 'guild' create table statement [Toms]
+2006/08/09
+ * Fixed Asura not wasting all SP away when it fails on cast-end. [Skotlex]
+ * Fixed homunc skill up bug [Toms]
+ * Adjusted some the dance/song/encore code so that the source of an
+ ensemble will always get checked, so that walking out of an ensemble skill
+ should make it end now. However, it's likely this is not completely solved
+ yet and will require further tweaking. [Skotlex]
+ * Added crash protection to the mob_db txt reading when the mob_db file has
+ lines with insufficient number of columns. [Skotlex]
+ * Moved the class-change code from battle_calc_weapon_attack to
+ skill_additional_effect. Alchemist summons now also have a chance of
+ triggering polymorphing. [Skotlex]
+ * Removed the code which was auto-setting attacks that do no damage to type
+ FLEE, since that was disabling status-effects which should incur even when
+ the damage was blocked. [Skotlex]
+ * Trade requests will now fail when either character is unable to act
+ (character in storage, vending, interacting with an npc, petrified, etc)
+ [Skotlex]
+ * Heard skotlex voice, changed all msg_table[] into msg_txt() in atcommand.c [Toms]
+2006/08/08
+ * Fixed the char-server not invoking the party_calc_state function when the
+ third party-member is added to a party, hence failing to check for families
+ and disabling even share from them unless all three relog first (state is
+ correctly calculated when party is first loaded). [Skotlex]
+ * Crash-protections in the mail-checking function. [Skotlex]
+ * Some additional parenthesis on equipment check in pc_equipitem, seems to
+ have fixed the mid/lower headgear-sprites not showing up. [Skotlex]
+ * Added back missing state set to prevent Ankle-Snare from being retrieved
+ after the target dies. [Skotlex]
+ * Fixed compilation warning [Toms]
+ * Added a check to handle Spider Web as a targetted skill. If there's more
+ than one character on the targetted cell, a different one may get trapped,
+ but it will mostly do as it is now. [Skotlex]
+ * Added check to Asura so that it will move you to the target when it fails
+ ONLY when you can cast the skill on the target (not stunned, asleep, target
+ not hidden, etc) [Skotlex]
+ * Changed the map_freeblock_unlock code so that when there's an "already
+ free'd pointer" error, the memory manager will print out the invoking
+ function rather than map_freeblock_unlock, this should help fix it up next
+ time it happens and is reported. [Skotlex]
+ * Casting Kaensin will clear out Suiton and viceversa now. [Skotlex]
+ * Fixed drop-rates (@whodrops) getting duplicates when you use @reloadmobdb
+ [Skotlex]
+ * Fixed unjailing not sending characters to Prontera. [Skotlex]
+ * Fixed yet again AS_SPLASHER doing full damage on all characters. Now you
+ can use the NK split damage value in the skill_db if you want damage
+ divided by the amount of targets rather than by 2. [Skotlex]
+ * Fixed crash on the battle_drain functions. [Skotlex]
+ * Cleaned up HAMI_CASTLE, HLIF_AVOID, HAMI_DEFENCE so that it's usable by
+ other types of objects other than Homunculus. [Skotlex]
+ * Cleaned up the Asura Strike code so that the SP/Spheres/States is not
+ consumed when the skill fails due to Fog of Wall. [Skotlex]
+ * When a negative delay for a skill is specified, this delay is now added
+ on top of the character's amotion rather than adelay [Skotlex]
+ * Modified main.sql to make the guild table allow NULL on the emblem data.
+ [Skotlex]
+ * Added file conf-tmpl/Changelog.txt to log config changes. [Skotlex]
+2006/08/07
+ * Fixed the login-sql server replying to the change-sex packet with the
+ wrong gender, causing the char-server to screw-up job-change updates.
+ [Skotlex]
+ * Cleaned up the apparent mess that is pc_skill. Hopefully it SHOULD work as
+ described on the docs now, this should also fix adopting not correctly
+ giving the family-related skills. The flag value of skill should be: 0 to
+ set the skill (if skill level is 0, this removes a learned skill), 1 grants
+ the skill as an item bonus which is temporary, and 2 will add a skill bonus
+ like 1, except the skill level adds up to whatever level already known of
+ that skill. [Skotlex]
+ * Fixed EQP_WEAPON related code messing up with both weapon AND shield.
+ [Skotlex]
+ * Cleaned up the Asura code so that when the skill fails your
+ SP/Spheres/Fury are all taken away always, as well as moving you next to
+ the target (as long as the target still exists within a reachable path from
+ your position) [Skotlex]
+ * SC_GUILDAURA is now removed on logout. [Skotlex]
+ * Fixed Venom Splasher doing half-damage instead of full-damage to the
+ "exploding" character. [Skotlex]
+ * Hopefully fixed the party_even_share cast-overflow bug as reported by
+ Adobe. [Skotlex]
+ * Standarized the autosave interval setting to be always in seconds
+ regardless of type. [Skotlex]
+ * Moved the "bosses can't be knockback" logic from battle_calc_* functions
+ and placed it on skill_blown. [Skotlex]
+ * Some parenthesis cleanup before invoking battle_calc_base_damage, could
+ be fixing the current issue with arrow attacks not adding the arrow damage.
+ [Skotlex]
+ * Fixed the map_search_freecell error which was making mobs fail to
+ respawn. [Skotlex]
+ * Added in Lupus's suggestion of not making multi-slot headgears set all
+ slot view-ids, which supposedly causes the client to re-draw the headgear
+ multiple times on characters. [Skotlex]
+ * Fixed HT_BLITZBEAT hitting neutral characters when it auto-triggers.
+ [Skotlex]
+ * Simplified the Tatami Gaeshi code. [Skotlex]
+ * Fixed AS_SPLASHER doing full damage on everyone except targetted char
+ instead of the other way around. [Skotlex]
+ * Fixed KAENSIN clearing out SUITON cells and viceversa. [Skotlex]
+ * The spawn area is now seen as range rather than absolute for mob spawn
+ lines. This means that x,y,10,10 will spawn the mob on a 21x21 grid around
+ the given x,y point. [Skotlex]
+ * Some clean up of the mob-spawn code. Now you can specify negative areas,
+ so that a spawn location such as 100,150,0,-1 will spawn a mob always on
+ x=100, but any Y value of the current map. [Skotlex]
+ * Reflected damage will now also have a chance of draining hp/sp. [Skotlex]
+ * Adjusted the order in which option/sc change packets are sent to match
+ Aegis's [Skotlex]
+ * Added script command getpartyleader through which you can retrieve
+ various information of a party's leader. See doc/script_commands.txt for
+ further information. [Skotlex]
+ * mpeg's Ninja work [Vicious]
+ * Adjusted Battle_check_target so that alchemist summoned mobs are
+ targetted by everyone as long as 1. The top-level master is a player and 2.
+ the actual attacker is not a mob-type. [Skotlex]
+ * Added config force_random_spawn which overrides the spawn-files defined
+ coordinates to make all mobs always spawn randomly on the map. [Skotlex]
+ * SC_SPEEDUP0 is no longer dispellable by SA_DISPEL [Skotlex]
+2006/08/06
+ * Updated item_db.sql & mob_db.sql to latest. [Toms]
+ * Little fixes on homunc (hp/sp are now saved and init stats changed) [Toms]
+2006/08/04
+ * Added a commented piece of code at the end of clif_parse_LoadEndAck which
+ will update your direction to wherever you were facing before warping.
+ Should this be the default? Nearby people DO see you facing on the same
+ direction before warping, it's only your client that will always see you
+ facing north on spawn (the spawn packet does contain direction
+ information). [Skotlex]
+ * Updated @mobinfo to display slots in the drop information. [Skotlex]
+ * Fixed flag.elefix not being respected in battle_calc_misc_damage.
+ [Skotlex]
+ * Some code cleanups in battle_calc_damage. [Skotlex]
+ * Modified bAddItemHealRate so it can receive both item-id and item-group
+ values (since the first item-id is +500, there's no risk of mixing them
+ up). [Skotlex]
+ * Removed settings enemy_critical_rate, homun_critical_rate. Added settings
+ enable_critical (defaults to specify only players), mob_critical_rate and
+ critical_rate. The last applies to all non-mobs and non-players
+ (battle/battle.conf) [Skotlex]
+ * Removed settings mob_npc_warp, mob_warpportal. Replaced with setting
+ mob_warp which specifies which types of warp can a mob step into
+ (battle/monster.conf) [Skotlex]
+ * Enabled Mastery damage on Soul Breaker again, moved adv katar mastery out
+ of the mastery function so that it may apply to all skills except Soul
+ Breaker. [Skotlex]
+ * Changed name of the setting log_pick to log_filter since that's what it
+ does now. [Skotlex]
+ * Modified enable_logs so that instead of a 0/1 setting, you can specify
+ which kind of events to log (so you can use a combination), see log_athena
+ for the bitmask configuration. [Skotlex]
+ * Cleaned a bit the contents of log_athena.conf
+ * Hide/Chasewalk will again stop screaming skill name. [Skotlex]
+ * Soul Breaker will no longer receive Mastery damage. [Skotlex]
+ * Fixed warning:'type' might be used uninitialized in this function [Toms]
+2006/08/03
+ * Added a check to skip the experience share of characters who are dead or
+ on another map. [Skotlex]
+ * Reverted the previous change, chasewalk has no icon, only the str-bonus
+ has that fist icon now. [Skotlex]
+ * Allowed chase-walk to display a skill animation when using it. [Skotlex]
+ * Readjusted the Chasewalk icon to be as it should be. [Skotlex]
+ * GS_DESPERADO is now a short-range attack skill. [Skotlex]
+ * Changed the Battle-Orders icon to be the Strength Up icon (for
+ Chasewalk's str bonus). [Skotlex]
+ * Fixed using the right-hand weapon's size modifiers regardless of which
+ weapon's damage was being calculated in regards to. [Skotlex]
+ * Simplified the ignore-size check by making the Weapon Perfection check be
+ done when specifying the flag, also moved the size-fix property of riding
+ spear-knights to status_calc_pc. [Skotlex]
+ * Changed SI_CHASEWALK value to 119 as concluded by LoneWolf [Skotlex]
+ * Corrected clif.c sending the raw mdef2 value to the client instead of
+ first substracting the "secret vit/2" bonus from it. [Skotlex]
+ * Added a damage cap to CR_ACIDDEMONSTRATION of INT_MAX/2 to prevent
+ overflows. It is not capped to INT_MAX because damage increasing skills
+ would cause it to still overflow afterwards. [Skotlex]
+ * Fixed NPC_CRITICALSLASH not being considered as a Critical hit by the
+ code. [Skotlex]
+ * Added RUDE_ATTACKED_COUNT so you can easily adjust how many rude-attacks
+ should happen before a mob uses the rude-attacked skill. Value has been set
+ to 2 for now. [Skotlex]
+ * Now when a mob changes target (to someone they can hit) their
+ rude-attacked count won't be reset, but instead will be reduced by one.
+ [Skotlex]
+ * SC_SPEEDUP0 can now stack with the other speed raising buffs. [Skotlex]
+ * Some adjustments so that the last-skill-used will be correctly cleared
+ when your combo-time ends. [Skotlex]
+ * Fix a bug in atcommand_charspeed [Toms]
+ * Fixed a logic error preventing from cooking anything [DracoRPG]
+ * Cleaned up the last NJ update code. [Skotlex]
+ * Added @ command `charspeed` [Skotlex]
+ * Fixed @jailfor using MAP_PRONTERA as jail instead of MAP_JAIL [Skotlex]
+ * Removed case for GS_SPREADATTACK on damage packets to see if the skill
+ displays correctly now. [Skotlex]
+ * Corrected Deluge/Volcano/V. Gale overlaps so that the placing tiles are
+ removed, NOT the ones who were already placed. [Skotlex]
+ * Made SC_SPEEDUP0 and SC_SPEEDUP1 use different icon IDs, to fix
+ icon-confusion when both are enabled at a time. [Skotlex]
+ * Mob rude-attacked count is not reset now on picking a new char (gotta
+ investigate this further) [Skotlex]
+ * Changed atoi to strtoul for guild-experience's field [Toms]
+ * Fixed a bug in int_storage.c, temp array doesn't have the good size [Toms]
+2006/08/02
+ * Modified yet again SC_SILENCE after iRO tests from Entwined on IRC.
+ Silence now ONLY blocks skills from being used, it will not stop on-going
+ casts. [Skotlex]
+ * Updated status_cast_cancel to also include silence (so the cast bar is
+ cancelled if you are silenced during it) [Skotlex]
+ * Updated the way SC_SILENCE works. From what I remember (from previous
+ forum discussions) it: 1- Always blocks skills from being used. 2- Will
+ only block a skill when the cast-bar ends IF the skill is targetted. If
+ anyone wants to debate to get this changed, make an appropiate forum topic
+ in the svn development area to discuss. [Skotlex]
+ * Added a check in the walking code when triggering skills.
+ NPC_SELFDESTRUCTION will no longer cancel walking, it will instead resend
+ the walk packet, this effectively causes the mob to start walking
+ (clientside) while the cast-bar is showing. [Skotlex]
+ * Fixed a logic error on battle_get_master which was causing infinite
+ loops.. [Skotlex]
+ * Fixed homunculus error message [Toms]
+ * Rewrote pc_payzeny to not use doubles, it may more accurately prevent
+ charging a player more zeny than they can withhold. [Skotlex]
+ * Fixed failing to create Deadly Poison Bottles damaging 50% of your max
+ life instead of 25% [Skotlex]
+ * Added the missing status-change flags to SC_FREEZE to signal it should
+ modify def and magic def [Skotlex]
+ * Little add on NJ_HUUMA [Toms]
+ * Merged Mpeg's work on Ninja skills [Toms]
+ * Fixed Martyr's Reckoning having a cap damage of 32k. [Skotlex]
+ * Now you can teleport in Thanatos Boss room, but you can't respawn there [Playtester]
+ * Fixed Defender Raising Walk speed instead of diminishing it. [Skotlex]
+ * Added a check on status-change load to prevent loading speed-affecting
+ status when their speed adjustment is 0 (prevents division by zero)
+ [Skotlex]
+ * Code cleanup & optimization on guild part of char-server [Toms]
+ * Fixed script code data not being free'd if a player quits in the middle
+ of a script. [Skotlex]
+ * Modified run_script so that when there are leaks, it will report the
+ place where run_script was called from as source rather than the inner code
+ of run_script (for debugging purposes) [Skotlex]
+ * Made recursive master check the default (otherwise it messes skill -> pet
+ -> player kind of herarchies) and cleaned up some the battle_get_master
+ code to prevent infinite loops in the weird case someone specifies that
+ their master is itself. [Skotlex]
+ * Recoded the GuildAura code to use val3 & val4, allowing much greater stat
+ bonuses (in case someone wants to get Guild Skill level 20 or something
+ crazy like that) [Skotlex]
+ * Updated battle_check_target so that all alchemist summoned mobs can be
+ target by everyone. [Skotlex]
+ * Cleaned up skill_check_condition_mob_master_sub, it will now count both
+ total number of summoned mobs and amount that belong to the same type.
+ [Skotlex]
+ * Corrected AM_CANNIBALIZE so it will fail if you already have plants of
+ another type out. [Skotlex]
+ * Using NPC_SELFDESTRUCTION no longer will make the caster stop walking.
+ [Skotlex]
+ * Removed SI_GUILDAURA, and replaced it with SI_LANDENDOW, now
+ Volcano/Deluge/V. Gale will get that funky icon instead. [Skotlex]
+ * Changed clif_hominfo to receive both sd and hd as parameters
+ * Some redundancy cleaning in mercenary.c [Skotlex]
+ * Moved updating of sd->mercenary.hp from merc_damage to pc_makesavestatus.
+ [Skotlex]
+2006/08/01
+ * Miscellanous fixes which make the Marine Sphere self destruction work as
+ best as I can. It only has one flaw: It self-destructs instantly after
+ walking because if I make it use self-destruction with a cast-bar,
+ client-side the object stops moving inmediately... [Skotlex]
+ * Modified unit_walktoxy and NPC_RUN to enable running even when the caster
+ does not has the MD_CANMOVE bit on. [Skotlex]
+ * PF_MINDBREAKER will now silently fail if you try to use it on someone who
+ already has the status active. [Skotlex]
+ * Cleaned up yet again skill_landprotector, now new cells of
+ Deluge/Volcano/V.Gale will delete previous cells when they are recasted on
+ top of each other. [Skotlex]
+ * Summoned Marine Spheres no longer get the MD_CANMOVE bit. [Skotlex]
+ * Cleaned up some more the SC_JAILED code [Skotlex]
+ * merged in atcommands jailfor, jailtime, charjailtime. Thanks to Meruru
+ and Coltaro for the code. [Skotlex]
+ * Cleaned the code of atcommands jail and unjail [Skotlex]
+ * Be warned that the code MAY contain bugs as I adjusted it to save the
+ character's position before jailing, allowing the automatic unjailing to
+ warp you back to the exact spot you were at before being jailed. [Skotlex]
+ * Should have fixed the cooking sets not displaying all cooking available
+ items. [Skotlex]
+ * Figured out and fixed the issue with Volcano/Deluge/Violent Gale not
+ really working. Thanks to Mpeg for noting it out. [Skotlex]
+ * Modified Self Destruction, so that Marine Spheres in non-versus maps will
+ hurt only enemies, while in all other situations this skill will hurt
+ everyone around them. [Skotlex]
+ * Expanded setting debuff_on_logout so that &1 removes negative buffs and
+ &2 removes positive buffs. [Skotlex]
+ * Food status boosts will no longer end on death, but they will end when
+ you respawn or logout. [Skotlex]
+ * Added battle config file status.conf, moved some settings from skill.conf
+ and battle.conf to it since they are entirely Status-Change related.
+ [Skotlex]
+ * Added the missing lines to enable script command "kickwaitingroomall"
+ [Skotlex]
+ * Magic Rod's can-act delay will no longer be applied when you absorb a
+ spell. [Skotlex]
+ * Fixed Don't Forget Me increasing speed instead of decreasing it. [Skotlex]
+ * Modified setlabel so that the script engine barks when you are trying to
+ use the same label name as a constant or variable name. [Skotlex]
+2006/07/31
+ * Fixed the subnet 0 mask being reset to 0 when someone goes up on the fame
+ rankings. [Skotlex]
+ * Updated Poison React chance to counter and number of counters as per
+ skill description updates. [Skotlex]
+ * Fixed Sharpshooting being counted as a magic attack, and hence, using
+ your MATK as base damage. [Skotlex]
+ * Fixed NPC_STOP id value in skill_cast_db [Skotlex]
+ * Bladestop will no longer stop when you push either of the characters
+ around. [Skotlex]
+ * Fixed Enchant Poison having a near 100% chance of poisoning target on
+ attack. [Skotlex]
+ * Little fix on duel [Toms]
+ * Added possibility to restrict duel usage to same map [Toms]
+ * Merged mpeg's fix on ninja skills [Toms]
+ * Corrected a status_get_race call which should be status_get_race2 in misc
+ attacks. [Skotlex]
+ * Moved the Devotion code to the top of the SC list in status_damage,
+ meaning that now stuff like being asleep or confused won't end if you are
+ hit, but the damage is absorbed by devotion. [Skotlex]
+ * Added the Soul Link of Rogue speed bonus to Chase-Walk. Since there's no
+ information of how much the bonus should be, it currently is a conservative
+ 10%. [Skotlex]
+ * Fixed a possible crash in the main script engine when restoring previous
+ script. [Skotlex]
+ * Fixed sleep.tick not being set back to 0 before resuming execution, which
+ leads to scripts that are continously executed even when they already ended
+ (they do nothing but waste resources) [Skotlex]
+ * Fixed a pair of free -> aFree used on stacks, which would lead to memory
+ manager reporting leaks where there aren't. [Skotlex]
+ * Removed incorrect "Waterball range+1 when standing on suiton" feature.
+ [Skotlex]
+ * Corrected the Speed update code to prevent sending "walk to xy" packets
+ twice when the affected character is a player. [Skotlex]
+ * Expanded mob can't move warning to print out where this mob was stuck at
+ (map, x,y) [Skotlex]
+ * Fixed segmentation fault in status_change_end, vd wasn't initialized [Toms]
+2006/07/30
+ * NPC_INVISIBLE will now use Cloaking of a level +9 of the used skill
+ level, so that at level 1 they can attack, use skills and receive no
+ walking penalty. [Skotlex]
+ * Mob casted Sanctuary will no longer always heal it's targets regardless
+ of element/race [Skotlex]
+ * Status change packets will now use as criteria for sending the actual
+ view_class instead of player/not-player. This will fix status-changes
+ displaying improperly on clones, and also possible crashes with disguised
+ players. [Skotlex]
+ * Merged mpeg's fix on ninja skills and SA_VOLCANO,SA_DELUGE,SA_VIOLENTGALE [Toms]
+ * Added bNoMiscDamage setting so you can specify misc-damage blocking from
+ skills. Modified battle_calc_damage so that even Pressure and similar
+ skills will be affected by this setting. [Skotlex]
+ * GS skill updates/fixes [Vicious]
+ * Force all users offline in sql when char-server starts [Toms]
+2006/07/29
+ * Removed ugly struct cast in login.c [Toms]
+ * New version of buildin_query_sql which accept more than one column and
+ can return the number of rows. See script_commands.txt for more details. [Toms]
+ * Fixed nullpo in merc_hom_skillup [Toms]
+ * Added a return value to buildin_rid2name if rid is invalid [Toms]
+ * Made the SQL ping interval default to 7 hours. [Skotlex]
+ * Made skill_unitsetting remove the group when no unit-cells were placed
+ down. basicly this means that if landprotector blocks all tiles, the group
+ will be removed from memory, preventing said group from counting to the
+ total number of skills you can set. [Skotlex]
+ * Fixed segmentation fault in script engine when calling something which is not a function [Toms]
+ * Fixed segmentation fault in script engine when activating DEBUG_RUN flag [Toms]
+2006/07/28
+ * Added Ishizu's code to check ammo type on attack. No more using Grenade
+ rounds with Guns. [Skotlex]
+ * offensive heal/sanctuary will only happen when the source of the heal is
+ a player, mob/pet casted heal will now always heal regardless of target.
+ [Skotlex]
+ * Shield Chain will now ignore the 'ice-pick' defense piercing bonus.
+ [Skotlex]
+ * Self destruction will now hit all characters in range, not just enemies.
+ [Skotlex]
+ * Cleaned up the NJ update code: [Skotlex]
+ - Restored code which was removed (stuff like SC_SKA)
+ - Fixed possible crashes on some NJ skills if used by non-players.
+ - Fixed most NJ magic spells doing more damage than they should.
+ - Fixed ZenyNage being able to do more damage than zeny you have.
+ - Cleaned up skill setting code for Suiton and Kaensin
+ * Some cleaning of battle_drain, Evil Druid card should work now. [Skotlex]
+ * Made status_damage allow damaging of objects not on a map, this should
+ fix pet-catching making the mob never respawn again. [Skotlex]
+ * Casted nothl to (unsigned int) in sprintf functions, IP is 32bits and sql field the same :) [Toms]
+ * Fixed "warning: `list' might be used uninitialized in this function" in char/char.c@3032 [Toms]
+ * Fixed "uninitialized local variable 'i' used" in skill.c and "warning: suggest explicit braces to avoid ambiguous `else'" in battle.c [Toms]
+ * Fixed "warning: long unsigned int format, unsigned int arg" in parse_login (login_sql\login.c) [Toms]
+ * Fixed sign warnings in login/login.c [Toms]
+ * Fixed "conversion from 'double' to 'int', possible loss of data" [Toms]
+ * Fixed "warning: redefinition of [ushort/uint/ulong]" [Toms]
+ * Fixed duplicate case value on NJ_SUITON [Toms]
+2006/07/27
+ * Fixed a memory leak when there exists more than one user function with
+ the same name, added the appropiate warning when this happens. [Skotlex]
+ * Added reporting source file when an npc shops item's price is
+ exploitable. [Skotlex]
+ * The picklog will now record negative values for items sold to npcs.
+ [Skotlex]
+ * Added inmediate position and hp-bar update when a character joins a
+ party. [Skotlex]
+ * Added missing SC information to NPC_CHANGEUNDEAD [Skotlex]
+ * Added config setting party_update_interval so you can specify how often
+ the party-mate minidots should be updated (defaults to 1 sec). [Skotlex]
+ * Removed a bunch of broken comments in skill.c [Skotlex]
+ * Synced the script.c file with as much data as possible from jA's:
+ [Skotlex]
+ - A lot of functions were moved around, a bunch of indentation and
+ space-usage changes were done to make it easier to diff against their
+ files.
+ - Miscellanous addition and corrections were applied.
+ - Largest one is likely a restructuring of run_script_main, which hopes to
+ solve the memory leaks.
+ - script engine now uses the setjmp functions to restore memory state when
+ there's an error parsing scripts, which means that script errors won't
+ cause the map-server to inmediately bail out anymore.
+ - NOTE that the amount of changes is pretty extensive, so DON'T USE THIS on
+ a live server. Update only to help test and debug to see if the script
+ engine memory leaks are gone.
+ * Added a cleanup routine on shutdown to remove all characters from memory
+ for whom the save ack has not returned from the char-server yet. [Skotlex]
+ * Now when you set the guardian's HP, if the guardian is spawned, it's HP
+ will be updated accordingly (and if you set it to 0, the guardian is
+ killed) [Skotlex]
+ * Added functions status_set_hp/status_set_sp to set hp/sp to a given
+ value. Applied usage of these on the Berserk and Soul Change code.
+ [Skotlex]
+ * Added config setting "party_hp_mode" (battle/party.conf) which determines
+ method to use to update party-mate hp bars. Aegis style is to update HP
+ bars whenever HP changes, while eAthena style is to update it together with
+ the map party dots. Defaults to aegis style. [Skotlex]
+ * Fixed packet 0x22a having the manner and opt3 packets in inverted
+ offsets. [Skotlex]
+ * Readded the check which prevents Cloaking from activating when your
+ learned level is less than 3 and you aren't next to a wall. [Skotlex]
+ * Some cleanups to the Frenzy/Berserk status change, it should probably
+ work correctly now. [Skotlex]
+ * Removed a redeclared variable i in the parsing of the fame list (char-sql
+ server) which seems to be the cause of the random memory corruptions.
+ [Skotlex]
+ * Updated item_db.sql to latest. [Toms]
+ * Fix homunc & code cleanup [Toms]
+ - Timer problems on delete_timer
+ - Intimacy problem (overflow & new values)
+ - Homunc deleted if intimacy < 0
+ - base exp is now given to master
+ - Homunc sometimes not saved
+2006/07/26
+ * Fixed a memory leak when reading the item_db txt. [Skotlex]
+ * Applied the necessary changes to make @partyoption reflect it's changes
+ on the alt+p window. [Skotlex]
+ * Modified party_item_share_type config setting so that using 1 disables
+ item-sharing from non-mob loot (player dropped items or pet loot) and 2
+ enables round-robin instead of random sharing. Using 3 obviously is
+ enabling both 1 and 2. [Skotlex]
+ * Added battle_get_master which returns the master bl of a given object.
+ [Skotlex]
+ * Recoded battle_check_target to use battle_get_master, the src/target
+ switch has been split into two, so that actual target and master target are
+ seperately treated (same for source). [Skotlex]
+ * Added support for "sc_end -1" which will clear all status changes. Added
+ the constant SC_ALL so you can use in scripts "sc_end SC_ALL;" instead.
+ [Skotlex]
+ * @pettalk will now fail when muted. [Skotlex]
+ * Enabled changing of equipment while stunned/asleep/petrified/etc [Skotlex]
+2006/07/25
+ * Cleaned up run_script_main to properly free previous stack-data when
+ running scripts. Note that scripts may still leak memory when run by
+ non-players and they don't reach the "END" state, however I am not sure how
+ this case should be handled, so it's left as it is for now. [Skotlex]
+ * Added a missing ntohl call in the loginlog code. [Skotlex]
+ * Added a check when buying from npcs to allow buying of item_avail items.
+ [Skotlex]
+ * Fixed duel accept invite sending the packet before the duel data is set
+ (resulting in a packet that noone receives). Thanks to Toms for finding it
+ out. [Skotlex]
+ * Fixed a possible crash when you dual-wield and the total damage is 0.
+ [Skotlex]
+ * Added Toms's perl scripts item_db.pl and mob_db.pl (they are in tools/),
+ they convert the txt databases into sql. [Skotlex]
+ - Usage: "script" < "input file" > "output file". eg: ./tools/item_db.pl < db/item_db.txt > sql-files/item_db.sql
+ * Updated the sql files since now it's quick [Skotlex]
+2006/07/24
+ * Re-updated the mob_db.sql to latest. [Skotlex]
+ * Cleaned up the skill_landprotector function to correctly block only magic
+ skills from being placed on land protectors. [Skotlex]
+ * Corrected itemdb_group so that it will not return the random item givers
+ (should give priority to actual item groups, so that the item heal bonuses
+ work correctly) [Skotlex]
+ * Cleaned up the Mistress Card related code so that the no-gemstone bonus
+ reduces item requirements by one rather than totally skip them. [Skotlex]
+ * Cleaned up the logs "can log"function to use the IT constants. Also
+ corrected the "only log large amounts" setting not working on negative
+ values (trades). [Skotlex]
+ * Adjusted skill_castfix_sc so that Suffragium will get consumed even on
+ instant cast skills, but Memorize won't. [Skotlex]
+ * BladeStop will now end when either of the characters is moved (knocked
+ out?) around. [Skotlex]
+ * Moved the Zeny penalty code from respawn to pc_dead. [Skotlex]
+ * Added a check to prevent Deluge/Volcano/Violent Gale from being placed on
+ top of each other. Reverted the previous 'fix' where atk was being
+ increased based on armor element rather than element of attack. [Skotlex]
+ * Removed the noreturn mapflag check from script command warp. [Skotlex]
+ * Homuculus cleanup [DracoRPG]
+ - Replaced nullpo's in parse functions by silent checks
+ - Removed server-side effect for menu option 0 (view status window...
+ why does the client send us the packet since we don't care? -_-)
+ - Rewrote intimacy underflow checks so they are really effective (no
+ need to check if an unsigned is < 0, it won't work... check before!)
+ * fixed unban unblocking players as well. [Skotlex]
+ * Fixed Volcano/Deluge/Violent Gale increasing damage based on element of
+ attack instead of defense element of attacker. [Skotlex]
+ * Cleaned up the code of Magic Rod, fixed it not giving SP. [Skotlex]
+ * Moved the code of Hermod and Basilica to castend_pos2 so it should work
+ now. [Skotlex]
+ * Modified the code of Ankle Snare so the status ends on unit's time-limit
+ rather than when the snared object moves away. [Skotlex]
+ * Re-worded the water check of ST_WATER skills. [Skotlex]
+ * Allowed sc-cast reductions to be processed even when cast-time is instant
+ (to let suffragium end even on instant-cast skills) [Skotlex]
+2006/07/23
+ * Modified setting skillrange_by_weapon (skill.conf) to be a
+ per-object-type setting instead of yes/no. The default now is that
+ weapon-based skills will take the attacker's range for non-players.
+ [Skotlex]
+ * Changed the default of skillrange_by_distance to include homunculus.
+ [Skotlex]
+ * Fixed buildin_isequip not working correctly with non-cards. [Skotlex]
+2006/07/22
+ * Updated mob_db.sql to latest. [Skotlex]
+ * Applied Toms's suggested corrections to homun code. [Skotlex]
+ * Corrected Cannibalize/Marine Sphere ignoring the selected summon spot.
+ [Skotlex]
+ * Fixed looting pets ignoring the item pick-up priority of other players.
+ [Skotlex]
+ * Should have fixed a signess warning in login txt. [Skotlex]
+2006/07/21
+ * Added blocking of @me when muted or in berserk status. [Skotlex]
+ * Corrected the @follow timer not being deleted on logout. [Skotlex]
+ * Applied the homunculus code fixes provided by Toms. [Skotlex]
+ * battle_check_target will now tag homunculus as invalid target when the
+ source is a skill-type object. [Skotlex]
+ * Added a check on pc_equipitem so that when the client specifies to equip
+ a weapon on the right hand when the left hand is available, the weapon will
+ be sent to the left hand instead (when dual-wielding is possible,
+ obviously). Same for the left/right accessories. [Skotlex]
+ * Added the necessary checks so that Suiton makes Fogwall have double
+ duration, and to make water-requiring skills to consume their cells.
+ [Skotlex]
+ * Corrected the loadmap event description to specify that the mapflag
+ required is actually "loadevent", NOT "loadmap"! [Skotlex]
+ * Now when the char-txt server does not finds a requested party, it will
+ clear out said party id of all characters (will help prevent massive
+ spamming/overhead when for some reason the party file needs to be deleted).
+ [Skotlex]
+ * Combo skills (inf = self, inf2 = no target self) no longer check range if
+ you use them while your attack-timer is still active. [Skotlex]
+ * Added back a map_freeblock call in skill_delunitgroup which caused a
+ memory leak when removed... [Skotlex]
+ * Added a check to prevent Blind from ending while standing on a fog of
+ wall. [Skotlex]
+ * The mob Slave ai will be executed now even when the slave has a target.
+ This will allow for "instant" warping to the master when it changes maps or
+ teleports. if the slave has a target already, it won't unlock it and chase
+ back to the master or anything like that. [Skotlex]
+ * Removed a couple of checks that prevents item ids above 20000. However,
+ remember that the max id is still ~32k or the client is the one who's gonna
+ crash! [Skotlex]
+2006/07/20
+ * Added source reporting when you do an invalid int&str or str&int
+ operation on a script. [Skotlex]
+ * Fixed the intif party creation packet having the incorrect size sent,
+ hence causing the leader's level to be read as garbage (which caused the
+ "impossible to even share" bug). [Skotlex]
+ * Added pc_check_weapontype to do a proper skill weapon check that takes
+ into account dual-wielding. That is, if a skill can be used with
+ daggers/axes, you'll be able to use the skill when dual-wielding them.
+ [Skotlex]
+ * Corrected Cloaking level 1-2 not letting you move across walls. [Skotlex]
+ * updated cloaking code so that when you set "enable cloaking without
+ walls", the code will consider you as "always next to a wall", thus you get
+ the wall-speed bonus always. [Skotlex]
+ * Applied the fix to homunculus name saving... [Skotlex]
+ * Added battle config settings agi_penalty_target and vit_penalty_target,
+ they define which object types will get vit/flee reductions when
+ multi-targetted and defaults to only players (battle/battle.conf) [Skotlex]
+ * Added the dummy intravision case for the changeoption packet 0x229
+ [Skotlex]
+ * Corrected Fog of Wall so that all targetted offensive skills (not only
+ those who do damage) will fail on cast-end 75% of the time. [Skotlex]
+ * corrected @homlevel up and one entry in the homun exp table as reported
+ on the forums by Albator. [Skotlex]
+ * Added the SQL fix to Homunculus skill learning/saving bug [DracoRPG]
+ * Added a status_check_skilluse on skill_attack_area call to prevent splash
+ damage skills from hitting hidden/trickdead/etc characters. [Skotlex]
+ * Corrected fog of wall to behave as best known currently: [Skotlex]
+ - Only takes effect when targetting a character inside it
+ - -50hit/-75% damage when using normal-ranged attacks
+ - -25% damage from all damage skills
+ - 75% chance of all targetted damage skills of failing.
+ * Should have fixed @refine applying multiple times to equipment that uses
+ multiple equip slots. [Skotlex]
+2006/07/19
+ * Fixed the inf code update breakage which was blocking all offensive
+ skills. [Skotlex]
+ * Added battle setting homun_critical_rate (defaults to 0) [Skotlex]
+ * Removed enemy_str/pet_str/enemy_perfect_flee and replaced them with
+ enable_perfect_flee which specifies which objects can have perfect flee and
+ enable_baseatk which specifies which objects can have a base attack value
+ (both in battle.conf) [Skotlex]
+ * Modified the targetted skill logic to enable offensive skills to be
+ targetted at party/guild members if the appropiate inf2 value is set.
+ [Skotlex]
+ * Added checks to make adding items to inventory/cart fail when a char is
+ in finalsave state. [Skotlex]
+ * Fixed parse_names on irc.c crashing when receiving a null argument.
+ [Skotlex]
+ * Modified the parsing of the names line, since some servers will send @
+ instead of = when separating the information. [Skotlex]
+ * Fixed the homun creation sql statement. Why noone else did so before?
+ [Skotlex]
+ * When enabling/disabling hiding/unhiding an npc, if the npc is a warp, it
+ will use clearchar and spawn packets instead of changeoption. Thanks to
+ Toms for the fix. [Skotlex]
+ * Corrected Trim chars to block 'enter', as explained by the Ultra mage.
+ [Skotlex]
+ * When the client passes account version 0, the login server will set it to
+ 1 now. [Skotlex]
+ * Corrected the HP bar scaling when HP is above Short Max. It should
+ display fine for any HP value now. [Skotlex]
+ * Added a check when the mob's adelay is shorter than the amotion, in which
+ case the adelay will be changed to the amotion value. [Skotlex]
+ * Some minor mapflag changes. [MasterOfMuppets]
+2006/07/18
+ * Added atcommand @partyoption, lets you alter the party item-distribution
+ type on the go. Usage is "@partyoption <pickup share> <item distribution>",
+ where both arguments can be 0/1, yes/no, etc. [Skotlex]
+ * Updated @changeleader and @partyoption to use msg_Athena entries.
+ [Skotlex]
+ * Added character 013 (enter) to the list of characters that are always
+ removed from new character names. [Skotlex]
+ * Fixed a crash when trying to extend TK's infinite combo feature. [Skotlex]
+ * Corrected Poison React to counter regardless of distance, and to use the
+ skill's 50+5*lv% counter chance (instead of 100%). [Skotlex]
+ * Corrected Venom splasher's splash damage [Skotlex]
+ * You now can't move/attack/use-skills when using Cloaking of a level less
+ than 3 [Skotlex]
+ * Fixed compilation of mercenary.c [Skotlex]
+ * Corrected Fog of Wall's "targetted spells fail 75% of the time" feature
+ by making it behave like GTB, that is, you just get a skill-failed on
+ cast-end, no skill-animation at all. [Skotlex]
+ * Added a proper check to make aggressive mobs never override homun targets
+ regardless of distance. [Skotlex]
+ * Removed a bunch of homun-related variables that are not needed at all.
+ The alive condition is removed, now the code checks for the hp value to
+ know if the homun is alive or not. [Skotlex]
+ * Cleaned up a bit the skill-id function, homun skill checks (such as delay
+ and skill-lv learned) should be correct now. [Skotlex]
+ * Added a proper check to make aggressive mobs never override homun targets
+ regardless of distance. [Skotlex]
+ * Fixed giving the 100% damage bonus when no-splash-targets are found in
+ the blown path to Grandcross instead of Bowling Bash. Bowling Bash damage
+ equation becomes then +50*lv% rather than +40*lv% when there's no
+ splash-damage (the 50*lv% figure is custom, all we know is that level 10
+ does 600% instead of 500% damage). [Skotlex]
+2006/07/17
+ * Updated mob_db.sql to current mob_db.txt data. [Skotlex]
+ * The char-server will allow off-line character saves when said char is
+ tagged for final-save (this is the scenario when the char-map reconnect).
+ [Skotlex]
+ * Should have fixed the Cart Termination damage code to be scaled correctly
+ when you change the max cart weight. Thanks to The Ultra Mage for the error
+ clarification. [Skotlex]
+ * Implemented Grandcross weird property where if there's noone on the path
+ it'll hit twice for the skill's reported damage, and when there is (or you
+ can't knockback the target) it'll do a splash attack that hits twice for
+ 500% to all affected targets. [Skotlex]
+ * Some cleaning of the combo code. TK Rankers will now get their combo-time
+ extended each time they trigger a kick, enabling them to do "unlimited
+ combos". [Skotlex]
+ * Modified the autosave function to use a sweep across the player db
+ instead of across connected clients. This will cause non-connected players
+ (like autotraders) to also be saved on a regular interval, may help with
+ possible data-loss from said characters on unclean shutdowns. [Skotlex]
+ * Removed the code that forces aggressive mobs to go after a Homun instead
+ of their master (no reason why there should be such a condition). [Skotlex]
+ * Some sign quest map flag updates [MasterOfMuppets]
+ * atcommand_follow is now more verbose. [Adam]
+ * Manually added int_homun.c to the VS8 char_sql project, *should* work [DracoRPG]
+ * Orn's fix to the very critical skill level up bug [DracoRPG]
+ * Updated mob_db.sql to current mob_db.txt data. [Skotlex]
+ * Added Orn's lil fix on homun [Vicious]
+ * Added Homunculus system, enjoy! [orn aka Nylou]
+ - WARNING: This currently only works with the SQL version, as the TXT char-server
+ has no code for it at the moment. You TXT server won't break, but the char-server
+ will complain of an unknown packet if you try to get an Homunculus
+ * Updated nomemo mapflags based on info from http://ro.doddlercon.com/images/memo.jpg [Poki#3]
+
+2006/07/15
+ * Small change in conf/battle/player.conf to say that 199 is max aspd allowed
+ (Haplo says that there are many reports of having over 200 is giving errors) [Evera]
+2006/07/13
+ * Kaahi no longer shows the heal effect to everyone. [Skotlex]
+ * Eska no will cause defense to change randomly every second. [Skotlex]
+ * Tuned up some more NJ_KAENSIN based on Tharis's information. [Skotlex]
+ * Corrected NJ_KAENSIN as per description. [Skotlex]
+ * Fixed a leaking map_freeblocklock on skill_del_unitgroup. [Skotlex]
+ * Changed the default save interval to 5 minutes. Added support for
+ specifying fixed save-intervals by using negative values. [Skotlex] EG:
+ - Save interval set to 300 (5 minutes): all characters will be saved in
+ equal time-slots, so that everyone is saved every 5 minutes regardless of
+ number of players online.
+ - Save interval set to -1000 (1000 ms): One character will be saved every
+ second, regardless of amount of characters online.
+ The new fixed-time-slots method is meant for larger servers, so that they
+ can control the saving-induced stressed on the char-server.
+ * Fixed @storeall and @charstoreall failing when the target character
+ already had the storage open. [Skotlex]
+ * Reverted temporarily the Cart Termination equation until it can be
+ fixed... [Skotlex]
+ * Fixed script command "recovery". [Skotlex]
+2006/07/12
+ * Fixed a small typo in my code [Zido]
+ * Added negative value in bonus exploit fix for more stat bonuses [Zido]
+ * Fixed exploit in pc_bonus there are no checks that check that the value being
+ added onto a status don't make it go below zero, which means if you have a mineral
+ card and reset stats it reduces your base attack to lower than zero, making it
+ go up to 64000. Fixed by adding a check for SP_BASE_ATK, although i recommend
+ doing it for other status bonuses also [Zido]
+ * Recoded NJ_BAKUENRYU to behave as I understand it best from the
+ skill-description (since Haplo told me this skill doesn't really has video
+ information or anything...) [Skotlex]
+ * Fixed NJ_TATAMIGAESHI to use ground-tiles rather than "for each in path"
+ calls. The skill should be working correctly now, except for the fact that
+ the correct "unit id" is missing (this is what would give the ground tile
+ it's correct display). Temporarily it is using 0xba until the correct value
+ is found. [Skotlex]
+ * Added back the undead check to turn undead/resurrection to prevent
+ damaging non-undead targets, removed it from the battle damage section.
+ [Skotlex]
+ * Resurrection will now silently fail when used on non-undead + not-dead
+ characters. [Skotlex]
+ * Poem of bragi/magic String's base delay reduction at level 10 (or above)
+ is now 50% instead of 3*lv%. [Skotlex]
+ * status_damage will no longer fail when the target is not on a map AND the
+ flag is 2 (charge rather than damage). Fixes SP-draining status changes
+ ending suddenly when in-between maps. [Skotlex]
+ * Fixed the IP value being apparently incorrectly casted before inserting
+ into the loginlog table on "connect success" events. [Skotlex]
+ * Fixed Cart Termination's damage. [Skotlex]
+ * Added the missing check to remove character from memory when logging out
+ and using the charsave_method which saves character map-server-side.
+ [Skotlex]
+2006/07/11
+ * Fixed inverted check which was preventing you from buying more than 1
+ from any stackable item.... [Skotlex]
+ * Should have fixed the crash in intif gm message... [Skotlex]
+ * Fixed GTB card only working while you had a status-change active.
+ [Skotlex]
+ * Fixed being unable to compound cards in armor. [Skotlex]
+ * Made @monsterignore be an universal ignore. Means you cannot be targetted
+ as an enemy by anything. Also added alias "@battleignore" which does the
+ same as monsterignore. [Skotlex]
+ * Fixed magic power setting your min matk as max-matk. [Skotlex]
+ * Modified the packets involved in @fakename in hopes it'll refresh
+ correctly on nearby clients now. [Skotlex]
+ * Fixed clif_parse not checking for func_parse before sending data to the
+ connected clients. This in turn required various code-rewrites in: [Skotlex]
+ - duel related messaging functions (added clif targets DUEL/DUEL_WOS).
+ - intif whisper to gm function
+ - day/night timers
+ - Rewrote the parse_console function to stop allocating/deallocating memory
+ on every call.
+ - Modified chrif_charselectreq to receive the player's ip among the data.
+ * Added function clif_disp_message, which is the same as
+ clif_disp_onlyself, except you can specify the targets (it sends a
+ guild-chat packet) [Skotlex]
+ * Fixed the subele bonus (elemental reduction) being applied to the element
+ of the attacker instead of the element of the attack. [Skotlex]
+ * mob skills now won't trigger on unit_stopwalking calls. [Skotlex]
+ * Coded @reset. [Skotlex]
+ * Reenabled @changesex [Skotlex]
+ * Added function pet_create_egg which handles creating pet eggs correctly
+ (when passed item id is indeed a valid petegg). Applied this on @createitem
+ and getitem. [Skotlex]
+ * Cleaned up code of @item [Skotlex]
+ * Cleaned up the itemdb_isequip functions. itemdb_isequip will now return
+ if the item is equipable by players, itemdb_isstackable returns if the item
+ can be stacked, and itemdb_isidentified returns if the item should drop
+ identified. [Skotlex]
+ * Added defines CARD0_PET/CARD0_FORGE/CARD0_CREATED to identify if a given
+ item has "invalid" cards, added define function itemdb_isspecial to
+ simplify this check. [Skotlex]
+ * Removed itemdb.c considering item ids above 20000 as invalid. [Skotlex]
+ * Cleaned up script commands getitem and card-counting related ones.
+ [Skotlex]
+ * Cleaned up a bit more pc_isequip [Skotlex]
+ * Added script function warpportal(x,y,targetmap$,targetx,targety).
+ This creates warp portals as in the skill unit as a volatile alternative
+ to static warp portals. [blackhole89]
+ * Modified the login-sql server to do the ip-ban check only on the
+ auth-packets instead of on every packet. [Skotlex]
+2006/07/10
+ * Corrected Warp Portal being unable to warp people who are standing on it
+ on the moment it triggers. [Skotlex]
+ * Fixed @follow stopping the moment you are warped. [Skotlex]
+ * Fixed pc_additem messing with the equip field of the passed item data.
+ Fixes the famous "equip stuff on your arrow slot" bug. [Skotlex]
+ * Fixed cart-termination crashing the server if you used level 16 of it.
+ [Skotlex]
+ * Fixed check_connect_login_server check in char-sql server. Fixes
+ char-server not reconnecting to the login server. [Skotlex]
+ * Login-sql server will no longer change an account's state to "7" when
+ banning a player. This should fix being able to use @ban to clear out a
+ @blocked player. Players will now be identified as banned only through the
+ banned-until timestamp. [Skotlex]
+ * Fixed a crash when using Gospel... [Skotlex]
+ * The on-place function won't be invoked on setting ground skills if the
+ group's tick is greater than the current tick. As Buuyo pointed out, this
+ should fix Sanctuary and Gospel taking effect inmediately instead of after
+ "x" amount of ms as they should. [Skotlex]
+ * Added login-char packet 0x2737. Sets all characters offline (login-server
+ side). [Skotlex]
+ * Cleaned up char server "set all offline" implementation to remove only
+ characters from the map-server from which the packet was invoked. It will
+ also now correctly kick/set-character offline from the map-server if they
+ are connected. [Skotlex]
+ * Cleaned up the char-sql reconnect code. It no longer sets everyone to
+ offline. [Skotlex]
+ * Removed setting "kick_on_disconnect", servers will no longer kick
+ characters out when there's a disconnection. Instead, it'll use the most
+ logical approach: Set characters into a "lost" state when there's a
+ disconnection, on reconnect, resent the list of online-characters, do a
+ sync, and let the difference be characters to be removed. Also, the
+ map-server won't release character data until it's saved and the ack
+ returns from the char-server to prevent data loss (all this data is resent
+ on reconnect for saving anyway). [Skotlex]
+ * Added a check in pc_equipitem so that when switching weapons and you have
+ the skill_range_by_weapon setting active, the skill info block (which
+ includes range) will be resent when the new weapon to equip has a range
+ different than the previous one. [Skotlex]
+ * One closer inspection, removed that clear in itemdb_reload for a foreach
+ call again. And modified itemdb_load to scrap the dummy item entry from the
+ item_db and replace it with proper data for the item. [Skotlex]
+ * itemdb_reload will clear the itemdb before reloading info instead of only
+ clearing the scripts now. [Skotlex]
+ * Some cleaning of skill_castend_pos2, fixed Gospel, and a
+ map_freeblock_unlock misplacement. [Skotlex]
+ * Sense/Estimation will now display the mob info window to all party
+ members in the same map. [Skotlex]
+2006/07/08
+ * Fixed the new addeff structure not working well with SC_STONE (because
+ SC_STONE is 0, which was by default not handled as a valid value).
+ [Skotlex]
+ * Added back the TF_MISS walking speed bonus to assassin type classes (how
+ did that got lost?) [Skotlex]
+ * Fixed mobinfo displaying exp as signed ints rather than unsigned.
+ [Skotlex]
+ * Added status_check_visibility to check if an object is within range of
+ view of another. Nothing more, nothing less. It's used by unit movement to
+ check whether you can continue chasing your target or not when the "chase
+ target" directive is given. [Skotlex]
+ * Fixed the char table having party/guild_id as smallint when they need int
+ there. Thanks to hermematon for pointing it out (use svn_ugprade7580.sql)
+ [Skotlex]
+ * Applied k3dt fixes to pet-hatching, ice-wall check, and wedding skills.
+ [Skotlex]
+ * Fixed endow skills calling the skill no damage packet twice. [Skotlex]
+ * Fixed a crash on warpwaitingpc when the chat-room is empty. [Skotlex]
+2006/07/07
+ * Fixed the Warm Skills [Skotlex]
+ * Removed the debug message when a player logs out and is removed from
+ memory, it is working fine (tested normal logging off and autotrade). [Skotlex]
+ * Corrected the pet-armor field of the pet not being updated on
+ equip/unequip of accessories, making them not show up inmediately. [Skotlex]
+ * Status_calc_bl will no longer stop you from attacking/walking when the
+ mode is changed unless the new mode no longer includes
+ "can-attack"/"can-move" respectively. [Skotlex]
+ * Should have fixed clif_item_sub to properly store pet egg/armor data.
+ There should be no more "random refine levels" bugs related to these.
+ [Skotlex]
+ * itemdb_exists will now return NULL for item_id 0. [Skotlex]
+ * Added a check to free a character from memory when changing map servers.
+ [Skotlex]
+ * Okay, added a chrif_save_ack packet to the char-server so now the map
+ server will know once a character was "final saved", and only then the
+ character will be removed from memory. On char-server reconnection, all
+ chars that are in final-save state are resent to save (if they are still in
+ memory, it's because the ack hasn't gotten here from the char-server). This
+ should effectively block all dupe problems due to heavy inter-server lag,
+ however as it's untested, it currently prints some debug messages when
+ people are saved and then removed from memory. Need testers so this can be
+ debugged and merged to stable! [Skotlex]
+ * Now, when the login-char connection is cut, the char-server won't set
+ everyone offline on reconnect, instead it will send the list of online
+ accounts to the login server. [Skotlex]
+ * Modified the error on the char-sql server to set chars online when it
+ receives a save packet from a character tagged as offline (until it can be
+ figured out why this is happening) [Skotlex]
+ * Fixed signed/unsigned comparison issues in the char txt/sql server.
+ [Skotlex]
+ * Fixed the cooking success chances. Thanks to Ishizu Chan. [Skotlex]
+ * Added a temporary band-aid to prevent executing the script of non-arrows
+ when they are equipped on the arrow-slot (until the actual cause of why
+ pc_unequipitem is not working correctly is discovered/fixed) [Skotlex]
+2006/07/06
+ * Modified the party_data structure on the map server to remove some
+ redundant data. Added a party_data structure on the char-server to hold a
+ more complete set of information about parties. Added to the party_member
+ structure the class of each member so that the map server can do the
+ appropiate checks even if the character is on another mapserver/offline.
+ Due to the format changes in the party structure, txt servers will have to
+ wipe their party file... (sql save format has not been changed) [Skotlex]
+ * Added function char_family to check if there's a family state given the
+ three character ids, instead of doing individual checks all the time.
+ [Skotlex]
+ * Rewrote all the item restriction functions so that they will take into
+ account slotted card restrictions as well. [Skotlex]
+ * Added no_skill_delay setting, when set, affected object types will have
+ the minimum skill delay for all skills. Defaults to mobs, since they
+ don't have skill delays. [Skotlex]
+ * Cleaned up pc_equipitem. When dual wielding or equipping accessories, if
+ the client actually specifies one of the two positions, it will be taken
+ into account (now, does the client actually does this?) [Skotlex]
+ * Fixed GrandCross and similar skills. [Skotlex]
+ * FogWall will now also affect the caster. [Skotlex]
+2006/07/05
+ * Updated NJ_KAENSIN by Saycyber21 [Vicious]
+ * Updated @refine to take account of MAX_REFINE, thanks to Omega... GM
+ Designer. [Skotlex]
+ - Also optimized the @refine loop for better performance.
+2006/07/04
+ * Fixed compile issue for NJ_BAKUENRYU, by Saycyber21. [Vicious]
+ * Implemented Saycyber21's some NJ work. Untested. :D [Vicious]
+ * Implemented cooking chances. Chance of success is 70% - 7*(dish-lv)% +
+ 12*(cooking set-lv)%. Exception: When using the legendary cooking set,
+ success chance is 100% regardless of dish. [Skotlex]
+ * Added battle config setting emergency_recall, specifies behaviour of that
+ skill (skill.conf): 0 - Disabled. 1 - can't be used in nowarpto maps. 2 -
+ Can be used everywhere. [Skotlex]
+ * Removed the NPC/Dance/Song inf2 check of AbraCadabra. whether a skill can
+ come out or not is entirely decided by the abra db file now. [Skotlex]
+ * Added structure s_addeffect to handle status change additions. Cleaned up
+ relevant code. It is now possible to specify ANY status change, not just
+ the basic ones. NOTE that the code is proof-read, but untested! [Skotlex]
+ * Added support for bonus3 bAddEff/bAddEffWhenHit as follows: [Skotlex]
+ bonus3 bAddEff/bAddEffWhenHit, <SC value>, <rate>, <target flag>.
+ Target flag is 0: Self. 1: Enemy. 2: Both.
+ * Added these descriptions to doc/item_bonus.txt [Skotlex]
+ * Added a check when joining a chat to make sure the target object is of
+ type BL_CHAT. [Skotlex]
+2006/07/03
+ * Cleared up the bAutoSpellWhenHit description in doc/item_bonus.txt
+ [Skotelx]
+ * Fixed Phantasmic Arrow and Magical Bullet not being correctly tagged as a
+ ranged arrow-type attack. [Skotlex]
+ * Updated help.txt and help2.txt, thanks to Inuyasha for providing the
+ updated files. [Skotlex]
+ * Char-server SQL won't perform the reconnect cleanup routines when
+ kick_on_disconnect is disabled. [Skotlex]
+ * Renamed summons_inherit_effects to summons_trigger_autospells as the
+ setting now only makes the attacks of the slaves trigger the autospells of
+ the master (as it should be). [Skotlex]
+ * Corrected code capping no_spawn_on_player to 50 when the max should be
+ 100. [Skotlex]
+ * Warmth will dispel when warping now (or else the effect is left on the
+ ground) [Skotlex]
+ * Fixed reading of the refine_db not working right when MAX_REFINE is
+ increased from 10. [Skotlex]
+ * Some more cleaning to the implementation of Abracadabra [Skotlex]
+ * Fixed a compile warning in login sql/txt [Skotlex]
+ * Fixed pc_makesavestatus not setting your logout position. [Skotlex]
+ * Fixed two dances becoming BA_DISSONANCE instead of DC_UGLYDANCE.
+ [Skotlex]
+ * Added the missing +100% damage modifier of Enchant Deadly Poison.
+ [Skotlex]
+ * Fixed SkillStatusChangeTable not working correctly for Homun/Guild
+ skills. [Skotlex]
+2006/06/30
+ * Fixed a typo in msg_athena.conf, "This item cannot be drop" -> "This item cannot be dropped" [MasterOfMuppets]
+ * Added a check to prevent equipped items from being traded. [Skotlex]
+ * Added UF_SONG (0x400) to differentiate songs from dances. [Skotlex]
+ * Added preliminar support for making a Song+Dance turn into BA_DISSONANCE
+ cells. Beware of potential bugs as it's untested. [Skotlex]
+ * Added mapflag "nochat" to prevent chatting rooms from being created.
+ [Skotlex]
+ * Corrected some of the sleep checks when the char id does not matches with
+ the char-id expected by the script engine. [Skotlex]
+ * Cleanup in itemheal related code, fixed the item heal group bonus not
+ working on Groups beyond 7. [Skotlex]
+ * Fixed pet's loot not being moved to your inventory on logout. [Skotlex]
+2006/06/29
+ * Made the map server send list of characters online to the char-server on
+ reconnection regardless of "kick_on_disconnect" setting, as otherwise, a
+ temporary disconnection would make the char-server tag all characters
+ offline and refuse to save them afterwards. [Skotlex]
+ * Fixed guild storage being "eternally in use" if you quit/logout before
+ closing it. [Skotlex]
+ * Ending SC_CLOAK/SC_HIDE/SC_CHASEWALK will now trigger ontouch npcs.
+ [Skotlex]
+ * [Fixed]
+ - Scripting system screwing up script position after mixing timers with menus.
+ - NPC attached AI mobs display as alive when dead.
+ - View data not updating after buildin_unitdeadsit.
+ [Improved]
+ - NPCE_LOADMAP to execute after all (area) objects are sent to the player.
+ - Simplified scripting system. sd will now use pointer to the script state itself.
+ [Lance]
+
+2006/06/28
+ * changed:
+ dynamic_pass_failure_ban_how_many:from 3 to 7
+ dynamic_pass_failure_ban_how_long:from 60 to 5
+ as in official servers. [Musashiden]
+ * Added a check in script command "set_option" so that invoking
+ "set_option(0)" removes Cart/Peco/Falcon, as expected by scripts. [Skotlex]
+ * Added trade-range check on trade start. [Skotlex]
+ * Added inf2 4096 (INF2_ALLOW_ENEMY) which is to be used in conjunction
+ with INF2_PARTY_ONLY/INF2_GUILD_ONLY when said skill should ALSO be allowed
+ to be used on enemies. [Skotlex]
+ * Cleaned up a bit the code for @item [Skotlex]
+ * Fixed character/storage being sent to be saved TWICE when you logged out
+ while the storage is opened. [Skotlex]
+ * Added save_settings map config. Specifies after which events do
+ characters get saved (defaults to all): 1 - Trade successful, 2 - Vending
+ transaction, 4 - Closing storage/guild storage, 8 - hatching a pet.
+ [Skotlex]
+ * Changed the mob drop rate adjust function to receive a signed int
+ argument. Probably will fix those drops with 0% becoming 100% [Skotlex]
+ * Corrected Musical Strike having a different damage equation from Throw
+ Arrow. [Skotlex]
+ * Added state rewarp to players. It gets set when a pc_setpos call is
+ triggered while the player is changing maps so that when the player finish
+ loading the map, it is inmediately rewarped to where it has been
+ rewarped/recalled to. [Skotlex]
+2006/06/27
+ * Map server will now resent the whole list of online characters to
+ char-server on reconnect when the kick_on_disconnect setting is active.
+ [Skotlex]
+ * Cleaned up and optimized the IP sync code. New login_athena config
+ setting sync_ip_interval specifies how often to sync the ip. The default is
+ 0 (disabled). [Skotlex]
+ * Added mapflag "loadevent", now load-map script events will ONLY trigger
+ on maps with this mapflag on, rather than every map. [Skotlex]
+ * High Jump can now be used in all versus maps. [Skotlex]
+ * Added Kaite's opt3 value, taken from jA [Skotlex]
+ * Added state dirty == 2 to storages. Signals when a storage was sent for
+ final saving. Said storage is removed from memory after the ack from the
+ char-server, and they are sent to save if the map/char servers reconnect
+ before the ack arrives. In short: they are guaranteed to be saved after a
+ char logs out. [Skotlex]
+ * Put pay_arche.gat in the "no experience lost" mapflag file. [MasterOfMuppets]
+2006/06/26
+ * Corrected the element of hunter traps. [Skotlex]
+ * Deadly Poison now also reduces def2 by 25% [Skotlex]
+ * Cleaned up a bit skill_moonlit, Moonlit Petals should work correctly now.
+ [Skotlex]
+ * Fixed @mi displaying always 0 instead of the mob's class. [Skotlex]
+ * Rough implementation of Ground Drift according to description and jA
+ info. [Skotlex]
+ * Implemented Tatami Gaeshi using skill description and jA implementation
+ for reference. [Skotlex]
+ * Merged Mitternacht's max_heal/max_heal_lv config settings. [Skotlex]
+ * Removed support of packet 0xc3 on the new packet versions. Thanks to
+ Meruru for pointing out they aren't being used anymore. [Skotlex]
+ * Autospells will now again check for the skill's nk value, so that skills
+ tagged "nodamage" skills will not trigger autospells. [Skotlex]
+ * Corrected clif_item_sub so that pet eggs will correctly be sent as
+ equipment (fixes them showing up "broken" and with random refine levels)
+ [Skotlex]
+ * [Added]:
+ - buildin_unitkill just for kicks. [Lance]
+
+2006/06/23
+ * [Optimized]:
+ - Setting of variables with defined scope in some frequently executed script
+ events.
+ [Added]:
+ - Missing script_require_trigger flags for some power hungry events.
+ * Updated mob_db.sql and item_db.sql to latest. [Skotlex]
+ * Modified pc_setoption so that it will correctly update sprite AND clothes
+ color when mounting/unmounting changing into/from xmas/wedding sprites.
+ [Skotlex]
+ * Allowed itemdb_exists to return the dummy item. Enables "invalid" items
+ to be sold, traded, dropped, etc. [Skotlex]
+ * Corrected ASC_BREAKER. Int-based damage is applied after attribute fixes
+ and before card reductions. The skill now completely disregards left
+ hand weapon. [Skotlex]
+ * Standarized PF_MEMORIZE to be 50% cast time on all skills (instead of
+ -50% for targetted skills and -66% for ground skills >.>) [Skotlex]
+ * Cleared up the comment on what item_check does and how it works.
+ [Skotlex]
+ * Changed setting for skill_nocast flag 16. It is no longer a "pk-mode map"
+ setting, it's now a clone-forbidden skill. That is, skills with the flag 16
+ will never be copied by clones. If you use a PK-mode server, use flag 2 now
+ to forbid skills from common maps. [Skotlex]
+ * Default skills from not being cloned are Magnus Exorcism and Turn Undead.
+ * The map search free cell will now use the size of the map # of tries
+ before giving up when the spawn area is the whole map. Added a check to
+ inmediately give up when the number of spawn retries has reached the max
+ specified (no_spawn_onplayer = 100). [Skotlex]
+ * Cleaned up a bit the clone code to account for the unit flags
+ UF_NOPC/UF_NOMOB when the skill is not ground-based (accounts for self
+ skill that causes a ground-tile to be placed, like Dances). [Skotlex]
+ * Added pc_bonus_autospell_del, gives support for removing autospell
+ effects. When a negative rate is specified, it will decrease the chance of
+ casting (eg: You have two different cards with autospell Heal +20% each,
+ then do autospell -30. The second card will be cancelled, and the first one
+ will become Heal +10%) [Skotlex]
+ * npc_timers now will not restore the previous timer data when there's no
+ players attached (when it's strictly an npc timer). This should reenable
+ the old behaviour of getnpctimer returning the total ellapsed time since
+ "startnpctimer" even after the last label has been reached. However, this
+ behaviour won't apply to player-attached timers. [Skotlex]
+ * [Fixed]:
+ - MAPREGSQL overloading SQL table with temperory map registries.
+ - Incorrect perfomance calculation for MAPREGSQL loading and saving. [Lance]
+
+2006/06/22
+ * Guessed and added support for the packets 0x22a (idle) and 0x22b (spawn).
+ This should complete the required packets for PACKETVER 7. [Skotlex]
+ * Added support for the PACKETVER 7 packets in the "dummy" current
+ intravision implementation. [Skotlex]
+ * Fixed @autoloot being off by 0.01% when entering a manual value.
+ [Skotlex]
+ * Restored the "Secret" behaviour of Blast Mine and Claymore Trap where
+ each target is hit N times (where N is the number of mobs in the splash
+ area at the moment of triggering). [Skotlex]
+ * Updated the tools/stackdump script to also handle sig-plugin generated
+ backtraces. Now it will also auto-determine whether the exe needs a .exe at
+ the end or not. Help me test it as I want this script on stable NOW :X
+ [Skotlex]
+ * Usage is "stackdump <login/char/map> <txt/sql> [number]". When a number
+ is given, sig-plugin stackdumps are assumed, otherwise it parses the normal
+ stackdump as before. [Skotlex]
+ * Corrected autoloot so that you can specify rate with decimal precision
+ ("@autoloot 0.01" should work) [Skotlex]
+2006/06/21
+ * [Removed]:
+ - Redundant mob name copying. (it's already copied in mob_parse_dataset) [Lance]
+ * [Fixed]:
+ - Compilation warnings and errors.
+ [Improved]:
+ - Changed and moved IP sync status messages to elaborate more. [Lance]
+ * Tested and fixed resolve_hostbyname. Applied said function around most of
+ the code where needed. Removed includes for the OS/network system pretty
+ much from every file (our socket.c file should handle this) [Skotlex]
+ * Made the GM mute request bypass the manner_system setting. [Skotlex]
+ * Applied use of parse_hostbyname() in chrif.c to fix compilation errors.
+ [Skotlex]
+ * status_percent_change will now account for when the target's max hp/sp is
+ above INT_MAX. [Skotlex]
+ * [Added]:
+ - DNS (WAN) sync for those pesky disconnections (dynamic ip renewal). [Lance]
+2006/06/20
+ * Some cleaning up of OPTION related code. OPTION_XMAS and OPTION_FLYING
+ really ARE the same value clientside! (totally stupid), therefore I've
+ opted from removing the flying animation since it really just displays as
+ Xmas for others (and the correct fix involves adding a bunch of
+ class-change packets...) [Skotlex]
+ * Updated skill_require_db to place the Zeny requirements of ZenyNage and
+ Fling. [Skotlex]
+ * Fixed crash when non-players use ZenyNage. Added the correct Zeny check
+ in skill_check_condition, fixed the skill so that it's damage is based on
+ whatever zeny is specified in skill_require_db. [Skotlex]
+ * Can-act delay will not be reset when warping now. [Skotlex]
+ * Fixed Quagmire not altering walking-speed. [Skotlex]
+ * Silence now blocks skills both on begin/end casting. [Skotlex]
+ * Updated status_calc_bl so that when walking speed changes, the character
+ is made to rewalk so that the new speed takes effect inmediately. [Skotlex]
+2006/06/19
+ * Added Ayothaya to nopenalty and nopvp mapflags. [Evera]
+ * Combo-used Skills with State "move_enable" will now override the "can't
+ move delay". Fixes Break-Fall -> Jump-Kick. [Skotlex]
+ * Some more cleanups of battle_calc_damage to account for absorbed damage
+ reductions. [Skotlex]
+ * Moved back Soul Drain code from mob_dead to skill_counter_additional_effect.
+ Now we are back to where the skill animation does not shows, but you DO
+ get SP T.T' [Skotlex]
+ * Some cleanups and corrections in battle.c to account for negative
+ (absorbed) damage. [Skotlex]
+ * Fixed fame-list updating crashing char-sql server when the given char-id
+ just got into ranking. [Skotlex]
+ * Added missing Arunafeltz maps with information from NLZ [Evera]
+2006/06/18
+ * [Fixed]:
+ - Typo in status.c add_sc() using 'skill' instead of 'sk' as index, resulting in
+ filling the SkillStatusChangeTableArray with junk data.
+ - > NEEDS CONFIRMATION < Ends casting if player is knocked with freezing/stun/whatever
+ - Typo in parse_frommap. [Lance]
+ * [Fixed]:
+ - clif_initialstatus using SHRT_MAX instead of USHRT_MAX for status_point.
+ * [Temperory Fixed]:
+ - Crashing of SQL char-server in parse_frommap case 0x2b01. [Lance]
+ * [Removed]:
+ - Large part of scripted mob control commands are removed.
+ - Large part of scripted player control commands are removed.
+ - Scripted mob slaves changing master ID.
+ [Added]:
+ - Unit control commands.
+ - CALLBACK_NPCCLICK for scripted mobs, added this to db/const.txt too.
+ - Macro RECURSIVE_MASTER_CHECK in battle.c
+ [Modified]:
+ - buildin_skilluseid and buildin_skillusepos -> buildin_unitskilluseid
+ and buildin_unitskillusepos.
+ - md->callback_flag to short (double word). [Lance]
+
+2006/06/17
+ * Devotion absorbed damage will now appear to come from oneself (instead of
+ the original attacker changing directions towards the Crusader) [Skotlex]
+ * Updated clif_refres to send inventory, cart, and weight info. [Skotlex]
+ * Fixed intif_guild_memberinfoshort to not leave a dangling pointer when
+ someone logs out <.< [Skotlex]
+ * Changed some mapflags related to the eye of hellion quest. [MasterOfMuppets]
+ * [Added]:
+ - buildin_checkcell, buildin_mobwarp, buildin_pcattack.
+ [Improved]:
+ - buildin_skilluseid and buildin_skillusepos to accept a few more arguments.
+ - mob_script_callback to return sucess value [Lance]
+ * Fixed the party HP packets to send max HP 10000 and scale HP accordingly
+ when the player's HP doesn't fits in the packet's field. Fixes HP bars not
+ correctly displaying the % of life when max HP is above 32k. [Skotlex]
+
+2006/06/16
+ * Fixed option value being reset'ed on login (fixes cart/peco/falcon being
+ lost) [Skotlex]
+ * Corrected @speed to alter your base speed instead of battle one. Means
+ the change remains for much longer (until status_calc_pc is invoked, which
+ could be due to equipping/unequipping stuff) [Skotlex]
+ * Modified the bNoMagicDamage/bNoWeaponDamage bonuses to be a 0-100
+ setting. Meaning you can do bonus bNoMagicDamage,50; To make all magic
+ damage be reduced by half. This bonus stack, so two cards with
+ bNoMagicDamage,50 will give magic immunity. [Skotlex]
+ * Removed setting gtb_pvp_only and replaced it with gtb_sc_immunity which
+ specifies the threshold before the bNoMagicDamage starts blocking support
+ statuses as well. ie: gtb_sc_imunity: 75 will mean that "bonus
+ bNoMagicDamage,70;" reduces magic damage by 70%, but does not blocks heal
+ or support status, while "bonus bNoMagicDamage,80;" does. [Skotlex]
+ * Removed db_tables.sql as it's no longer used. [Skotlex]
+ * the mvp_sd is removed when the mob is the emperium and there's no
+ killer/exp-awarded (assumed killed by script), this prevents the on-kill
+ event from triggering and giving the castle to whoever damaged the most the
+ emperium without destroying it. [Skotlex]
+ * [Added]:
+ - Custom slave mobs to inherit the callback_flag.
+ - Added option #25 to buildin_setmobdata to set the callback_flag. [Lance]
+ * [Improved]:
+ - Cleaned up Custom Mob Script Callback codes. Looks much better now :B. [Lance]
+
+2006/06/15
+ * [Fixed]:
+ - intif_parse_RenamePetOk for not compatible with ANSI-C initialzation specification.
+ [Lance]
+ * Added indexes for loginlog and ipbanlist as they did not have any.
+ (note, someone already put the index on loginlog on trunk.) [Euph]
+ * Merged Adam's patch to let the char-server handle validation of
+ pet-name-change requests through the allowed char letters config. [Skotlex]
+ * Fixed "wedding_ignore_palette: yes" not working when relogging with the
+ gear already equipped. [Skotlex]
+ * Added blocking of the Kick skills when you are a Soul Linker. [Skotlex]
+ * Added enabling to turn off a kick-stance regardless of class. [Skotlex]
+ * Altered a bit how status_set_viewdata behaves in regards to Wedding/Xmas
+ options. [Skotlex]
+ * Added back OPTION_XMAS, but the actual value is missing! [Skotlex]
+ * Corrected chrif_save so that the player is not set offline on map-change.
+ [Skotlex]
+ * Added change-look support in pc_setoption when specifying OPTION_XMAS
+ [Skotlex]
+ * Fixed clif_parse_RemoveOption removing all options instead of just
+ Falcon/Cart/Peco [Skotlex]
+ * Fixed clif_send not sending packets to SELF when specifying AREA if the
+ source is not on the map yet. [Skotlex]
+ * Fixed and cleaned up script command 'equip' [Skotlex]
+ * Fixed 'autoequip' items. [Skotlex]
+ * Fixed Aspd not being updated in your status window after Agi/Dex
+ increasing statuses take effect. [Skotlex]
+2006/06/14
+ * Fixed map_nick2sd so that searching for "Adam" will not match a char
+ named "Adam Smith". Thanks to Adam for reporting it out. [Skotlex]
+ * Modified how luk reduces status changes by reducing the gap. Eg: resist =
+ vit; resist += (max - resist)*luk/300; [Skotlex]
+ * Added battle settings pc_max_sc_luk/mob_max_sc_luk to handle which is the
+ luk threshold at which you gain inmunity (defaults to 300). [Skotlex]
+ * Fixed buildin_getmobdata. It was trying to handle the first parameter as the
+ array to fill in. [blackhole89]
+ * Blocked again skill usage during marionette. [Skotlex]
+ * Fixed main.sql adding a key on char_id rather than account_id for the
+ char table. [Skotlex]
+ * Cleaned up character saving in char-sql, it no longer needs to query the
+ database to see if the player exists on each char-save, instead it checks
+ the received data against the online-players db. No such fix is required
+ for char-txt. [Skotlex]
+ * Added an error message on the char-server when the received player data
+ size does not matches with the expected size (should avoid the crash that
+ happens on such a memcpy). [Skotlex]
+ * [Improved]:
+ - script_save_mapreg for MapregSQL Saving to display perfomance only in slow
+ queries. [Lance]
+2006/06/13
+ * Updated mob_db.sql and item_db.sql to latest. [Skotlex]
+ * Added account_id index to char table. Thanks to Buuyo for reporting it.
+ Sql users apply upgrade_svn7146.sql NOW. [Skotlex]
+ * Marionette and Devotion will now check raw distance and ignore obstacles
+ and the like. [Skotlex]
+ * Added irc_channel_pass setting and prevent crashing when irc server
+ lookup by host fails. Thanks to Trancid for the details. [Skotlex]
+ * [Fixed]:
+ - clif_parse_GetCharNameRequest displaying false alarm for legitimate GM snooping.
+ [Lance]
+ * Added support for reading correctly status change data from Guild and
+ Homun skills. [Skotlex]
+ * Added support for reading Homun skill data (which means the HM skills are
+ now safe to add to skill_db, skill_require_db, etc) [Skotlex]
+ * Oppositions can't be made during WoE now. [Skotlex]
+ * Fixed a few compiler warnings from VC [Skotlex]
+ * Commented out the Homunculus Skills<->Status Change link which was
+ causing some memory corruptions. [Skotlex]
+2006/06/12
+ * [Fixed]:
+ - buildin_npcshopitem not allocating extra 1 block of terminator.
+ [Added]:
+ - Modified versions of Dj-Yhn's buildin_npcshopdelitem and buildin_npcshopadditem
+ [Lance]
+ * Updated clif_disp_onlyself to not use dynamic memory and write directly
+ to the player's buffer. [Skotlex]
+ * Updated @noask to also tell the user what he has just rejected (added
+ msg_athena entries for each of the different requests). Also updated it to
+ use clif_disp_onlyself. [Skotlex]
+ * Fixed a pair of missing initializers in the clif storage functions.
+ [Skotlex]
+ * @heal no longer displays a healing animation. Fixes the client believing
+ you couldn't be healed more than 32K. [Skotlex]
+ * Now you can use any skills (except encore/dancing ones) while under
+ Longing for Freeding. [Skotlex]
+ * Now you can use any skills while under Marionette Control. [Skotlex]
+ * Fixed npc_checknear's distance check returning the opposite of what it
+ should (false when the range is correct and viceversa) [Skotlex]
+ * Added a warning on item loading when an item is of equippable type but
+ has no equippable position. [Skotlex]
+ * Turning an alliance to an opposition won't work now during WoE [Skotlex]
+ * Slaves can summon other mobs now. The only ones who can't do this are
+ player summoned mobs. [Skotlex]
+ * Merged the following functions for faster processing of items: [Skotlex]
+ clif_storageitemlist + clif_storageequiplist = clif_storagelist
+ clif_guildstorageitemlist + clif_guildstorageequiplist = clif_guildstoragelist
+ clif_itemlist + clif_equiplist = clif_inventorylist
+ Note that the changes are a bit substantial and need proper testing!
+ * Increased max knockback value support to 25. [Skotlex]
+ * [Optimized]:
+ - buildin_npcshopitem memory allocation to calculate before reallocating.
+ [Lance]
+ * Made guild member exp an unsigned int. [Skotlex]
+ * Various cleanups to the npc clicking related functions. Should fix quite
+ some possible crashes from crafted packets. [Skotlex]
+ * Added overflow checks for bonus settings mdef_rate/def_rate. [Skotlex]
+ * Added missing update of INT after a buf. [Skotlex]
+ * Small cleanup of how SC_BLEEDING works. [Skotlex]
+ * Fixed party_foreach_samemap invoking the function on the CASTER instead
+ of on the party members. [Skotlex]
+ * Modified clif_parse_NpcClicked to handle the different situations with
+ different bl-objects (attack on players/mobs, click on npcs or mobs with
+ npc attached) [Skotlex]
+2006/06/09
+ * [Fixed]
+ - Compilation warnings on guild.c and int_guild.c [Lance]
+ * Added structure party_data and party_member_data to the map server to
+ hold party-specific required information about parties including
+ Monk/TK/SG/SN states and party member count. Family information is still
+ missing, and handling of the state should probably be done by the
+ char-server, too... [Skotlex]
+ * party Hp updates are no longer done each time the Hp is modified, but
+ together with the party xy timer. It means HP-bars will be a bit delayed
+ before being updated, but packet consumption should be much less during
+ heated battles. [Skotlex]
+ * Fixed MoM's typo [Vicious]
+ * Fixed map_readafm missing strcpy(afm_name, m->name). [Skotlex]
+ * [Improved]:
+ - npc_click interception on BL_MOB and BL_PC to let sd act accordingly.
+ [Lance]
+ * [Fixed]:
+ - Execution of sleep/sleep2 more than once will hang the script_state.
+ [Lance]
+ * Fixed @mapinfo displaying incorrectly maps with nosave which send you
+ back to your last savepoint. [Skotlex]
+ * Moved guild_exp_rate from a mapserver battle config setting to a char
+ server config. It no longer modifies the total taxed exp as seen on the
+ guild information window, but directly modifies the exp that the guild
+ earns. [Skotlex]
+ * Added an error report and correction when the map server receives a guild
+ from the char-server with more guild members than MAX_GUILD. [Skotlex]
+ * Changed the interval between waterballs back to 125 [MasterOfMuppets]
+ * Fixed a typo in char_sql/char.c, thanks to Euph [MasterOfMuppets]
+2006/06/08
+ * Modified guild exp to be an unsigned int rather than a signed one.
+ [Skotlex]
+ * Fixed @skilltree printing out Unknown job for most targets used.
+ [Skotlex]
+ * Cleaned clif_pvpset to not send the packet to nearby characters when the
+ source is GM-hidden. May help fix the crash on PvP with gm-hidden
+ characters. [Skotlex]
+ * Modified map_freeblock_unlock so that aFree errors will report the
+ file/line that INVOKED the function rather than the function itself.
+ [Skotlex]
+ NOTE: Do NOT disable the memory manager as that will break this change.
+ This change is to be temporarily set until the afree'd error can be
+ resolved.
+ * Updated mob_npc_warp to a three-state config switch. 0 disables. 1 enable
+ only on warps that don't lead to nobranch maps. 2 - enable on all warps.
+ [Skotlex]
+ * Adjusted Don't Forget Me, Defender, Longing to use all val entries, and
+ to hold the speed adjustment value rather than speed penalty (eg: 125
+ instead of 25). [Skotlex]
+ * Cleaned up status_calc_speed so that speed penalties are correctly
+ handled (eg: 25% penalty is speed*100/75, not +speed*25/100). Thanks to
+ Euph for pointing it out and Belle for the speed mechanics. [Skotlex]
+2006/06/07
+ * Fixed Sense using mdef instead of mdef2 [Skotlex]
+ * Fixed item-skills not showing up on login. [Skotlex]
+ * Cleaned up clif_parseLoadEndAck, by testing which packets are required
+ only on first-login and which ones are required on all map-changes.
+ Skill-tree, Exp, Skill Points and most of the basic status are no longer
+ sent on map-change (items, cart data and zeny still need to be sent one
+ very map-change). [Skotlex]
+ * Fixed the mob state not being set to Berserk/Angry correctly after the
+ mob reaches the target's location. [Skotlex]
+ * Added config setting mob_npc_warp, when set to yes, enables mobs to be
+ warped between maps when stepping on a npc-warp. [Skotlex]
+ * Added monster_ai setting &64, when enabled makes a mob run to any nearby
+ npc-warp when their current target has switched maps. [Skotlex]
+ * Added pc_calcexp to calculate individual exp bonuses acquired from exp's
+ source (race bonus cards, SG Exp skills, pk-mode higher level exp) [Skotlex]
+ * pc_gain_exp now also receives the source of the exp, when said source
+ exists, bonuses are applicated as needed. [Skotlex]
+ * Added status_kill when capturing a mob, should take care of the mob not
+ respawning after caputed. [Skotlex]
+ * Fixed item info not displaying the found item id [Skotlex]
+ * Fixed item info not displaying the weight value properly. [Skotlex]
+ * Adjusted status resistances and durations taking as base Viccious's info
+ from the kro guidebook. [Skotlex]
+ * Moved souldrain code from skill_counter_additional_effect to mob_dead. It
+ should display the skill animation correctly now. [Skotlex]
+ * Adjusted several sc rate/time reductions as pointed out by Playtester.
+ [Skotlex]
+ - Luk now plays a luk/10 reduction role rather than a luk/3 one.
+ * Removed char_nick2id from char-sql server as it's no longer needed.
+ [Skotlex]
+ * Fixed quitting the map server not properly saving the storage before
+ deleting it. Thanks to Adam for pointing it out. [Skotlex]
+ * Cleaned status_get_sc_tick/status_get_sc_def to use the status_data
+ function. [Skotlex]
+ * SC_STOP's chance and duration can't be reduced anymore. [Skotlex]
+ * Storm Gust no longer has a 100% chance to freeze by passing mdef, now it
+ has a 300% base chance reduced by mdef and the like as explained out by
+ Tharis. [Skotlex]
+ * Frost Diver/Frost Nova's base freezing chance is no longer affected by
+ target's int. [Skotlex]
+ * [Improved]:
+ - mob_dead not to remove script controlled monsters with player sprites.
+ [Added]:
+ - buildin_mobdeadsit :D [Lance]
+ * [Fixed]:
+ - temp++ gets issued before if(mvp_damage<(unsigned int)md->dmglog[i].dmg) in
+ mob_damage. Thanks to seahorsix. [Lance]
+ * [Fixed]:
+ - Corrected login-server SQL to use *((ulong *)p) instead of (ulong)p [Lance]
+ * [Optimized]:
+ - list and size not being initialized (size get intialized in default: switch case)
+ Eliminated default case and initialized list and size at the beginning. [Lance]
+2006/06/06
+ * Hopefully fixed for sure mobs getting extra stats when changing-class due
+ to the mobs level up setting. [Skotlex]
+ * Removed a piece of code that should no longer be needed due to the
+ combo-skill setting (inf = self, inf2 = no-target-self) which is blocking
+ self-skills from being used on others (pets/mobs should be allowed to do
+ that) [Skotlex]
+ * Added a status_check_skilluse call in Sightblaster to prevent it from
+ hitting hidden/cloaked/act-dead/etc players. [Skotlex]
+ * Fixed firewall counter going down by 2 each hit rather than 1. [Skotlex]
+ * Fixed Soul Burn not zapping away all SP. [Skotlex]
+ * The monsters can level up setting will not take effect when the mob's
+ level is LESS than their db counter-part (should prevent under-leveling
+ causing underflows and semi-immortal mobs) [Skotlex]
+ * Fixed mvp-exp calculations being messed up with more than one attacker.
+ [Skotlex]
+ * Changed the mob exp race bonus so that each player gets their own bonus,
+ rather than the killer's bonus applying to everyone. Still not the
+ "correct" way, but one step closer to it. [Skotlex]
+ * [Fixed]:
+ - Allocation of event_list in guild_npc_request_info to aCalloc so
+ memcpy(ev->name,event,strlen(event)) will have a null terminator. [Lance]
+2006/06/05
+ * Fixed a crash when using SL_SMA and the "combo" ain't ready. [Skotlex]
+ * Hopefully fixed changing a mob's class causing them to get all sort of
+ stat bonuses due to the mobs-level-up setting. [Skotlex]
+ * Changed hit, flee, cri, flee2, def2 and mdef2 to signed short, def, mdef
+ to signed char to correctly account for cards with penalties in said stats.
+ [Skotlex]
+ * Fog of Wall won't affect the caster now in any way. [Skotlex]
+ * Added clif_fixpos packets before attacking for the first time to clear
+ any position sync issues with the client. [Skotlex]
+ * Fixed skill_unitsetting using layout->count for the for instead of
+ group->count [Skotlex]
+ * Added SC_INCDEXRATE/SC_INCAGIRATE. NPC_POWERUP/NPC_AGIUP now correctly
+ increase dex/agi by 40% per level. [Skotlex]
+ * Fixed char-sql server not deleting character variables when deleting a
+ char. [Skotlex]
+ * Corrected cloaking not ending on attack if you are near a wall. [Skotlex]
+ * Updated pc_bonus to use cap_value on all status_data modifiers to prevent
+ overflows/underflows. [Skotlex]
+2006/06/03
+ * Fixed @mi/@mobinfo not showing the name collumns correcly [shadow]
+ * Solved the bug that made firewalls only castable a few times until [MasterOfMuppets]
+ you relogged. Thanks to Euph for the fix.
+ * Added variable other_mapserver_count to chrif.c which holds total count
+ of connected map-servers. By using this we prevent sending unnecessary
+ packets to the char-server when there's no more map-servers connected.
+ [Skotlex]
+ - Affected packets are whispers, announces, party messages, guild messages.
+2006/06/02
+ * Fixed Visual Studio 7.1 Solution File (Login TXT and Map TXT were removed)
+ * Fixed a bug in unit_can_reach_bl which breaks path seeking when the
+ target is near obstacles. [Skotlex]
+ * Updated offensive use of Sanctuary to function like on the official servers [MasterOfMuppets]
+ * Changed the interval between waterballs from 150 to 250 milliseconds [MasterOfMuppets]
+ * Corrected clif_parse_takeitem to ALWAYS return a NAK packet when it
+ fails. Fixes cases where the client gets "stuck" and refuses to let you
+ pick any items. [Skotlex]
+ * Removed the walk delay from firewall and changed its knockback [MasterOfMuppets]
+ to 1 tile to make it act more like in the official servers.
+ * Some cleaning of the mob slave ai. [Skotlex]
+ * Corrected Brandish Spear to work on levels above 10. [Skotlex]
+ * Updated Two-HandQuicken, One-HandQuicken to give 30 +2*lv% aspd-rate for
+ skill levels above 10 (meant for boss casted skills) [Skotlex]
+ * Fixed Spear-Quicken messing with the calc_flag [Skotlex]
+ * Fixed Freeze/Stone/Benedictio not changing your elemental LEVEL to 1.
+ [Skotlex]
+ * [Fixed]
+ - Yet another compilation warning. [Lance]
+2006/06/01
+ * Altered status_calc_pc so that equipment scripts are ran before
+ card-scripts. [Skotlex]
+ * Fixed pc_bonus to not underflow/overflow when adjusting def/mdef.
+ [Skotlex]
+ - These two together, should fix Tao Gunka Card.
+ * npc_debug_warps() will now be invoked if warp_point_debug is set.
+ [Skotlex]
+ * Updated item_db.sql/mob_db.sql to current. [Skotlex]
+ * Fixed NPC_SELFDESTRUCTION not showing nor dealing damage. [Skotlex]
+ * NPC_TRANSFORMATION/NPC_METAMORPHOSIS will now preserve the original mob
+ without removing it when the skill level is greater than one. [Skotlex]
+ * Added SC_DANCING declaration in the Status Change tables to signal it
+ modifies Walk speed. [Skotlex]
+ * Fixed pc_damage setting your canlog_tick even if the damage has no source
+ (eg: poison, berserk) [Skotlex]
+ * Berserk's aspd bonus now stacks with other aspd bonuses, but is still
+ affected by Quagmire/Forget-me-not. [Skotlex]
+ * Corrected setting slaves_inherit_mode to not apply to morphosis skills.
+ [Skotlex]
+ * Corrected pc_setoption to invoke status_calc_pc when getting/removing the
+ cart. [Skotlex]
+ * Fixed @mobinfo displaying the wrong element. [Skotlex]
+ * Fixed Autoblitz taking into account target's luck rather than attacker's
+ [Skotlex]
+ * Fixed slaves warping endlessly to their master when the master-slave
+ distance exceeds 30. [Skotlex]
+ * SC_ORCISH will now be dispelled on logout (if debufF_on_logout is set)
+ [Skotlex]
+ * Removed attackrange/attackrange_ from TBL_PC, corrected clif.c using the
+ incorrect range variable. [Skotlex]
+ * You can now equip/unequip stuff while the storage is open. [Skotlex]
+2006/05/31
+ * Fixed Soul Drain not really giving you SP [Skotlex]
+ * [Fixed]:
+ - Suppressed compilation warning in chrif.c [Lance]
+ * [Fixed]:
+ - Guys can't go across map-servers :( [Lance]
+ * [Fixed]:
+ - Restoration and saving of sd->npc_id must be done every time. [Lance]
+ * Added back the Freeze/Petrify adjustments of -50%def and +25%mdef (when
+ where these lost?). Thanks to Buuyo for pointing it out. [Skotlex]
+ * Corrected the mob_ai&2 setting triggering rude-attacked due to can't walk
+ delay. [Skotlex]
+ * Made the char_name_option char_athena.conf setting apply to parties and
+ guilds as well. It cannot be applied to pets yet without adding a
+ change-name-request interserver packet. [Skotlex]
+ * Moved the JOB_* defines from map.h to mmo.h, update char.c to use them.
+ [Skotlex]
+ * Added function char_read_fame_list for famelist reading. Invoked it on
+ init, and made it be sent automatically to connecting map servers.
+ [Skotlex]
+ * Some cleaning of the fame-list reading code. [Skotlex]
+ * Some cleaning of the fame-update code, fixed a logic bug which made the
+ ranking list fail to display the correct ranker names. [Skotlex]
+ * Removed typedef bool from socket.h and included cbasetypes.c instead.
+ [Skotlex]
+ * Cleaned up and corrected the calculation of hit/flee/cri/lucky dodge in
+ status_calc_bl. [Skotlex]
+ * [Fixed]:
+ - Incorrect SQL syntax in login.c (missing collumn) [Lance]
+ * [Improved]:
+ - SQL upgrade file for the new loginlog. Thanks to ultramage. [Lance]
+ * [Fixed]:
+ - nullpo in pet.c caused by equipping without checking if the pet is available.
+ [Lance]
+ * [Fixed]:
+ - Latest client support completed! [Lance]
+ * [Fixed]:
+ - Missing #include for cbasetypes.h in login server SQL.
+ - Logic errors in run_script [Lance]
+ * [Added]:
+ - Partial support for latest login packet. But it seems to have a new security
+ module. [Lance]
+2006/05/30
+ * [Improved]:
+ - Fake NPC interface to use real NPCs.
+ - Scripting interface to restore and save sd->npc_id. [Lance]
+ * Added function pc_check_skilltree for checking if you unlocked new
+ tree-skills when raising non-passive skills. [Skotlex]
+ * Fixed flee/hit calculation in status_calc_bl to account for bonuses from
+ the base status. [Skotlex]
+ * [Fixed]:
+ - Compatibility problems in login.c [Lance]
+ * Fixed pets ignoring can-act delays for skill usage. [Skotlex]
+ * [Added]:
+ - Mercenary.c in VS.NET 2005 project files
+ [Improved]:
+ - loginlog using unsigned long `ip` field.
+ (Please check for compatibility problems). [Lance]
+ * Fixed status_calc_pc not zero'ing ALL vars it should, allowing certain
+ bonuses (like effect-on-hit) to stack. [Skotlex]
+ * slaves inherit speed setting will now work regardless of whether the
+ slave or master has the MD_CANMOVE mode bit. [Skotlex]
+ * Call Slave now invokes slaves on a 5x5 area around master. [Skotlex]
+ * AL_TELEPORT will fail when used by slave mobs. [Skotlex]
+ * Added NPC_ENERGYDRAIN, NPC_MENTALBREAKER to the list of undodgeable
+ attacks. [Skotlex]
+ * Fixed status_damage not setting your HP to 0 when you died [Skotlex]
+ * Fixed the pcbonus2 warnings using the wrong value before printing the
+ invalid Element error. [Skotlex]
+ * Fixed underflow issues when calculating dmotion. [Skotlex]
+ * Fixed Absorb Spirit Spheres [Skotlex]
+ * Added battle_config min_chat_delay (default 0, battle/client.conf)
+ specifies in ms what is the min delay between player sent chats
+ (whisper/global/party/guild). Messages that exceed this threshold are
+ silently ignored for now (perhaps need to add a "DON'T SPAM" reply to the
+ player?) [Skotlex]
+ * [Fixed]:
+ - signed/usigned problem in sprintf and fscanf @ mercenary.c [Lance]
+ * Rewrote/cleaned up @petfriendly. [Skotlex]
+ * Cleaned up final part of status_calc_pc (flags 2/4 do not exist) [Skotlex]
+ * Updated attr_fix_table reading code to account for ELE_MAX (will
+ correctly read bigger elemental tables if ELE_MAX is changed) [Skotlex]
+ * Aggressive mobs will now use battle_check_range rather than mob_can_reach
+ to decide whether to lock-on or not to a target within sight-range. [Skotlex]
+ * Added warnings in mob_readdb when the mob's element is invalid. [Skotlex]
+ * Added error messages in pc_bonus* functions when an invalid element is
+ passed to the relevant bonuses. [Skotlex]
+ * [Optimized]:
+ - clif_specialeffect to use the enums.
+ [Improved]:
+ - buildin_specialeffect and buildin_specialeffect2 to accept effect area
+ definition. [Lance]
+ * [Added]:
+ - Visual Studio .NET 2003 includes for mercenary.c [Lance]
+ * Removed the on-die specific code from unit_remove_map and placed it on
+ the corresponding *_dead functions. unit_remove_map should never assume the
+ char died, it is just a "remove from map" function. [Skotlex]
+ * Updated status_damage to handle the general death code (clearing status
+ changes, clearing skill related data, sending death packet, etc). The
+ return value from the *_dead functions will tell it what to do or not with
+ the object (death aborted, clear it from map/memory, etc) [Skotlex]
+ * Cleaned up pc_dead to take advantage of the fact that status changes are
+ not ended until after the function. [Skotlex]
+ * Disabled ontouch npcs triggering on hidden/chase-walk characters.
+ [Skotlex]
+ * Updated/adapted current Homun code to use the status_data update.
+ [Skotlex]
+ * Updated map-server Makefile to compile mercenary.* files. [Skotlex]
+ * [Fixed]:
+ - Pets attacking even master is dead. [Lance]
+ * Fixed battle_calc_weapon_attack damage capping damage to a minimum of 0
+ (negative values should be allowed when attack is absorbed by target's
+ element) [Skotlex]
+2006/05/29
+ * [Fixed]:
+ - Missing ';' in item #4358 [Lance]
+ * [Fixed]:
+ - Missing maps in map index database. [Lance]
+ * [Fixed]:
+ - Battle mechanics in battle_check_target [Lance]
+ * [Fixed]:
+ - Typo in mob_dead causing crash. Thanks to reddozen and his gang for testing.
+ [Lance]
+ * Cleaned up friend list saving and fixed loading of friends.txt file
+ (char-txt) [Skotlex]
+ * Added the Arunafeltz maps, not tested yet [Playtester]
+ - someone with an up-to-date client should test them
+ * Fixed pc_gainexp resetting your exp to 0 rather than adding it in...
+ [Skotlex]
+ * Corrected aspd calculation code to avoid negative overflows. [Skotlex]
+ * Fixed battle_check_target check on BCT_ALL to check versus BL_CHAR
+ instead of BL_PC and BL_MOB [Skotlex]
+ * [Fixed]:
+ - Declaration of int map_getcellp(struct map_data*,int,int,cell_t); [Lance]
+ * Removed Undead being inmune to poison status. [Skotlex]
+ * Removed speed penalty from SC_SKA [Skotlex]
+ * Fixed SC_SPURT triggering on Soul Linkers. [Skotlex]
+ * SC_DODGE won't be dispelled on death now. [Skotlex]
+ * [Fixed]:
+ - pc_follow_timer possible triggering crash.
+ - pc_reg_received to use battle_status.hp instead of status.hp
+ [Added]:
+ - macro map_id2index for non-cyptic mapid to mapindex conversion. [Lance]
+ * Added a division by zero check in mob_dead to prevent the (impossible)
+ case where a mob dies with received damage of zero. [Skotlex]
+ * Modified skill_get_range2 to return range 9 for skills with range 0 for
+ Non-Players. This usually signals Self skills, and mobs/pets should be able
+ to use them in other characters. [Skotlex]
+ * Optimized a bit the SC_PROVOKE code (to use val3/val4) [Skotlex]
+ * Fixed draining when the amount drained is negative (invoke zap rather
+ than heal) [Skotlex]
+ * Implemented GS_FLING as per the current skill description. [Skotlex]
+ * Fixed pc_readparam/pc_setparam to use battle_status.hp/sp rather than
+ status.hp/sp, fixes scripts reading the wrong Hp/Sp values [Skotlex]
+ * Added some missing SC_* entries on the initial listing (potion related
+ and speed up ones) [Skotlex]
+ * Fixed function declaration of map_getcellp() [Skotlex]
+ * [Fixed]:
+ - status.c:920: warning: 'mbl' might be used uninitialized in this function
+ - skill.c:6648: warning: 'matk_min' might be used uninitialized in this function
+ - skill.c:6648: warning: 'matk_max' might be used uninitialized in this function
+ - skill.c:2826: warning: 'sid' might be used uninitialized in this function [Lance]
+ * [Optimized]:
+ - Removed unused variable (account_id) in storage_guild_storagesaved.
+ * [Optimized]:
+ - Removed unused checks for unsigned data type and possible logic error for
+ char type (gcc treats char as unsigned). [Lance]
+ * [Fixed]:
+ - Relogging in with 0 HP didn't trigger dead event. [Lance]
+2006/05/28
+ * Added functions status_revive, pc_revive and mob_revive to handle revival
+ (it doesn't handles player respawning, though). Fixed reviving @ commands.
+ [Skotlex]
+ * Added SC_BLADESTOP to the skill enum at the beginning of status.c (fixes
+ Bladestop causing an unknown status change message). [Skotlex]
+ * Fixed MSS_DEAD state skills not triggering. [Skotlex]
+ * Changed undeads to by default always sustain 100% of the damage from firewalls [MasterOfMuppets]
+ * [Fixed]:
+ - script functions that doesn't pass references, thanks to End_of_exam. [Lance]
+ * [Protected]:
+ - clif_parse_LGMmessage from possible hacks [Lance]
+ * Fixed unable to store n items into storage unless n was the total amount
+ of items you had. [Skotlex]
+ * Suppressed compilation warnings (unsigned and signed mismatches) [Lance]
+2006/05/27
+ * Added structure status_data which holds status-related information (str,
+ agi, etc, speed, amotion, adelay, dmotion, weapon-damage, race, size, etc)
+ and weapon_atk structure with the weapon specific info (atk, atk2, element)
+ to be used by all combat structures (TODO: Homun needs to be updated to use
+ it). This in change involves a LOT of changes throughout the code and many
+ optimizations were done as well. Partial list (see svn changelog for complete
+ changes): [Skotlex]
+ - NOTE: Changes are substantial! I tested a bunch of stuff and all the
+ skills I changed the most, but it is possible there are unnoticed bugs
+ remaining to fix!
+ - Cleaned up TBL_PC, TBL_MOB, TBL_PC and mob_db structures to use status_data.
+ - Split damage received functions into pc_damage/pc_dead and mob_damage/mob_dead
+ - Added status functions to deal with damage and healing (status_damage,
+ status_heal, status_percent_change) and a bunch of defines for easier
+ handling of them (status_percent_heal, status_percent_damage,
+ status_fix_damage, status_kill, etc). Objects must be hurt/healed through
+ THIS, pc_damage/mob_damage most no longer be directly invoked!
+ - Rewrote and cleaned up battle_calc_misc_attack
+ - Merged config options pc_attack_attr_none, mob_attack_attr_none,
+ pet_attack_attr_none into attack_attr_none (type 4)
+ - Removed config options player_defense_type, monster_defense_type,
+ pet_defense_type in favor of weapon_defense_type
+ - Modified skill_calc_heal to take into account the MEDITATION bonus.
+ - Modified Slim Pitcher so it will work when casted by non-players. Will
+ now also work with SP-healing items.
+ - Rewrote Freedom of Cast code to use function status_freecast_switch to
+ switch adelay/speed when cast begins/ends.
+ - Modified Magic Power to store amplified MATK/MATK2 in val3/val4 for
+ easier updating when used in conjunction with ground skills.
+ - Fixed Asura Strike being usable from within a combo regardless of combo skill.
+ - Added status_calc_bl which does status-change related calculations using
+ as base the base_status of the bl object and the SCB_* flag passed. This is
+ invoked on status changes, and status_calc_pc will no longer be invoked
+ (which results on much faster status-change calculations).
+ - pc_clean_skilltree will now also remove item-granted skills.
+ - Learning skills will now only invoke status_calc_pc when the skill is passive.
+ - Cleaned up pc_check_base/job_lvup to only invoke the lv-up related
+ packets and functions ONCE regardless of skill-levls earned.
+ - Cleaned up pc_ regen related functions.
+ - Made player-sprite mobs have item pickup animation and walkdelay when taking items.
+ - Clones will copy a player's base status rather than battle status (so
+ status-change alterations are not cloned)
+2006/05/26
+ * Part B of the homunculus code. [blackhole89]
+ While most of the homunculus handling functions are in now, it still lacks
+ code required for players to create it.
+ Given I haven't screwed up, you could master yourself one through the DB though.
+ * Fixed crashing in mob.c [Lance]
+ * Patches to allow everything to work right. + 1 more sample script. [Lance]
+ * Mob control engine tested 99% working so far. [Lance]
+ * Change scripting engine's NPC scope vars to dot (.) style.
+ * Improved and (should be fully) fixed the mob control engine. [Lance]
+ * Fixed typos in char.c [Lance]
+ * Rewrote fame rank lists system to reduce char-server load, as requested by
+ Skotlex: now it has a copy of those lists, and updates only the proper one
+ when needed instead of rebuilding all from saves everytime (which required
+ to always save the character before rebuilding the lists) [DracoRPG]
+ - Note it hasn't been compiled nor tested with SQL, please do it for me
+2006/05/25
+ * Simplified ASC_BREAKER by making it a BF_WEAPON attack with an additional
+ int-based damage component (which is added right before elemental
+ modifiers) as described by AuronX. Pending further refining. [Skotlex]
+ * Resolved differences between Stable/Trunk msg_athena.conf. [Lupus]
+ Fixed atcommand @request MSG numbers accordinly.
+ On adding new MSG strings, plzm reserve them in STABLE msg_athena.conf, too
+ * Added NoVending mapflag. You may disable vending in the streets [Lupus]
+ * Increased capacity for Account Variables to 64 [Skotlex]
+ * Reverted Intravision implementation to that of stable's. [Skotlex]
+ * Corrected Login Server taking it's first argument as both login config
+ and lan config. [Skotlex]
+ * Fixed mob control commands.
+ * Fixed memory leak in scripts (again). Still have a few lying. [Lance]
+2006/05/24
+ * Fix to the slave AI problem. [erKURITA], by [Skotlex], reported by Niktout.
+ * Item sharing now shares the same rules as exp sharing (no sharing when
+ dead, or idle, etc) [Skotlex]
+ * Fixed summoned slaves being able to cast onspawn summon-skills (slaves
+ aren't supposed to be able to call minions) [Skotlex]
+ * The clif_skill_poseffect packet will not be invoked in Snap unless the
+ skill was successful. May fix the client-position lag. [Skotlex]
+ * Merged item_db.sql from stable (the one from stable was more recent than
+ the one of trunk...) [Skotlex]
+ * Corrected SL KA* spells not working on other Soul Linkers. [Skotlex]
+ * Corrected a pair of incorrect sql query parsing logic in the login-sql
+ ban request packet. [Skotlex]
+2006/05/23
+ * Corrected mob angry mode, now it only "restores" itself after being hit
+ when the mob has no target within their range of sight rather than on
+ picking a new target. [Skotlex]
+ * Fixed wedding sprite where it would stay active after unequipping. [Zido]
+ * Some cleanup of run_script, should fix the memory leak there. [Skotlex]
+ * the charname request hack message has been downgraded to only include
+ GM-invisible characters. [Skotlex]
+ * corrected clif_charnameack to send negative ID when a disguised player
+ asks for it's own disguised name. [Skotlex]
+ * Cleaned up the disguised target-id checks taking into considering that
+ the only character that sees a negative ID is the same disguised character.
+ [Skotlex]
+ * Modified battle_calc_weapon_attack to use new flags pdef/pdef (pierce
+ defense), Investigate and Icepick will now use the final def/vit-def values
+ rather than the base ones. [Skotlex]
+ * The move-enable condition checks for skills are now checked for only when
+ on skill use, not at cast-end time. [Skotlex]
+ * Corrected clif parse name request failing on disguised characters [Skotlex]
+ * Corrected Soul Drain draining from all non-ground-based skills including
+ non-magic attacks. [Skotlex]
+ * Corrected pc_setoption to change the option and then change class.
+ changing option-wedding will automatically convert the view-class as well.
+ [Skotlex]
+ * Corrected the 15% drop rate increase when killing higher level mobs in
+ pk-mode triggering for all mobs with lower level than yourself. Thanks to
+ Vayu. [Skotlex]
+ * Fixed typo (this time it's not my fault) in script_reload() clearing the same
+ db each time o_o [Lance]
+ * Fixed sleep command. [Lance]
+ * Added 'setd' support for local NPC scope (') variables. [Lance]
+ * [Scripting Engine Update] New variables are ready to be used. [Lance]
+2006/05/22
+ * Updated skill_delayfix to return 0 for mobs since they have no skill
+ delay other than the one specified in mob_skill_db [Skotlex]
+ * Corrected the 20 lvl diff 15% exp bonus on pk_mode servers. Thanks to
+ Vayu for pointing it out. [Skotlex]
+ * status_get_sc_tick will now use directly Stun's formula rather than
+ invoking the status sc chance once. [Skotlex]
+ * Fixed a possible null pointer in script command misc_effect [Skotlex]
+ * Modified Investigate to take into consideration final def/vit-def rather
+ than base values for damage adjustment. [Skotlex]
+ * WARNING: New scripting system contains memory leak
+ TODO: Free all scripts using script_free_code() instead of old methods. [Lance]
+ * Excluded idle and auto-trade party members from TK_POWER list. [Lance]
+ * Fixed compilation errors.
+ Tidy up jobmaster for easy debugging. [Lance]
+2006/05/21
+ * Part A of the Homunculus code.
+ This only features the structures, status_* and clif_* (packets) and is
+ not functional yet in any conventional way, but doesn't interfere
+ with present functionality either.
+ Main purpose is helping me to keep my work organized. [blackhole89]
+ * Fixed the "fake" mute status bug. [Zido]
+ * Speed up array size calculation and deletion. [Lance]
+ * Player must learn the skill before doing auto-spell [Lance]
+ * Exploit prevention in clif_parse_NpcStringInput [Lance]
+ * SC_SPEARSQUICKEN -> SC_SPEARQUICKEN normalized enum name [Lupus]
+ * Thanks to damirych & Falcon for [2006/04/30] STEAL skill [Lupus]
+2006/05/20
+ * grfio_final moved back if any of GRF overriding is enabled so servers
+ with such configuration will not have different values after reloading. [Lance]
+ * jA1983 script.c buildin_menu fix. Thanks to End_of_exam. [Lance]
+ * Abit of alterations to login-server. [Lance]
+2006/05/19
+ * Minor unsigned/signed alteration in pc_additem to shut the compiler up. [Lance]
+ * Small change in pc_additem that could be fixing the current bug with new
+ items not getting added. [Skotlex]
+ * Fixed loginlog definition in main.sql, thanks to Tempesta [Skotlex]
+ * Likely fixed the mob-skill random picking behaviour causing infinite
+ loops sometimes. [Skotlex]
+ * Modified mobskill_use behaviour to pick a random starting point and check
+ skills from that, rather than always checking from first to last. Fixes
+ skills with high priority blocking skills lower down in the list from
+ triggering. [Skotlex]
+ * Updated mob ai behaviour so that mobs use IDLE state skills when their
+ current target cannot be reached for melee fighting. [Skotlex]
+2006/05/18
+ * Added 5 config settings to adjust damage in pk-mode servers (misc.conf)
+ [Skotlex]
+ * Fixed mob_max_skilllvl being capped to 11! [Skotlex]
+ * Rewrote/cleaned up several functions in storage.c [Skotlex]
+ * Optimized pc_additem comparisons to account for items with more than four
+ slots. [Skotlex]
+ * Updated clif.c to enable retrieval of items from cart/storage while
+ trading. Exception is retrieving items from the cart while vending.
+ [Skotlex]
+ - The reasoning is that an ongoing trade will not get "corrupted" if you
+ earn items before it is commited (only if you lose items from your
+ inventory), and it is an annoyance when you realize the stuff you want to
+ trade is on the cart/storage.
+ * skill reiteration code now does not checks for the trigger-area of the
+ skill in the case of non-players, which means mobs can now place traps in
+ cells adjacent to each other. [Skotlex]
+ * Applied an experimental weather code that should lower bandwidth usage to
+ near-none, which's only disadvantage should be the weather not clearing out
+ until moving to another map (even when the mapflag is removed from the
+ current map). Please test and report if there's any anomalies with it.
+ [Skotlex]
+ * NPC_AGIUP will now give movement boost of 50% [Skotlex]
+ * Fixed WZ_WATERBALL number of hits when used by non-players. [Skotlex]
+ * MO_BODYRELOCATION will send the slide packet with the actual src's
+ coordinates rather than selected tile. [Skotlex]
+2006/05/17
+ * Modified mob_can_changetarget to return true always when the new target
+ is the provoked-by character. Fixes provoke not making the mob change
+ target when it already is locked on another player. [Skotlex]
+ * Added check to clear previous skill when combo time ends. Should fix TK
+ Rankers being unable to initiate a combo with the same kick their previous
+ combo was finished with. [Skotlex]
+ * Power Up and Agi Up now increase Hit/Flee by 20%/lv [Skotlex]
+2006/05/16
+ * Modified "hide woe damage" to send the number of hits rather than 1 as
+ damage Because when the damage is less than the number of hits, the client
+ will display MISS. [Skotlex]
+ * Fire Pillar will now do 200%MATK damage per hit when level is >10.
+ [Skotlex]
+ * Blood Drain always hits now. [Skotlex]
+ * Fixed Mob Area Skills not updating their use-time (rendering their skill
+ delay useless) [Skotlex]
+ * Search free cell will now skip picking the center-tile as target
+ location. Will prevent slaves from walking on top of their master, or mobs
+ placing stuff right under themselves with the "around" target conditions
+ among other things. [Skotlex]
+2006/05/15
+ * Small changes to the skill.conf
+ - Monsters now can place ground skills on top of each other by default
+ - Land_Skill_Limit format changed and set to "Only Players" by default
+ * When reading mapflags, when a map is set to be pvp or gvg, the other will
+ be turned off (disables pvp mapflags in gvg maps for pk-servers) [Skotlex]
+ * Firepillar's damage per hit is now 100% MATK (rather than 20%) when the
+ skill level is above 10. [Skotlex]
+ * Sorted out the item_data structure, getiteminfo should work correctly
+ now. [Skotlex]
+ * KA* skills can now be casted on other Soul Linkers as well without the
+ Spirit requirement. [Skotlex]
+ * Soul Drain will now show the SP drained regardless of drain display
+ settings. [Skotlex]
+ * SC_COMBO state will now end in skill_attack rather than
+ skill_check_condition (as it is required there to apply damage bonuses
+ based on combo-casted skills) [Skotlex]
+ * Fixed Option_Wedding in const.txt (0x1000 won't work, it has to be 4096)
+ [Skotlex]
+ * Fixed the nocast flag 2 (not usable in pvp) returning true in pk-mode
+ servers. [Skotlex]
+ * When removing a castle's owning guild, the char servers will erase the
+ guardian data now. [Skotlex]
+ * Changed the behaviour of immobile mobs when they can't chase their
+ target. Rather than using a longrange skill and then unlocking, they will
+ use an attack/angry state skill and then unlock. [Skotlex]
+ * Some adjustments of how disguising + gm-hiding work together. [Skotlex]
+ * Fixed clif_GlobalMessage being the exact same function as clif_message
+ (the first should send to ALL_CLIENT and the later should send to
+ AREA_CHAT_WOS). Should fix globalmes script command. [Skotlex]
+ * Added SC_BLADESTOP to the switch listing in status_change_start [Skotlex]
+ * Characters in vending are now always considered "idle" if the
+ idle_no_share setting is active. [Skotlex]
+ * Players with OPTION_INVISIBLE should not be sent to clients. [Lance]
+ * Remaining fixes for item scripts. [Lance]
+ * Added NPC event deprecated warnings to ease debugging old scripts. [Lance]
+
+2006/05/12
+ * Supplied fake NPC ID in sd->npc_id for item scripts. [Lance]
+ * Bugfix on fake npc [Lance]
+ * Fixed mob_once_spawn not working for non-random coordinates. [blackhole89]
+ * Reverted again the change that stuns the caster on Ske, Ska, Swoo when
+ the target is a nonplayer (rather than always) [Skotlex]
+ * Modified mob_spawn_once so that coordinates -1,-1 are "random around the
+ player" while 0,0 are random around the whole map (regardless of whether
+ there's a player attached or not) [Skotlex]
+ * Knockback will no longer work on traps during woe. [Skotlex]
+2006/05/11
+ * Fixed the definition of the KEY in the loginlog, thanks to TheUltraMage
+ [Skotlex]
+ * NPC_POWERUP and NPC_AGIUP now cause a increase in hit/flee (respectively)
+ of 40% per level. [Skotlex]
+ * Changed a bit the MAX_ZENY checks in trade.c to prevent overflows.
+ [Skotlex]
+ * Rewrote npc_selllist for a more proper-clean implementation. [Skotlex]
+ * Increased NPC_POWERUP's dex bonus to +25*lv [Skotlex]
+ * Moved TK_DOWNKICK's stun time from time to time2 [Skotlex]
+ * Added TK_TURNKICK's stun to splash-pushed mobs. Duration is 2secs (time2)
+ [Skotlex]
+ * Merged the code for Ska, Ske, Swoo together. Swoo stun duration is now 10
+ secs (reducable) if you target a mob that already has Swoo active. [Skotlex]
+ * Added the missing semi-comma from the upgrade_svn6533.sql file. Thanks to
+ Tanaous [Skotlex]
+ * Added back the missing code that substracts arrows when normal-attacking.
+ [Skotlex]
+2006/05/10
+ * Changed the state of Asura back to explosionspirits, added a hardcoded
+ move_enable check when invoking Asura and NOT while in BladeStop or a
+ Combo. [Skotlex]
+ * Added back SC_XMAS to status.c, it got lost sometime during all the
+ previous reworkings. [Skotlex]
+ * Changed wedding costumes to use setoption rather than changebase.
+ [Skotlex]
+ * Modified setoption so that flag 1 or no flag adds an option, and flag 0
+ removes it. [Skotlex]
+ * Updated script_commands with the new behaviour. [Skotlex]
+ * Updated mob_db2.txt and mob_db2.sql to have only 10 drop slots rather
+ than 15. [Skotlex]
+ * Users are now able to use their own dnsbl servers (login_athena) [Zido]
+
+2006/05/09
+ * Rewrote/cleaned up trade.c for a more clean trading implementation.
+ [Skotlex]
+ * Added @request commands, sends a request to all connected GMs of
+ lowest_gm_level or above as a whisper message. Defaults to gm level 20
+ users (UNTESTED). [Skotlex]
+ * Modified @commands to use Meruru's code which is faster and does a fair
+ attempt at tabulating the commands presented. [Skotlex]
+ * Updated SKA to return a random value between 0 and 99 each time
+ status_get_def is invoked. [Skotlex]
+ * Updated Making Arrow to not include unidentified items in the list.
+ [Skotlex]
+ * Reduced drop slots from 15 to 10. [Skotlex]
+ * Updated mob_db.sql with the current data. [Skotlex]
+ * Updated setoption script command to receive a second (optional) argument
+ flag. If the flag is 1, the option is added to what the player currently
+ has; likewise using flag 2 removes only that option. No flag (or any other
+ value) is the older behaviour of removing all other options and setting
+ specificly what is passed. [Skotlex]
+ * Updated script_commands information for setoption due to this change.
+ [Skotlex]
+ * Small fix in npc-created chat rooms to properly include the terminating 0
+ on the chat's event. [Skotlex]
+ * Fixed Fog of Wall's symmetry in respect to Misc attacks, they no longer
+ get reduced by 50% regardless of who is standing on the fog. [Skotlex]
+ * monster_ai&2 will now trigger the rude-attacked skill when the mob can't
+ move and the attacker is out of it's attack range. [Skotlex]
+ * Added missing icon for Joint Beat [Skotlex]
+ * Mob-search functions will now skip enemies with no exp/job_exp. [Skotlex]
+ * Treasure chests will now be excluded from the mob-drop listings
+ (@whodrops) [Skotlex]
+ * Fix on pc_skill which fixes overlapping when one gets more than one bonus
+ for the same skill. [Skotlex]
+ * Updated main.sql's loginlog table structure. [Skotlex]
+ * Added svn_update6533.sql to update the loginlog structure as suggested by
+ theultramage. [Skotlex]
+ * Cleaned up somewhat the implementation of BladeStop. [Skotlex]
+ * Fixed the head_bottom (pet-armor) position in packet 0x22c (walk packet)
+ when crafted for non-players. [Skotlex]
+ * Script commands sc_start, sc_start2 and sc_start4 will now start
+ regardless of sc defense of the target player (that is, they cannot be
+ avoided/blocked) [Skotlex]
+ * Fixed a possible counter overflow in attacked_count, changed the var size
+ to unsigned char since the code can handle the overflow now. [Skotlex]
+ * Multiple targets again reduces armor defense, as reported by Tharis.
+ [Skotlex]
+ * Increased dex bonus of NPC_POWERUP to +20 per level. [Skotlex]
+ * Fog of Wall's -50 hit reduction is now only for ranged attacks. [Skotlex]
+2006/05/08
+ * Reverted the change that was making ES skills stun the caster always.
+ [Skotlex]
+ * Removed the fixpos packet which is sent whenever you are hit while moving
+ as Aegis doesn't sends this packet neither. [Skotlex]
+ * ES magic will now put the caster on stun for 0.5 secs regardless of
+ whether the skill-target is a mob or not. [Skotlex]
+ * Added function clif_party_join_info which sends packet 0x1e9 each time a
+ party-member joins. This packet (as redundant info as it has) should also
+ contain the field for "adoptability", but that needs to be coded in yet.
+ [Skotlex]
+ * Added clif_ParseAdoptRequest which does the basic adoption handling. More
+ checks and the reply packets still need to be coded in. [Skotlex]
+ * Happy State and TK stances won't dispel on death now. [Skotlex]
+ * Cleaned up combo-skill implementation, SC_COMBO is automatically ended in
+ skill_check_condition now. [Skotlex]
+ * Modified TK-ranker infinite combos to behave as described by AuronX.
+ Refer to his thread in the development section for details. [Skotlex]
+ * Made all Soul Link Spirit skills not be castable on self. [Skotlex]
+ * Changed rate of NPC status effect skills to 50+10*lv% base chance
+ (guessed, but better than 100% for all levels) [Skotlex]
+ * Changed max level of NPC status effect skills to 5 [Skotlex]
+ * Increased max number of tries to find a random spot in maps to 1000 since
+ some maps have so many non-walkable tiles it's hard to find one in just 100
+ tries. [Skotlex]
+ * status_set_viewdata will remove the Wedding Option status when you set a
+ class that is not wedding. [Skotlex]
+ * hide_gvg_damage will now send 1 instead of -1 as damage. [Skotlex]
+ * idletime will now be updated on attack-request, not on sit/standup
+ [Skotlex]
+ * Party members sitting will no longer be considered idle. [Skotlex]
+ * Removed SP_DISGUISE from the bonus list (onequip/onunequip should be used
+ with the disguise/undisguise script commands instead). [Skotlex]
+ * Moved Sharp Shooting display to the block with Auto-Counter (since that's
+ the other skill that can show critical as well) [Skotlex]
+ * Corrected some fields in the standing still packet (guild emblem being
+ stored as a Long when it should be Short) [Skotlex]
+ * Modified most fields of view_data to be unsigned shorts rather than
+ signed ones. [Skotlex]
+ * On-Touch NPCs will now make you stop walking when you trigger them.
+ [Skotlex]
+ * ShadowJump/JumpKick will make you land on the target's cell now.
+ [Skotlex]
+ * Fixed Kaahi triggering only once per skill duration. [Skotlex]
+2006/05/07
+ * Fixed readme/changelog.html [KillerBox]
+ * Removed old logs. [Lupus]
+ TODO: 1. Add produce logging into PICKLOG 2. Replace map names with map index
+2006/05/05
+ * Optimized clif.c clif_scriptmenu/input/inputstr to check for sd->state.using_fake_npc
+ before sending one (as it's not required to send twice).
+ * Reinitialize sd->state.using_fake_npc in clif_parse_LoadEndAck (for scripts that warps
+ players and still continues execution to work). [Lance]
+ * Updated item_db.sql to current. [Skotlex]
+ * Fixed a bug in @commands, most likely the reason some people were still
+ getting crashes. [Skotlex]
+ * Fixed @commands not showing the last available commands (unless the total
+ amount of commands is divisible by ten) [Skotlex]
+ * Added a npc-script-event cache to avoid looking up event-scripts every
+ time they need to be executed. Events cached are all those defined in
+ script_config (on login, logout, mapchange, death, kill, level up) [Skotlex]
+ - Since the cache holds direct pointers to the npcs/events, do NOT unload
+ the related NPCs or you'll get dangling pointer crashes. However,
+ @reloadscript will work fine.
+ - Set the etc_log to on to see a summary of npcs/events loaded for script
+ execution on startup.
+ * The Rest bonus activated by using /doridori while in rest should now
+ trigger with all the class tree (TK/SL/SG) [Skotlex]
+ * Fixed Kaupe always triggering when the one who was under Kaupe was a
+ player rather than the one attacking... [Skotlex]
+ * /doridori now won't double the HP/SP regen of TKs, it only activates
+ their "happy" state. [Skotlex]
+ * Added the -50 hit penalty when standing on Wall of Fog. [Skotlex]
+ * Uncommented the status_calc_mdef2 call in status_calc_pc. [Skotlex]
+ * Being in Enjoyable Rest state will now also trigger the HP/SP Time skills
+ (even if there's no other TK around). [Skotlex]
+ * Added battle config settings view_range_rate and chase_range_rate to
+ adjust the view-range and chase-range (range2/range3) of the mob_db without
+ having to manually change them (battle/monster.conf) [Skotlex]
+ * Kaupe now will only block all skills of players, for non-players, only
+ normal attacks can be missed. [Skotlex]
+ * Moved the Kaite spell-reflect code after the damage calculation function,
+ so the reflected damage is exactly the damage the original target would
+ have received. Will only trigger if the damage to be reflected is above 0.
+ [Skotlex]
+ * OnEquip scripts will now trigger on log-on. [Skotlex]
+ * Infinite Endure will no longer give mdef bonus. [Skotlex]
+ * Removed bInfiniteEndure bonus, Eddga card now uses onequip/onunequip to
+ start/end infinite endure. [Skotlex]
+ * Fixed Kaahi's SP cost per heal. [Skotlex]
+ * Now when walkdelay is set to 0, characters will stop walking when hit,
+ but will not have any walk delay. (previously setting walk delay to 0 would
+ not even stop characters from walking when hit) [Skotlex]
+2006/05/04
+ * Some people think its sexy to declare variables after blocks of code. Fixed. [Zido]
+ * Fixed a possible infinite loop in skill_clear_unit_group [Skotlex]
+ * Some clean-ups in the mob_ai [Skotlex]
+ * Improved atcommand autoloot, now displays droprate in percents and notices
+ player if autoloot is already on or off. Also simplified the code [Harbin, Kain],
+ commited by erKURITA
+ * Added one grace range in the mob_loot search function which should fix
+ mob_can_reach failing when invoked with the same distance that distance_bl
+ returned. [Skotlex]
+ * Stun time for using ES magic on non-mobs reduced to 0.5 secs. [Skotlex]
+ * Eska is now usable on bosses. [Skotlex]
+ * Swoo will stun you if attempted on an already 'swooned' enemy. [Skotlex]
+ * clif_skill_failed will print out a debug line with the skill_id (since
+ the current null_po does not helps at all to fix it) [Skotlex]
+ * Applied TheUltraMage's suggested fixes to the grfio module. [Skotlex]
+ * Rewrote Kaahi to behave as it should. It will heal whatever amount of
+ damage accumulates in the time2 interval (500ms by default) after being
+ hit. [Skotlex]
+ * Changed skill_unit_move_unit_group to enable moving of all types of
+ ground-skills except ensembles (fixes warmth not following you) [Skotlex]
+2006/05/03
+ * Kaahi now triggers every 500ms rather than on every hit (but it only
+ heals if in those 500ms an attack that would previously trigger Kaahi has
+ taken effect). In other words, it works just like before, except damage
+ gets "buffered" into 500ms slots. [Skotlex]
+ * Kaite, Kaute will now show a skill effect when they trigger. [Skotlex
+ * Knowledge will now only trigger if you logon to the memorized map, not
+ walk into it. [Skotlex]
+ * Corrected @whomap directly invoking msg_table[] rather than msg_txt()
+ [Skotlex]
+ * Guessed where the pet data goes in spawn packet 0x7c. This may be wrong
+ and not fix the pet issue, but I doubt it'll cause any problems that won't
+ be fixed by making the pet move. [Skotlex]
+ * Updated Charge Attack's state from none to move_enable. [Skotlex]
+ * Made tomahawk an NPC_SKILL so that it may not be plagiarized. [Skotlex]
+2006/05/02
+ * Fixed standing up not really standing you up. [Skotlex]
+ * Moved battle_consume_ammo to the end of skill_castend_damage_id,
+ skill_castend_nodamage_id and skill_castend_pos2 rather than
+ battle_calc_weapon_attack. They will trigger when the player's arrow_atk
+ state is active and a ground skill was not invoked. It should fix all
+ issues with splash/ground skills consuming ammo per target rather than once
+ per skill use. [Skotlex]
+ * Added structure state to the ground skills, their fields are magic_power,
+ into_abyss and ammo_consume to indicate the states that were previously
+ stored in val3. [Skotlex]
+ * Implemented desperado as explained by Rockman-EXE. The skill-effect is
+ not showing up though, I'll need some logged packets to see what's missing.
+ [Skotlex]
+ * Removed the unit_can_move checks in skill cast-end, they should be
+ performed in skill_check_require when the skill's state is move_enabled.
+ [Skotlex]
+ * Changed extremity fist's state to move_enabled, the explosion spirits
+ check is now hardcoded. [Skotlex]
+ * Absorb Spirit Sphere now gives +10SP per sphere as per discussions with
+ Haplo. [Skotlex]
+ * Changed a <= into a < in pc_steal_item. This means drops with 0.01% are
+ impossible to steal unless you have at least 100% steal-rate (where steal
+ rate is dex - opponent dex + skill_lv*3% + 10%) [Skotlex[
+ * Cleaned up clif_parse_action_request to enable sitting/standing while in
+ shops, interacting with npcs, etc. [Skotlex]
+ * Kaite now works against all types of spells. [Skotlex]
+ * Kaupe now works against all skills. [Skotlex]
+ * Sanctuary now won't damage non-enemies. [Skotlex]
+ * Blessing now will always give you bonus stats even if you are wearing
+ undead armor. [Skotlex]
+ * Modified how Rogue's treasure works so that you get +1% to your steal
+ rate rather than +0.01% to the final rate. [Skotlex]
+ * Rewrote Warmth to use ground-skill-units, it should behave now like in
+ officials (implementation is not quite the same, but it should yield the
+ same effects while consuming less bandwidth). "Stacking", as it's called,
+ is possible now, but limited to eA's minimum timer skill interval (100ms).
+ [Skotlex]
+ * Modified NPC_POWERUP so that it gives +10 dex * skill level rather than
+ +5+lv to all stats (as explained by Playtester and Tharis on how the skill
+ behaves). [Skotlex]
+ * Allowed SG_FEEL memorizing the same map for all three. [Skotlex]
+ * SC_FUSION won't end when you die now. [Skotlex]
+2006/05/01
+ * Added knockback when you run into a wall during running. However
+ position is not being refreshed on the client yet... [Skotlex]
+ * Fixed pc_disguise not allowing you to "redisguise". [Skotlex]
+ * Corrected a crash when sd is null in npc_event [Skotlex]
+ * After testing to make sure it works properly, I'm including
+ new battle conf options to limit MVP drops. [Reddozen]
+ * Removed OPTION_XMAS, it seems to not exist.... [Skotlex]
+ * Added SC_SMA to handle "ready to use SMA" status (rather than SC_COMBO)
+ since it has a visual effect to use. [Skotlex]
+ * Corrected the value of OPTION_FLYING [Skotlex]
+ * Using SG_FUSION ends Soul Linked effect. [Skotlex]
+ * status_setviewdata will set your option accordingly when the previous/new
+ view-class is wedding or xmas suit. [Skotlex]
+ * Added function map_foreachinshootrange, behaves the same way as
+ map_foreachinrange, but it also performs a "shoot-path" check before
+ invoking the function. Used in the skill subtimer function if
+ skill_wall_check is defined. [Skotlex]
+ * Fixed AL_WARP displaying "Unknown Area" selections when you don't have
+ all memo points used up. [Skotlex]
+ * Fixed alive_count not being reset on skill unitsetting, which leads to
+ some groups not being cleared once all their units expire. [Skotlex]
+ * Optimized Kaahi/Kahai, will now only show the amount of HP healed. Moved
+ to skill_counter additional effect so it may trigger even on miss. [Skotlex]
+ * SKA no longer blocks skills. [Skotlex]
+ * Optimized fake npc system. Added npc_checknear back to npc_buysellsel. [Lance]
diff --git a/src/common/socket.c b/src/common/socket.c
index f9262f424..4651f1dac 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -1,1360 +1,1360 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <errno.h>
-
-#ifdef __WIN32
-#define __USE_W32_SOCKETS
-#include <windows.h>
-#include <winsock.h>
-#include <io.h>
-
-typedef int socklen_t;
-#else
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <net/if.h>
-#include <unistd.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <netdb.h>
-#include <arpa/inet.h>
-
-#ifndef SIOCGIFCONF
-#include <sys/sockio.h> // SIOCGIFCONF on Solaris, maybe others? [Shinomori]
-#endif
-
-#endif
-
-#ifdef _WIN32
-#define SEBADF WSAENOTSOCK
-#define serrno WSAGetLastError()
-#else
-#define SEBADF EBADF
-#define serrno errno
-#endif
-
-#include <fcntl.h>
-#include <string.h>
-
-#include "../common/socket.h"
-#include "../common/mmo.h" // [Valaris] thanks to fov
-#include "../common/timer.h"
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-
-fd_set readfds;
-int fd_max;
-time_t last_tick;
-time_t stall_time = 60;
-int ip_rules = 1;
-
-// reuse port
-#ifndef SO_REUSEPORT
- #define SO_REUSEPORT 15
-#endif
-
-#ifndef TCP_FRAME_LEN
-#define TCP_FRAME_LEN 1024
-#endif
-
-static int mode_neg=1;
-static unsigned int frame_size=TCP_FRAME_LEN;
-
-#ifndef MINICORE
-enum {
- ACO_DENY_ALLOW=0,
- ACO_ALLOW_DENY,
- ACO_MUTUAL_FAILTURE,
-};
-
-static struct _access_control *access_allow;
-static struct _access_control *access_deny;
-static int access_order=ACO_DENY_ALLOW;
-static int access_allownum=0;
-static int access_denynum=0;
-static int access_debug=0;
-static int ddos_count = 10;
-static int ddos_interval = 3000;
-static int ddos_autoreset = 600*1000;
-#endif
-
-
-// values derived from freya
-// a player that send more than 2k is probably a hacker without be parsed
-// biggest known packet: S 0153 <len>.w <emblem data>.?B -> 24x24 256 color .bmp (0153 + len.w + 1618/1654/1756 bytes)
-size_t rfifo_size = (16*1024);
-size_t wfifo_size = (16*1024);
-
-#define CONVIP(ip) ip&0xFF,(ip>>8)&0xFF,(ip>>16)&0xFF,ip>>24
-
-struct socket_data *session[FD_SETSIZE];
-
-static int null_parse(int fd);
-static int (*default_func_parse)(int) = null_parse;
-
-static int null_console_parse(char *buf);
-static int (*default_console_parse)(char*) = null_console_parse;
-#ifndef MINICORE
-static int connect_check(unsigned int ip);
-#else
- #define connect_check(n) 1
-#endif
-
-/*======================================
- * CORE : Set function
- *--------------------------------------
- */
-void set_defaultparse(int (*defaultparse)(int))
-{
- default_func_parse = defaultparse;
-}
-
-void set_nonblocking(int fd, int yes) {
- // I don't think we need this
- // TCP_NODELAY BOOL Disables the Nagle algorithm for send coalescing.
- if(mode_neg)
- setsockopt(fd,IPPROTO_TCP,TCP_NODELAY,(char *)&yes,sizeof yes);
-
- // FIONBIO Use with a nonzero argp parameter to enable the nonblocking mode of socket s.
- // The argp parameter is zero if nonblocking is to be disabled.
-#ifdef __WIN32
- ioctlsocket(fd, FIONBIO, &yes);
-#else
- ioctl(fd,FIONBIO,&yes);
-#endif
-}
-
-static void setsocketopts(int fd)
-{
- int yes = 1; // reuse fix
-#ifndef WIN32
- // set SO_REAUSEADDR to true, unix only. on windows this option causes
- // the previous owner of the socket to give up, which is not desirable
- // in most cases, neither compatible with unix.
- setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(char *)&yes,sizeof(yes));
-#ifdef SO_REUSEPORT
- setsockopt(fd,SOL_SOCKET,SO_REUSEPORT,(char *)&yes,sizeof(yes));
-#endif
-#endif
- setsockopt(fd,IPPROTO_TCP,TCP_NODELAY,(char *)&yes,sizeof(yes));
-// setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *) &wfifo_size , sizeof(rfifo_size ));
-// setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *) &rfifo_size , sizeof(rfifo_size ));
-#ifdef __WIN32
-{ //set SO_LINGER option (from Freya)
- //(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/closesocket_2.asp)
- struct linger opt;
- opt.l_onoff = 1;
- opt.l_linger = 0;
- if (setsockopt(fd, SOL_SOCKET, SO_LINGER, (char*)&opt, sizeof(opt)))
- ShowWarning("setsocketopts: Unable to set SO_LINGER mode for connection %d!\n",fd);
-}
-#endif
-}
-
-/*======================================
- * CORE : Socket Sub Function
- *--------------------------------------
- */
-static void set_eof(int fd)
-{ //Marks a connection eof and invokes the parse_function to disconnect it right away. [Skotlex]
- if (session_isActive(fd))
- session[fd]->eof=1;
-}
-
-static int recv_to_fifo(int fd)
-{
- int len;
-
- if( (fd<0) || (fd>=FD_SETSIZE) || (NULL==session[fd]) )
- return -1;
-
- if(session[fd]->eof)
- return -1;
-
-#ifdef __WIN32
- len=recv(fd,(char *)session[fd]->rdata+session[fd]->rdata_size, RFIFOSPACE(fd), 0);
- if (len == SOCKET_ERROR) {
- if (WSAGetLastError() == WSAECONNABORTED) {
- ShowWarning("recv_to_fifo: Software caused connection abort on session #%d\n", fd);
- FD_CLR(fd, &readfds); //Remove the socket so the select() won't hang on it.
-// exit(1); //Windows can't really recover from this one. [Skotlex]
- }
- if (WSAGetLastError() != WSAEWOULDBLOCK) {
-// ShowDebug("recv_to_fifo: error %d, ending connection #%d\n", WSAGetLastError(), fd);
- set_eof(fd);
- }
- return 0;
- }
-#else
- len=read(fd,session[fd]->rdata+session[fd]->rdata_size, RFIFOSPACE(fd));
- if (len == -1)
- {
- if (errno == ECONNABORTED)
- {
- ShowFatalError("recv_to_fifo: Network broken (Software caused connection abort on session #%d)\n", fd);
-// exit(1); //Temporal debug, maybe this can be fixed.
- }
- if (errno != EAGAIN) { //Connection error.
-// perror("closing session: recv_to_fifo");
- set_eof(fd);
- }
- return 0;
- }
-#endif
- if (len <= 0) { //Normal connection end.
- set_eof(fd);
- return 0;
- }
-
- session[fd]->rdata_size+=len;
- session[fd]->rdata_tick = last_tick;
- return 0;
-}
-
-static int send_from_fifo(int fd)
-{
- int len;
- if( !session_isValid(fd) )
- return -1;
-
-// if (s->eof) // if we close connection, we can not send last information (you're been disconnected, etc...) [Yor]
-// return -1;
-/*
- // clear write buffer if not connected <- I really like more the idea of sending the last information. [Skotlex]
- if( session[fd]->eof )
- {
- session[fd]->wdata_size = 0;
- return -1;
- }
-*/
-
- if (session[fd]->wdata_size == 0)
- return 0;
-
-#ifdef __WIN32
- len=send(fd, (const char *)session[fd]->wdata,session[fd]->wdata_size, 0);
- if (len == SOCKET_ERROR) {
- if (WSAGetLastError() == WSAECONNABORTED) {
- ShowWarning("send_from_fifo: Software caused connection abort on session #%d\n", fd);
- session[fd]->wdata_size = 0; //Clear the send queue as we can't send anymore. [Skotlex]
- set_eof(fd);
- FD_CLR(fd, &readfds); //Remove the socket so the select() won't hang on it.
- }
- if (WSAGetLastError() != WSAEWOULDBLOCK) {
-// ShowDebug("send_from_fifo: error %d, ending connection #%d\n", WSAGetLastError(), fd);
- session[fd]->wdata_size = 0; //Clear the send queue as we can't send anymore. [Skotlex]
- set_eof(fd);
- }
- return 0;
- }
-#else
- len=send(fd, session[fd]->wdata, session[fd]->wdata_size, MSG_NOSIGNAL);
- if (len == -1)
- {
- if (errno == ECONNABORTED)
- {
- ShowWarning("send_from_fifo: Network broken (Software caused connection abort on session #%d)\n", fd);
- session[fd]->wdata_size = 0; //Clear the send queue as we can't send anymore. [Skotlex]
- set_eof(fd);
- }
- if (errno != EAGAIN) {
-// perror("closing session: send_from_fifo");
- session[fd]->wdata_size = 0; //Clear the send queue as we can't send anymore. [Skotlex]
- set_eof(fd);
- }
- return 0;
- }
-#endif
-
- //{ int i; ShowMessage("send %d : ",fd); for(i=0;i<len;i++){ ShowMessage("%02x ",session[fd]->wdata[i]); } ShowMessage("\n");}
- if(len>0){
- if((unsigned int)len<session[fd]->wdata_size){
- memmove(session[fd]->wdata,session[fd]->wdata+len,session[fd]->wdata_size-len);
- session[fd]->wdata_size-=len;
- } else {
- session[fd]->wdata_size=0;
- }
- }
- return 0;
-}
-
-void flush_fifo(int fd)
-{
- if(session[fd] != NULL && session[fd]->func_send == send_from_fifo)
- {
- set_nonblocking(fd, 1);
- send_from_fifo(fd);
- set_nonblocking(fd, 0);
- }
-}
-
-void flush_fifos(void)
-{
- int i;
- for(i=1;i<fd_max;i++)
- if(session[i] != NULL &&
- session[i]->func_send == send_from_fifo)
- send_from_fifo(i);
-}
-
-static int null_parse(int fd)
-{
- ShowMessage("null_parse : %d\n",fd);
- session[fd]->rdata_pos = session[fd]->rdata_size; //RFIFOSKIP(fd, RFIFOREST(fd)); simplify calculation
- return 0;
-}
-
-/*======================================
- * CORE : Socket Function
- *--------------------------------------
- */
-
-static int connect_client(int listen_fd)
-{
- int fd;
- struct sockaddr_in client_address;
-#ifdef __WIN32
- int len;
-#else
- socklen_t len;
-#endif
- //ShowMessage("connect_client : %d\n",listen_fd);
-
- len=sizeof(client_address);
-
- fd = accept(listen_fd,(struct sockaddr*)&client_address,&len);
-#ifdef __WIN32
- if (fd == SOCKET_ERROR || fd == INVALID_SOCKET || fd < 0) {
- ShowError("accept failed (code %i)!\n", WSAGetLastError());
- return -1;
- }
-#else
- if(fd==-1) {
- perror("accept");
- return -1;
- }
-#endif
-
- if(fd_max<=fd) fd_max=fd+1;
-
- setsocketopts(fd);
-
-#ifdef __WIN32
- {
- unsigned long val = 1;
- if (ioctlsocket(fd, FIONBIO, &val) != 0)
- ShowError("Couldn't set the socket to non-blocking mode (code %d)!\n", WSAGetLastError());
- }
-#else
- if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1)
- perror("connect_client (set nonblock)");
-#endif
-
- if (ip_rules && !connect_check(*(unsigned int*)(&client_address.sin_addr))) {
- do_close(fd);
- return -1;
- } else
- FD_SET(fd,&readfds);
-
- CREATE(session[fd], struct socket_data, 1);
- CREATE_A(session[fd]->rdata, unsigned char, rfifo_size);
- CREATE_A(session[fd]->wdata, unsigned char, wfifo_size);
-
- session[fd]->max_rdata = (int)rfifo_size;
- session[fd]->max_wdata = (int)wfifo_size;
- session[fd]->func_recv = recv_to_fifo;
- session[fd]->func_send = send_from_fifo;
- if(!session[listen_fd]->func_parse)
- session[fd]->func_parse = default_func_parse;
- else
- session[fd]->func_parse = session[listen_fd]->func_parse;
- session[fd]->client_addr = client_address;
- session[fd]->rdata_tick = last_tick;
- session[fd]->type = SESSION_UNKNOWN; // undefined type
-
- //ShowMessage("new_session : %d %d\n",fd,session[fd]->eof);
- return fd;
-}
-
-int make_listen_bind(long ip,int port)
-{
- struct sockaddr_in server_address;
- int fd;
- int result;
-
- fd = (int)socket( AF_INET, SOCK_STREAM, 0 );
-
-#ifdef __WIN32
- if (fd == INVALID_SOCKET) {
- ShowError("socket() creation failed (code %d)!\n", fd, WSAGetLastError());
- exit(1);
- }
-#else
- if (fd == -1) {
- perror("make_listen_port:socket()");
- exit(1);
- }
-#endif
-
-#ifdef __WIN32
- {
- unsigned long val = 1;
- if (ioctlsocket(fd, FIONBIO, &val) != 0)
- ShowError("Couldn't set the socket to non-blocking mode (code %d)!\n", WSAGetLastError());
- }
-#else
- if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1)
- perror("make_listen_bind (set nonblock)");
-#endif
-
- setsocketopts(fd);
-
- server_address.sin_family = AF_INET;
- server_address.sin_addr.s_addr = ip;
- server_address.sin_port = htons((unsigned short)port);
-
- result = bind(fd, (struct sockaddr*)&server_address, sizeof(server_address));
-#ifdef __WIN32
- if( result == SOCKET_ERROR ) {
- ShowError("bind failed (socket %d, code %d)!\n", fd, WSAGetLastError());
- exit(1);
- }
-#else
- if( result == -1 ) {
- perror("bind");
- exit(1);
- }
-#endif
- result = listen( fd, 5 );
-#ifdef __WIN32
- if( result == SOCKET_ERROR ) {
- ShowError("listen failed (socket %d, code %d)!\n", fd, WSAGetLastError());
- exit(1);
- }
-#else
- if( result != 0) { /* error */
- perror("listen");
- exit(1);
- }
-#endif
- if ( fd < 0 || fd > FD_SETSIZE )
- { //Crazy error that can happen in Windows? (info from Freya)
- ShowFatalError("listen() returned invalid fd %d!\n",fd);
- exit(1);
- }
-
- if(fd_max<=fd) fd_max=fd+1;
- FD_SET(fd, &readfds );
-
- CREATE(session[fd], struct socket_data, 1);
-
- malloc_set(session[fd],0,sizeof(*session[fd]));
- session[fd]->func_recv = connect_client;
-
- return fd;
-}
-
-int make_listen_port(int port)
-{
- return make_listen_bind(INADDR_ANY,port);
-}
-
-// Console Reciever [Wizputer]
-int console_recieve(int i) {
- int n;
- char *buf;
-
- CREATE_A(buf, char, 64);
- malloc_tsetdword(buf,0,sizeof(64));
-
- n = read(0, buf , 64);
- if ( n < 0 )
- ShowError("Console input read error\n");
- else
- {
- ShowNotice ("Sorry, the console is currently non-functional.\n");
-// session[0]->func_console(buf);
- }
-
- aFree(buf);
- return 0;
-}
-
-void set_defaultconsoleparse(int (*defaultparse)(char*))
-{
- default_console_parse = defaultparse;
-}
-
-static int null_console_parse(char *buf)
-{
- ShowMessage("null_console_parse : %s\n",buf);
- return 0;
-}
-
-// function parse table
-// To-do: -- use dynamic arrays
-// -- add a register_parse_func();
-struct func_parse_table func_parse_table[SESSION_MAX];
-
-int default_func_check (struct socket_data *sd) { return 1; }
-
-void func_parse_check (struct socket_data *sd)
-{
- int i;
- for (i = SESSION_HTTP; i < SESSION_MAX; i++) {
- if (func_parse_table[i].func &&
- func_parse_table[i].check &&
- func_parse_table[i].check(sd) != 0)
- {
- sd->type = i;
- sd->func_parse = func_parse_table[i].func;
- return;
- }
- }
-
- // undefined -- treat as raw socket (using default parse)
- sd->type = SESSION_RAW;
-}
-
-// Console Input [Wizputer]
-int start_console(void) {
-
- //Until a better plan is came up with... can't be using session[0] anymore! [Skotlex]
- ShowNotice("The console is currently nonfunctional.\n");
- return 0;
-
- FD_SET(0,&readfds);
-
- if (!session[0]) { // dummy socket already uses fd 0
- CREATE(session[0], struct socket_data, 1);
- }
- malloc_set(session[0],0,sizeof(*session[0]));
-
- session[0]->func_recv = console_recieve;
- session[0]->func_console = default_console_parse;
-
- return 0;
-}
-
-int make_connection(long ip,int port)
-{
- struct sockaddr_in server_address;
- int fd;
- int result;
-
- fd = (int)socket( AF_INET, SOCK_STREAM, 0 );
-
-#ifdef __WIN32
- if (fd == INVALID_SOCKET) {
- ShowError("socket() creation failed (code %d)!\n", fd, WSAGetLastError());
- return -1;
- }
-#else
- if (fd == -1) {
- perror("make_connection:socket()");
- return -1;
- }
-#endif
-
- setsocketopts(fd);
-
- server_address.sin_family = AF_INET;
- server_address.sin_addr.s_addr = ip;
- server_address.sin_port = htons((unsigned short)port);
-
- ShowStatus("Connecting to %d.%d.%d.%d:%i\n",
- (ip)&0xFF,(ip>>8)&0xFF,(ip>>16)&0xFF,(ip>>24)&0xFF,port);
-
- result = connect(fd, (struct sockaddr *)(&server_address), sizeof(struct sockaddr_in));
-#ifdef __WIN32
- if( result == SOCKET_ERROR ) {
- ShowError("connect failed (socket %d, code %d)!\n", fd, WSAGetLastError());
- do_close(fd);
- return -1;
- }
-#else
- if (result < 0) { //This is only used when the map/char server try to connect to each other, so it can be handled. [Skotlex]
- perror("make_connection");
- do_close(fd);
- return -1;
- }
-#endif
-//Now the socket can be made non-blocking. [Skotlex]
-#ifdef __WIN32
- {
- unsigned long val = 1;
- if (ioctlsocket(fd, FIONBIO, &val) != 0)
- ShowError("Couldn't set the socket to non-blocking mode (code %d)!\n", WSAGetLastError());
- }
-#else
- if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1)
- perror("make_connection (set nonblock)");
-#endif
-
- if (fd_max <= fd)
- fd_max = fd + 1;
- FD_SET(fd,&readfds);
-
- CREATE(session[fd], struct socket_data, 1);
- CREATE_A(session[fd]->rdata, unsigned char, rfifo_size);
- CREATE_A(session[fd]->wdata, unsigned char, wfifo_size);
-
- session[fd]->max_rdata = (int)rfifo_size;
- session[fd]->max_wdata = (int)wfifo_size;
- session[fd]->func_recv = recv_to_fifo;
- session[fd]->func_send = send_from_fifo;
- session[fd]->func_parse = default_func_parse;
- session[fd]->rdata_tick = last_tick;
-
- return fd;
-}
-
-void free_session_mem(int fd)
-{
- if (session[fd]){
- if (session[fd]->rdata)
- aFree(session[fd]->rdata);
- if (session[fd]->wdata)
- aFree(session[fd]->wdata);
- if (session[fd]->session_data)
- aFree(session[fd]->session_data);
- aFree(session[fd]);
- session[fd] = NULL;
- }
-}
-
-int delete_session(int fd)
-{
- if (fd <= 0 || fd >= FD_SETSIZE)
- return -1;
- FD_CLR(fd, &readfds);
- free_session_mem(fd);
- //ShowMessage("delete_session:%d\n",fd);
- return 0;
-}
-
-int realloc_fifo(int fd,unsigned int rfifo_size,unsigned int wfifo_size)
-{
- if( !session_isValid(fd) )
- return 0;
-
- if( session[fd]->max_rdata != rfifo_size && session[fd]->rdata_size < rfifo_size){
- RECREATE(session[fd]->rdata, unsigned char, rfifo_size);
- session[fd]->max_rdata = rfifo_size;
- }
-
- if( session[fd]->max_wdata != wfifo_size && session[fd]->wdata_size < wfifo_size){
- RECREATE(session[fd]->wdata, unsigned char, wfifo_size);
- session[fd]->max_wdata = wfifo_size;
- }
- return 0;
-}
-
-int realloc_writefifo(int fd, size_t addition)
-{
- size_t newsize;
-
- if( !session_isValid(fd) ) // might not happen
- return 0;
-
- if( session[fd]->wdata_size + (int)addition > session[fd]->max_wdata )
- { // grow rule; grow in multiples of wfifo_size
- newsize = wfifo_size;
- while( session[fd]->wdata_size + addition > newsize ) newsize += newsize;
- }
- else if( session[fd]->max_wdata>=FIFOSIZE_SERVERLINK) {
- //Inter-server adjust. [Skotlex]
- if ((session[fd]->wdata_size+(int)addition)*4 < session[fd]->max_wdata)
- newsize = session[fd]->max_wdata/2;
- else
- return 0; //No change
- } else if( session[fd]->max_wdata>(int)wfifo_size &&
- (session[fd]->wdata_size+(int)addition)*4 < session[fd]->max_wdata )
- { // shrink rule, shrink by 2 when only a quater of the fifo is used, don't shrink below 4*addition
- newsize = session[fd]->max_wdata/2;
- }
- else // no change
- return 0;
-
- RECREATE(session[fd]->wdata, unsigned char, newsize);
- session[fd]->max_wdata = (int)newsize;
-
- return 0;
-}
-
-int WFIFOSET(int fd,int len)
-{
- size_t newreserve;
- struct socket_data *s = session[fd];
-
- if( !session_isValid(fd) || s->wdata == NULL )
- return 0;
-
- // we have written len bytes to the buffer already before calling WFIFOSET
- if(s->wdata_size+len > s->max_wdata)
- { // actually there was a buffer overflow already
- unsigned char *sin_addr = (unsigned char *)&s->client_addr.sin_addr;
- ShowFatalError("socket: Buffer Overflow. Connection %d (%d.%d.%d.%d) has written %d byteson a %d/%d bytes buffer.\n", fd,
- sin_addr[0], sin_addr[1], sin_addr[2], sin_addr[3], len, s->wdata_size, s->max_wdata);
- ShowDebug("Likely command that caused it: 0x%x\n",
- (*(unsigned short*)(s->wdata+s->wdata_size)));
- // no other chance, make a better fifo model
- exit(1);
- }
-
- s->wdata_size += len;
- // always keep a wfifo_size reserve in the buffer
- // For inter-server connections, let the reserve be 1/8th of the link size.
- newreserve = s->wdata_size + (s->max_wdata>=FIFOSIZE_SERVERLINK?FIFOSIZE_SERVERLINK<<3:wfifo_size);
-
- if(s->wdata_size >= frame_size)
- send_from_fifo(fd);
-
- // realloc after sending
- // readfifo does not need to be realloced at all
- // Even the inter-server buffer may need reallocating! [Skotlex]
- realloc_writefifo(fd, newreserve);
-
- return 0;
-}
-
-int do_sendrecv(int next)
-{
- fd_set rfd,efd; //Added the Error Set so that such sockets can be made eof. They are the same as the rfd for now. [Skotlex]
- struct sockaddr_in addr_check;
- struct timeval timeout;
- int ret,i,size;
-
- last_tick = time(0);
-
-
- //PRESEND Need to do this to ensure that the clients get something to do
- //which hopefully will cause them to send packets. [Meruru]
- for (i = 1; i < fd_max; i++)
- {
- if(!session[i])
- continue;
-
- if(session[i]->wdata_size && session[i]->func_send)
- session[i]->func_send(i);
- }
-
- timeout.tv_sec = next/1000;
- timeout.tv_usec = next%1000*1000;
-
- for(memcpy(&rfd, &readfds, sizeof(rfd)),
- memcpy(&efd, &readfds, sizeof(efd));
- (ret = select(fd_max, &rfd, NULL, &efd, &timeout))<0;
- memcpy(&rfd, &readfds, sizeof(rfd)),
- memcpy(&efd, &readfds, sizeof(efd)))
- {
- if(serrno != SEBADF)
- return 0;
-
- //Well then the error is due to a bad socket. Lets find and remove it
- //and try again
- for(i = 1; i < fd_max; i++)
- {
- if(!session[i])
- continue;
-
- //check the validity of the socket. Does what the last thing did
- //just alot faster [Meruru]
- size = sizeof(struct sockaddr);
- if(getsockname(i,(struct sockaddr*)&addr_check,&size)<0)
- if(serrno == SEBADF) //See the #defines at the top
- {
- free_session_mem(i); //free the bad session
- continue;
- }
-
- FD_SET(i,&readfds);
- ret = i;
- }
-
- fd_max = ret;
- }
-
- //ok under windows to use FD_ISSET is FUCKING stupid
- //because windows uses an array so lets do them part by part [Meruru]
-#ifdef _WIN32
- //Do the socket sets. Unlike linux which uses a bit mask windows uses
- //a array. So calls to FS_ISSET are SLOW AS SHIT. So we have to do
- //a special case for them which actually turns out ok [Meruru]
- for(i=0;i<(int)rfd.fd_count;i++)
- {
- if(session[rfd.fd_array[i]] &&
- session[rfd.fd_array[i]]->func_recv)
- session[rfd.fd_array[i]]->func_recv(rfd.fd_array[i]);
- }
- for(i=0;i<(int)efd.fd_count;i++)
- set_eof(efd.fd_array[i]);
-
- for (i = 1; i < fd_max; i++)
- {
- if(!session[i])
- continue;
-
- //POSTSEND: Does write EVER BLOCK? NO!! not unless WE ARE CURRENTLY SENDING SOMETHING
- //Or just have opened a connection and dont know if its ready
- //And since eA isn't multi threaded and all the sockets are non blocking THIS ISNT A PROBLEM! [Meruru]
-
- if(session[i]->wdata_size && session[i]->func_send)
- session[i]->func_send(i);
-
- if(session[i] && session[i]->eof) //The session check is for when the connection ended in func_parse
- { //Finally, even if there is no data to parse, connections signalled eof should be closed, so we call parse_func [Skotlex]
- if (session[i]->func_parse)
- session[i]->func_parse(i); //This should close the session inmediately.
- }
- }
-
-#else //where under linux its just a bit check so its smart [Meruru]
-
- for (i = 1; i < fd_max; i++){
- if(!session[i])
- continue;
-
- if(FD_ISSET(i,&efd)){
- //ShowMessage("error:%d\n",i);
- ShowDebug("do_sendrecv: Connection error on Session %d.\n", i);
- set_eof(i);
- continue;
- }
-
-
- if(FD_ISSET(i,&rfd)){
- //ShowMessage("read:%d\n",i);
- if(session[i]->func_recv)
- session[i]->func_recv(i);
- }
-
- //Does write EVER BLOCK. NO not unless WE ARE CURRENTALLY SENDING SOMETHING
- //And sence eA isnt multi threaded THIS ISNT A PROBLEM!
- if(session[i]->wdata_size && session[i]->func_send)
- session[i]->func_send(i);
-
- if(session[i] && session[i]->eof) //The session check is for when the connection ended in func_parse
- { //Finally, even if there is no data to parse, connections signalled eof should be closed, so we call parse_func [Skotlex]
- if (session[i]->func_parse)
- session[i]->func_parse(i); //This should close the session inmediately.
- }
- }
-#endif
-
- return 0;
-}
-
-int do_parsepacket(void)
-{
- int i;
- struct socket_data *sd;
- for(i = 1; i < fd_max; i++){
- sd = session[i];
- if(!sd)
- continue;
- if (sd->rdata_tick && DIFF_TICK(last_tick,sd->rdata_tick) > stall_time) {
- ShowInfo ("Session #%d timed out\n", i);
- sd->eof = 1;
- }
- if(sd->rdata_size == 0 && sd->eof == 0)
- continue;
- if(sd->func_parse){
- if(sd->type == SESSION_UNKNOWN)
- func_parse_check(sd);
- if(sd->type != SESSION_UNKNOWN)
- sd->func_parse(i);
- if(!session[i])
- continue;
- /* after parse, check client's RFIFO size to know if there is an invalid packet (too big and not parsed) */
- if (session[i]->rdata_size == rfifo_size && session[i]->max_rdata == rfifo_size) {
- session[i]->eof = 1;
- continue;
- }
- }
- RFIFOFLUSH(i);
- }
- return 0;
-}
-
-/* DDoS 攻撃対策 */
-#ifndef MINICORE
-struct _access_control {
- unsigned int ip;
- unsigned int mask;
-};
-
-struct _connect_history {
- struct _connect_history *next;
- struct _connect_history *prev;
- int status;
- int count;
- unsigned int ip;
- unsigned int tick;
-};
-static struct _connect_history *connect_history[0x10000];
-static int connect_check_(unsigned int ip);
-
-// 接続できるかどうかの確認
-// false : 接続OK
-// true : 接続NG
-static int connect_check(unsigned int ip) {
- int result = connect_check_(ip);
- if(access_debug) {
- ShowMessage("connect_check: Connection from %d.%d.%d.%d %s\n",
- CONVIP(ip),result ? "allowed." : "denied!");
- }
- return result;
-}
-
-static int connect_check_(unsigned int ip) {
- struct _connect_history *hist = connect_history[ip & 0xFFFF];
- struct _connect_history *hist_new;
- int i,is_allowip = 0,is_denyip = 0,connect_ok = 0;
-
- // allow , deny リストに入っているか確認
- for(i = 0;i < access_allownum; i++) {
- if((ip & access_allow[i].mask) == (access_allow[i].ip & access_allow[i].mask)) {
- if(access_debug) {
- ShowMessage("connect_check: Found match from allow list:%d.%d.%d.%d IP:%d.%d.%d.%d Mask:%d.%d.%d.%d\n",
- CONVIP(ip),
- CONVIP(access_allow[i].ip),
- CONVIP(access_allow[i].mask));
- }
- is_allowip = 1;
- break;
- }
- }
- for(i = 0;i < access_denynum; i++) {
- if((ip & access_deny[i].mask) == (access_deny[i].ip & access_deny[i].mask)) {
- if(access_debug) {
- ShowMessage("connect_check: Found match from deny list:%d.%d.%d.%d IP:%d.%d.%d.%d Mask:%d.%d.%d.%d\n",
- CONVIP(ip),
- CONVIP(access_deny[i].ip),
- CONVIP(access_deny[i].mask));
- }
- is_denyip = 1;
- break;
- }
- }
- // コネクト出来るかどうか確認
- // connect_ok
- // 0 : 無条件に拒否
- // 1 : 田代砲チェックの結果次第
- // 2 : 無条件に許可
- switch(access_order) {
- case ACO_DENY_ALLOW:
- default:
- if(is_allowip) {
- connect_ok = 2;
- } else if(is_denyip) {
- connect_ok = 0;
- } else {
- connect_ok = 1;
- }
- break;
- case ACO_ALLOW_DENY:
- if(is_denyip) {
- connect_ok = 0;
- } else if(is_allowip) {
- connect_ok = 2;
- } else {
- connect_ok = 1;
- }
- break;
- case ACO_MUTUAL_FAILTURE:
- if(is_allowip) {
- connect_ok = 2;
- } else {
- connect_ok = 0;
- }
- break;
- }
-
- // 接続履歴を調べる
- while(hist) {
- if(ip == hist->ip) {
- // 同じIP発見
- if(hist->status) {
- // ban フラグが立ってる
- return (connect_ok == 2 ? 1 : 0);
- } else if(DIFF_TICK(gettick(),hist->tick) < ddos_interval) {
- // ddos_interval秒以内にリクエスト有り
- hist->tick = gettick();
- if(hist->count++ >= ddos_count) {
- // ddos 攻撃を検出
- hist->status = 1;
- ShowWarning("connect_check: DDOS Attack detected from %d.%d.%d.%d!\n",
- CONVIP(ip));
- return (connect_ok == 2 ? 1 : 0);
- } else {
- return connect_ok;
- }
- } else {
- // ddos_interval秒以内にリクエスト無いのでタイマークリア
- hist->tick = gettick();
- hist->count = 0;
- return connect_ok;
- }
- }
- hist = hist->next;
- }
- // IPリストに無いので新規作成
- hist_new = (struct _connect_history *) aCalloc(1,sizeof(struct _connect_history));
- hist_new->ip = ip;
- hist_new->tick = gettick();
- if(connect_history[ip & 0xFFFF] != NULL) {
- hist = connect_history[ip & 0xFFFF];
- hist->prev = hist_new;
- hist_new->next = hist;
- }
- connect_history[ip & 0xFFFF] = hist_new;
- return connect_ok;
-}
-
-static int connect_check_clear(int tid,unsigned int tick,int id,int data) {
- int i;
- int clear = 0;
- int list = 0;
- struct _connect_history *hist , *hist2;
- for(i = 0;i < 0x10000 ; i++) {
- hist = connect_history[i];
- while(hist) {
- if ((DIFF_TICK(tick,hist->tick) > ddos_interval * 3 && !hist->status) ||
- (DIFF_TICK(tick,hist->tick) > ddos_autoreset && hist->status)) {
- // clear data
- hist2 = hist->next;
- if(hist->prev) {
- hist->prev->next = hist->next;
- } else {
- connect_history[i] = hist->next;
- }
- if(hist->next) {
- hist->next->prev = hist->prev;
- }
- aFree(hist);
- hist = hist2;
- clear++;
- } else {
- hist = hist->next;
- }
- list++;
- }
- }
- if(access_debug) {
- ShowMessage("connect_check_clear: Cleared %d of %d from IP list.\n", clear, list);
- }
- return list;
-}
-
-// IPマスクチェック
-int access_ipmask(const char *str,struct _access_control* acc)
-{
- unsigned int mask=0,i=0,m,ip, a0,a1,a2,a3;
- if( !strcmp(str,"all") ) {
- ip = 0;
- mask = 0;
- } else {
- if( sscanf(str,"%d.%d.%d.%d%n",&a0,&a1,&a2,&a3,&i)!=4 || i==0) {
- ShowError("access_ipmask: Unknown format %s!\n",str);
- return 0;
- }
- ip = (a3 << 24) | (a2 << 16) | (a1 << 8) | a0;
-
- if(sscanf(str+i,"/%d.%d.%d.%d",&a0,&a1,&a2,&a3)==4 ){
- mask = (a3 << 24) | (a2 << 16) | (a1 << 8) | a0;
- } else if(sscanf(str+i,"/%d",&m) == 1) {
- for(i=0;i<m;i++) {
- mask = (mask >> 1) | 0x80000000;
- }
- mask = ntohl(mask);
- } else {
- mask = 0xFFFFFFFF;
- }
- }
- if(access_debug) {
- ShowMessage("access_ipmask: Loaded IP:%d.%d.%d.%d mask:%d.%d.%d.%d\n",
- CONVIP(ip), CONVIP(mask));
- }
- acc->ip = ip;
- acc->mask = mask;
- return 1;
-}
-#endif
-
-int socket_config_read(const char *cfgName) {
- int i;
- char line[1024],w1[1024],w2[1024];
- FILE *fp;
-
- fp=fopen(cfgName, "r");
- if(fp==NULL){
- ShowError("File not found: %s\n", cfgName);
- return 1;
- }
- while(fgets(line,1020,fp)){
- if(line[0] == '/' && line[1] == '/')
- continue;
- i=sscanf(line,"%[^:]: %[^\r\n]",w1,w2);
- if(i!=2)
- continue;
- if(strcmpi(w1,"stall_time")==0){
- stall_time = atoi(w2);
- #ifndef MINICORE
- } else if(strcmpi(w1,"enable_ip_rules")==0){
- if(strcmpi(w2,"yes")==0)
- ip_rules = 1;
- else if(strcmpi(w2,"no")==0)
- ip_rules = 0;
- else ip_rules = atoi(w2);
- } else if(strcmpi(w1,"order")==0){
- access_order=atoi(w2);
- if(strcmpi(w2,"deny,allow")==0) access_order=ACO_DENY_ALLOW;
- if(strcmpi(w2,"allow,deny")==0) access_order=ACO_ALLOW_DENY;
- if(strcmpi(w2,"mutual-failure")==0) access_order=ACO_MUTUAL_FAILTURE;
- } else if(strcmpi(w1,"allow")==0){
- access_allow = (struct _access_control *) aRealloc(access_allow,(access_allownum+1)*sizeof(struct _access_control));
- if(access_ipmask(w2,&access_allow[access_allownum])) {
- access_allownum++;
- }
- } else if(strcmpi(w1,"deny")==0){
- access_deny = (struct _access_control *) aRealloc(access_deny,(access_denynum+1)*sizeof(struct _access_control));
- if(access_ipmask(w2,&access_deny[access_denynum])) {
- access_denynum++;
- }
- } else if(!strcmpi(w1,"ddos_interval")){
- ddos_interval = atoi(w2);
- } else if(!strcmpi(w1,"ddos_count")){
- ddos_count = atoi(w2);
- } else if(!strcmpi(w1,"ddos_autoreset")){
- ddos_autoreset = atoi(w2);
- } else if(!strcmpi(w1,"debug")){
- if(strcmpi(w2,"yes")==0)
- access_debug = 1;
- else if(strcmpi(w2,"no")==0)
- access_debug = 0;
- else access_debug = atoi(w2);
- #endif
- } else if (strcmpi(w1, "mode_neg") == 0)
- {
- if(strcmpi(w2,"yes")==0)
- mode_neg = 1;
- else if(strcmpi(w2,"no")==0)
- mode_neg = 0;
- else mode_neg = atoi(w2);
- } else if (strcmpi(w1, "frame_size") == 0)
- frame_size = strtoul(w2, NULL, 10);
- else if (strcmpi(w1, "import") == 0)
- socket_config_read(w2);
- }
- fclose(fp);
- return 0;
-}
-
-int RFIFOSKIP(int fd,int len)
-{
- struct socket_data *s;
-
- if ( !session_isActive(fd) ) //Nullpo error here[Kevin]
- return 0;
-
- s = session[fd];
-
- if ((signed int)(s->rdata_size-s->rdata_pos-len)<0) {
- //fprintf(stderr,"too many skip\n");
- //exit(1);
- //better than a COMPLETE program abort // TEST! :)
- ShowError("too many skip (%d) now skipped: %d (FD: %d)\n", len, RFIFOREST(fd), fd);
- len = RFIFOREST(fd);
- }
- s->rdata_pos = s->rdata_pos+len;
- return 0;
-}
-
-
-unsigned int addr_[16]; // ip addresses of local host (host byte order)
-unsigned int naddr_ = 0; // # of ip addresses
-
-void socket_final (void)
-{
- int i;
-#ifndef MINICORE
- struct _connect_history *hist , *hist2;
- for(i = 0; i < 0x10000; i++) {
- hist = connect_history[i];
- while(hist) {
- hist2 = hist->next;
- aFree(hist);
- hist = hist2;
- }
- }
- if (access_allow)
- aFree(access_allow);
- if (access_deny)
- aFree(access_deny);
-#endif
-
- for (i = 1; i < fd_max; i++) {
- if(session[i])
- delete_session(i);
- }
-
- // session[0] のダミーデータを削除
- aFree(session[0]->rdata);
- aFree(session[0]->wdata);
- aFree(session[0]);
-}
-
-//Closes a socket.
-//Needed to simplify shutdown code as well as manage the subtle differences in socket management from Windows and *nix.
-void do_close(int fd)
-{
-//We don't really care if these closing functions return an error, we are just shutting down and not reusing this socket.
-#ifdef __WIN32
-// shutdown(fd, SD_BOTH); //FIXME: Shutdown requires winsock2.h! What would be the proper shutting down method for winsock1?
- if (session[fd] && session[fd]->func_send == send_from_fifo)
- session[fd]->func_send(fd); //Flush the data as it is gonna be closed down, but it may not succeed as it is a nonblocking socket! [Skotlex]
- closesocket(fd);
-#else
- if (close(fd))
- perror("do_close: close");
-#endif
- if (session[fd])
- delete_session(fd);
-}
-
-void socket_init (void)
-{
- char *SOCKET_CONF_FILENAME = "conf/packet_athena.conf";
-#ifdef __WIN32
- char** a;
- unsigned int i;
- char fullhost[255];
- struct hostent* hent;
-
- /* Start up the windows networking */
- WORD version_wanted = MAKEWORD(1, 1); //Demand at least WinSocket version 1.1 (from Freya)
- WSADATA wsaData;
-
- if ( WSAStartup(version_wanted, &wsaData) != 0 ) {
- ShowFatalError("SYSERR: WinSock not available!\n");
- exit(1);
- }
-
- if(gethostname(fullhost, sizeof(fullhost)) == SOCKET_ERROR) {
- ShowError("Ugg.. no hostname defined!\n");
- return;
- }
-
- // XXX This should look up the local IP addresses in the registry
- // instead of calling gethostbyname. However, the way IP addresses
- // are stored in the registry is annoyingly complex, so I'll leave
- // this as T.B.D.
- hent = gethostbyname(fullhost);
- if (hent == NULL) {
- ShowError("Cannot resolve our own hostname to a IP address");
- return;
- }
-
- a = hent->h_addr_list;
- for(i = 0; a[i] != 0 && i < 16; ++i) {
- unsigned long addr1 = ntohl(*(unsigned long*) a[i]);
- addr_[i] = addr1;
- }
- naddr_ = i;
-#else
- int pos;
- int fdes = socket(AF_INET, SOCK_STREAM, 0);
- char buf[16 * sizeof(struct ifreq)];
- struct ifconf ic;
-
- // The ioctl call will fail with Invalid Argument if there are more
- // interfaces than will fit in the buffer
- ic.ifc_len = sizeof(buf);
- ic.ifc_buf = buf;
- if(ioctl(fdes, SIOCGIFCONF, &ic) == -1) {
- ShowError("SIOCGIFCONF failed!\n");
- return;
- }
-
- for(pos = 0; pos < ic.ifc_len;)
- {
- struct ifreq * ir = (struct ifreq *) (ic.ifc_buf + pos);
-
- struct sockaddr_in * a = (struct sockaddr_in *) &(ir->ifr_addr);
-
- if(a->sin_family == AF_INET) {
- u_long ad = ntohl(a->sin_addr.s_addr);
- if(ad != INADDR_LOOPBACK && ad != INADDR_ANY) {
- addr_[naddr_ ++] = ad;
- if(naddr_ == 16)
- break;
- }
- }
-
- #if defined(_AIX) || defined(__APPLE__)
- pos += ir->ifr_addr.sa_len; // For when we port athena to run on Mac's :)
- pos += sizeof(ir->ifr_name);
- #else
- pos += sizeof(struct ifreq);
- #endif
- }
-#endif
-
- FD_ZERO(&readfds);
-
- socket_config_read(SOCKET_CONF_FILENAME);
-
- // initialise last send-receive tick
- last_tick = time(0);
-
- // session[0] Was for the console (whatever that was?), but is now currently used for disconnected sessions of the map
- // server, and as such, should hold enough buffer (it is a vacuum so to speak) as it is never flushed. [Skotlex]
- CREATE(session[0], struct socket_data, 1);
- CREATE_A(session[0]->rdata, unsigned char, 2*rfifo_size);
- CREATE_A(session[0]->wdata, unsigned char, 2*wfifo_size);
- session[0]->max_rdata = (int)2*rfifo_size;
- session[0]->max_wdata = (int)2*wfifo_size;
-
- malloc_set (func_parse_table, 0, sizeof(func_parse_table));
- func_parse_table[SESSION_RAW].check = default_func_check;
- func_parse_table[SESSION_RAW].func = default_func_parse;
-
-#ifndef MINICORE
- // とりあえず5分ごとに不要なデータを削除する
- add_timer_func_list(connect_check_clear, "connect_check_clear");
- add_timer_interval(gettick()+1000,connect_check_clear,0,0,300*1000);
-#endif
-}
-
-
-bool session_isValid(int fd)
-{ //End of Exam has pointed out that fd==0 is actually an unconnected session! [Skotlex]
- //But this is not so true, it is used... for... something. The console uses it, would this not cause problems? [Skotlex]
- return ( (fd>0) && (fd<FD_SETSIZE) && (NULL!=session[fd]) );
-}
-
-bool session_isActive(int fd)
-{
- return ( session_isValid(fd) && !session[fd]->eof );
-}
-
-in_addr_t resolve_hostbyname(char* hostname, unsigned char *ip, char *ip_str) {
- struct hostent *h = gethostbyname(hostname);
- char ip_buf[16];
- unsigned char ip2[4];
- if (!h) return 0;
- if (ip == NULL) ip = ip2;
- ip[0] = (unsigned char) h->h_addr[0];
- ip[1] = (unsigned char) h->h_addr[1];
- ip[2] = (unsigned char) h->h_addr[2];
- ip[3] = (unsigned char) h->h_addr[3];
- if (ip_str == NULL) ip_str = ip_buf;
- sprintf(ip_str, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
- return inet_addr(ip_str);
-}
+// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
+// For more information, see LICENCE in the main folder
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <errno.h>
+
+#ifdef __WIN32
+#define __USE_W32_SOCKETS
+#include <windows.h>
+#include <winsock.h>
+#include <io.h>
+
+typedef int socklen_t;
+#else
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <net/if.h>
+#include <unistd.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <netdb.h>
+#include <arpa/inet.h>
+
+#ifndef SIOCGIFCONF
+#include <sys/sockio.h> // SIOCGIFCONF on Solaris, maybe others? [Shinomori]
+#endif
+
+#endif
+
+#ifdef _WIN32
+#define SEBADF WSAENOTSOCK
+#define serrno WSAGetLastError()
+#else
+#define SEBADF EBADF
+#define serrno errno
+#endif
+
+#include <fcntl.h>
+#include <string.h>
+
+#include "../common/socket.h"
+#include "../common/mmo.h" // [Valaris] thanks to fov
+#include "../common/timer.h"
+#include "../common/malloc.h"
+#include "../common/showmsg.h"
+
+fd_set readfds;
+int fd_max;
+time_t last_tick;
+time_t stall_time = 60;
+int ip_rules = 1;
+
+// reuse port
+#ifndef SO_REUSEPORT
+ #define SO_REUSEPORT 15
+#endif
+
+#ifndef TCP_FRAME_LEN
+#define TCP_FRAME_LEN 1024
+#endif
+
+static int mode_neg=1;
+static size_t frame_size=TCP_FRAME_LEN;
+
+#ifndef MINICORE
+enum {
+ ACO_DENY_ALLOW=0,
+ ACO_ALLOW_DENY,
+ ACO_MUTUAL_FAILTURE,
+};
+
+static struct _access_control *access_allow;
+static struct _access_control *access_deny;
+static int access_order=ACO_DENY_ALLOW;
+static int access_allownum=0;
+static int access_denynum=0;
+static int access_debug=0;
+static int ddos_count = 10;
+static int ddos_interval = 3000;
+static int ddos_autoreset = 600*1000;
+#endif
+
+
+// values derived from freya
+// a player that send more than 2k is probably a hacker without be parsed
+// biggest known packet: S 0153 <len>.w <emblem data>.?B -> 24x24 256 color .bmp (0153 + len.w + 1618/1654/1756 bytes)
+size_t rfifo_size = (16*1024);
+size_t wfifo_size = (16*1024);
+
+#define CONVIP(ip) ip&0xFF,(ip>>8)&0xFF,(ip>>16)&0xFF,ip>>24
+
+struct socket_data *session[FD_SETSIZE];
+
+static int null_parse(int fd);
+static int (*default_func_parse)(int) = null_parse;
+
+static int null_console_parse(char *buf);
+static int (*default_console_parse)(char*) = null_console_parse;
+#ifndef MINICORE
+static int connect_check(unsigned int ip);
+#else
+ #define connect_check(n) 1
+#endif
+
+/*======================================
+ * CORE : Set function
+ *--------------------------------------
+ */
+void set_defaultparse(int (*defaultparse)(int))
+{
+ default_func_parse = defaultparse;
+}
+
+void set_nonblocking(int fd, int yes) {
+ // I don't think we need this
+ // TCP_NODELAY BOOL Disables the Nagle algorithm for send coalescing.
+ if(mode_neg)
+ setsockopt(fd,IPPROTO_TCP,TCP_NODELAY,(char *)&yes,sizeof yes);
+
+ // FIONBIO Use with a nonzero argp parameter to enable the nonblocking mode of socket s.
+ // The argp parameter is zero if nonblocking is to be disabled.
+#ifdef __WIN32
+ ioctlsocket(fd, FIONBIO, &yes);
+#else
+ ioctl(fd,FIONBIO,&yes);
+#endif
+}
+
+static void setsocketopts(int fd)
+{
+ int yes = 1; // reuse fix
+#ifndef WIN32
+ // set SO_REAUSEADDR to true, unix only. on windows this option causes
+ // the previous owner of the socket to give up, which is not desirable
+ // in most cases, neither compatible with unix.
+ setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(char *)&yes,sizeof(yes));
+#ifdef SO_REUSEPORT
+ setsockopt(fd,SOL_SOCKET,SO_REUSEPORT,(char *)&yes,sizeof(yes));
+#endif
+#endif
+ setsockopt(fd,IPPROTO_TCP,TCP_NODELAY,(char *)&yes,sizeof(yes));
+// setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *) &wfifo_size , sizeof(rfifo_size ));
+// setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *) &rfifo_size , sizeof(rfifo_size ));
+#ifdef __WIN32
+{ //set SO_LINGER option (from Freya)
+ //(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/closesocket_2.asp)
+ struct linger opt;
+ opt.l_onoff = 1;
+ opt.l_linger = 0;
+ if (setsockopt(fd, SOL_SOCKET, SO_LINGER, (char*)&opt, sizeof(opt)))
+ ShowWarning("setsocketopts: Unable to set SO_LINGER mode for connection %d!\n",fd);
+}
+#endif
+}
+
+/*======================================
+ * CORE : Socket Sub Function
+ *--------------------------------------
+ */
+static void set_eof(int fd)
+{ //Marks a connection eof and invokes the parse_function to disconnect it right away. [Skotlex]
+ if (session_isActive(fd))
+ session[fd]->eof=1;
+}
+
+static int recv_to_fifo(int fd)
+{
+ int len;
+
+ if( (fd<0) || (fd>=FD_SETSIZE) || (NULL==session[fd]) )
+ return -1;
+
+ if(session[fd]->eof)
+ return -1;
+
+#ifdef __WIN32
+ len=recv(fd,(char *)session[fd]->rdata+session[fd]->rdata_size, RFIFOSPACE(fd), 0);
+ if (len == SOCKET_ERROR) {
+ if (WSAGetLastError() == WSAECONNABORTED) {
+ ShowWarning("recv_to_fifo: Software caused connection abort on session #%d\n", fd);
+ FD_CLR(fd, &readfds); //Remove the socket so the select() won't hang on it.
+// exit(1); //Windows can't really recover from this one. [Skotlex]
+ }
+ if (WSAGetLastError() != WSAEWOULDBLOCK) {
+// ShowDebug("recv_to_fifo: error %d, ending connection #%d\n", WSAGetLastError(), fd);
+ set_eof(fd);
+ }
+ return 0;
+ }
+#else
+ len=read(fd,session[fd]->rdata+session[fd]->rdata_size, RFIFOSPACE(fd));
+ if (len == -1)
+ {
+ if (errno == ECONNABORTED)
+ {
+ ShowFatalError("recv_to_fifo: Network broken (Software caused connection abort on session #%d)\n", fd);
+// exit(1); //Temporal debug, maybe this can be fixed.
+ }
+ if (errno != EAGAIN) { //Connection error.
+// perror("closing session: recv_to_fifo");
+ set_eof(fd);
+ }
+ return 0;
+ }
+#endif
+ if (len <= 0) { //Normal connection end.
+ set_eof(fd);
+ return 0;
+ }
+
+ session[fd]->rdata_size+=len;
+ session[fd]->rdata_tick = last_tick;
+ return 0;
+}
+
+static int send_from_fifo(int fd)
+{
+ int len;
+ if( !session_isValid(fd) )
+ return -1;
+
+// if (s->eof) // if we close connection, we can not send last information (you're been disconnected, etc...) [Yor]
+// return -1;
+/*
+ // clear write buffer if not connected <- I really like more the idea of sending the last information. [Skotlex]
+ if( session[fd]->eof )
+ {
+ session[fd]->wdata_size = 0;
+ return -1;
+ }
+*/
+
+ if (session[fd]->wdata_size == 0)
+ return 0;
+
+#ifdef __WIN32
+ len=send(fd, (const char *)session[fd]->wdata,session[fd]->wdata_size, 0);
+ if (len == SOCKET_ERROR) {
+ if (WSAGetLastError() == WSAECONNABORTED) {
+ ShowWarning("send_from_fifo: Software caused connection abort on session #%d\n", fd);
+ session[fd]->wdata_size = 0; //Clear the send queue as we can't send anymore. [Skotlex]
+ set_eof(fd);
+ FD_CLR(fd, &readfds); //Remove the socket so the select() won't hang on it.
+ }
+ if (WSAGetLastError() != WSAEWOULDBLOCK) {
+// ShowDebug("send_from_fifo: error %d, ending connection #%d\n", WSAGetLastError(), fd);
+ session[fd]->wdata_size = 0; //Clear the send queue as we can't send anymore. [Skotlex]
+ set_eof(fd);
+ }
+ return 0;
+ }
+#else
+ len=send(fd, session[fd]->wdata, session[fd]->wdata_size, MSG_NOSIGNAL);
+ if (len == -1)
+ {
+ if (errno == ECONNABORTED)
+ {
+ ShowWarning("send_from_fifo: Network broken (Software caused connection abort on session #%d)\n", fd);
+ session[fd]->wdata_size = 0; //Clear the send queue as we can't send anymore. [Skotlex]
+ set_eof(fd);
+ }
+ if (errno != EAGAIN) {
+// perror("closing session: send_from_fifo");
+ session[fd]->wdata_size = 0; //Clear the send queue as we can't send anymore. [Skotlex]
+ set_eof(fd);
+ }
+ return 0;
+ }
+#endif
+
+ //{ int i; ShowMessage("send %d : ",fd); for(i=0;i<len;i++){ ShowMessage("%02x ",session[fd]->wdata[i]); } ShowMessage("\n");}
+ if(len>0){
+ if((size_t)len<session[fd]->wdata_size){
+ memmove(session[fd]->wdata,session[fd]->wdata+len,session[fd]->wdata_size-len);
+ session[fd]->wdata_size-=len;
+ } else {
+ session[fd]->wdata_size=0;
+ }
+ }
+ return 0;
+}
+
+void flush_fifo(int fd)
+{
+ if(session[fd] != NULL && session[fd]->func_send == send_from_fifo)
+ {
+ set_nonblocking(fd, 1);
+ send_from_fifo(fd);
+ set_nonblocking(fd, 0);
+ }
+}
+
+void flush_fifos(void)
+{
+ int i;
+ for(i=1;i<fd_max;i++)
+ if(session[i] != NULL &&
+ session[i]->func_send == send_from_fifo)
+ send_from_fifo(i);
+}
+
+static int null_parse(int fd)
+{
+ ShowMessage("null_parse : %d\n",fd);
+ session[fd]->rdata_pos = session[fd]->rdata_size; //RFIFOSKIP(fd, RFIFOREST(fd)); simplify calculation
+ return 0;
+}
+
+/*======================================
+ * CORE : Socket Function
+ *--------------------------------------
+ */
+
+static int connect_client(int listen_fd)
+{
+ int fd;
+ struct sockaddr_in client_address;
+#ifdef __WIN32
+ int len;
+#else
+ socklen_t len;
+#endif
+ //ShowMessage("connect_client : %d\n",listen_fd);
+
+ len=sizeof(client_address);
+
+ fd = accept(listen_fd,(struct sockaddr*)&client_address,&len);
+#ifdef __WIN32
+ if ( fd == INVALID_SOCKET ) {
+ ShowError("accept failed (code %i)!\n", WSAGetLastError());
+ return -1;
+ }
+#else
+ if(fd==-1) {
+ perror("accept");
+ return -1;
+ }
+#endif
+
+ if(fd_max<=fd) fd_max=fd+1;
+
+ setsocketopts(fd);
+
+#ifdef __WIN32
+ {
+ unsigned long val = 1;
+ if (ioctlsocket(fd, FIONBIO, &val) != 0)
+ ShowError("Couldn't set the socket to non-blocking mode (code %d)!\n", WSAGetLastError());
+ }
+#else
+ if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1)
+ perror("connect_client (set nonblock)");
+#endif
+
+ if (ip_rules && !connect_check(*(unsigned int*)(&client_address.sin_addr))) {
+ do_close(fd);
+ return -1;
+ } else
+ FD_SET(fd,&readfds);
+
+ CREATE(session[fd], struct socket_data, 1);
+ CREATE(session[fd]->rdata, unsigned char, rfifo_size);
+ CREATE(session[fd]->wdata, unsigned char, wfifo_size);
+
+ session[fd]->max_rdata = rfifo_size;
+ session[fd]->max_wdata = wfifo_size;
+ session[fd]->func_recv = recv_to_fifo;
+ session[fd]->func_send = send_from_fifo;
+ if(!session[listen_fd]->func_parse)
+ session[fd]->func_parse = default_func_parse;
+ else
+ session[fd]->func_parse = session[listen_fd]->func_parse;
+ session[fd]->client_addr = client_address;
+ session[fd]->rdata_tick = last_tick;
+ session[fd]->type = SESSION_UNKNOWN; // undefined type
+
+ //ShowMessage("new_session : %d %d\n",fd,session[fd]->eof);
+ return fd;
+}
+
+int make_listen_bind(long ip,int port)
+{
+ struct sockaddr_in server_address;
+ int fd;
+ int result;
+
+ fd = (int)socket( AF_INET, SOCK_STREAM, 0 );
+
+#ifdef __WIN32
+ if (fd == INVALID_SOCKET) {
+ ShowError("socket() creation failed (code %d)!\n", fd, WSAGetLastError());
+ exit(1);
+ }
+#else
+ if (fd == -1) {
+ perror("make_listen_port:socket()");
+ exit(1);
+ }
+#endif
+
+#ifdef __WIN32
+ {
+ unsigned long val = 1;
+ if (ioctlsocket(fd, FIONBIO, &val) != 0)
+ ShowError("Couldn't set the socket to non-blocking mode (code %d)!\n", WSAGetLastError());
+ }
+#else
+ if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1)
+ perror("make_listen_bind (set nonblock)");
+#endif
+
+ setsocketopts(fd);
+
+ server_address.sin_family = AF_INET;
+ server_address.sin_addr.s_addr = ip;
+ server_address.sin_port = htons((unsigned short)port);
+
+ result = bind(fd, (struct sockaddr*)&server_address, sizeof(server_address));
+#ifdef __WIN32
+ if( result == SOCKET_ERROR ) {
+ ShowError("bind failed (socket %d, code %d)!\n", fd, WSAGetLastError());
+ exit(1);
+ }
+#else
+ if( result == -1 ) {
+ perror("bind");
+ exit(1);
+ }
+#endif
+ result = listen( fd, 5 );
+#ifdef __WIN32
+ if( result == SOCKET_ERROR ) {
+ ShowError("listen failed (socket %d, code %d)!\n", fd, WSAGetLastError());
+ exit(1);
+ }
+#else
+ if( result != 0) { /* error */
+ perror("listen");
+ exit(1);
+ }
+#endif
+ if ( fd < 0 || fd > FD_SETSIZE )
+ { //Crazy error that can happen in Windows? (info from Freya)
+ ShowFatalError("listen() returned invalid fd %d!\n",fd);
+ exit(1);
+ }
+
+ if(fd_max<=fd) fd_max=fd+1;
+ FD_SET(fd, &readfds );
+
+ CREATE(session[fd], struct socket_data, 1);
+
+ malloc_set(session[fd],0,sizeof(*session[fd]));
+ session[fd]->func_recv = connect_client;
+
+ return fd;
+}
+
+int make_listen_port(int port)
+{
+ return make_listen_bind(INADDR_ANY,port);
+}
+
+// Console Reciever [Wizputer]
+int console_recieve(int i) {
+ int n;
+ char *buf;
+
+ CREATE(buf, char, 64);
+ malloc_tsetdword(buf,0,sizeof(64));
+
+ n = read(0, buf , 64);
+ if ( n < 0 )
+ ShowError("Console input read error\n");
+ else
+ {
+ ShowNotice ("Sorry, the console is currently non-functional.\n");
+// session[0]->func_console(buf);
+ }
+
+ aFree(buf);
+ return 0;
+}
+
+void set_defaultconsoleparse(int (*defaultparse)(char*))
+{
+ default_console_parse = defaultparse;
+}
+
+static int null_console_parse(char *buf)
+{
+ ShowMessage("null_console_parse : %s\n",buf);
+ return 0;
+}
+
+// function parse table
+// To-do: -- use dynamic arrays
+// -- add a register_parse_func();
+struct func_parse_table func_parse_table[SESSION_MAX];
+
+int default_func_check (struct socket_data *sd) { return 1; }
+
+void func_parse_check (struct socket_data *sd)
+{
+ int i;
+ for (i = SESSION_HTTP; i < SESSION_MAX; i++) {
+ if (func_parse_table[i].func &&
+ func_parse_table[i].check &&
+ func_parse_table[i].check(sd) != 0)
+ {
+ sd->type = i;
+ sd->func_parse = func_parse_table[i].func;
+ return;
+ }
+ }
+
+ // undefined -- treat as raw socket (using default parse)
+ sd->type = SESSION_RAW;
+}
+
+// Console Input [Wizputer]
+int start_console(void) {
+
+ //Until a better plan is came up with... can't be using session[0] anymore! [Skotlex]
+ ShowNotice("The console is currently nonfunctional.\n");
+ return 0;
+
+ FD_SET(0,&readfds);
+
+ if (!session[0]) { // dummy socket already uses fd 0
+ CREATE(session[0], struct socket_data, 1);
+ }
+ malloc_set(session[0],0,sizeof(*session[0]));
+
+ session[0]->func_recv = console_recieve;
+ session[0]->func_console = default_console_parse;
+
+ return 0;
+}
+
+int make_connection(long ip,int port)
+{
+ struct sockaddr_in server_address;
+ int fd;
+ int result;
+
+ fd = (int)socket( AF_INET, SOCK_STREAM, 0 );
+
+#ifdef __WIN32
+ if (fd == INVALID_SOCKET) {
+ ShowError("socket() creation failed (code %d)!\n", fd, WSAGetLastError());
+ return -1;
+ }
+#else
+ if (fd == -1) {
+ perror("make_connection:socket()");
+ return -1;
+ }
+#endif
+
+ setsocketopts(fd);
+
+ server_address.sin_family = AF_INET;
+ server_address.sin_addr.s_addr = ip;
+ server_address.sin_port = htons((unsigned short)port);
+
+ ShowStatus("Connecting to %d.%d.%d.%d:%i\n",
+ (ip)&0xFF,(ip>>8)&0xFF,(ip>>16)&0xFF,(ip>>24)&0xFF,port);
+
+ result = connect(fd, (struct sockaddr *)(&server_address), sizeof(struct sockaddr_in));
+#ifdef __WIN32
+ if( result == SOCKET_ERROR ) {
+ ShowError("connect failed (socket %d, code %d)!\n", fd, WSAGetLastError());
+ do_close(fd);
+ return -1;
+ }
+#else
+ if (result < 0) { //This is only used when the map/char server try to connect to each other, so it can be handled. [Skotlex]
+ perror("make_connection");
+ do_close(fd);
+ return -1;
+ }
+#endif
+//Now the socket can be made non-blocking. [Skotlex]
+#ifdef __WIN32
+ {
+ unsigned long val = 1;
+ if (ioctlsocket(fd, FIONBIO, &val) != 0)
+ ShowError("Couldn't set the socket to non-blocking mode (code %d)!\n", WSAGetLastError());
+ }
+#else
+ if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1)
+ perror("make_connection (set nonblock)");
+#endif
+
+ if (fd_max <= fd)
+ fd_max = fd + 1;
+ FD_SET(fd,&readfds);
+
+ CREATE(session[fd], struct socket_data, 1);
+ CREATE(session[fd]->rdata, unsigned char, rfifo_size);
+ CREATE(session[fd]->wdata, unsigned char, wfifo_size);
+
+ session[fd]->max_rdata = rfifo_size;
+ session[fd]->max_wdata = wfifo_size;
+ session[fd]->func_recv = recv_to_fifo;
+ session[fd]->func_send = send_from_fifo;
+ session[fd]->func_parse = default_func_parse;
+ session[fd]->rdata_tick = last_tick;
+
+ return fd;
+}
+
+void free_session_mem(int fd)
+{
+ if (session[fd]){
+ if (session[fd]->rdata)
+ aFree(session[fd]->rdata);
+ if (session[fd]->wdata)
+ aFree(session[fd]->wdata);
+ if (session[fd]->session_data)
+ aFree(session[fd]->session_data);
+ aFree(session[fd]);
+ session[fd] = NULL;
+ }
+}
+
+int delete_session(int fd)
+{
+ if (fd <= 0 || fd >= FD_SETSIZE)
+ return -1;
+ FD_CLR(fd, &readfds);
+ free_session_mem(fd);
+ //ShowMessage("delete_session:%d\n",fd);
+ return 0;
+}
+
+int realloc_fifo(int fd,unsigned int rfifo_size,unsigned int wfifo_size)
+{
+ if( !session_isValid(fd) )
+ return 0;
+
+ if( session[fd]->max_rdata != rfifo_size && session[fd]->rdata_size < rfifo_size){
+ RECREATE(session[fd]->rdata, unsigned char, rfifo_size);
+ session[fd]->max_rdata = rfifo_size;
+ }
+
+ if( session[fd]->max_wdata != wfifo_size && session[fd]->wdata_size < wfifo_size){
+ RECREATE(session[fd]->wdata, unsigned char, wfifo_size);
+ session[fd]->max_wdata = wfifo_size;
+ }
+ return 0;
+}
+
+int realloc_writefifo(int fd, size_t addition)
+{
+ size_t newsize;
+
+ if( !session_isValid(fd) ) // might not happen
+ return 0;
+
+ if( session[fd]->wdata_size + addition > session[fd]->max_wdata )
+ { // grow rule; grow in multiples of wfifo_size
+ newsize = wfifo_size;
+ while( session[fd]->wdata_size + addition > newsize ) newsize += newsize;
+ }
+ else if( session[fd]->max_wdata>=FIFOSIZE_SERVERLINK) {
+ //Inter-server adjust. [Skotlex]
+ if ((session[fd]->wdata_size+addition)*4 < session[fd]->max_wdata)
+ newsize = session[fd]->max_wdata/2;
+ else
+ return 0; //No change
+ } else if( session[fd]->max_wdata>wfifo_size &&
+ (session[fd]->wdata_size+addition)*4 < session[fd]->max_wdata )
+ { // shrink rule, shrink by 2 when only a quater of the fifo is used, don't shrink below 4*addition
+ newsize = session[fd]->max_wdata/2;
+ }
+ else // no change
+ return 0;
+
+ RECREATE(session[fd]->wdata, unsigned char, newsize);
+ session[fd]->max_wdata = newsize;
+
+ return 0;
+}
+
+int WFIFOSET(int fd,int len)
+{
+ size_t newreserve;
+ struct socket_data *s = session[fd];
+
+ if( !session_isValid(fd) || s->wdata == NULL )
+ return 0;
+
+ // we have written len bytes to the buffer already before calling WFIFOSET
+ if(s->wdata_size+len > s->max_wdata)
+ { // actually there was a buffer overflow already
+ unsigned char *sin_addr = (unsigned char *)&s->client_addr.sin_addr;
+ ShowFatalError("socket: Buffer Overflow. Connection %d (%d.%d.%d.%d) has written %d byteson a %d/%d bytes buffer.\n", fd,
+ sin_addr[0], sin_addr[1], sin_addr[2], sin_addr[3], len, s->wdata_size, s->max_wdata);
+ ShowDebug("Likely command that caused it: 0x%x\n",
+ (*(unsigned short*)(s->wdata+s->wdata_size)));
+ // no other chance, make a better fifo model
+ exit(1);
+ }
+
+ s->wdata_size += len;
+ // always keep a wfifo_size reserve in the buffer
+ // For inter-server connections, let the reserve be 1/8th of the link size.
+ newreserve = s->wdata_size + (s->max_wdata>=FIFOSIZE_SERVERLINK?FIFOSIZE_SERVERLINK<<3:wfifo_size);
+
+ if(s->wdata_size >= frame_size)
+ send_from_fifo(fd);
+
+ // realloc after sending
+ // readfifo does not need to be realloced at all
+ // Even the inter-server buffer may need reallocating! [Skotlex]
+ realloc_writefifo(fd, newreserve);
+
+ return 0;
+}
+
+int do_sendrecv(int next)
+{
+ fd_set rfd,efd; //Added the Error Set so that such sockets can be made eof. They are the same as the rfd for now. [Skotlex]
+ struct sockaddr_in addr_check;
+ struct timeval timeout;
+ int ret,i,size;
+
+ last_tick = time(0);
+
+
+ //PRESEND Need to do this to ensure that the clients get something to do
+ //which hopefully will cause them to send packets. [Meruru]
+ for (i = 1; i < fd_max; i++)
+ {
+ if(!session[i])
+ continue;
+
+ if(session[i]->wdata_size && session[i]->func_send)
+ session[i]->func_send(i);
+ }
+
+ timeout.tv_sec = next/1000;
+ timeout.tv_usec = next%1000*1000;
+
+ for(memcpy(&rfd, &readfds, sizeof(rfd)),
+ memcpy(&efd, &readfds, sizeof(efd));
+ (ret = select(fd_max, &rfd, NULL, &efd, &timeout))<0;
+ memcpy(&rfd, &readfds, sizeof(rfd)),
+ memcpy(&efd, &readfds, sizeof(efd)))
+ {
+ if(serrno != SEBADF)
+ return 0;
+
+ //Well then the error is due to a bad socket. Lets find and remove it
+ //and try again
+ for(i = 1; i < fd_max; i++)
+ {
+ if(!session[i])
+ continue;
+
+ //check the validity of the socket. Does what the last thing did
+ //just alot faster [Meruru]
+ size = sizeof(struct sockaddr);
+ if(getsockname(i,(struct sockaddr*)&addr_check,&size)<0)
+ if(serrno == SEBADF) //See the #defines at the top
+ {
+ free_session_mem(i); //free the bad session
+ continue;
+ }
+
+ FD_SET(i,&readfds);
+ ret = i;
+ }
+
+ fd_max = ret;
+ }
+
+ //ok under windows to use FD_ISSET is FUCKING stupid
+ //because windows uses an array so lets do them part by part [Meruru]
+#ifdef _WIN32
+ //Do the socket sets. Unlike linux which uses a bit mask windows uses
+ //a array. So calls to FS_ISSET are SLOW AS SHIT. So we have to do
+ //a special case for them which actually turns out ok [Meruru]
+ for(i=0;i<(int)rfd.fd_count;i++)
+ {
+ if(session[rfd.fd_array[i]] &&
+ session[rfd.fd_array[i]]->func_recv)
+ session[rfd.fd_array[i]]->func_recv(rfd.fd_array[i]);
+ }
+ for(i=0;i<(int)efd.fd_count;i++)
+ set_eof(efd.fd_array[i]);
+
+ for (i = 1; i < fd_max; i++)
+ {
+ if(!session[i])
+ continue;
+
+ //POSTSEND: Does write EVER BLOCK? NO!! not unless WE ARE CURRENTLY SENDING SOMETHING
+ //Or just have opened a connection and dont know if its ready
+ //And since eA isn't multi threaded and all the sockets are non blocking THIS ISNT A PROBLEM! [Meruru]
+
+ if(session[i]->wdata_size && session[i]->func_send)
+ session[i]->func_send(i);
+
+ if(session[i]->eof) //The session check is for when the connection ended in func_parse
+ { //Finally, even if there is no data to parse, connections signalled eof should be closed, so we call parse_func [Skotlex]
+ if (session[i]->func_parse)
+ session[i]->func_parse(i); //This should close the session inmediately.
+ }
+ }
+
+#else //where under linux its just a bit check so its smart [Meruru]
+
+ for (i = 1; i < fd_max; i++){
+ if(!session[i])
+ continue;
+
+ if(FD_ISSET(i,&efd)){
+ //ShowMessage("error:%d\n",i);
+ ShowDebug("do_sendrecv: Connection error on Session %d.\n", i);
+ set_eof(i);
+ continue;
+ }
+
+
+ if(FD_ISSET(i,&rfd)){
+ //ShowMessage("read:%d\n",i);
+ if(session[i]->func_recv)
+ session[i]->func_recv(i);
+ }
+
+ //Does write EVER BLOCK. NO not unless WE ARE CURRENTALLY SENDING SOMETHING
+ //And sence eA isnt multi threaded THIS ISNT A PROBLEM!
+ if(session[i]->wdata_size && session[i]->func_send)
+ session[i]->func_send(i);
+
+ if(session[i] && session[i]->eof) //The session check is for when the connection ended in func_parse
+ { //Finally, even if there is no data to parse, connections signalled eof should be closed, so we call parse_func [Skotlex]
+ if (session[i]->func_parse)
+ session[i]->func_parse(i); //This should close the session inmediately.
+ }
+ }
+#endif
+
+ return 0;
+}
+
+int do_parsepacket(void)
+{
+ int i;
+ struct socket_data *sd;
+ for(i = 1; i < fd_max; i++){
+ sd = session[i];
+ if(!sd)
+ continue;
+ if (sd->rdata_tick && DIFF_TICK(last_tick,sd->rdata_tick) > stall_time) {
+ ShowInfo ("Session #%d timed out\n", i);
+ sd->eof = 1;
+ }
+ if(sd->rdata_size == 0 && sd->eof == 0)
+ continue;
+ if(sd->func_parse){
+ if(sd->type == SESSION_UNKNOWN)
+ func_parse_check(sd);
+ if(sd->type != SESSION_UNKNOWN)
+ sd->func_parse(i);
+ if(!session[i])
+ continue;
+ /* after parse, check client's RFIFO size to know if there is an invalid packet (too big and not parsed) */
+ if (session[i]->rdata_size == rfifo_size && session[i]->max_rdata == rfifo_size) {
+ session[i]->eof = 1;
+ continue;
+ }
+ }
+ RFIFOFLUSH(i);
+ }
+ return 0;
+}
+
+/* DDoS 攻撃対策 */
+#ifndef MINICORE
+struct _access_control {
+ unsigned int ip;
+ unsigned int mask;
+};
+
+struct _connect_history {
+ struct _connect_history *next;
+ struct _connect_history *prev;
+ int status;
+ int count;
+ unsigned int ip;
+ unsigned int tick;
+};
+static struct _connect_history *connect_history[0x10000];
+static int connect_check_(unsigned int ip);
+
+// 接続できるかどうかの確認
+// false : 接続OK
+// true : 接続NG
+static int connect_check(unsigned int ip) {
+ int result = connect_check_(ip);
+ if(access_debug) {
+ ShowMessage("connect_check: Connection from %d.%d.%d.%d %s\n",
+ CONVIP(ip),result ? "allowed." : "denied!");
+ }
+ return result;
+}
+
+static int connect_check_(unsigned int ip) {
+ struct _connect_history *hist = connect_history[ip & 0xFFFF];
+ struct _connect_history *hist_new;
+ int i,is_allowip = 0,is_denyip = 0,connect_ok = 0;
+
+ // allow , deny リストに入っているか確認
+ for(i = 0;i < access_allownum; i++) {
+ if((ip & access_allow[i].mask) == (access_allow[i].ip & access_allow[i].mask)) {
+ if(access_debug) {
+ ShowMessage("connect_check: Found match from allow list:%d.%d.%d.%d IP:%d.%d.%d.%d Mask:%d.%d.%d.%d\n",
+ CONVIP(ip),
+ CONVIP(access_allow[i].ip),
+ CONVIP(access_allow[i].mask));
+ }
+ is_allowip = 1;
+ break;
+ }
+ }
+ for(i = 0;i < access_denynum; i++) {
+ if((ip & access_deny[i].mask) == (access_deny[i].ip & access_deny[i].mask)) {
+ if(access_debug) {
+ ShowMessage("connect_check: Found match from deny list:%d.%d.%d.%d IP:%d.%d.%d.%d Mask:%d.%d.%d.%d\n",
+ CONVIP(ip),
+ CONVIP(access_deny[i].ip),
+ CONVIP(access_deny[i].mask));
+ }
+ is_denyip = 1;
+ break;
+ }
+ }
+ // コネクト出来るかどうか確認
+ // connect_ok
+ // 0 : 無条件に拒否
+ // 1 : 田代砲チェックの結果次第
+ // 2 : 無条件に許可
+ switch(access_order) {
+ case ACO_DENY_ALLOW:
+ default:
+ if(is_allowip) {
+ connect_ok = 2;
+ } else if(is_denyip) {
+ connect_ok = 0;
+ } else {
+ connect_ok = 1;
+ }
+ break;
+ case ACO_ALLOW_DENY:
+ if(is_denyip) {
+ connect_ok = 0;
+ } else if(is_allowip) {
+ connect_ok = 2;
+ } else {
+ connect_ok = 1;
+ }
+ break;
+ case ACO_MUTUAL_FAILTURE:
+ if(is_allowip) {
+ connect_ok = 2;
+ } else {
+ connect_ok = 0;
+ }
+ break;
+ }
+
+ // 接続履歴を調べる
+ while(hist) {
+ if(ip == hist->ip) {
+ // 同じIP発見
+ if(hist->status) {
+ // ban フラグが立ってる
+ return (connect_ok == 2 ? 1 : 0);
+ } else if(DIFF_TICK(gettick(),hist->tick) < ddos_interval) {
+ // ddos_interval秒以内にリクエスト有り
+ hist->tick = gettick();
+ if(hist->count++ >= ddos_count) {
+ // ddos 攻撃を検出
+ hist->status = 1;
+ ShowWarning("connect_check: DDOS Attack detected from %d.%d.%d.%d!\n",
+ CONVIP(ip));
+ return (connect_ok == 2 ? 1 : 0);
+ } else {
+ return connect_ok;
+ }
+ } else {
+ // ddos_interval秒以内にリクエスト無いのでタイマークリア
+ hist->tick = gettick();
+ hist->count = 0;
+ return connect_ok;
+ }
+ }
+ hist = hist->next;
+ }
+ // IPリストに無いので新規作成
+ hist_new = (struct _connect_history *) aCalloc(1,sizeof(struct _connect_history));
+ hist_new->ip = ip;
+ hist_new->tick = gettick();
+ if(connect_history[ip & 0xFFFF] != NULL) {
+ hist = connect_history[ip & 0xFFFF];
+ hist->prev = hist_new;
+ hist_new->next = hist;
+ }
+ connect_history[ip & 0xFFFF] = hist_new;
+ return connect_ok;
+}
+
+static int connect_check_clear(int tid,unsigned int tick,int id,int data) {
+ int i;
+ int clear = 0;
+ int list = 0;
+ struct _connect_history *hist , *hist2;
+ for(i = 0;i < 0x10000 ; i++) {
+ hist = connect_history[i];
+ while(hist) {
+ if ((DIFF_TICK(tick,hist->tick) > ddos_interval * 3 && !hist->status) ||
+ (DIFF_TICK(tick,hist->tick) > ddos_autoreset && hist->status)) {
+ // clear data
+ hist2 = hist->next;
+ if(hist->prev) {
+ hist->prev->next = hist->next;
+ } else {
+ connect_history[i] = hist->next;
+ }
+ if(hist->next) {
+ hist->next->prev = hist->prev;
+ }
+ aFree(hist);
+ hist = hist2;
+ clear++;
+ } else {
+ hist = hist->next;
+ }
+ list++;
+ }
+ }
+ if(access_debug) {
+ ShowMessage("connect_check_clear: Cleared %d of %d from IP list.\n", clear, list);
+ }
+ return list;
+}
+
+// IPマスクチェック
+int access_ipmask(const char *str,struct _access_control* acc)
+{
+ unsigned int mask=0,i=0,m,ip, a0,a1,a2,a3;
+ if( !strcmp(str,"all") ) {
+ ip = 0;
+ mask = 0;
+ } else {
+ if( sscanf(str,"%d.%d.%d.%d%n",&a0,&a1,&a2,&a3,&i)!=4 || i==0) {
+ ShowError("access_ipmask: Unknown format %s!\n",str);
+ return 0;
+ }
+ ip = (a3 << 24) | (a2 << 16) | (a1 << 8) | a0;
+
+ if(sscanf(str+i,"/%d.%d.%d.%d",&a0,&a1,&a2,&a3)==4 ){
+ mask = (a3 << 24) | (a2 << 16) | (a1 << 8) | a0;
+ } else if(sscanf(str+i,"/%d",&m) == 1) {
+ for(i=0;i<m;i++) {
+ mask = (mask >> 1) | 0x80000000;
+ }
+ mask = ntohl(mask);
+ } else {
+ mask = 0xFFFFFFFF;
+ }
+ }
+ if(access_debug) {
+ ShowMessage("access_ipmask: Loaded IP:%d.%d.%d.%d mask:%d.%d.%d.%d\n",
+ CONVIP(ip), CONVIP(mask));
+ }
+ acc->ip = ip;
+ acc->mask = mask;
+ return 1;
+}
+#endif
+
+int socket_config_read(const char *cfgName) {
+ int i;
+ char line[1024],w1[1024],w2[1024];
+ FILE *fp;
+
+ fp=fopen(cfgName, "r");
+ if(fp==NULL){
+ ShowError("File not found: %s\n", cfgName);
+ return 1;
+ }
+ while(fgets(line,1020,fp)){
+ if(line[0] == '/' && line[1] == '/')
+ continue;
+ i=sscanf(line,"%[^:]: %[^\r\n]",w1,w2);
+ if(i!=2)
+ continue;
+ if(strcmpi(w1,"stall_time")==0){
+ stall_time = atoi(w2);
+ #ifndef MINICORE
+ } else if(strcmpi(w1,"enable_ip_rules")==0){
+ if(strcmpi(w2,"yes")==0)
+ ip_rules = 1;
+ else if(strcmpi(w2,"no")==0)
+ ip_rules = 0;
+ else ip_rules = atoi(w2);
+ } else if(strcmpi(w1,"order")==0){
+ access_order=atoi(w2);
+ if(strcmpi(w2,"deny,allow")==0) access_order=ACO_DENY_ALLOW;
+ if(strcmpi(w2,"allow,deny")==0) access_order=ACO_ALLOW_DENY;
+ if(strcmpi(w2,"mutual-failure")==0) access_order=ACO_MUTUAL_FAILTURE;
+ } else if(strcmpi(w1,"allow")==0){
+ access_allow = (struct _access_control *) aRealloc(access_allow,(access_allownum+1)*sizeof(struct _access_control));
+ if(access_ipmask(w2,&access_allow[access_allownum])) {
+ access_allownum++;
+ }
+ } else if(strcmpi(w1,"deny")==0){
+ access_deny = (struct _access_control *) aRealloc(access_deny,(access_denynum+1)*sizeof(struct _access_control));
+ if(access_ipmask(w2,&access_deny[access_denynum])) {
+ access_denynum++;
+ }
+ } else if(!strcmpi(w1,"ddos_interval")){
+ ddos_interval = atoi(w2);
+ } else if(!strcmpi(w1,"ddos_count")){
+ ddos_count = atoi(w2);
+ } else if(!strcmpi(w1,"ddos_autoreset")){
+ ddos_autoreset = atoi(w2);
+ } else if(!strcmpi(w1,"debug")){
+ if(strcmpi(w2,"yes")==0)
+ access_debug = 1;
+ else if(strcmpi(w2,"no")==0)
+ access_debug = 0;
+ else access_debug = atoi(w2);
+ #endif
+ } else if (strcmpi(w1, "mode_neg") == 0)
+ {
+ if(strcmpi(w2,"yes")==0)
+ mode_neg = 1;
+ else if(strcmpi(w2,"no")==0)
+ mode_neg = 0;
+ else mode_neg = atoi(w2);
+ } else if (strcmpi(w1, "frame_size") == 0)
+ frame_size = (size_t)strtoul(w2, NULL, 10);
+ else if (strcmpi(w1, "import") == 0)
+ socket_config_read(w2);
+ }
+ fclose(fp);
+ return 0;
+}
+
+int RFIFOSKIP(int fd,int len)
+{
+ struct socket_data *s;
+
+ if ( !session_isActive(fd) ) //Nullpo error here[Kevin]
+ return 0;
+
+ s = session[fd];
+
+ if ( s->rdata_size - s->rdata_pos - len < 0 ) {
+ //fprintf(stderr,"too many skip\n");
+ //exit(1);
+ //better than a COMPLETE program abort // TEST! :)
+ ShowError("too many skip (%d) now skipped: %d (FD: %d)\n", len, RFIFOREST(fd), fd);
+ len = RFIFOREST(fd);
+ }
+ s->rdata_pos = s->rdata_pos+len;
+ return 0;
+}
+
+
+unsigned int addr_[16]; // ip addresses of local host (host byte order)
+unsigned int naddr_ = 0; // # of ip addresses
+
+void socket_final (void)
+{
+ int i;
+#ifndef MINICORE
+ struct _connect_history *hist , *hist2;
+ for(i = 0; i < 0x10000; i++) {
+ hist = connect_history[i];
+ while(hist) {
+ hist2 = hist->next;
+ aFree(hist);
+ hist = hist2;
+ }
+ }
+ if (access_allow)
+ aFree(access_allow);
+ if (access_deny)
+ aFree(access_deny);
+#endif
+
+ for (i = 1; i < fd_max; i++) {
+ if(session[i])
+ delete_session(i);
+ }
+
+ // session[0] のダミーデータを削除
+ aFree(session[0]->rdata);
+ aFree(session[0]->wdata);
+ aFree(session[0]);
+}
+
+//Closes a socket.
+//Needed to simplify shutdown code as well as manage the subtle differences in socket management from Windows and *nix.
+void do_close(int fd)
+{
+//We don't really care if these closing functions return an error, we are just shutting down and not reusing this socket.
+#ifdef __WIN32
+// shutdown(fd, SD_BOTH); //FIXME: Shutdown requires winsock2.h! What would be the proper shutting down method for winsock1?
+ if (session[fd] && session[fd]->func_send == send_from_fifo)
+ session[fd]->func_send(fd); //Flush the data as it is gonna be closed down, but it may not succeed as it is a nonblocking socket! [Skotlex]
+ closesocket(fd);
+#else
+ if (close(fd))
+ perror("do_close: close");
+#endif
+ if (session[fd])
+ delete_session(fd);
+}
+
+void socket_init (void)
+{
+ char *SOCKET_CONF_FILENAME = "conf/packet_athena.conf";
+#ifdef __WIN32
+ char** a;
+ unsigned int i;
+ char fullhost[255];
+ struct hostent* hent;
+
+ /* Start up the windows networking */
+ WORD version_wanted = MAKEWORD(1, 1); //Demand at least WinSocket version 1.1 (from Freya)
+ WSADATA wsaData;
+
+ if ( WSAStartup(version_wanted, &wsaData) != 0 ) {
+ ShowFatalError("SYSERR: WinSock not available!\n");
+ exit(1);
+ }
+
+ if(gethostname(fullhost, sizeof(fullhost)) == SOCKET_ERROR) {
+ ShowError("Ugg.. no hostname defined!\n");
+ return;
+ }
+
+ // XXX This should look up the local IP addresses in the registry
+ // instead of calling gethostbyname. However, the way IP addresses
+ // are stored in the registry is annoyingly complex, so I'll leave
+ // this as T.B.D.
+ hent = gethostbyname(fullhost);
+ if (hent == NULL) {
+ ShowError("Cannot resolve our own hostname to a IP address");
+ return;
+ }
+
+ a = hent->h_addr_list;
+ for(i = 0; a[i] != 0 && i < 16; ++i) {
+ unsigned long addr1 = ntohl(*(unsigned long*) a[i]);
+ addr_[i] = addr1;
+ }
+ naddr_ = i;
+#else
+ int pos;
+ int fdes = socket(AF_INET, SOCK_STREAM, 0);
+ char buf[16 * sizeof(struct ifreq)];
+ struct ifconf ic;
+
+ // The ioctl call will fail with Invalid Argument if there are more
+ // interfaces than will fit in the buffer
+ ic.ifc_len = sizeof(buf);
+ ic.ifc_buf = buf;
+ if(ioctl(fdes, SIOCGIFCONF, &ic) == -1) {
+ ShowError("SIOCGIFCONF failed!\n");
+ return;
+ }
+
+ for(pos = 0; pos < ic.ifc_len;)
+ {
+ struct ifreq * ir = (struct ifreq *) (ic.ifc_buf + pos);
+
+ struct sockaddr_in * a = (struct sockaddr_in *) &(ir->ifr_addr);
+
+ if(a->sin_family == AF_INET) {
+ u_long ad = ntohl(a->sin_addr.s_addr);
+ if(ad != INADDR_LOOPBACK && ad != INADDR_ANY) {
+ addr_[naddr_ ++] = ad;
+ if(naddr_ == 16)
+ break;
+ }
+ }
+
+ #if defined(_AIX) || defined(__APPLE__)
+ pos += ir->ifr_addr.sa_len; // For when we port athena to run on Mac's :)
+ pos += sizeof(ir->ifr_name);
+ #else
+ pos += sizeof(struct ifreq);
+ #endif
+ }
+#endif
+
+ FD_ZERO(&readfds);
+
+ socket_config_read(SOCKET_CONF_FILENAME);
+
+ // initialise last send-receive tick
+ last_tick = time(0);
+
+ // session[0] Was for the console (whatever that was?), but is now currently used for disconnected sessions of the map
+ // server, and as such, should hold enough buffer (it is a vacuum so to speak) as it is never flushed. [Skotlex]
+ CREATE(session[0], struct socket_data, 1);
+ CREATE(session[0]->rdata, unsigned char, 2*rfifo_size);
+ CREATE(session[0]->wdata, unsigned char, 2*wfifo_size);
+ session[0]->max_rdata = 2*rfifo_size;
+ session[0]->max_wdata = 2*wfifo_size;
+
+ malloc_set(func_parse_table, 0, sizeof(func_parse_table));
+ func_parse_table[SESSION_RAW].check = default_func_check;
+ func_parse_table[SESSION_RAW].func = default_func_parse;
+
+#ifndef MINICORE
+ // とりあえず5分ごとに不要なデータを削除する
+ add_timer_func_list(connect_check_clear, "connect_check_clear");
+ add_timer_interval(gettick()+1000,connect_check_clear,0,0,300*1000);
+#endif
+}
+
+
+bool session_isValid(int fd)
+{ //End of Exam has pointed out that fd==0 is actually an unconnected session! [Skotlex]
+ //But this is not so true, it is used... for... something. The console uses it, would this not cause problems? [Skotlex]
+ return ( (fd>0) && (fd<FD_SETSIZE) && (NULL!=session[fd]) );
+}
+
+bool session_isActive(int fd)
+{
+ return ( session_isValid(fd) && !session[fd]->eof );
+}
+
+in_addr_t resolve_hostbyname(char* hostname, unsigned char *ip, char *ip_str) {
+ struct hostent *h = gethostbyname(hostname);
+ char ip_buf[16];
+ unsigned char ip2[4];
+ if (!h) return 0;
+ if (ip == NULL) ip = ip2;
+ ip[0] = (unsigned char) h->h_addr[0];
+ ip[1] = (unsigned char) h->h_addr[1];
+ ip[2] = (unsigned char) h->h_addr[2];
+ ip[3] = (unsigned char) h->h_addr[3];
+ if (ip_str == NULL) ip_str = ip_buf;
+ sprintf(ip_str, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
+ return inet_addr(ip_str);
+}
diff --git a/src/common/socket.h b/src/common/socket.h
index ae13353b2..eb3a78f7e 100644
--- a/src/common/socket.h
+++ b/src/common/socket.h
@@ -1,176 +1,176 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
-
-#ifndef _SOCKET_H_
-#define _SOCKET_H_
-
-#include <stdio.h>
-
-#ifdef __WIN32
-#define __USE_W32_SOCKETS
-#include <windows.h>
-typedef long in_addr_t;
-#else
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#endif
-#include <time.h>
-#include "../common/malloc.h"
-#include "cbasetypes.h"
-
-extern time_t last_tick;
-extern time_t stall_time;
-
-// define declaration
-
-#define RFIFOSPACE(fd) (session[fd]->max_rdata-session[fd]->rdata_size)
-#ifdef TURBO
-#define RFIFOHEAD(fd) char *rbPtr ## fd = session[fd]->rdata+session[fd]->rdata_pos
-#define RFIFOP(fd,pos) (&rbPtr ## fd[pos])
-#else
-//Make it a comment so it does not disrupts the rest of code.
-#define RFIFOHEAD(fd) //
-#define RFIFOP(fd,pos) (session[fd]->rdata+session[fd]->rdata_pos+(pos))
-#endif
-// use function instead of macro.
-#define RFIFOB(fd,pos) (*(unsigned char*)RFIFOP(fd,pos))
-#define RFIFOW(fd,pos) (*(unsigned short*)RFIFOP(fd,pos))
-#define RFIFOL(fd,pos) (*(unsigned long*)RFIFOP(fd,pos))
-#define RFIFOREST(fd) (session[fd]->rdata_size-session[fd]->rdata_pos)
-#define RFIFOFLUSH(fd) \
- if(session[fd]->rdata_size == session[fd]->rdata_pos) \
- { session[fd]->rdata_size = session[fd]->rdata_pos = 0; } else { \
- session[fd]->rdata_size -= session[fd]->rdata_pos; \
- memmove(session[fd]->rdata, session[fd]->rdata+session[fd]->rdata_pos, session[fd]->rdata_size); \
- session[fd]->rdata_pos=0; \
- }
-
-//#define RFIFOSKIP(fd,len) ((session[fd]->rdata_size-session[fd]->rdata_pos-(len)<0) ? (fprintf(stderr,"too many skip\n"),exit(1)) : (session[fd]->rdata_pos+=(len)))
-
-#define RBUFP(p,pos) (((unsigned char*)(p))+(pos))
-#define RBUFB(p,pos) (*(unsigned char*)RBUFP((p),(pos)))
-#define RBUFW(p,pos) (*(unsigned short*)RBUFP((p),(pos)))
-#define RBUFL(p,pos) (*(unsigned long*)RBUFP((p),(pos)))
-
-#define WFIFOSPACE(fd) (session[fd]->max_wdata-session[fd]->wdata_size)
-#ifdef TURBO
-#define WFIFOHEAD(fd, x) char *wbPtr ## fd = fd?(session[fd]->wdata+session[fd]->wdata_size):0;
-#define WFIFOP(fd,pos) (&wbPtr ## fd[pos])
-#else
-#define WFIFOHEAD(fd, size) { if((fd) && session[fd]->wdata_size + (size) > session[fd]->max_wdata ) realloc_writefifo(fd, size); }
-
-#define WFIFOP(fd,pos) (session[fd]->wdata+session[fd]->wdata_size+(pos))
-#endif
-#define WFIFOB(fd,pos) (*(unsigned char*)WFIFOP(fd,pos))
-#define WFIFOW(fd,pos) (*(unsigned short*)WFIFOP(fd,pos))
-#define WFIFOL(fd,pos) (*(unsigned long*)WFIFOP(fd,pos))
-// use function instead of macro.
-//#define WFIFOSET(fd,len) (session[fd]->wdata_size = (session[fd]->wdata_size + (len) + 2048 < session[fd]->max_wdata) ? session[fd]->wdata_size + len : session[fd]->wdata_size)
-#define WBUFP(p,pos) (((unsigned char*)(p)) + (pos))
-#define WBUFB(p,pos) (*(unsigned char*)((p) + (pos)))
-#define WBUFW(p,pos) (*(unsigned short*)((p) + (pos)))
-#define WBUFL(p,pos) (*(unsigned long*)((p) + (pos)))
-
-//FD_SETSIZE must be modified on the project files/Makefile, since a change here won't affect
-// dependant windows libraries.
-/*
-#ifdef __WIN32
-//The default FD_SETSIZE is kinda small for windows systems.
- #ifdef FD_SETSIZE
- #undef FD_SETSIZE
- #endif
-#define FD_SETSIZE 4096
-#endif
-*/
-#ifdef __INTERIX
-#define FD_SETSIZE 4096
-#endif // __INTERIX
-
-/* Removed Cygwin FD_SETSIZE declarations, now are directly passed on to the compiler through Makefile [Valaris] */
-
-// Session type
-enum SessionType {
- SESSION_UNKNOWN = -1,
- SESSION_RAW = 0,
- SESSION_HTTP = 1,
-//-----------------
- SESSION_MAX = 2
-};
-
-// Struct declaration
-
-struct socket_data{
- unsigned char eof;
- unsigned char *rdata, *wdata;
- unsigned int max_rdata, max_wdata;
- unsigned int rdata_size, wdata_size;
- int rdata_pos;
- time_t rdata_tick;
- struct sockaddr_in client_addr;
- int (*func_recv)(int);
- int (*func_send)(int);
- int (*func_parse)(int);
- int (*func_console)(char*);
- void* session_data;
- void* session_data2;
- enum SessionType type;
-};
-
-// Parse functions table
-struct func_parse_table {
- int (*func)(int);
- int (*check)(struct socket_data *);
-};
-extern struct func_parse_table func_parse_table[SESSION_MAX];
-
-
-// Data prototype declaration
-
-extern struct socket_data *session[FD_SETSIZE];
-
-extern int fd_max;
-
-//////////////////////////////////
-// some checking on sockets
-extern bool session_isValid(int fd);
-extern bool session_isActive(int fd);
-//////////////////////////////////
-
-// Function prototype declaration
-
-int make_listen_port(int);
-int make_listen_bind(long,int);
-int make_connection(long,int);
-int delete_session(int);
-int realloc_fifo(int fd,unsigned int rfifo_size,unsigned int wfifo_size);
-int realloc_writefifo(int fd, size_t addition);
-int WFIFOSET(int fd,int len);
-int RFIFOSKIP(int fd,int len);
-
-int do_sendrecv(int next);
-int do_parsepacket(void);
-void do_close(int fd);
-void socket_init(void);
-void socket_final(void);
-
-extern void flush_fifo(int fd);
-extern void flush_fifos(void);
-extern void set_nonblocking(int fd, int yes);
-
-int start_console(void);
-
-void set_defaultparse(int (*defaultparse)(int));
-void set_defaultconsoleparse(int (*defaultparse)(char*));
-
-//Resolves the hostname and stores the string representation of the string in ip.
-//Meant to simplify calls to gethostbyname without the need of all the
-//required network includes.
-//hostname is the name to resolve.
-//ip is an array of char[4] where the individual parts of the ip are stored (optional)
-//ip_str is a char[16] where the whole ip is stored in string notation (optional)
-in_addr_t resolve_hostbyname(char* hostname, unsigned char *ip, char *ip_str);
-
-extern unsigned int addr_[16]; // ip addresses of local host (host byte order)
-extern unsigned int naddr_; // # of ip addresses
-#endif // _SOCKET_H_
+// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
+// For more information, see LICENCE in the main folder
+
+#ifndef _SOCKET_H_
+#define _SOCKET_H_
+
+#include <stdio.h>
+
+#ifdef __WIN32
+#define __USE_W32_SOCKETS
+#include <windows.h>
+typedef long in_addr_t;
+#else
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#endif
+#include <time.h>
+#include "../common/malloc.h"
+#include "cbasetypes.h"
+
+extern time_t last_tick;
+extern time_t stall_time;
+
+// define declaration
+
+#define RFIFOSPACE(fd) (session[fd]->max_rdata-session[fd]->rdata_size)
+#ifdef TURBO
+#define RFIFOHEAD(fd) char *rbPtr ## fd = session[fd]->rdata+session[fd]->rdata_pos
+#define RFIFOP(fd,pos) (&rbPtr ## fd[pos])
+#else
+//Make it a comment so it does not disrupts the rest of code.
+#define RFIFOHEAD(fd) //
+#define RFIFOP(fd,pos) (session[fd]->rdata+session[fd]->rdata_pos+(pos))
+#endif
+// use function instead of macro.
+#define RFIFOB(fd,pos) (*(unsigned char*)RFIFOP(fd,pos))
+#define RFIFOW(fd,pos) (*(unsigned short*)RFIFOP(fd,pos))
+#define RFIFOL(fd,pos) (*(unsigned long*)RFIFOP(fd,pos))
+#define RFIFOREST(fd) (session[fd]->rdata_size-session[fd]->rdata_pos)
+#define RFIFOFLUSH(fd) \
+ if(session[fd]->rdata_size == session[fd]->rdata_pos) \
+ { session[fd]->rdata_size = session[fd]->rdata_pos = 0; } else { \
+ session[fd]->rdata_size -= session[fd]->rdata_pos; \
+ memmove(session[fd]->rdata, session[fd]->rdata+session[fd]->rdata_pos, session[fd]->rdata_size); \
+ session[fd]->rdata_pos=0; \
+ }
+
+//#define RFIFOSKIP(fd,len) ((session[fd]->rdata_size-session[fd]->rdata_pos-(len)<0) ? (fprintf(stderr,"too many skip\n"),exit(1)) : (session[fd]->rdata_pos+=(len)))
+
+#define RBUFP(p,pos) (((unsigned char*)(p))+(pos))
+#define RBUFB(p,pos) (*(unsigned char*)RBUFP((p),(pos)))
+#define RBUFW(p,pos) (*(unsigned short*)RBUFP((p),(pos)))
+#define RBUFL(p,pos) (*(unsigned long*)RBUFP((p),(pos)))
+
+#define WFIFOSPACE(fd) (session[fd]->max_wdata-session[fd]->wdata_size)
+#ifdef TURBO
+#define WFIFOHEAD(fd, x) char *wbPtr ## fd = fd?(session[fd]->wdata+session[fd]->wdata_size):0;
+#define WFIFOP(fd,pos) (&wbPtr ## fd[pos])
+#else
+#define WFIFOHEAD(fd, size) { if((fd) && session[fd]->wdata_size + (size) > session[fd]->max_wdata ) realloc_writefifo(fd, size); }
+
+#define WFIFOP(fd,pos) (session[fd]->wdata+session[fd]->wdata_size+(pos))
+#endif
+#define WFIFOB(fd,pos) (*(unsigned char*)WFIFOP(fd,pos))
+#define WFIFOW(fd,pos) (*(unsigned short*)WFIFOP(fd,pos))
+#define WFIFOL(fd,pos) (*(unsigned long*)WFIFOP(fd,pos))
+// use function instead of macro.
+//#define WFIFOSET(fd,len) (session[fd]->wdata_size = (session[fd]->wdata_size + (len) + 2048 < session[fd]->max_wdata) ? session[fd]->wdata_size + len : session[fd]->wdata_size)
+#define WBUFP(p,pos) (((unsigned char*)(p)) + (pos))
+#define WBUFB(p,pos) (*(unsigned char*)((p) + (pos)))
+#define WBUFW(p,pos) (*(unsigned short*)((p) + (pos)))
+#define WBUFL(p,pos) (*(unsigned long*)((p) + (pos)))
+
+//FD_SETSIZE must be modified on the project files/Makefile, since a change here won't affect
+// dependant windows libraries.
+/*
+#ifdef __WIN32
+//The default FD_SETSIZE is kinda small for windows systems.
+ #ifdef FD_SETSIZE
+ #undef FD_SETSIZE
+ #endif
+#define FD_SETSIZE 4096
+#endif
+*/
+#ifdef __INTERIX
+#define FD_SETSIZE 4096
+#endif // __INTERIX
+
+/* Removed Cygwin FD_SETSIZE declarations, now are directly passed on to the compiler through Makefile [Valaris] */
+
+// Session type
+enum SessionType {
+ SESSION_UNKNOWN = -1,
+ SESSION_RAW = 0,
+ SESSION_HTTP = 1,
+//-----------------
+ SESSION_MAX = 2
+};
+
+// Struct declaration
+
+struct socket_data{
+ unsigned char eof;
+ unsigned char *rdata, *wdata;
+ size_t max_rdata, max_wdata;
+ size_t rdata_size, wdata_size;
+ size_t rdata_pos;
+ time_t rdata_tick;
+ struct sockaddr_in client_addr;
+ int (*func_recv)(int);
+ int (*func_send)(int);
+ int (*func_parse)(int);
+ int (*func_console)(char*);
+ void* session_data;
+ void* session_data2;
+ enum SessionType type;
+};
+
+// Parse functions table
+struct func_parse_table {
+ int (*func)(int);
+ int (*check)(struct socket_data *);
+};
+extern struct func_parse_table func_parse_table[SESSION_MAX];
+
+
+// Data prototype declaration
+
+extern struct socket_data *session[FD_SETSIZE];
+
+extern int fd_max;
+
+//////////////////////////////////
+// some checking on sockets
+extern bool session_isValid(int fd);
+extern bool session_isActive(int fd);
+//////////////////////////////////
+
+// Function prototype declaration
+
+int make_listen_port(int);
+int make_listen_bind(long,int);
+int make_connection(long,int);
+int delete_session(int);
+int realloc_fifo(int fd,unsigned int rfifo_size,unsigned int wfifo_size);
+int realloc_writefifo(int fd, size_t addition);
+int WFIFOSET(int fd,int len);
+int RFIFOSKIP(int fd,int len);
+
+int do_sendrecv(int next);
+int do_parsepacket(void);
+void do_close(int fd);
+void socket_init(void);
+void socket_final(void);
+
+extern void flush_fifo(int fd);
+extern void flush_fifos(void);
+extern void set_nonblocking(int fd, int yes);
+
+int start_console(void);
+
+void set_defaultparse(int (*defaultparse)(int));
+void set_defaultconsoleparse(int (*defaultparse)(char*));
+
+//Resolves the hostname and stores the string representation of the string in ip.
+//Meant to simplify calls to gethostbyname without the need of all the
+//required network includes.
+//hostname is the name to resolve.
+//ip is an array of char[4] where the individual parts of the ip are stored (optional)
+//ip_str is a char[16] where the whole ip is stored in string notation (optional)
+in_addr_t resolve_hostbyname(char* hostname, unsigned char *ip, char *ip_str);
+
+extern unsigned int addr_[16]; // ip addresses of local host (host byte order)
+extern unsigned int naddr_; // # of ip addresses
+#endif // _SOCKET_H_
diff --git a/src/common/strlib.c b/src/common/strlib.c
index 8cff2a878..92601f9b1 100644
--- a/src/common/strlib.c
+++ b/src/common/strlib.c
@@ -1,194 +1,194 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "strlib.h"
-#include "utils.h"
-#include "../common/malloc.h"
-
-//-----------------------------------------------
-// string lib.
-char* jstrescape (char* pt) {
- //copy from here
- char *ptr;
- int i =0, j=0;
-
- //copy string to temporary
- CREATE_A(ptr, char, J_MAX_MALLOC_SIZE);
- strcpy(ptr,pt);
-
- while (ptr[i] != '\0') {
- switch (ptr[i]) {
- case '\'':
- pt[j++] = '\\';
- pt[j++] = ptr[i++];
- break;
- case '\\':
- pt[j++] = '\\';
- pt[j++] = ptr[i++];
- break;
- case '%':
- pt[j++] = '_'; i++;
- break;
- default:
- pt[j++] = ptr[i++];
- }
- }
- pt[j++] = '\0';
- aFree (ptr);
- return &pt[0];
-}
-
-char* jstrescapecpy (char* pt,char* spt) {
- //copy from here
- //WARNING: Target string pt should be able to hold strlen(spt)*2, as each time
- //a escape character is found, the target's final length increases! [Skotlex]
- int i =0, j=0;
-
- if (!spt) { //Return an empty string [Skotlex]
- pt[0] = '\0';
- return &pt[0];
- }
-
- while (spt[i] != '\0') {
- switch (spt[i]) {
- case '\'':
- pt[j++] = '\\';
- pt[j++] = spt[i++];
- break;
- case '\\':
- pt[j++] = '\\';
- pt[j++] = spt[i++];
- break;
- case '%':
- pt[j++] = '_'; i++;
- break;
- default:
- pt[j++] = spt[i++];
- }
- }
- pt[j++] = '\0';
- return &pt[0];
-}
-int jmemescapecpy (char* pt,char* spt, int size) {
- //copy from here
- int i =0, j=0;
-
- while (i < size) {
- switch (spt[i]) {
- case '\'':
- pt[j++] = '\\';
- pt[j++] = spt[i++];
- break;
- case '\\':
- pt[j++] = '\\';
- pt[j++] = spt[i++];
- break;
- case '%':
- pt[j++] = '_'; i++;
- break;
- default:
- pt[j++] = spt[i++];
- }
- }
- // copy size is 0 ~ (j-1)
- return j;
-}
-
-//-----------------------------------------------------
-// Function to suppress control characters in a string.
-//-----------------------------------------------------
-//int remove_control_chars(char *str) {
-int remove_control_chars(unsigned char *str) {
- int i;
- int change = 0;
-
- for(i = 0; str[i]; i++) {
- if (str[i] < 32) {
- str[i] = '_';
- change = 1;
- }
- }
-
- return change;
-}
-
-//Trims a string, also removes illegal characters such as \t and reduces continous spaces to a single one. by [Foruken]
-char *trim(char *str, const char *delim)
-{
- char *strp = strtok(str,delim);
- char buf[1024];
- char *bufp = buf;
- malloc_tsetdword(buf,0,sizeof buf);
-
- while(strp) {
- strcpy(bufp, strp);
- bufp = bufp + strlen(strp);
- strp = strtok(NULL, delim);
- if (strp) {
- strcpy(bufp," ");
- bufp++;
- }
- }
- strcpy(str,buf);
- return str;
-}
-
-
-//stristr: Case insensitive version of strstr, code taken from
-//http://www.daniweb.com/code/snippet313.html, Dave Sinkula
-//
-const char *stristr(const char *haystack, const char *needle)
-{
- if ( !*needle )
- {
- return haystack;
- }
- for ( ; *haystack; ++haystack )
- {
- if ( toupper(*haystack) == toupper(*needle) )
- {
- /*
- * Matched starting char -- loop through remaining chars.
- */
- const char *h, *n;
- for ( h = haystack, n = needle; *h && *n; ++h, ++n )
- {
- if ( toupper(*h) != toupper(*n) )
- {
- break;
- }
- }
- if ( !*n ) /* matched all of 'needle' to null termination */
- {
- return haystack; /* return the start of the match */
- }
- }
- }
- return 0;
-}
-
-#ifdef __WIN32
-char *_strtok_r(char *s1, const char *s2, char **lasts)
-{
- char *ret;
-
- if (s1 == NULL)
- s1 = *lasts;
- while(*s1 && strchr(s2, *s1))
- ++s1;
- if(*s1 == '\0')
- return NULL;
- ret = s1;
- while(*s1 && !strchr(s2, *s1))
- ++s1;
- if(*s1)
- *s1++ = '\0';
- *lasts = s1;
- return ret;
-}
-#endif
+// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
+// For more information, see LICENCE in the main folder
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "strlib.h"
+#include "utils.h"
+#include "../common/malloc.h"
+
+//-----------------------------------------------
+// string lib.
+char* jstrescape (char* pt) {
+ //copy from here
+ char *ptr;
+ int i =0, j=0;
+
+ //copy string to temporary
+ CREATE(ptr, char, J_MAX_MALLOC_SIZE);
+ strcpy(ptr,pt);
+
+ while (ptr[i] != '\0') {
+ switch (ptr[i]) {
+ case '\'':
+ pt[j++] = '\\';
+ pt[j++] = ptr[i++];
+ break;
+ case '\\':
+ pt[j++] = '\\';
+ pt[j++] = ptr[i++];
+ break;
+ case '%':
+ pt[j++] = '_'; i++;
+ break;
+ default:
+ pt[j++] = ptr[i++];
+ }
+ }
+ pt[j++] = '\0';
+ aFree(ptr);
+ return &pt[0];
+}
+
+char* jstrescapecpy (char* pt,char* spt) {
+ //copy from here
+ //WARNING: Target string pt should be able to hold strlen(spt)*2, as each time
+ //a escape character is found, the target's final length increases! [Skotlex]
+ int i =0, j=0;
+
+ if (!spt) { //Return an empty string [Skotlex]
+ pt[0] = '\0';
+ return &pt[0];
+ }
+
+ while (spt[i] != '\0') {
+ switch (spt[i]) {
+ case '\'':
+ pt[j++] = '\\';
+ pt[j++] = spt[i++];
+ break;
+ case '\\':
+ pt[j++] = '\\';
+ pt[j++] = spt[i++];
+ break;
+ case '%':
+ pt[j++] = '_'; i++;
+ break;
+ default:
+ pt[j++] = spt[i++];
+ }
+ }
+ pt[j++] = '\0';
+ return &pt[0];
+}
+int jmemescapecpy (char* pt,char* spt, int size) {
+ //copy from here
+ int i =0, j=0;
+
+ while (i < size) {
+ switch (spt[i]) {
+ case '\'':
+ pt[j++] = '\\';
+ pt[j++] = spt[i++];
+ break;
+ case '\\':
+ pt[j++] = '\\';
+ pt[j++] = spt[i++];
+ break;
+ case '%':
+ pt[j++] = '_'; i++;
+ break;
+ default:
+ pt[j++] = spt[i++];
+ }
+ }
+ // copy size is 0 ~ (j-1)
+ return j;
+}
+
+//-----------------------------------------------------
+// Function to suppress control characters in a string.
+//-----------------------------------------------------
+//int remove_control_chars(char *str) {
+int remove_control_chars(unsigned char *str) {
+ int i;
+ int change = 0;
+
+ for(i = 0; str[i]; i++) {
+ if (str[i] < 32) {
+ str[i] = '_';
+ change = 1;
+ }
+ }
+
+ return change;
+}
+
+//Trims a string, also removes illegal characters such as \t and reduces continous spaces to a single one. by [Foruken]
+char *trim(char *str, const char *delim)
+{
+ char *strp = strtok(str,delim);
+ char buf[1024];
+ char *bufp = buf;
+ malloc_tsetdword(buf,0,sizeof buf);
+
+ while(strp) {
+ strcpy(bufp, strp);
+ bufp = bufp + strlen(strp);
+ strp = strtok(NULL, delim);
+ if (strp) {
+ strcpy(bufp," ");
+ bufp++;
+ }
+ }
+ strcpy(str,buf);
+ return str;
+}
+
+
+//stristr: Case insensitive version of strstr, code taken from
+//http://www.daniweb.com/code/snippet313.html, Dave Sinkula
+//
+const char *stristr(const char *haystack, const char *needle)
+{
+ if ( !*needle )
+ {
+ return haystack;
+ }
+ for ( ; *haystack; ++haystack )
+ {
+ if ( toupper(*haystack) == toupper(*needle) )
+ {
+ /*
+ * Matched starting char -- loop through remaining chars.
+ */
+ const char *h, *n;
+ for ( h = haystack, n = needle; *h && *n; ++h, ++n )
+ {
+ if ( toupper(*h) != toupper(*n) )
+ {
+ break;
+ }
+ }
+ if ( !*n ) /* matched all of 'needle' to null termination */
+ {
+ return haystack; /* return the start of the match */
+ }
+ }
+ }
+ return 0;
+}
+
+#ifdef __WIN32
+char *_strtok_r(char *s1, const char *s2, char **lasts)
+{
+ char *ret;
+
+ if (s1 == NULL)
+ s1 = *lasts;
+ while(*s1 && strchr(s2, *s1))
+ ++s1;
+ if(*s1 == '\0')
+ return NULL;
+ ret = s1;
+ while(*s1 && !strchr(s2, *s1))
+ ++s1;
+ if(*s1)
+ *s1++ = '\0';
+ *lasts = s1;
+ return ret;
+}
+#endif
diff --git a/src/map/intif.c b/src/map/intif.c
index 025d76c9b..40cd52136 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -1,1574 +1,1579 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
-
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <string.h>
-
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/timer.h"
-#include "../common/nullpo.h"
-#include "../common/malloc.h"
-#include "map.h"
-#include "battle.h"
-#include "chrif.h"
-#include "clif.h"
-#include "pc.h"
-#include "intif.h"
-#include "storage.h"
-#include "party.h"
-#include "guild.h"
-#include "pet.h"
-#include "atcommand.h"
-#include "mercenary.h" //albator
-
-static const int packet_len_table[]={
- -1,-1,27,-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3800-0x380f
- -1, 7, 0, 0, 0, 0, 0, 0, -1,11, 0, 0, 0, 0, 0, 0, //0x3810
- 39,-1,15,15, 14,19, 7,-1, 0, 0, 0, 0, 0, 0, 0, 0, //0x3820
- 10,-1,15, 0, 79,19, 7,-1, 0,-1,-1,-1, 14,67,186,-1, //0x3830
- 9, 9,-1,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3840
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 11,-1, 7, 3, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3880
- -1,-1, 7, 3, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3890 Homunculus [albator]
-};
-
-extern int char_fd; // inter serverのfdはchar_fdを使う
-#define inter_fd (char_fd) // エイリアス
-
-//-----------------------------------------------------------------
-// inter serverへの送信
-
-int CheckForCharServer(void) {
- return ((char_fd <= 0) || session[char_fd] == NULL || session[char_fd]->wdata == NULL);
-}
-
-// pet
-int intif_create_pet(int account_id,int char_id,short pet_class,short pet_lv,short pet_egg_id,
- short pet_equip,short intimate,short hungry,char rename_flag,char incuvate,char *pet_name)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd, 24 + NAME_LENGTH);
- WFIFOW(inter_fd,0) = 0x3080;
- WFIFOL(inter_fd,2) = account_id;
- WFIFOL(inter_fd,6) = char_id;
- WFIFOW(inter_fd,10) = pet_class;
- WFIFOW(inter_fd,12) = pet_lv;
- WFIFOW(inter_fd,14) = pet_egg_id;
- WFIFOW(inter_fd,16) = pet_equip;
- WFIFOW(inter_fd,18) = intimate;
- WFIFOW(inter_fd,20) = hungry;
- WFIFOB(inter_fd,22) = rename_flag;
- WFIFOB(inter_fd,23) = incuvate;
- memcpy(WFIFOP(inter_fd,24),pet_name,NAME_LENGTH);
- WFIFOSET(inter_fd,24+NAME_LENGTH);
-
- return 0;
-}
-
-int intif_request_petdata(int account_id,int char_id,int pet_id)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd, 14);
- WFIFOW(inter_fd,0) = 0x3081;
- WFIFOL(inter_fd,2) = account_id;
- WFIFOL(inter_fd,6) = char_id;
- WFIFOL(inter_fd,10) = pet_id;
- WFIFOSET(inter_fd,14);
-
- return 0;
-}
-
-int intif_save_petdata(int account_id,struct s_pet *p)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd, sizeof(struct s_pet) + 8);
- WFIFOW(inter_fd,0) = 0x3082;
- WFIFOW(inter_fd,2) = sizeof(struct s_pet) + 8;
- WFIFOL(inter_fd,4) = account_id;
- memcpy(WFIFOP(inter_fd,8),p,sizeof(struct s_pet));
- WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
-
- return 0;
-}
-
-int intif_delete_petdata(int pet_id)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,6);
- WFIFOW(inter_fd,0) = 0x3083;
- WFIFOL(inter_fd,2) = pet_id;
- WFIFOSET(inter_fd,6);
-
- return 1;
-}
-int intif_rename_pet(struct map_session_data *sd,char *name)
-{
- if (CheckForCharServer())
- return 1;
-
- WFIFOHEAD(inter_fd,NAME_LENGTH+11);
- WFIFOW(inter_fd,0) = 0x3084;
- WFIFOL(inter_fd,2) = sd->status.account_id;
- WFIFOL(inter_fd,6) = sd->status.char_id;
- memcpy(WFIFOP(inter_fd,10),name, NAME_LENGTH);
- WFIFOSET(inter_fd,NAME_LENGTH+11);
- return 0;
-}
-
-
-// GMメッセージを送信
-int intif_GMmessage(char* mes,int len,int flag)
-{
- int lp = (flag&0x10) ? 8 : 4;
-
- // Send to the local players
- clif_GMmessage(NULL, mes, len, flag);
-
- if (CheckForCharServer())
- return 0;
-
- if (other_mapserver_count < 1)
- return 0; //No need to send.
-
- WFIFOHEAD(inter_fd,lp + len + 4);
- WFIFOW(inter_fd,0) = 0x3000;
- WFIFOW(inter_fd,2) = lp + len + 4;
- WFIFOL(inter_fd,4) = 0xFF000000; //"invalid" color signals standard broadcast.
- WFIFOL(inter_fd,8) = 0x65756c62;
- memcpy(WFIFOP(inter_fd,4+lp), mes, len);
- WFIFOSET(inter_fd, WFIFOW(inter_fd,2));
- return 0;
-}
-
-int intif_announce(char* mes,int len, unsigned long color, int flag)
-{
- // Send to the local players
- if(color == 0xFE000000) // This is main chat message [LuzZza]
- clif_MainChatMessage(mes);
- else
- clif_announce(NULL, mes, len, color, flag);
-
- if (CheckForCharServer())
- return 0;
-
- if (other_mapserver_count < 1)
- return 0; //No need to send.
-
- WFIFOHEAD(inter_fd, 8 + len);
- WFIFOW(inter_fd,0) = 0x3000;
- WFIFOW(inter_fd,2) = 8 + len;
- WFIFOL(inter_fd,4) = color;
- memcpy(WFIFOP(inter_fd,8), mes, len);
- WFIFOSET(inter_fd, WFIFOW(inter_fd,2));
- return 0;
-}
-
-// The transmission of Wisp/Page to inter-server (player not found on this server)
-int intif_wis_message(struct map_session_data *sd, char *nick, char *mes, int mes_len) {
- nullpo_retr(0, sd);
- if (CheckForCharServer())
- return 0;
-
- if (other_mapserver_count < 1)
- { //Character not found.
- clif_wis_end(sd->fd, 1);
- return 0;
- }
-
- WFIFOHEAD(inter_fd,mes_len + 52);
- WFIFOW(inter_fd,0) = 0x3001;
- WFIFOW(inter_fd,2) = mes_len + 52;
- memcpy(WFIFOP(inter_fd,4), sd->status.name, NAME_LENGTH);
- memcpy(WFIFOP(inter_fd,4+NAME_LENGTH), nick, NAME_LENGTH);
- memcpy(WFIFOP(inter_fd,4+2*NAME_LENGTH), mes, mes_len);
- WFIFOSET(inter_fd, WFIFOW(inter_fd,2));
-
- if (battle_config.etc_log)
- ShowInfo("intif_wis_message from %s to %s (message: '%s')\n", sd->status.name, nick, mes);
-
- return 0;
-}
-
-// The reply of Wisp/page
-int intif_wis_replay(int id, int flag) {
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,7);
- WFIFOW(inter_fd,0) = 0x3002;
- WFIFOL(inter_fd,2) = id;
- WFIFOB(inter_fd,6) = flag; // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
- WFIFOSET(inter_fd,7);
-
- if (battle_config.etc_log)
- ShowInfo("intif_wis_replay: id: %d, flag:%d\n", id, flag);
-
- return 0;
-}
-
-// The transmission of GM only Wisp/Page from server to inter-server
-int intif_wis_message_to_gm(char *Wisp_name, int min_gm_level, char *mes) {
- int mes_len;
- if (CheckForCharServer())
- return 0;
- mes_len = strlen(mes) + 1; // + null
- WFIFOHEAD(inter_fd, mes_len + 30);
- WFIFOW(inter_fd,0) = 0x3003;
- WFIFOW(inter_fd,2) = mes_len + 30;
- memcpy(WFIFOP(inter_fd,4), Wisp_name, NAME_LENGTH);
- WFIFOW(inter_fd,4+NAME_LENGTH) = (short)min_gm_level;
- memcpy(WFIFOP(inter_fd,6+NAME_LENGTH), mes, mes_len);
- WFIFOSET(inter_fd, WFIFOW(inter_fd,2));
-
- if (battle_config.etc_log)
- ShowNotice("intif_wis_message_to_gm: from: '%s', min level: %d, message: '%s'.\n", Wisp_name, min_gm_level, mes);
-
- return 0;
-}
-
-int intif_regtostr(char* str, struct global_reg *reg, int qty) {
- int len =0, i;
-
- for (i = 0; i < qty; i++) {
- len+= sprintf(str+len, "%s", reg[i].str)+1; //We add 1 to consider the '\0' in place.
- len+= sprintf(str+len, "%s", reg[i].value)+1;
- }
- return len;
-}
-
-//Request for saving registry values.
-int intif_saveregistry(struct map_session_data *sd, int type)
-{
- struct global_reg *reg;
- int count;
-
- if (CheckForCharServer())
- return -1;
-
- switch (type) {
- case 3: //Character reg
- reg = sd->save_reg.global;
- count = sd->save_reg.global_num;
- sd->state.reg_dirty &= ~0x4;
- break;
- case 2: //Account reg
- reg = sd->save_reg.account;
- count = sd->save_reg.account_num;
- sd->state.reg_dirty &= ~0x2;
- break;
- case 1: //Account2 reg
- reg = sd->save_reg.account2;
- count = sd->save_reg.account2_num;
- sd->state.reg_dirty &= ~0x1;
- break;
- default: //Broken code?
- if (battle_config.error_log)
- ShowError("intif_saveregistry: Invalid type %d\n", type);
- return -1;
- }
- WFIFOHEAD(inter_fd, 288 * MAX_REG_NUM+13);
- WFIFOW(inter_fd,0)=0x3004;
- WFIFOL(inter_fd,4)=sd->status.account_id;
- WFIFOL(inter_fd,8)=sd->status.char_id;
- WFIFOB(inter_fd,12)=type;
- if(count ==0){
- WFIFOW(inter_fd,2)=13;
- }else{
- int i,p;
- for (p=13,i = 0; i < count; i++) {
- if (reg[i].str[0] && reg[i].value != 0) {
- p+= sprintf(WFIFOP(inter_fd,p), "%s", reg[i].str)+1; //We add 1 to consider the '\0' in place.
- p+= sprintf(WFIFOP(inter_fd,p), "%s", reg[i].value)+1;
- }
- }
- WFIFOW(inter_fd,2)=p;
- }
- WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
- return 0;
-}
-
-//Request the registries for this player.
-int intif_request_registry(struct map_session_data *sd, int flag)
-{
- nullpo_retr(0, sd);
-
- sd->save_reg.account2_num = -1;
- sd->save_reg.account_num = -1;
- sd->save_reg.global_num = -1;
-
- if (CheckForCharServer())
- return 0;
-
- WFIFOHEAD(inter_fd,6);
- WFIFOW(inter_fd,0) = 0x3005;
- WFIFOL(inter_fd,2) = sd->status.account_id;
- WFIFOL(inter_fd,6) = sd->status.char_id;
- WFIFOB(inter_fd,10) = (flag&1?1:0); //Request Acc Reg 2
- WFIFOB(inter_fd,11) = (flag&2?1:0); //Request Acc Reg
- WFIFOB(inter_fd,12) = (flag&4?1:0); //Request Char Reg
- WFIFOSET(inter_fd,13);
-
- return 0;
-}
-
-// 倉庫データ要求
-int intif_request_storage(int account_id)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,6);
- WFIFOW(inter_fd,0) = 0x3010;
- WFIFOL(inter_fd,2) = account_id;
- WFIFOSET(inter_fd,6);
- return 0;
-}
-// 倉庫データ送信
-int intif_send_storage(struct storage *stor)
-{
- if (CheckForCharServer())
- return 0;
- nullpo_retr(0, stor);
- WFIFOHEAD(inter_fd,sizeof(struct storage)+8);
- WFIFOW(inter_fd,0) = 0x3011;
- WFIFOW(inter_fd,2) = sizeof(struct storage)+8;
- WFIFOL(inter_fd,4) = stor->account_id;
- memcpy( WFIFOP(inter_fd,8),stor, sizeof(struct storage) );
- WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
- return 0;
-}
-
-int intif_request_guild_storage(int account_id,int guild_id)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,10);
- WFIFOW(inter_fd,0) = 0x3018;
- WFIFOL(inter_fd,2) = account_id;
- WFIFOL(inter_fd,6) = guild_id;
- WFIFOSET(inter_fd,10);
- return 0;
-}
-int intif_send_guild_storage(int account_id,struct guild_storage *gstor)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,sizeof(struct guild_storage)+12);
- WFIFOW(inter_fd,0) = 0x3019;
- WFIFOW(inter_fd,2) = sizeof(struct guild_storage)+12;
- WFIFOL(inter_fd,4) = account_id;
- WFIFOL(inter_fd,8) = gstor->guild_id;
- memcpy( WFIFOP(inter_fd,12),gstor, sizeof(struct guild_storage) );
- WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
- return 0;
-}
-
-// パーティ作成要求
-int intif_create_party(struct party_member *member,char *name,int item,int item2)
-{
- if (CheckForCharServer())
- return 0;
- nullpo_retr(0, member);
-
- WFIFOHEAD(inter_fd,64);
- WFIFOW(inter_fd,0) = 0x3020;
- WFIFOW(inter_fd,2) = 30+sizeof(struct party_member);
- memcpy(WFIFOP(inter_fd,4),name, NAME_LENGTH);
- WFIFOB(inter_fd,28)= item;
- WFIFOB(inter_fd,29)= item2;
- memcpy(WFIFOP(inter_fd,30), member, sizeof(struct party_member));
- WFIFOSET(inter_fd,WFIFOW(inter_fd, 2));
- return 0;
-}
-// パーティ情報要求
-int intif_request_partyinfo(int party_id)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,6);
- WFIFOW(inter_fd,0) = 0x3021;
- WFIFOL(inter_fd,2) = party_id;
- WFIFOSET(inter_fd,6);
-// if(battle_config.etc_log)
-// printf("intif: request party info\n");
- return 0;
-}
-// パーティ追加要求
-int intif_party_addmember(int party_id,struct party_member *member)
-{
- if (CheckForCharServer())
- return 0;
-
- WFIFOHEAD(inter_fd,42);
- WFIFOW(inter_fd,0)=0x3022;
- WFIFOW(inter_fd,2)=8+sizeof(struct party_member);
- WFIFOL(inter_fd,4)=party_id;
- memcpy(WFIFOP(inter_fd,8),member,sizeof(struct party_member));
- WFIFOSET(inter_fd,WFIFOW(inter_fd, 2));
- return 1;
-}
-// パーティ設定変更
-int intif_party_changeoption(int party_id,int account_id,int exp,int item)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,14);
- WFIFOW(inter_fd,0)=0x3023;
- WFIFOL(inter_fd,2)=party_id;
- WFIFOL(inter_fd,6)=account_id;
- WFIFOW(inter_fd,10)=exp;
- WFIFOW(inter_fd,12)=item;
- WFIFOSET(inter_fd,14);
- return 0;
-}
-// パーティ脱退要求
-int intif_party_leave(int party_id,int account_id, int char_id)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,14);
- WFIFOW(inter_fd,0)=0x3024;
- WFIFOL(inter_fd,2)=party_id;
- WFIFOL(inter_fd,6)=account_id;
- WFIFOL(inter_fd,10)=char_id;
- WFIFOSET(inter_fd,14);
- return 0;
-}
-// パーティ移動要求
-int intif_party_changemap(struct map_session_data *sd,int online)
-{
- if (CheckForCharServer())
- return 0;
- if(!sd)
- return 0;
-
- WFIFOHEAD(inter_fd,19);
- WFIFOW(inter_fd,0)=0x3025;
- WFIFOL(inter_fd,2)=sd->status.party_id;
- WFIFOL(inter_fd,6)=sd->status.account_id;
- WFIFOL(inter_fd,10)=sd->status.char_id;
- WFIFOW(inter_fd,14)=sd->mapindex;
- WFIFOB(inter_fd,16)=online;
- WFIFOW(inter_fd,17)=sd->status.base_level;
- WFIFOSET(inter_fd,19);
- return 1;
-}
-// パーティー解散要求
-int intif_break_party(int party_id)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,6);
- WFIFOW(inter_fd,0)=0x3026;
- WFIFOL(inter_fd,2)=party_id;
- WFIFOSET(inter_fd,6);
- return 0;
-}
-// パーティ会話送信
-int intif_party_message(int party_id,int account_id,char *mes,int len)
-{
- if (CheckForCharServer())
- return 0;
-
- if (other_mapserver_count < 1)
- return 0; //No need to send.
-
- WFIFOHEAD(inter_fd,len + 12);
- WFIFOW(inter_fd,0)=0x3027;
- WFIFOW(inter_fd,2)=len+12;
- WFIFOL(inter_fd,4)=party_id;
- WFIFOL(inter_fd,8)=account_id;
- memcpy(WFIFOP(inter_fd,12),mes,len);
- WFIFOSET(inter_fd,len+12);
- return 0;
-}
-// パーティ競合チェック要求
-int intif_party_checkconflict(int party_id,int account_id,int char_id)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,10 + NAME_LENGTH);
- WFIFOW(inter_fd,0)=0x3028;
- WFIFOL(inter_fd,2)=party_id;
- WFIFOL(inter_fd,6)=account_id;
- WFIFOL(inter_fd,10)=char_id;
- WFIFOSET(inter_fd,14);
- return 0;
-}
-
-int intif_party_leaderchange(int party_id,int account_id,int char_id)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,14);
- WFIFOW(inter_fd,0)=0x3029;
- WFIFOL(inter_fd,2)=party_id;
- WFIFOL(inter_fd,6)=account_id;
- WFIFOL(inter_fd,10)=char_id;
- WFIFOSET(inter_fd,14);
- return 0;
-}
-
-
-// ギルド作成要求
-int intif_guild_create(const char *name,const struct guild_member *master)
-{
- if (CheckForCharServer())
- return 0;
- nullpo_retr(0, master);
-
- WFIFOHEAD(inter_fd,sizeof(struct guild_member)+(8+NAME_LENGTH));
- WFIFOW(inter_fd,0)=0x3030;
- WFIFOW(inter_fd,2)=sizeof(struct guild_member)+(8+NAME_LENGTH);
- WFIFOL(inter_fd,4)=master->account_id;
- memcpy(WFIFOP(inter_fd,8),name,NAME_LENGTH);
- memcpy(WFIFOP(inter_fd,8+NAME_LENGTH),master,sizeof(struct guild_member));
- WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
- return 0;
-}
-// ギルド情報要求
-int intif_guild_request_info(int guild_id)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,6);
- WFIFOW(inter_fd,0) = 0x3031;
- WFIFOL(inter_fd,2) = guild_id;
- WFIFOSET(inter_fd,6);
- return 0;
-}
-// ギルドメンバ追加要求
-int intif_guild_addmember(int guild_id,struct guild_member *m)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,sizeof(struct guild_member)+8);
- WFIFOW(inter_fd,0) = 0x3032;
- WFIFOW(inter_fd,2) = sizeof(struct guild_member)+8;
- WFIFOL(inter_fd,4) = guild_id;
- memcpy(WFIFOP(inter_fd,8),m,sizeof(struct guild_member));
- WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
- return 0;
-}
-
-int intif_guild_change_gm(int guild_id, const char* name, int len)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd, len + 8);
- WFIFOW(inter_fd, 0)=0x3033;
- WFIFOW(inter_fd, 2)=len+8;
- WFIFOL(inter_fd, 4)=guild_id;
- memcpy(WFIFOP(inter_fd,8),name,len);
- WFIFOSET(inter_fd,len+8);
- return 0;
-}
-
-// ギルドメンバ脱退/追放要求
-int intif_guild_leave(int guild_id,int account_id,int char_id,int flag,const char *mes)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd, 55);
- WFIFOW(inter_fd, 0) = 0x3034;
- WFIFOL(inter_fd, 2) = guild_id;
- WFIFOL(inter_fd, 6) = account_id;
- WFIFOL(inter_fd,10) = char_id;
- WFIFOB(inter_fd,14) = flag;
- memcpy(WFIFOP(inter_fd,15),mes,40);
- WFIFOSET(inter_fd,55);
- return 0;
-}
-// ギルドメンバのオンライン状況/Lv更新要求
-int intif_guild_memberinfoshort(int guild_id,
- int account_id,int char_id,int online,int lv,int class_)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd, 19);
- WFIFOW(inter_fd, 0) = 0x3035;
- WFIFOL(inter_fd, 2) = guild_id;
- WFIFOL(inter_fd, 6) = account_id;
- WFIFOL(inter_fd,10) = char_id;
- WFIFOB(inter_fd,14) = online;
- WFIFOW(inter_fd,15) = lv;
- WFIFOW(inter_fd,17) = class_;
- WFIFOSET(inter_fd,19);
- return 0;
-}
-// ギルド解散通知
-int intif_guild_break(int guild_id)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd, 6);
- WFIFOW(inter_fd, 0) = 0x3036;
- WFIFOL(inter_fd, 2) = guild_id;
- WFIFOSET(inter_fd,6);
- return 0;
-}
-// ギルド会話送信
-int intif_guild_message(int guild_id,int account_id,char *mes,int len)
-{
- if (CheckForCharServer())
- return 0;
-
- if (other_mapserver_count < 1)
- return 0; //No need to send.
-
- WFIFOHEAD(inter_fd, len + 12);
- WFIFOW(inter_fd,0)=0x3037;
- WFIFOW(inter_fd,2)=len+12;
- WFIFOL(inter_fd,4)=guild_id;
- WFIFOL(inter_fd,8)=account_id;
- memcpy(WFIFOP(inter_fd,12),mes,len);
- WFIFOSET(inter_fd,len+12);
-
- return 0;
-}
-// ギルド競合チェック要求
-int intif_guild_checkconflict(int guild_id,int account_id,int char_id)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd, 14);
- WFIFOW(inter_fd, 0)=0x3038;
- WFIFOL(inter_fd, 2)=guild_id;
- WFIFOL(inter_fd, 6)=account_id;
- WFIFOL(inter_fd,10)=char_id;
- WFIFOSET(inter_fd,14);
- return 0;
-}
-// ギルド基本情報変更要求
-int intif_guild_change_basicinfo(int guild_id,int type,const void *data,int len)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd, len + 10);
- WFIFOW(inter_fd,0)=0x3039;
- WFIFOW(inter_fd,2)=len+10;
- WFIFOL(inter_fd,4)=guild_id;
- WFIFOW(inter_fd,8)=type;
- memcpy(WFIFOP(inter_fd,10),data,len);
- WFIFOSET(inter_fd,len+10);
- return 0;
-}
-// ギルドメンバ情報変更要求
-int intif_guild_change_memberinfo(int guild_id,int account_id,int char_id,
- int type,const void *data,int len)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd, len + 18);
- WFIFOW(inter_fd, 0)=0x303a;
- WFIFOW(inter_fd, 2)=len+18;
- WFIFOL(inter_fd, 4)=guild_id;
- WFIFOL(inter_fd, 8)=account_id;
- WFIFOL(inter_fd,12)=char_id;
- WFIFOW(inter_fd,16)=type;
- memcpy(WFIFOP(inter_fd,18),data,len);
- WFIFOSET(inter_fd,len+18);
- return 0;
-}
-// ギルド役職変更要求
-int intif_guild_position(int guild_id,int idx,struct guild_position *p)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd, sizeof(struct guild_position)+12);
- WFIFOW(inter_fd,0)=0x303b;
- WFIFOW(inter_fd,2)=sizeof(struct guild_position)+12;
- WFIFOL(inter_fd,4)=guild_id;
- WFIFOL(inter_fd,8)=idx;
- memcpy(WFIFOP(inter_fd,12),p,sizeof(struct guild_position));
- WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
- return 0;
-}
-// ギルドスキルアップ要求
-int intif_guild_skillup(int guild_id,int skill_num,int account_id,int flag)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,14);
- WFIFOW(inter_fd, 0)=0x303c;
- WFIFOL(inter_fd, 2)=guild_id;
- WFIFOL(inter_fd, 6)=skill_num;
- WFIFOL(inter_fd,10)=account_id;
- //WFIFOL(inter_fd,14)=flag;
- WFIFOSET(inter_fd,14);
- return 0;
-}
-// ギルド同盟/敵対要求
-int intif_guild_alliance(int guild_id1,int guild_id2,int account_id1,int account_id2,int flag)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,19);
- WFIFOW(inter_fd, 0)=0x303d;
- WFIFOL(inter_fd, 2)=guild_id1;
- WFIFOL(inter_fd, 6)=guild_id2;
- WFIFOL(inter_fd,10)=account_id1;
- WFIFOL(inter_fd,14)=account_id2;
- WFIFOB(inter_fd,18)=flag;
- WFIFOSET(inter_fd,19);
- return 0;
-}
-// ギルド告知変更要求
-int intif_guild_notice(int guild_id,const char *mes1,const char *mes2)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,186);
- WFIFOW(inter_fd,0)=0x303e;
- WFIFOL(inter_fd,2)=guild_id;
- memcpy(WFIFOP(inter_fd,6),mes1,60);
- memcpy(WFIFOP(inter_fd,66),mes2,120);
- WFIFOSET(inter_fd,186);
- return 0;
-}
-// ギルドエンブレム変更要求
-int intif_guild_emblem(int guild_id,int len,const char *data)
-{
- if (CheckForCharServer())
- return 0;
- if(guild_id<=0 || len<0 || len>2000)
- return 0;
- WFIFOHEAD(inter_fd,len + 12);
- WFIFOW(inter_fd,0)=0x303f;
- WFIFOW(inter_fd,2)=len+12;
- WFIFOL(inter_fd,4)=guild_id;
- WFIFOL(inter_fd,8)=0;
- memcpy(WFIFOP(inter_fd,12),data,len);
- WFIFOSET(inter_fd,len+12);
- return 0;
-}
-//現在のギルド城占領ギルドを調べる
-int intif_guild_castle_dataload(int castle_id,int index)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,5);
- WFIFOW(inter_fd,0)=0x3040;
- WFIFOW(inter_fd,2)=castle_id;
- WFIFOB(inter_fd,4)=index;
- WFIFOSET(inter_fd,5);
- return 0;
-}
-
-//ギルド城占領ギルド変更要求
-int intif_guild_castle_datasave(int castle_id,int index, int value)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,9);
- WFIFOW(inter_fd,0)=0x3041;
- WFIFOW(inter_fd,2)=castle_id;
- WFIFOB(inter_fd,4)=index;
- WFIFOL(inter_fd,5)=value;
- WFIFOSET(inter_fd,9);
- return 0;
-}
-
-//-----------------------------------------------------------------
-// Homunculus Packets send to Inter server [albator]
-//-----------------------------------------------------------------
-
-int intif_homunculus_create(int account_id, struct s_homunculus *sh)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd, sizeof(struct s_homunculus)+8);
- WFIFOW(inter_fd,0) = 0x3090;
- WFIFOW(inter_fd,2) = sizeof(struct s_homunculus)+8;
- WFIFOL(inter_fd,4) = account_id;
- memcpy(WFIFOP(inter_fd,8),sh,sizeof(struct s_homunculus));
- WFIFOSET(inter_fd, WFIFOW(inter_fd,2));
- return 0;
-}
-
-int intif_homunculus_requestload(int account_id, int homun_id)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd, 10);
- WFIFOW(inter_fd,0) = 0x3091;
- WFIFOL(inter_fd,2) = account_id;
- WFIFOL(inter_fd,6) = homun_id;
- WFIFOSET(inter_fd, 10);
- return 1;
-}
-
-int intif_homunculus_requestsave(int account_id, struct s_homunculus* sh)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd, sizeof(struct s_homunculus)+8);
- WFIFOW(inter_fd,0) = 0x3092;
- WFIFOW(inter_fd,2) = sizeof(struct s_homunculus)+8;
- WFIFOL(inter_fd,4) = account_id;
- memcpy(WFIFOP(inter_fd,8),sh,sizeof(struct s_homunculus));
- WFIFOSET(inter_fd, WFIFOW(inter_fd,2));
- return 0;
-
-}
-
-int intif_homunculus_requestdelete(int homun_id)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd, 6);
- WFIFOW(inter_fd, 0) = 0x3093;
- WFIFOL(inter_fd,2) = homun_id;
- WFIFOSET(inter_fd,6);
- return 0;
-
-}
-
-
-//-----------------------------------------------------------------
-// Packets receive from inter server
-
-// Wisp/Page reception
-int intif_parse_WisMessage(int fd) { // rewritten by [Yor]
- struct map_session_data* sd;
- char *wisp_source;
- char name[NAME_LENGTH];
- int id, i;
- RFIFOHEAD(fd);
- id=RFIFOL(fd,4);
-
- memcpy(name, RFIFOP(fd,32), NAME_LENGTH);
- name[NAME_LENGTH-1] = '\0'; //In case name arrived without it's terminator. [Skotlex]
- sd = map_nick2sd(name);
- if(sd == NULL || strcmp(sd->status.name, name) != 0)
- { //Not found
- intif_wis_replay(id,1);
- return 0;
- }
- if(sd->state.ignoreAll) {
- intif_wis_replay(id, 2);
- return 0;
- }
- wisp_source = (char *) RFIFOP(fd,8); // speed up [Yor]
- for(i=0; i < MAX_IGNORE_LIST &&
- sd->ignore[i].name[0] != '\0' &&
- strcmp(sd->ignore[i].name, wisp_source) != 0
- ; i++);
-
- if (i < MAX_IGNORE_LIST && sd->ignore[i].name[0] != '\0')
- { //Ignored
- intif_wis_replay(id, 2);
- return 0;
- }
- //Success to send whisper.
- clif_wis_message(sd->fd, wisp_source, (char*)RFIFOP(fd,56),RFIFOW(fd,2)-56);
- intif_wis_replay(id,0); // 送信成功
- return 0;
-}
-
-// Wisp/page transmission result reception
-int intif_parse_WisEnd(int fd) {
- struct map_session_data* sd;
- RFIFOHEAD(fd);
-
- if (battle_config.etc_log)
- ShowInfo("intif_parse_wisend: player: %s, flag: %d\n", RFIFOP(fd,2), RFIFOB(fd,26)); // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
- sd = (struct map_session_data *)map_nick2sd((char *) RFIFOP(fd,2));
- if (sd != NULL)
- clif_wis_end(sd->fd, RFIFOB(fd,26));
-
- return 0;
-}
-
-static int mapif_parse_WisToGM_sub(struct map_session_data* sd,va_list va) {
- int min_gm_level = va_arg(va, int);
- char *wisp_name;
- char *message;
- int len;
- if (pc_isGM(sd) < min_gm_level) return 0;
- wisp_name = va_arg(va, char*);
- message = va_arg(va, char*);
- len = va_arg(va, int);
- clif_wis_message(sd->fd, wisp_name, message, len);
- return 1;
-}
-
-// Received wisp message from map-server via char-server for ALL gm
-int mapif_parse_WisToGM(int fd) { // 0x3003/0x3803 <packet_len>.w <wispname>.24B <min_gm_level>.w <message>.?B
- int min_gm_level, mes_len;
- char Wisp_name[NAME_LENGTH];
- char mbuf[255];
- char *message;
- RFIFOHEAD(fd);
-
- mes_len = RFIFOW(fd,2) - 30;
- message = (char *) (mes_len >= 255 ? (char *) aMallocA(mes_len) : mbuf);
-
- min_gm_level = (int)RFIFOW(fd,28);
- memcpy(Wisp_name, RFIFOP(fd,4), NAME_LENGTH);
- Wisp_name[NAME_LENGTH-1] = '\0';
- memcpy(message, RFIFOP(fd,30), mes_len);
- message[mes_len-1] = '\0';
- // information is sended to all online GM
- clif_foreachclient(mapif_parse_WisToGM_sub, min_gm_level, Wisp_name, message, mes_len);
-
- if (message != mbuf)
- aFree(message);
- return 0;
-}
-
-// アカウント変数通知
-int intif_parse_Registers(int fd) {
- int j,p,len,max, flag;
- struct map_session_data *sd;
- struct global_reg *reg;
- int *qty;
- RFIFOHEAD(fd);
-
- if( (sd=map_id2sd(RFIFOL(fd,4)))==NULL)
- return 1;
-
- if (RFIFOB(fd,12) == 3 && sd->status.char_id != RFIFOL(fd,8))
- return 1; //Character registry from another character.
-
- flag = (sd->save_reg.global_num == -1 || sd->save_reg.account_num == -1 || sd->save_reg.account2_num == -1);
-
- switch (RFIFOB(fd,12)) {
- case 3: //Character Registry
- reg = sd->save_reg.global;
- qty = &sd->save_reg.global_num;
- max = GLOBAL_REG_NUM;
- break;
- case 2: //Account Registry
- reg = sd->save_reg.account;
- qty = &sd->save_reg.account_num;
- max = ACCOUNT_REG_NUM;
- break;
- case 1: //Account2 Registry
- reg = sd->save_reg.account2;
- qty = &sd->save_reg.account2_num;
- max = ACCOUNT_REG2_NUM;
- break;
- default:
- if (battle_config.error_log)
- ShowError("intif_parse_Registers: Unrecognized type %d\n",RFIFOB(fd,12));
- return 0;
- }
- for(j=0,p=13;j<max && p<RFIFOW(fd,2);j++){
- sscanf(RFIFOP(fd,p), "%31c%n", reg[j].str,&len);
- reg[j].str[len]='\0';
- p += len+1; //+1 to skip the '\0' between strings.
- sscanf(RFIFOP(fd,p), "%255c%n", reg[j].value,&len);
- reg[j].value[len]='\0';
- p += len+1;
- }
- *qty = j;
-
- if (flag && sd->save_reg.global_num > -1 && sd->save_reg.account_num > -1 && sd->save_reg.account2_num > -1)
- pc_reg_received(sd); //Received all registry values, execute init scripts and what-not. [Skotlex]
- return 1;
-}
-
-// 倉庫データ受信
-int intif_parse_LoadStorage(int fd) {
- struct storage *stor;
- struct map_session_data *sd;
- RFIFOHEAD(fd);
-
- sd=map_id2sd( RFIFOL(fd,4) );
- if(sd==NULL){
- if(battle_config.error_log)
- ShowError("intif_parse_LoadStorage: user not found %d\n",RFIFOL(fd,4));
- return 1;
- }
-
- if (sd->state.finalsave)
- return 1; //Player is already scheduled to leave the server.
-
- stor = account2storage( RFIFOL(fd,4));
-
- if (stor->storage_status == 1) { // Already open.. lets ignore this update
- if (battle_config.error_log)
- ShowWarning("intif_parse_LoadStorage: storage received for a client already open (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
- return 1;
- }
- if (stor->dirty) { // Already have storage, and it has been modified and not saved yet! Exploit! [Skotlex]
- if (battle_config.error_log)
- ShowWarning("intif_parse_LoadStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
- return 1;
- }
- if (RFIFOW(fd,2)-8 != sizeof(struct storage)) {
- if (battle_config.error_log)
- ShowError("intif_parse_LoadStorage: data size error %d %d\n", RFIFOW(fd,2)-8, sizeof(struct storage));
- return 1;
- }
- if(battle_config.save_log)
- ShowInfo("intif_openstorage: %d\n",RFIFOL(fd,4) );
- memcpy(stor,RFIFOP(fd,8),sizeof(struct storage));
- stor->dirty=0;
- stor->storage_status=1;
- sd->state.storage_flag = 1;
- clif_storagelist(sd,stor);
- clif_updatestorageamount(sd,stor);
-
- return 0;
-}
-
-// 倉庫データ送信成功
-int intif_parse_SaveStorage(int fd)
-{
- RFIFOHEAD(fd);
- if(battle_config.save_log)
- ShowInfo("intif_savestorage: done %d %d\n",RFIFOL(fd,2),RFIFOB(fd,6) );
- storage_storage_saved(RFIFOL(fd,2));
- return 0;
-}
-
-int intif_parse_LoadGuildStorage(int fd)
-{
- struct guild_storage *gstor;
- struct map_session_data *sd;
- int guild_id;
- RFIFOHEAD(fd);
- guild_id = RFIFOL(fd,8);
- if(guild_id <= 0)
- return 1;
- sd=map_id2sd( RFIFOL(fd,4) );
- if(sd==NULL){
- if(battle_config.error_log)
- ShowError("intif_parse_LoadGuildStorage: user not found %d\n",RFIFOL(fd,4));
- return 1;
- }
- gstor=guild2storage(guild_id);
- if(!gstor) {
- if(battle_config.error_log)
- ShowWarning("intif_parse_LoadGuildStorage: error guild_id %d not exist\n",guild_id);
- return 1;
- }
- if (gstor->storage_status == 1) { // Already open.. lets ignore this update
- if (battle_config.error_log)
- ShowWarning("intif_parse_LoadGuildStorage: storage received for a client already open (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
- return 1;
- }
- if (gstor->dirty) { // Already have storage, and it has been modified and not saved yet! Exploit! [Skotlex]
- if (battle_config.error_log)
- ShowWarning("intif_parse_LoadGuildStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
- return 1;
- }
- if( RFIFOW(fd,2)-12 != sizeof(struct guild_storage) ){
- gstor->storage_status = 0;
- if(battle_config.error_log)
- ShowError("intif_parse_LoadGuildStorage: data size error %d %d\n",RFIFOW(fd,2)-12 , sizeof(struct guild_storage));
- return 1;
- }
- if(battle_config.save_log)
- ShowInfo("intif_open_guild_storage: %d\n",RFIFOL(fd,4) );
- memcpy(gstor,RFIFOP(fd,12),sizeof(struct guild_storage));
- gstor->storage_status = 1;
- sd->state.storage_flag = 2;
- clif_guildstoragelist(sd,gstor);
- clif_updateguildstorageamount(sd,gstor);
- return 0;
-}
-int intif_parse_SaveGuildStorage(int fd)
-{
- RFIFOHEAD(fd);
- if(battle_config.save_log) {
- ShowInfo("intif_save_guild_storage: done %d %d %d\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOB(fd,10) );
- }
- storage_guild_storagesaved(/*RFIFOL(fd,2), */RFIFOL(fd,6));
- return 0;
-}
-
-// パーティ作成可否
-int intif_parse_PartyCreated(int fd)
-{
- RFIFOHEAD(fd);
- if(battle_config.etc_log)
- ShowInfo("intif: party created by account %d\n\n", RFIFOL(fd,2));
- party_created(RFIFOL(fd,2), RFIFOL(fd,6),RFIFOB(fd,10),RFIFOL(fd,11), (char *)RFIFOP(fd,15));
- return 0;
-}
-// パーティ情報
-int intif_parse_PartyInfo(int fd)
-{
- RFIFOHEAD(fd);
- if( RFIFOW(fd,2)==8){
- if(battle_config.error_log)
- ShowWarning("intif: party noinfo %d\n",RFIFOL(fd,4));
- party_recv_noinfo(RFIFOL(fd,4));
- return 0;
- }
-
-// printf("intif: party info %d\n",RFIFOL(fd,4));
- if( RFIFOW(fd,2)!=sizeof(struct party)+4 ){
- if(battle_config.error_log)
- ShowError("intif: party info : data size error %d %d %d\n",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct party)+4);
- }
- party_recv_info((struct party *)RFIFOP(fd,4));
- return 0;
-}
-// パーティ追加通知
-int intif_parse_PartyMemberAdded(int fd)
-{
- RFIFOHEAD(fd);
- if(battle_config.etc_log)
- ShowInfo("intif: party member added Party (%d), Account(%d), Char(%d)\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
- party_member_added(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10), RFIFOB(fd, 14));
- return 0;
-}
-// パーティ設定変更通知
-int intif_parse_PartyOptionChanged(int fd)
-{
- RFIFOHEAD(fd);
- party_optionchanged(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOW(fd,10),RFIFOW(fd,12),RFIFOB(fd,14));
- return 0;
-}
-// パーティ脱退通知
-int intif_parse_PartyMemberLeaved(int fd)
-{
- RFIFOHEAD(fd);
- if(battle_config.etc_log)
- ShowInfo("intif: party member leaved: Party(%d), Account(%d), Char(%d)\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
- party_member_leaved(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
- return 0;
-}
-// パーティ解散通知
-int intif_parse_PartyBroken(int fd)
-{
- RFIFOHEAD(fd);
- party_broken(RFIFOL(fd,2));
- return 0;
-}
-// パーティ移動通知
-int intif_parse_PartyMove(int fd)
-{
- RFIFOHEAD(fd);
- party_recv_movemap(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOW(fd,14),RFIFOB(fd,16),RFIFOW(fd,17));
- return 0;
-}
-// パーティメッセージ
-int intif_parse_PartyMessage(int fd)
-{
- RFIFOHEAD(fd);
-// if(battle_config.etc_log)
-// printf("intif_parse_PartyMessage: %s\n",RFIFOP(fd,12));
- party_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12);
- return 0;
-}
-
-// ギルド作成可否
-int intif_parse_GuildCreated(int fd)
-{
- RFIFOHEAD(fd);
- guild_created(RFIFOL(fd,2),RFIFOL(fd,6));
- return 0;
-}
-// ギルド情報
-int intif_parse_GuildInfo(int fd)
-{
- RFIFOHEAD(fd);
- if( RFIFOW(fd,2)==8){
- if(battle_config.error_log)
- ShowWarning("intif: guild noinfo %d\n",RFIFOL(fd,4));
- guild_recv_noinfo(RFIFOL(fd,4));
- return 0;
- }
-
-// if(battle_config.etc_log)
-// printf("intif: guild info %d\n",RFIFOL(fd,4));
- if( RFIFOW(fd,2)!=sizeof(struct guild)+4 ){
- if(battle_config.error_log)
- ShowError("intif: guild info : data size error Gid: %d recv size: %d Expected size: %d\n",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct guild)+4);
- }
- guild_recv_info((struct guild *)RFIFOP(fd,4));
- return 0;
-}
-// ギルドメンバ追加通知
-int intif_parse_GuildMemberAdded(int fd)
-{
- RFIFOHEAD(fd);
- if(battle_config.etc_log)
- ShowInfo("intif: guild member added %d %d %d %d\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14));
- guild_member_added(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14));
- return 0;
-}
-// ギルドメンバ脱退/追放通知
-int intif_parse_GuildMemberLeaved(int fd)
-{
- RFIFOHEAD(fd);
- guild_member_leaved(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),
- (char *) RFIFOP(fd,55), (char *) RFIFOP(fd,15));
- return 0;
-}
-
-// ギルドメンバオンライン状態/Lv変更通知
-int intif_parse_GuildMemberInfoShort(int fd)
-{
- RFIFOHEAD(fd);
- guild_recv_memberinfoshort(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOW(fd,15),RFIFOW(fd,17));
- return 0;
-}
-// ギルド解散通知
-int intif_parse_GuildBroken(int fd)
-{
- RFIFOHEAD(fd);
- guild_broken(RFIFOL(fd,2),RFIFOB(fd,6));
- return 0;
-}
-
-// ギルド基本情報変更通知
-int intif_parse_GuildBasicInfoChanged(int fd)
-{
- int type, guild_id;
- unsigned int dd;
- void *data;
- struct guild *g;
- short dw;
- RFIFOHEAD(fd);
- type=RFIFOW(fd,8);
- guild_id=RFIFOL(fd,4);
- data=RFIFOP(fd,10);
- g=guild_search(guild_id);
- dw=*((short *)data);
- dd=*((unsigned int *)data);
- if( g==NULL )
- return 0;
- switch(type){
- case GBI_EXP: g->exp=dd; break;
- case GBI_GUILDLV: g->guild_lv=dw; break;
- case GBI_SKILLPOINT: g->skill_point=dd; break;
- }
- return 0;
-}
-// ギルドメンバ情報変更通知
-int intif_parse_GuildMemberInfoChanged(int fd)
-{
- int type, guild_id, account_id, char_id, idx, dd;
- void* data;
- struct guild *g;
- RFIFOHEAD(fd);
- type=RFIFOW(fd,16);
- guild_id=RFIFOL(fd,4);
- account_id=RFIFOL(fd,8);
- char_id=RFIFOL(fd,12);
- data=RFIFOP(fd,18);
- g=guild_search(guild_id);
- dd=*((int *)data);
- if( g==NULL )
- return 0;
- idx=guild_getindex(g,account_id,char_id);
- switch(type){
- case GMI_POSITION:
- g->member[idx].position=dd;
- guild_memberposition_changed(g,idx,dd);
- break;
- case GMI_EXP:
- g->member[idx].exp=dd;
- break;
- case GMI_HAIR:
- g->member[idx].hair=dd;
- break;
- case GMI_HAIR_COLOR:
- g->member[idx].hair_color=dd;
- break;
- case GMI_GENDER:
- g->member[idx].gender=dd;
- break;
- case GMI_CLASS:
- g->member[idx].class_=dd;
- break;
- case GMI_LEVEL:
- g->member[idx].lv=dd;
- break;
- }
- return 0;
-}
-
-// ギルド役職変更通知
-int intif_parse_GuildPosition(int fd)
-{
- RFIFOHEAD(fd);
- if( RFIFOW(fd,2)!=sizeof(struct guild_position)+12 ){
- if(battle_config.error_log)
- ShowError("intif: guild info : data size error\n %d %d %d",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct guild_position)+12);
- }
- guild_position_changed(RFIFOL(fd,4),RFIFOL(fd,8),(struct guild_position *)RFIFOP(fd,12));
- return 0;
-}
-// ギルドスキル割り振り通知
-int intif_parse_GuildSkillUp(int fd)
-{
- RFIFOHEAD(fd);
- guild_skillupack(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
- return 0;
-}
-// ギルド同盟/敵対通知
-int intif_parse_GuildAlliance(int fd)
-{
- RFIFOHEAD(fd);
- guild_allianceack(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOL(fd,14),
- RFIFOB(fd,18),(char *) RFIFOP(fd,19),(char *) RFIFOP(fd,43));
- return 0;
-}
-// ギルド告知変更通知
-int intif_parse_GuildNotice(int fd)
-{
- RFIFOHEAD(fd);
- guild_notice_changed(RFIFOL(fd,2),(char *) RFIFOP(fd,6),(char *) RFIFOP(fd,66));
- return 0;
-}
-// ギルドエンブレム変更通知
-int intif_parse_GuildEmblem(int fd)
-{
- RFIFOHEAD(fd);
- guild_emblem_changed(RFIFOW(fd,2)-12,RFIFOL(fd,4),RFIFOL(fd,8), (char *)RFIFOP(fd,12));
- return 0;
-}
-// ギルド会話受信
-int intif_parse_GuildMessage(int fd)
-{
- RFIFOHEAD(fd);
- guild_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12);
- return 0;
-}
-// ギルド城データ要求返信
-int intif_parse_GuildCastleDataLoad(int fd)
-{
- RFIFOHEAD(fd);
- return guild_castledataloadack(RFIFOW(fd,2),RFIFOB(fd,4),RFIFOL(fd,5));
-}
-// ギルド城データ変更通知
-int intif_parse_GuildCastleDataSave(int fd)
-{
- RFIFOHEAD(fd);
- return guild_castledatasaveack(RFIFOW(fd,2),RFIFOB(fd,4),RFIFOL(fd,5));
-}
-
-// ギルド城データ一括受信(初期化時)
-int intif_parse_GuildCastleAllDataLoad(int fd)
-{
- RFIFOHEAD(fd);
- return guild_castlealldataload(RFIFOW(fd,2),(struct guild_castle *)RFIFOP(fd,4));
-}
-
-int intif_parse_GuildMasterChanged(int fd)
-{
- RFIFOHEAD(fd);
- return guild_gm_changed(RFIFOL(fd,2),RFIFOL(fd,6));
-}
-
-// pet
-int intif_parse_CreatePet(int fd)
-{
- RFIFOHEAD(fd);
- pet_get_egg(RFIFOL(fd,2),RFIFOL(fd,7),RFIFOB(fd,6));
-
- return 0;
-}
-
-int intif_parse_RecvPetData(int fd)
-{
- struct s_pet p;
- int len;
- RFIFOHEAD(fd);
- len=RFIFOW(fd,2);
- if(sizeof(struct s_pet)!=len-9) {
- if(battle_config.etc_log)
- ShowError("intif: pet data: data size error %d %d\n",sizeof(struct s_pet),len-9);
- }
- else{
- memcpy(&p,RFIFOP(fd,9),sizeof(struct s_pet));
- pet_recv_petdata(RFIFOL(fd,4),&p,RFIFOB(fd,8));
- }
-
- return 0;
-}
-int intif_parse_SavePetOk(int fd)
-{
- RFIFOHEAD(fd);
- if(RFIFOB(fd,6) == 1) {
- if(battle_config.error_log)
- ShowError("pet data save failure\n");
- }
-
- return 0;
-}
-
-int intif_parse_DeletePetOk(int fd)
-{
- RFIFOHEAD(fd);
- if(RFIFOB(fd,2) == 1) {
- if(battle_config.error_log)
- ShowError("pet data delete failure\n");
- }
-
- return 0;
-}
-
-int intif_parse_RenamePetOk(int fd)
-{
- struct map_session_data *sd = NULL;
- RFIFOHEAD(fd);
- if((sd=map_id2sd(RFIFOL(fd,2)))==NULL ||
- sd->status.char_id != RFIFOL(fd,6))
- return 0;
- if (RFIFOB(fd,10) == 0) {
- clif_displaymessage(sd->fd, msg_txt(280)); // You cannot use this name for your pet.
- clif_send_petstatus(sd); //Send status so client knows oet name change got rejected.
- return 0;
- }
- pet_change_name(sd, RFIFOP(fd,11),1);
- return 0;
-}
-
-//----------------------------------------------------------------
-// Homunculus recv packets [albator]
-
-int intif_parse_CreateHomunculus(int fd)
-{
- int len;
- RFIFOHEAD(fd);
- len=RFIFOW(fd,2)-9;
- if(sizeof(struct s_homunculus)!=len) {
- if(battle_config.etc_log)
- ShowError("intif: create homun data: data size error %d != %d\n",sizeof(struct s_homunculus),len);
- return 0;
- }
- merc_hom_recv_data(RFIFOL(fd,4), (struct s_homunculus*)RFIFOP(fd,9), RFIFOB(fd,8)) ;
- return 0;
-}
-
-int intif_parse_RecvHomunculusData(int fd)
-{
- int len;
-
- RFIFOHEAD(fd);
- len=RFIFOW(fd,2)-9;
-
- if(sizeof(struct s_homunculus)!=len) {
- if(battle_config.etc_log)
- ShowError("intif: homun data: data size error %d %d\n",sizeof(struct s_homunculus),len);
- return 0;
- }
- merc_hom_recv_data(RFIFOL(fd,4), (struct s_homunculus*)RFIFOP(fd,9), RFIFOB(fd,8));
- return 0;
-}
-
-int intif_parse_SaveHomunculusOk(int fd)
-{
- RFIFOHEAD(fd);
- if(RFIFOB(fd,6) != 1) {
- if(battle_config.error_log)
- ShowError("homunculus data save failure for account %d\n", RFIFOL(fd,2));
- }
- return 0;
-}
-
-int intif_parse_DeleteHomunculusOk(int fd)
-{
- RFIFOHEAD(fd);
- if(RFIFOB(fd,2) != 1) {
- if(battle_config.error_log)
- ShowError("Homunculus data delete failure\n");
- }
-
- return 0;
-}
-//-----------------------------------------------------------------
-// inter serverからの通信
-// エラーがあれば0(false)を返すこと
-// パケットが処理できれば1,パケット長が足りなければ2を返すこと
-int intif_parse(int fd)
-{
- int packet_len, cmd;
- RFIFOHEAD(fd);
- cmd = RFIFOW(fd,0);
- // パケットのID確認
- if(cmd<0x3800 || cmd>=0x3800+(sizeof(packet_len_table)/sizeof(packet_len_table[0])) ||
- packet_len_table[cmd-0x3800]==0){
- return 0;
- }
- // パケットの長さ確認
- packet_len = packet_len_table[cmd-0x3800];
- if(packet_len==-1){
- if(RFIFOREST(fd)<4)
- return 2;
- packet_len = RFIFOW(fd,2);
- }
-// if(battle_config.etc_log)
-// printf("intif_parse %d %x %d %d\n",fd,cmd,packet_len,RFIFOREST(fd));
- if((int)RFIFOREST(fd)<packet_len){
- return 2;
- }
- // 処理分岐
- switch(cmd){
- case 0x3800:
- if (RFIFOL(fd,4) == 0xFF000000) //Normal announce.
- clif_GMmessage(NULL,(char *) RFIFOP(fd,8),packet_len-8,0);
- else if (RFIFOL(fd,4) == 0xFE000000) //Main chat message [LuzZza]
- clif_MainChatMessage((char *)RFIFOP(fd,8));
- else //Color announce.
- clif_announce(NULL,(char *) RFIFOP(fd,8),packet_len-8,RFIFOL(fd,4),0);
- break;
- case 0x3801: intif_parse_WisMessage(fd); break;
- case 0x3802: intif_parse_WisEnd(fd); break;
- case 0x3803: mapif_parse_WisToGM(fd); break;
- case 0x3804: intif_parse_Registers(fd); break;
- case 0x3810: intif_parse_LoadStorage(fd); break;
- case 0x3811: intif_parse_SaveStorage(fd); break;
- case 0x3818: intif_parse_LoadGuildStorage(fd); break;
- case 0x3819: intif_parse_SaveGuildStorage(fd); break;
- case 0x3820: intif_parse_PartyCreated(fd); break;
- case 0x3821: intif_parse_PartyInfo(fd); break;
- case 0x3822: intif_parse_PartyMemberAdded(fd); break;
- case 0x3823: intif_parse_PartyOptionChanged(fd); break;
- case 0x3824: intif_parse_PartyMemberLeaved(fd); break;
- case 0x3825: intif_parse_PartyMove(fd); break;
- case 0x3826: intif_parse_PartyBroken(fd); break;
- case 0x3827: intif_parse_PartyMessage(fd); break;
- case 0x3830: intif_parse_GuildCreated(fd); break;
- case 0x3831: intif_parse_GuildInfo(fd); break;
- case 0x3832: intif_parse_GuildMemberAdded(fd); break;
- case 0x3834: intif_parse_GuildMemberLeaved(fd); break;
- case 0x3835: intif_parse_GuildMemberInfoShort(fd); break;
- case 0x3836: intif_parse_GuildBroken(fd); break;
- case 0x3837: intif_parse_GuildMessage(fd); break;
- case 0x3839: intif_parse_GuildBasicInfoChanged(fd); break;
- case 0x383a: intif_parse_GuildMemberInfoChanged(fd); break;
- case 0x383b: intif_parse_GuildPosition(fd); break;
- case 0x383c: intif_parse_GuildSkillUp(fd); break;
- case 0x383d: intif_parse_GuildAlliance(fd); break;
- case 0x383e: intif_parse_GuildNotice(fd); break;
- case 0x383f: intif_parse_GuildEmblem(fd); break;
- case 0x3840: intif_parse_GuildCastleDataLoad(fd); break;
- case 0x3841: intif_parse_GuildCastleDataSave(fd); break;
- case 0x3842: intif_parse_GuildCastleAllDataLoad(fd); break;
- case 0x3843: intif_parse_GuildMasterChanged(fd); break;
- case 0x3880: intif_parse_CreatePet(fd); break;
- case 0x3881: intif_parse_RecvPetData(fd); break;
- case 0x3882: intif_parse_SavePetOk(fd); break;
- case 0x3883: intif_parse_DeletePetOk(fd); break;
- case 0x3884: intif_parse_RenamePetOk(fd); break;
- case 0x3890: intif_parse_CreateHomunculus(fd); break;
- case 0x3891: intif_parse_RecvHomunculusData(fd); break;
- case 0x3892: intif_parse_SaveHomunculusOk(fd); break;
- case 0x3893: intif_parse_DeleteHomunculusOk(fd); break;
- default:
- if(battle_config.error_log)
- ShowError("intif_parse : unknown packet %d %x\n",fd,RFIFOW(fd,0));
- return 0;
- }
- // パケット読み飛ばし
- RFIFOSKIP(fd,packet_len);
- return 1;
-}
+// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
+// For more information, see LICENCE in the main folder
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <string.h>
+
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/timer.h"
+#include "../common/nullpo.h"
+#include "../common/malloc.h"
+#include "map.h"
+#include "battle.h"
+#include "chrif.h"
+#include "clif.h"
+#include "pc.h"
+#include "intif.h"
+#include "storage.h"
+#include "party.h"
+#include "guild.h"
+#include "pet.h"
+#include "atcommand.h"
+#include "mercenary.h" //albator
+
+static const int packet_len_table[]={
+ -1,-1,27,-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3800-0x380f
+ -1, 7, 0, 0, 0, 0, 0, 0, -1,11, 0, 0, 0, 0, 0, 0, //0x3810
+ 39,-1,15,15, 14,19, 7,-1, 0, 0, 0, 0, 0, 0, 0, 0, //0x3820
+ 10,-1,15, 0, 79,19, 7,-1, 0,-1,-1,-1, 14,67,186,-1, //0x3830
+ 9, 9,-1,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3840
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 11,-1, 7, 3, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3880
+ -1,-1, 7, 3, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3890 Homunculus [albator]
+};
+
+extern int char_fd; // inter serverのfdはchar_fdを使う
+#define inter_fd (char_fd) // エイリアス
+
+//-----------------------------------------------------------------
+// inter serverへの送信
+
+int CheckForCharServer(void) {
+ return ((char_fd <= 0) || session[char_fd] == NULL || session[char_fd]->wdata == NULL);
+}
+
+// pet
+int intif_create_pet(int account_id,int char_id,short pet_class,short pet_lv,short pet_egg_id,
+ short pet_equip,short intimate,short hungry,char rename_flag,char incuvate,char *pet_name)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd, 24 + NAME_LENGTH);
+ WFIFOW(inter_fd,0) = 0x3080;
+ WFIFOL(inter_fd,2) = account_id;
+ WFIFOL(inter_fd,6) = char_id;
+ WFIFOW(inter_fd,10) = pet_class;
+ WFIFOW(inter_fd,12) = pet_lv;
+ WFIFOW(inter_fd,14) = pet_egg_id;
+ WFIFOW(inter_fd,16) = pet_equip;
+ WFIFOW(inter_fd,18) = intimate;
+ WFIFOW(inter_fd,20) = hungry;
+ WFIFOB(inter_fd,22) = rename_flag;
+ WFIFOB(inter_fd,23) = incuvate;
+ memcpy(WFIFOP(inter_fd,24),pet_name,NAME_LENGTH);
+ WFIFOSET(inter_fd,24+NAME_LENGTH);
+
+ return 0;
+}
+
+int intif_request_petdata(int account_id,int char_id,int pet_id)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd, 14);
+ WFIFOW(inter_fd,0) = 0x3081;
+ WFIFOL(inter_fd,2) = account_id;
+ WFIFOL(inter_fd,6) = char_id;
+ WFIFOL(inter_fd,10) = pet_id;
+ WFIFOSET(inter_fd,14);
+
+ return 0;
+}
+
+int intif_save_petdata(int account_id,struct s_pet *p)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd, sizeof(struct s_pet) + 8);
+ WFIFOW(inter_fd,0) = 0x3082;
+ WFIFOW(inter_fd,2) = sizeof(struct s_pet) + 8;
+ WFIFOL(inter_fd,4) = account_id;
+ memcpy(WFIFOP(inter_fd,8),p,sizeof(struct s_pet));
+ WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
+
+ return 0;
+}
+
+int intif_delete_petdata(int pet_id)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,6);
+ WFIFOW(inter_fd,0) = 0x3083;
+ WFIFOL(inter_fd,2) = pet_id;
+ WFIFOSET(inter_fd,6);
+
+ return 1;
+}
+int intif_rename_pet(struct map_session_data *sd,char *name)
+{
+ if (CheckForCharServer())
+ return 1;
+
+ WFIFOHEAD(inter_fd,NAME_LENGTH+11);
+ WFIFOW(inter_fd,0) = 0x3084;
+ WFIFOL(inter_fd,2) = sd->status.account_id;
+ WFIFOL(inter_fd,6) = sd->status.char_id;
+ memcpy(WFIFOP(inter_fd,10),name, NAME_LENGTH);
+ WFIFOSET(inter_fd,NAME_LENGTH+11);
+ return 0;
+}
+
+
+// GMメッセージを送信
+int intif_GMmessage(char* mes,int len,int flag)
+{
+ int lp = (flag&0x10) ? 8 : 4;
+
+ // Send to the local players
+ clif_GMmessage(NULL, mes, len, flag);
+
+ if (CheckForCharServer())
+ return 0;
+
+ if (other_mapserver_count < 1)
+ return 0; //No need to send.
+
+ WFIFOHEAD(inter_fd,lp + len + 4);
+ WFIFOW(inter_fd,0) = 0x3000;
+ WFIFOW(inter_fd,2) = lp + len + 4;
+ WFIFOL(inter_fd,4) = 0xFF000000; //"invalid" color signals standard broadcast.
+ WFIFOL(inter_fd,8) = 0x65756c62;
+ memcpy(WFIFOP(inter_fd,4+lp), mes, len);
+ WFIFOSET(inter_fd, WFIFOW(inter_fd,2));
+ return 0;
+}
+
+int intif_announce(char* mes,int len, unsigned long color, int flag)
+{
+ // Send to the local players
+ if(color == 0xFE000000) // This is main chat message [LuzZza]
+ clif_MainChatMessage(mes);
+ else
+ clif_announce(NULL, mes, len, color, flag);
+
+ if (CheckForCharServer())
+ return 0;
+
+ if (other_mapserver_count < 1)
+ return 0; //No need to send.
+
+ WFIFOHEAD(inter_fd, 8 + len);
+ WFIFOW(inter_fd,0) = 0x3000;
+ WFIFOW(inter_fd,2) = 8 + len;
+ WFIFOL(inter_fd,4) = color;
+ memcpy(WFIFOP(inter_fd,8), mes, len);
+ WFIFOSET(inter_fd, WFIFOW(inter_fd,2));
+ return 0;
+}
+
+// The transmission of Wisp/Page to inter-server (player not found on this server)
+int intif_wis_message(struct map_session_data *sd, char *nick, char *mes, int mes_len) {
+ nullpo_retr(0, sd);
+ if (CheckForCharServer())
+ return 0;
+
+ if (other_mapserver_count < 1)
+ { //Character not found.
+ clif_wis_end(sd->fd, 1);
+ return 0;
+ }
+
+ WFIFOHEAD(inter_fd,mes_len + 52);
+ WFIFOW(inter_fd,0) = 0x3001;
+ WFIFOW(inter_fd,2) = mes_len + 52;
+ memcpy(WFIFOP(inter_fd,4), sd->status.name, NAME_LENGTH);
+ memcpy(WFIFOP(inter_fd,4+NAME_LENGTH), nick, NAME_LENGTH);
+ memcpy(WFIFOP(inter_fd,4+2*NAME_LENGTH), mes, mes_len);
+ WFIFOSET(inter_fd, WFIFOW(inter_fd,2));
+
+ if (battle_config.etc_log)
+ ShowInfo("intif_wis_message from %s to %s (message: '%s')\n", sd->status.name, nick, mes);
+
+ return 0;
+}
+
+// The reply of Wisp/page
+int intif_wis_replay(int id, int flag) {
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,7);
+ WFIFOW(inter_fd,0) = 0x3002;
+ WFIFOL(inter_fd,2) = id;
+ WFIFOB(inter_fd,6) = flag; // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
+ WFIFOSET(inter_fd,7);
+
+ if (battle_config.etc_log)
+ ShowInfo("intif_wis_replay: id: %d, flag:%d\n", id, flag);
+
+ return 0;
+}
+
+// The transmission of GM only Wisp/Page from server to inter-server
+int intif_wis_message_to_gm(char *Wisp_name, int min_gm_level, char *mes) {
+ int mes_len;
+ if (CheckForCharServer())
+ return 0;
+ mes_len = strlen(mes) + 1; // + null
+ WFIFOHEAD(inter_fd, mes_len + 30);
+ WFIFOW(inter_fd,0) = 0x3003;
+ WFIFOW(inter_fd,2) = mes_len + 30;
+ memcpy(WFIFOP(inter_fd,4), Wisp_name, NAME_LENGTH);
+ WFIFOW(inter_fd,4+NAME_LENGTH) = (short)min_gm_level;
+ memcpy(WFIFOP(inter_fd,6+NAME_LENGTH), mes, mes_len);
+ WFIFOSET(inter_fd, WFIFOW(inter_fd,2));
+
+ if (battle_config.etc_log)
+ ShowNotice("intif_wis_message_to_gm: from: '%s', min level: %d, message: '%s'.\n", Wisp_name, min_gm_level, mes);
+
+ return 0;
+}
+
+int intif_regtostr(char* str, struct global_reg *reg, int qty) {
+ int len =0, i;
+
+ for (i = 0; i < qty; i++) {
+ len+= sprintf(str+len, "%s", reg[i].str)+1; //We add 1 to consider the '\0' in place.
+ len+= sprintf(str+len, "%s", reg[i].value)+1;
+ }
+ return len;
+}
+
+//Request for saving registry values.
+int intif_saveregistry(struct map_session_data *sd, int type)
+{
+ struct global_reg *reg;
+ int count;
+
+ if (CheckForCharServer())
+ return -1;
+
+ switch (type) {
+ case 3: //Character reg
+ reg = sd->save_reg.global;
+ count = sd->save_reg.global_num;
+ sd->state.reg_dirty &= ~0x4;
+ break;
+ case 2: //Account reg
+ reg = sd->save_reg.account;
+ count = sd->save_reg.account_num;
+ sd->state.reg_dirty &= ~0x2;
+ break;
+ case 1: //Account2 reg
+ reg = sd->save_reg.account2;
+ count = sd->save_reg.account2_num;
+ sd->state.reg_dirty &= ~0x1;
+ break;
+ default: //Broken code?
+ if (battle_config.error_log)
+ ShowError("intif_saveregistry: Invalid type %d\n", type);
+ return -1;
+ }
+ WFIFOHEAD(inter_fd, 288 * MAX_REG_NUM+13);
+ WFIFOW(inter_fd,0)=0x3004;
+ WFIFOL(inter_fd,4)=sd->status.account_id;
+ WFIFOL(inter_fd,8)=sd->status.char_id;
+ WFIFOB(inter_fd,12)=type;
+ if(count ==0){
+ WFIFOW(inter_fd,2)=13;
+ }else{
+ int i,p;
+ for (p=13,i = 0; i < count; i++) {
+ if (reg[i].str[0] && reg[i].value != 0) {
+ p+= sprintf(WFIFOP(inter_fd,p), "%s", reg[i].str)+1; //We add 1 to consider the '\0' in place.
+ p+= sprintf(WFIFOP(inter_fd,p), "%s", reg[i].value)+1;
+ }
+ }
+ WFIFOW(inter_fd,2)=p;
+ }
+ WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
+ return 0;
+}
+
+//Request the registries for this player.
+int intif_request_registry(struct map_session_data *sd, int flag)
+{
+ nullpo_retr(0, sd);
+
+ sd->save_reg.account2_num = -1;
+ sd->save_reg.account_num = -1;
+ sd->save_reg.global_num = -1;
+
+ if (CheckForCharServer())
+ return 0;
+
+ WFIFOHEAD(inter_fd,6);
+ WFIFOW(inter_fd,0) = 0x3005;
+ WFIFOL(inter_fd,2) = sd->status.account_id;
+ WFIFOL(inter_fd,6) = sd->status.char_id;
+ WFIFOB(inter_fd,10) = (flag&1?1:0); //Request Acc Reg 2
+ WFIFOB(inter_fd,11) = (flag&2?1:0); //Request Acc Reg
+ WFIFOB(inter_fd,12) = (flag&4?1:0); //Request Char Reg
+ WFIFOSET(inter_fd,13);
+
+ return 0;
+}
+
+// 倉庫データ要求
+int intif_request_storage(int account_id)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,6);
+ WFIFOW(inter_fd,0) = 0x3010;
+ WFIFOL(inter_fd,2) = account_id;
+ WFIFOSET(inter_fd,6);
+ return 0;
+}
+// 倉庫データ送信
+int intif_send_storage(struct storage *stor)
+{
+ if (CheckForCharServer())
+ return 0;
+ nullpo_retr(0, stor);
+ WFIFOHEAD(inter_fd,sizeof(struct storage)+8);
+ WFIFOW(inter_fd,0) = 0x3011;
+ WFIFOW(inter_fd,2) = sizeof(struct storage)+8;
+ WFIFOL(inter_fd,4) = stor->account_id;
+ memcpy( WFIFOP(inter_fd,8),stor, sizeof(struct storage) );
+ WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
+ return 0;
+}
+
+int intif_request_guild_storage(int account_id,int guild_id)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,10);
+ WFIFOW(inter_fd,0) = 0x3018;
+ WFIFOL(inter_fd,2) = account_id;
+ WFIFOL(inter_fd,6) = guild_id;
+ WFIFOSET(inter_fd,10);
+ return 0;
+}
+int intif_send_guild_storage(int account_id,struct guild_storage *gstor)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,sizeof(struct guild_storage)+12);
+ WFIFOW(inter_fd,0) = 0x3019;
+ WFIFOW(inter_fd,2) = sizeof(struct guild_storage)+12;
+ WFIFOL(inter_fd,4) = account_id;
+ WFIFOL(inter_fd,8) = gstor->guild_id;
+ memcpy( WFIFOP(inter_fd,12),gstor, sizeof(struct guild_storage) );
+ WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
+ return 0;
+}
+
+// パーティ作成要求
+int intif_create_party(struct party_member *member,char *name,int item,int item2)
+{
+ if (CheckForCharServer())
+ return 0;
+ nullpo_retr(0, member);
+
+ WFIFOHEAD(inter_fd,64);
+ WFIFOW(inter_fd,0) = 0x3020;
+ WFIFOW(inter_fd,2) = 30+sizeof(struct party_member);
+ memcpy(WFIFOP(inter_fd,4),name, NAME_LENGTH);
+ WFIFOB(inter_fd,28)= item;
+ WFIFOB(inter_fd,29)= item2;
+ memcpy(WFIFOP(inter_fd,30), member, sizeof(struct party_member));
+ WFIFOSET(inter_fd,WFIFOW(inter_fd, 2));
+ return 0;
+}
+// パーティ情報要求
+int intif_request_partyinfo(int party_id)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,6);
+ WFIFOW(inter_fd,0) = 0x3021;
+ WFIFOL(inter_fd,2) = party_id;
+ WFIFOSET(inter_fd,6);
+// if(battle_config.etc_log)
+// printf("intif: request party info\n");
+ return 0;
+}
+// パーティ追加要求
+int intif_party_addmember(int party_id,struct party_member *member)
+{
+ if (CheckForCharServer())
+ return 0;
+
+ WFIFOHEAD(inter_fd,42);
+ WFIFOW(inter_fd,0)=0x3022;
+ WFIFOW(inter_fd,2)=8+sizeof(struct party_member);
+ WFIFOL(inter_fd,4)=party_id;
+ memcpy(WFIFOP(inter_fd,8),member,sizeof(struct party_member));
+ WFIFOSET(inter_fd,WFIFOW(inter_fd, 2));
+ return 1;
+}
+// パーティ設定変更
+int intif_party_changeoption(int party_id,int account_id,int exp,int item)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,14);
+ WFIFOW(inter_fd,0)=0x3023;
+ WFIFOL(inter_fd,2)=party_id;
+ WFIFOL(inter_fd,6)=account_id;
+ WFIFOW(inter_fd,10)=exp;
+ WFIFOW(inter_fd,12)=item;
+ WFIFOSET(inter_fd,14);
+ return 0;
+}
+// パーティ脱退要求
+int intif_party_leave(int party_id,int account_id, int char_id)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,14);
+ WFIFOW(inter_fd,0)=0x3024;
+ WFIFOL(inter_fd,2)=party_id;
+ WFIFOL(inter_fd,6)=account_id;
+ WFIFOL(inter_fd,10)=char_id;
+ WFIFOSET(inter_fd,14);
+ return 0;
+}
+// パーティ移動要求
+int intif_party_changemap(struct map_session_data *sd,int online)
+{
+ if (CheckForCharServer())
+ return 0;
+ if(!sd)
+ return 0;
+
+ WFIFOHEAD(inter_fd,19);
+ WFIFOW(inter_fd,0)=0x3025;
+ WFIFOL(inter_fd,2)=sd->status.party_id;
+ WFIFOL(inter_fd,6)=sd->status.account_id;
+ WFIFOL(inter_fd,10)=sd->status.char_id;
+ WFIFOW(inter_fd,14)=sd->mapindex;
+ WFIFOB(inter_fd,16)=online;
+ WFIFOW(inter_fd,17)=sd->status.base_level;
+ WFIFOSET(inter_fd,19);
+ return 1;
+}
+// パーティー解散要求
+int intif_break_party(int party_id)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,6);
+ WFIFOW(inter_fd,0)=0x3026;
+ WFIFOL(inter_fd,2)=party_id;
+ WFIFOSET(inter_fd,6);
+ return 0;
+}
+// パーティ会話送信
+int intif_party_message(int party_id,int account_id,char *mes,int len)
+{
+ if (CheckForCharServer())
+ return 0;
+
+ if (other_mapserver_count < 1)
+ return 0; //No need to send.
+
+ WFIFOHEAD(inter_fd,len + 12);
+ WFIFOW(inter_fd,0)=0x3027;
+ WFIFOW(inter_fd,2)=len+12;
+ WFIFOL(inter_fd,4)=party_id;
+ WFIFOL(inter_fd,8)=account_id;
+ memcpy(WFIFOP(inter_fd,12),mes,len);
+ WFIFOSET(inter_fd,len+12);
+ return 0;
+}
+// パーティ競合チェック要求
+int intif_party_checkconflict(int party_id,int account_id,int char_id)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,10 + NAME_LENGTH);
+ WFIFOW(inter_fd,0)=0x3028;
+ WFIFOL(inter_fd,2)=party_id;
+ WFIFOL(inter_fd,6)=account_id;
+ WFIFOL(inter_fd,10)=char_id;
+ WFIFOSET(inter_fd,14);
+ return 0;
+}
+
+int intif_party_leaderchange(int party_id,int account_id,int char_id)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,14);
+ WFIFOW(inter_fd,0)=0x3029;
+ WFIFOL(inter_fd,2)=party_id;
+ WFIFOL(inter_fd,6)=account_id;
+ WFIFOL(inter_fd,10)=char_id;
+ WFIFOSET(inter_fd,14);
+ return 0;
+}
+
+
+// ギルド作成要求
+int intif_guild_create(const char *name,const struct guild_member *master)
+{
+ if (CheckForCharServer())
+ return 0;
+ nullpo_retr(0, master);
+
+ WFIFOHEAD(inter_fd,sizeof(struct guild_member)+(8+NAME_LENGTH));
+ WFIFOW(inter_fd,0)=0x3030;
+ WFIFOW(inter_fd,2)=sizeof(struct guild_member)+(8+NAME_LENGTH);
+ WFIFOL(inter_fd,4)=master->account_id;
+ memcpy(WFIFOP(inter_fd,8),name,NAME_LENGTH);
+ memcpy(WFIFOP(inter_fd,8+NAME_LENGTH),master,sizeof(struct guild_member));
+ WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
+ return 0;
+}
+// ギルド情報要求
+int intif_guild_request_info(int guild_id)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,6);
+ WFIFOW(inter_fd,0) = 0x3031;
+ WFIFOL(inter_fd,2) = guild_id;
+ WFIFOSET(inter_fd,6);
+ return 0;
+}
+// ギルドメンバ追加要求
+int intif_guild_addmember(int guild_id,struct guild_member *m)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,sizeof(struct guild_member)+8);
+ WFIFOW(inter_fd,0) = 0x3032;
+ WFIFOW(inter_fd,2) = sizeof(struct guild_member)+8;
+ WFIFOL(inter_fd,4) = guild_id;
+ memcpy(WFIFOP(inter_fd,8),m,sizeof(struct guild_member));
+ WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
+ return 0;
+}
+
+int intif_guild_change_gm(int guild_id, const char* name, int len)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd, len + 8);
+ WFIFOW(inter_fd, 0)=0x3033;
+ WFIFOW(inter_fd, 2)=len+8;
+ WFIFOL(inter_fd, 4)=guild_id;
+ memcpy(WFIFOP(inter_fd,8),name,len);
+ WFIFOSET(inter_fd,len+8);
+ return 0;
+}
+
+// ギルドメンバ脱退/追放要求
+int intif_guild_leave(int guild_id,int account_id,int char_id,int flag,const char *mes)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd, 55);
+ WFIFOW(inter_fd, 0) = 0x3034;
+ WFIFOL(inter_fd, 2) = guild_id;
+ WFIFOL(inter_fd, 6) = account_id;
+ WFIFOL(inter_fd,10) = char_id;
+ WFIFOB(inter_fd,14) = flag;
+ memcpy(WFIFOP(inter_fd,15),mes,40);
+ WFIFOSET(inter_fd,55);
+ return 0;
+}
+// ギルドメンバのオンライン状況/Lv更新要求
+int intif_guild_memberinfoshort(int guild_id,
+ int account_id,int char_id,int online,int lv,int class_)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd, 19);
+ WFIFOW(inter_fd, 0) = 0x3035;
+ WFIFOL(inter_fd, 2) = guild_id;
+ WFIFOL(inter_fd, 6) = account_id;
+ WFIFOL(inter_fd,10) = char_id;
+ WFIFOB(inter_fd,14) = online;
+ WFIFOW(inter_fd,15) = lv;
+ WFIFOW(inter_fd,17) = class_;
+ WFIFOSET(inter_fd,19);
+ return 0;
+}
+// ギルド解散通知
+int intif_guild_break(int guild_id)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd, 6);
+ WFIFOW(inter_fd, 0) = 0x3036;
+ WFIFOL(inter_fd, 2) = guild_id;
+ WFIFOSET(inter_fd,6);
+ return 0;
+}
+// ギルド会話送信
+int intif_guild_message(int guild_id,int account_id,char *mes,int len)
+{
+ if (CheckForCharServer())
+ return 0;
+
+ if (other_mapserver_count < 1)
+ return 0; //No need to send.
+
+ WFIFOHEAD(inter_fd, len + 12);
+ WFIFOW(inter_fd,0)=0x3037;
+ WFIFOW(inter_fd,2)=len+12;
+ WFIFOL(inter_fd,4)=guild_id;
+ WFIFOL(inter_fd,8)=account_id;
+ memcpy(WFIFOP(inter_fd,12),mes,len);
+ WFIFOSET(inter_fd,len+12);
+
+ return 0;
+}
+// ギルド競合チェック要求
+int intif_guild_checkconflict(int guild_id,int account_id,int char_id)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd, 14);
+ WFIFOW(inter_fd, 0)=0x3038;
+ WFIFOL(inter_fd, 2)=guild_id;
+ WFIFOL(inter_fd, 6)=account_id;
+ WFIFOL(inter_fd,10)=char_id;
+ WFIFOSET(inter_fd,14);
+ return 0;
+}
+// ギルド基本情報変更要求
+int intif_guild_change_basicinfo(int guild_id,int type,const void *data,int len)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd, len + 10);
+ WFIFOW(inter_fd,0)=0x3039;
+ WFIFOW(inter_fd,2)=len+10;
+ WFIFOL(inter_fd,4)=guild_id;
+ WFIFOW(inter_fd,8)=type;
+ memcpy(WFIFOP(inter_fd,10),data,len);
+ WFIFOSET(inter_fd,len+10);
+ return 0;
+}
+// ギルドメンバ情報変更要求
+int intif_guild_change_memberinfo(int guild_id,int account_id,int char_id,
+ int type,const void *data,int len)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd, len + 18);
+ WFIFOW(inter_fd, 0)=0x303a;
+ WFIFOW(inter_fd, 2)=len+18;
+ WFIFOL(inter_fd, 4)=guild_id;
+ WFIFOL(inter_fd, 8)=account_id;
+ WFIFOL(inter_fd,12)=char_id;
+ WFIFOW(inter_fd,16)=type;
+ memcpy(WFIFOP(inter_fd,18),data,len);
+ WFIFOSET(inter_fd,len+18);
+ return 0;
+}
+// ギルド役職変更要求
+int intif_guild_position(int guild_id,int idx,struct guild_position *p)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd, sizeof(struct guild_position)+12);
+ WFIFOW(inter_fd,0)=0x303b;
+ WFIFOW(inter_fd,2)=sizeof(struct guild_position)+12;
+ WFIFOL(inter_fd,4)=guild_id;
+ WFIFOL(inter_fd,8)=idx;
+ memcpy(WFIFOP(inter_fd,12),p,sizeof(struct guild_position));
+ WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
+ return 0;
+}
+// ギルドスキルアップ要求
+int intif_guild_skillup(int guild_id,int skill_num,int account_id,int flag)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,14);
+ WFIFOW(inter_fd, 0)=0x303c;
+ WFIFOL(inter_fd, 2)=guild_id;
+ WFIFOL(inter_fd, 6)=skill_num;
+ WFIFOL(inter_fd,10)=account_id;
+ //WFIFOL(inter_fd,14)=flag;
+ WFIFOSET(inter_fd,14);
+ return 0;
+}
+// ギルド同盟/敵対要求
+int intif_guild_alliance(int guild_id1,int guild_id2,int account_id1,int account_id2,int flag)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,19);
+ WFIFOW(inter_fd, 0)=0x303d;
+ WFIFOL(inter_fd, 2)=guild_id1;
+ WFIFOL(inter_fd, 6)=guild_id2;
+ WFIFOL(inter_fd,10)=account_id1;
+ WFIFOL(inter_fd,14)=account_id2;
+ WFIFOB(inter_fd,18)=flag;
+ WFIFOSET(inter_fd,19);
+ return 0;
+}
+// ギルド告知変更要求
+int intif_guild_notice(int guild_id,const char *mes1,const char *mes2)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,186);
+ WFIFOW(inter_fd,0)=0x303e;
+ WFIFOL(inter_fd,2)=guild_id;
+ memcpy(WFIFOP(inter_fd,6),mes1,60);
+ memcpy(WFIFOP(inter_fd,66),mes2,120);
+ WFIFOSET(inter_fd,186);
+ return 0;
+}
+// ギルドエンブレム変更要求
+int intif_guild_emblem(int guild_id,int len,const char *data)
+{
+ if (CheckForCharServer())
+ return 0;
+ if(guild_id<=0 || len<0 || len>2000)
+ return 0;
+ WFIFOHEAD(inter_fd,len + 12);
+ WFIFOW(inter_fd,0)=0x303f;
+ WFIFOW(inter_fd,2)=len+12;
+ WFIFOL(inter_fd,4)=guild_id;
+ WFIFOL(inter_fd,8)=0;
+ memcpy(WFIFOP(inter_fd,12),data,len);
+ WFIFOSET(inter_fd,len+12);
+ return 0;
+}
+//現在のギルド城占領ギルドを調べる
+int intif_guild_castle_dataload(int castle_id,int index)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,5);
+ WFIFOW(inter_fd,0)=0x3040;
+ WFIFOW(inter_fd,2)=castle_id;
+ WFIFOB(inter_fd,4)=index;
+ WFIFOSET(inter_fd,5);
+ return 0;
+}
+
+//ギルド城占領ギルド変更要求
+int intif_guild_castle_datasave(int castle_id,int index, int value)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd,9);
+ WFIFOW(inter_fd,0)=0x3041;
+ WFIFOW(inter_fd,2)=castle_id;
+ WFIFOB(inter_fd,4)=index;
+ WFIFOL(inter_fd,5)=value;
+ WFIFOSET(inter_fd,9);
+ return 0;
+}
+
+//-----------------------------------------------------------------
+// Homunculus Packets send to Inter server [albator]
+//-----------------------------------------------------------------
+
+int intif_homunculus_create(int account_id, struct s_homunculus *sh)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd, sizeof(struct s_homunculus)+8);
+ WFIFOW(inter_fd,0) = 0x3090;
+ WFIFOW(inter_fd,2) = sizeof(struct s_homunculus)+8;
+ WFIFOL(inter_fd,4) = account_id;
+ memcpy(WFIFOP(inter_fd,8),sh,sizeof(struct s_homunculus));
+ WFIFOSET(inter_fd, WFIFOW(inter_fd,2));
+ return 0;
+}
+
+int intif_homunculus_requestload(int account_id, int homun_id)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd, 10);
+ WFIFOW(inter_fd,0) = 0x3091;
+ WFIFOL(inter_fd,2) = account_id;
+ WFIFOL(inter_fd,6) = homun_id;
+ WFIFOSET(inter_fd, 10);
+ return 1;
+}
+
+int intif_homunculus_requestsave(int account_id, struct s_homunculus* sh)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd, sizeof(struct s_homunculus)+8);
+ WFIFOW(inter_fd,0) = 0x3092;
+ WFIFOW(inter_fd,2) = sizeof(struct s_homunculus)+8;
+ WFIFOL(inter_fd,4) = account_id;
+ memcpy(WFIFOP(inter_fd,8),sh,sizeof(struct s_homunculus));
+ WFIFOSET(inter_fd, WFIFOW(inter_fd,2));
+ return 0;
+
+}
+
+int intif_homunculus_requestdelete(int homun_id)
+{
+ if (CheckForCharServer())
+ return 0;
+ WFIFOHEAD(inter_fd, 6);
+ WFIFOW(inter_fd, 0) = 0x3093;
+ WFIFOL(inter_fd,2) = homun_id;
+ WFIFOSET(inter_fd,6);
+ return 0;
+
+}
+
+
+//-----------------------------------------------------------------
+// Packets receive from inter server
+
+// Wisp/Page reception
+int intif_parse_WisMessage(int fd) { // rewritten by [Yor]
+ struct map_session_data* sd;
+ char *wisp_source;
+ char name[NAME_LENGTH];
+ int id, i;
+ RFIFOHEAD(fd);
+ id=RFIFOL(fd,4);
+
+ memcpy(name, RFIFOP(fd,32), NAME_LENGTH);
+ name[NAME_LENGTH-1] = '\0'; //In case name arrived without it's terminator. [Skotlex]
+ sd = map_nick2sd(name);
+ if(sd == NULL || strcmp(sd->status.name, name) != 0)
+ { //Not found
+ intif_wis_replay(id,1);
+ return 0;
+ }
+ if(sd->state.ignoreAll) {
+ intif_wis_replay(id, 2);
+ return 0;
+ }
+ wisp_source = (char *) RFIFOP(fd,8); // speed up [Yor]
+ for(i=0; i < MAX_IGNORE_LIST &&
+ sd->ignore[i].name[0] != '\0' &&
+ strcmp(sd->ignore[i].name, wisp_source) != 0
+ ; i++);
+
+ if (i < MAX_IGNORE_LIST && sd->ignore[i].name[0] != '\0')
+ { //Ignored
+ intif_wis_replay(id, 2);
+ return 0;
+ }
+ //Success to send whisper.
+ clif_wis_message(sd->fd, wisp_source, (char*)RFIFOP(fd,56),RFIFOW(fd,2)-56);
+ intif_wis_replay(id,0); // 送信成功
+ return 0;
+}
+
+// Wisp/page transmission result reception
+int intif_parse_WisEnd(int fd) {
+ struct map_session_data* sd;
+ RFIFOHEAD(fd);
+
+ if (battle_config.etc_log)
+ ShowInfo("intif_parse_wisend: player: %s, flag: %d\n", RFIFOP(fd,2), RFIFOB(fd,26)); // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
+ sd = (struct map_session_data *)map_nick2sd((char *) RFIFOP(fd,2));
+ if (sd != NULL)
+ clif_wis_end(sd->fd, RFIFOB(fd,26));
+
+ return 0;
+}
+
+static int mapif_parse_WisToGM_sub(struct map_session_data* sd,va_list va) {
+ int min_gm_level = va_arg(va, int);
+ char *wisp_name;
+ char *message;
+ int len;
+ if (pc_isGM(sd) < min_gm_level) return 0;
+ wisp_name = va_arg(va, char*);
+ message = va_arg(va, char*);
+ len = va_arg(va, int);
+ clif_wis_message(sd->fd, wisp_name, message, len);
+ return 1;
+}
+
+// Received wisp message from map-server via char-server for ALL gm
+int mapif_parse_WisToGM(int fd) { // 0x3003/0x3803 <packet_len>.w <wispname>.24B <min_gm_level>.w <message>.?B
+ int min_gm_level, mes_len;
+ char Wisp_name[NAME_LENGTH];
+ char mbuf[255];
+ char *message;
+ RFIFOHEAD(fd);
+
+ mes_len = RFIFOW(fd,2) - 30;
+ message = (char *) (mes_len >= 255 ? (char *) aMallocA(mes_len) : mbuf);
+
+ min_gm_level = (int)RFIFOW(fd,28);
+ memcpy(Wisp_name, RFIFOP(fd,4), NAME_LENGTH);
+ Wisp_name[NAME_LENGTH-1] = '\0';
+ memcpy(message, RFIFOP(fd,30), mes_len);
+ message[mes_len-1] = '\0';
+ // information is sended to all online GM
+ clif_foreachclient(mapif_parse_WisToGM_sub, min_gm_level, Wisp_name, message, mes_len);
+
+ if (message != mbuf)
+ aFree(message);
+ return 0;
+}
+
+// アカウント変数通知
+int intif_parse_Registers(int fd) {
+ int j,p,len,max, flag;
+ struct map_session_data *sd;
+ struct global_reg *reg;
+ int *qty;
+ RFIFOHEAD(fd);
+
+ if( (sd=map_id2sd(RFIFOL(fd,4)))==NULL ||
+ !session_isValid(sd->fd)) // Invalid session
+ return 1;
+
+ if (RFIFOB(fd,12) == 3 && sd->status.char_id != RFIFOL(fd,8))
+ return 1; //Character registry from another character.
+
+ flag = (sd->save_reg.global_num == -1 || sd->save_reg.account_num == -1 || sd->save_reg.account2_num == -1);
+
+ switch (RFIFOB(fd,12)) {
+ case 3: //Character Registry
+ reg = sd->save_reg.global;
+ qty = &sd->save_reg.global_num;
+ max = GLOBAL_REG_NUM;
+ break;
+ case 2: //Account Registry
+ reg = sd->save_reg.account;
+ qty = &sd->save_reg.account_num;
+ max = ACCOUNT_REG_NUM;
+ break;
+ case 1: //Account2 Registry
+ reg = sd->save_reg.account2;
+ qty = &sd->save_reg.account2_num;
+ max = ACCOUNT_REG2_NUM;
+ break;
+ default:
+ if (battle_config.error_log)
+ ShowError("intif_parse_Registers: Unrecognized type %d\n",RFIFOB(fd,12));
+ return 0;
+ }
+ for(j=0,p=13;j<max && p<RFIFOW(fd,2);j++){
+ sscanf(RFIFOP(fd,p), "%31c%n", reg[j].str,&len);
+ reg[j].str[len]='\0';
+ p += len+1; //+1 to skip the '\0' between strings.
+ sscanf(RFIFOP(fd,p), "%255c%n", reg[j].value,&len);
+ reg[j].value[len]='\0';
+ p += len+1;
+ }
+ *qty = j;
+
+ if (flag && sd->save_reg.global_num > -1 && sd->save_reg.account_num > -1 && sd->save_reg.account2_num > -1)
+ pc_reg_received(sd); //Received all registry values, execute init scripts and what-not. [Skotlex]
+ return 1;
+}
+
+// 倉庫データ受信
+int intif_parse_LoadStorage(int fd) {
+ struct storage *stor;
+ struct map_session_data *sd;
+ RFIFOHEAD(fd);
+
+ sd=map_id2sd( RFIFOL(fd,4) );
+ if(sd==NULL){
+ if(battle_config.error_log)
+ ShowError("intif_parse_LoadStorage: user not found %d\n",RFIFOL(fd,4));
+ return 1;
+ }
+
+ if (sd->state.finalsave || //Player is already scheduled to leave the server.
+ !session_isValid(sd->fd)) // Invalid session
+ return 1;
+
+ stor = account2storage( RFIFOL(fd,4));
+
+ if (stor->storage_status == 1) { // Already open.. lets ignore this update
+ if (battle_config.error_log)
+ ShowWarning("intif_parse_LoadStorage: storage received for a client already open (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
+ return 1;
+ }
+ if (stor->dirty) { // Already have storage, and it has been modified and not saved yet! Exploit! [Skotlex]
+ if (battle_config.error_log)
+ ShowWarning("intif_parse_LoadStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
+ return 1;
+ }
+ if (RFIFOW(fd,2)-8 != sizeof(struct storage)) {
+ if (battle_config.error_log)
+ ShowError("intif_parse_LoadStorage: data size error %d %d\n", RFIFOW(fd,2)-8, sizeof(struct storage));
+ return 1;
+ }
+ if(battle_config.save_log)
+ ShowInfo("intif_openstorage: %d\n",RFIFOL(fd,4) );
+ memcpy(stor,RFIFOP(fd,8),sizeof(struct storage));
+ stor->dirty=0;
+ stor->storage_status=1;
+ sd->state.storage_flag = 1;
+ clif_storagelist(sd,stor);
+ clif_updatestorageamount(sd,stor);
+
+ return 0;
+}
+
+// 倉庫データ送信成功
+int intif_parse_SaveStorage(int fd)
+{
+ RFIFOHEAD(fd);
+ if(battle_config.save_log)
+ ShowInfo("intif_savestorage: done %d %d\n",RFIFOL(fd,2),RFIFOB(fd,6) );
+ storage_storage_saved(RFIFOL(fd,2));
+ return 0;
+}
+
+int intif_parse_LoadGuildStorage(int fd)
+{
+ struct guild_storage *gstor;
+ struct map_session_data *sd;
+ int guild_id;
+ RFIFOHEAD(fd);
+ guild_id = RFIFOL(fd,8);
+ if(guild_id <= 0)
+ return 1;
+ sd=map_id2sd( RFIFOL(fd,4) );
+ if(sd==NULL){
+ if(battle_config.error_log)
+ ShowError("intif_parse_LoadGuildStorage: user not found %d\n",RFIFOL(fd,4));
+ return 1;
+ } else if(!session_isValid(sd->fd))
+ return 1; // Invalid session
+
+ gstor=guild2storage(guild_id);
+ if(!gstor) {
+ if(battle_config.error_log)
+ ShowWarning("intif_parse_LoadGuildStorage: error guild_id %d not exist\n",guild_id);
+ return 1;
+ }
+ if (gstor->storage_status == 1) { // Already open.. lets ignore this update
+ if (battle_config.error_log)
+ ShowWarning("intif_parse_LoadGuildStorage: storage received for a client already open (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
+ return 1;
+ }
+ if (gstor->dirty) { // Already have storage, and it has been modified and not saved yet! Exploit! [Skotlex]
+ if (battle_config.error_log)
+ ShowWarning("intif_parse_LoadGuildStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
+ return 1;
+ }
+ if( RFIFOW(fd,2)-12 != sizeof(struct guild_storage) ){
+ gstor->storage_status = 0;
+ if(battle_config.error_log)
+ ShowError("intif_parse_LoadGuildStorage: data size error %d %d\n",RFIFOW(fd,2)-12 , sizeof(struct guild_storage));
+ return 1;
+ }
+ if(battle_config.save_log)
+ ShowInfo("intif_open_guild_storage: %d\n",RFIFOL(fd,4) );
+ memcpy(gstor,RFIFOP(fd,12),sizeof(struct guild_storage));
+ gstor->storage_status = 1;
+ sd->state.storage_flag = 2;
+ clif_guildstoragelist(sd,gstor);
+ clif_updateguildstorageamount(sd,gstor);
+ return 0;
+}
+int intif_parse_SaveGuildStorage(int fd)
+{
+ RFIFOHEAD(fd);
+ if(battle_config.save_log) {
+ ShowInfo("intif_save_guild_storage: done %d %d %d\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOB(fd,10) );
+ }
+ storage_guild_storagesaved(/*RFIFOL(fd,2), */RFIFOL(fd,6));
+ return 0;
+}
+
+// パーティ作成可否
+int intif_parse_PartyCreated(int fd)
+{
+ RFIFOHEAD(fd);
+ if(battle_config.etc_log)
+ ShowInfo("intif: party created by account %d\n\n", RFIFOL(fd,2));
+ party_created(RFIFOL(fd,2), RFIFOL(fd,6),RFIFOB(fd,10),RFIFOL(fd,11), (char *)RFIFOP(fd,15));
+ return 0;
+}
+// パーティ情報
+int intif_parse_PartyInfo(int fd)
+{
+ RFIFOHEAD(fd);
+ if( RFIFOW(fd,2)==8){
+ if(battle_config.error_log)
+ ShowWarning("intif: party noinfo %d\n",RFIFOL(fd,4));
+ party_recv_noinfo(RFIFOL(fd,4));
+ return 0;
+ }
+
+// printf("intif: party info %d\n",RFIFOL(fd,4));
+ if( RFIFOW(fd,2)!=sizeof(struct party)+4 ){
+ if(battle_config.error_log)
+ ShowError("intif: party info : data size error %d %d %d\n",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct party)+4);
+ }
+ party_recv_info((struct party *)RFIFOP(fd,4));
+ return 0;
+}
+// パーティ追加通知
+int intif_parse_PartyMemberAdded(int fd)
+{
+ RFIFOHEAD(fd);
+ if(battle_config.etc_log)
+ ShowInfo("intif: party member added Party (%d), Account(%d), Char(%d)\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
+ party_member_added(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10), RFIFOB(fd, 14));
+ return 0;
+}
+// パーティ設定変更通知
+int intif_parse_PartyOptionChanged(int fd)
+{
+ RFIFOHEAD(fd);
+ party_optionchanged(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOW(fd,10),RFIFOW(fd,12),RFIFOB(fd,14));
+ return 0;
+}
+// パーティ脱退通知
+int intif_parse_PartyMemberLeaved(int fd)
+{
+ RFIFOHEAD(fd);
+ if(battle_config.etc_log)
+ ShowInfo("intif: party member leaved: Party(%d), Account(%d), Char(%d)\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
+ party_member_leaved(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
+ return 0;
+}
+// パーティ解散通知
+int intif_parse_PartyBroken(int fd)
+{
+ RFIFOHEAD(fd);
+ party_broken(RFIFOL(fd,2));
+ return 0;
+}
+// パーティ移動通知
+int intif_parse_PartyMove(int fd)
+{
+ RFIFOHEAD(fd);
+ party_recv_movemap(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOW(fd,14),RFIFOB(fd,16),RFIFOW(fd,17));
+ return 0;
+}
+// パーティメッセージ
+int intif_parse_PartyMessage(int fd)
+{
+ RFIFOHEAD(fd);
+// if(battle_config.etc_log)
+// printf("intif_parse_PartyMessage: %s\n",RFIFOP(fd,12));
+ party_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12);
+ return 0;
+}
+
+// ギルド作成可否
+int intif_parse_GuildCreated(int fd)
+{
+ RFIFOHEAD(fd);
+ guild_created(RFIFOL(fd,2),RFIFOL(fd,6));
+ return 0;
+}
+// ギルド情報
+int intif_parse_GuildInfo(int fd)
+{
+ RFIFOHEAD(fd);
+ if( RFIFOW(fd,2)==8){
+ if(battle_config.error_log)
+ ShowWarning("intif: guild noinfo %d\n",RFIFOL(fd,4));
+ guild_recv_noinfo(RFIFOL(fd,4));
+ return 0;
+ }
+
+// if(battle_config.etc_log)
+// printf("intif: guild info %d\n",RFIFOL(fd,4));
+ if( RFIFOW(fd,2)!=sizeof(struct guild)+4 ){
+ if(battle_config.error_log)
+ ShowError("intif: guild info : data size error Gid: %d recv size: %d Expected size: %d\n",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct guild)+4);
+ }
+ guild_recv_info((struct guild *)RFIFOP(fd,4));
+ return 0;
+}
+// ギルドメンバ追加通知
+int intif_parse_GuildMemberAdded(int fd)
+{
+ RFIFOHEAD(fd);
+ if(battle_config.etc_log)
+ ShowInfo("intif: guild member added %d %d %d %d\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14));
+ guild_member_added(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14));
+ return 0;
+}
+// ギルドメンバ脱退/追放通知
+int intif_parse_GuildMemberLeaved(int fd)
+{
+ RFIFOHEAD(fd);
+ guild_member_leaved(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),
+ (char *) RFIFOP(fd,55), (char *) RFIFOP(fd,15));
+ return 0;
+}
+
+// ギルドメンバオンライン状態/Lv変更通知
+int intif_parse_GuildMemberInfoShort(int fd)
+{
+ RFIFOHEAD(fd);
+ guild_recv_memberinfoshort(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOW(fd,15),RFIFOW(fd,17));
+ return 0;
+}
+// ギルド解散通知
+int intif_parse_GuildBroken(int fd)
+{
+ RFIFOHEAD(fd);
+ guild_broken(RFIFOL(fd,2),RFIFOB(fd,6));
+ return 0;
+}
+
+// ギルド基本情報変更通知
+int intif_parse_GuildBasicInfoChanged(int fd)
+{
+ int type, guild_id;
+ unsigned int dd;
+ void *data;
+ struct guild *g;
+ short dw;
+ RFIFOHEAD(fd);
+ type=RFIFOW(fd,8);
+ guild_id=RFIFOL(fd,4);
+ data=RFIFOP(fd,10);
+ g=guild_search(guild_id);
+ dw=*((short *)data);
+ dd=*((unsigned int *)data);
+ if( g==NULL )
+ return 0;
+ switch(type){
+ case GBI_EXP: g->exp=dd; break;
+ case GBI_GUILDLV: g->guild_lv=dw; break;
+ case GBI_SKILLPOINT: g->skill_point=dd; break;
+ }
+ return 0;
+}
+// ギルドメンバ情報変更通知
+int intif_parse_GuildMemberInfoChanged(int fd)
+{
+ int type, guild_id, account_id, char_id, idx, dd;
+ void* data;
+ struct guild *g;
+ RFIFOHEAD(fd);
+ type=RFIFOW(fd,16);
+ guild_id=RFIFOL(fd,4);
+ account_id=RFIFOL(fd,8);
+ char_id=RFIFOL(fd,12);
+ data=RFIFOP(fd,18);
+ g=guild_search(guild_id);
+ dd=*((int *)data);
+ if( g==NULL )
+ return 0;
+ idx=guild_getindex(g,account_id,char_id);
+ switch(type){
+ case GMI_POSITION:
+ g->member[idx].position=dd;
+ guild_memberposition_changed(g,idx,dd);
+ break;
+ case GMI_EXP:
+ g->member[idx].exp=dd;
+ break;
+ case GMI_HAIR:
+ g->member[idx].hair=dd;
+ break;
+ case GMI_HAIR_COLOR:
+ g->member[idx].hair_color=dd;
+ break;
+ case GMI_GENDER:
+ g->member[idx].gender=dd;
+ break;
+ case GMI_CLASS:
+ g->member[idx].class_=dd;
+ break;
+ case GMI_LEVEL:
+ g->member[idx].lv=dd;
+ break;
+ }
+ return 0;
+}
+
+// ギルド役職変更通知
+int intif_parse_GuildPosition(int fd)
+{
+ RFIFOHEAD(fd);
+ if( RFIFOW(fd,2)!=sizeof(struct guild_position)+12 ){
+ if(battle_config.error_log)
+ ShowError("intif: guild info : data size error\n %d %d %d",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct guild_position)+12);
+ }
+ guild_position_changed(RFIFOL(fd,4),RFIFOL(fd,8),(struct guild_position *)RFIFOP(fd,12));
+ return 0;
+}
+// ギルドスキル割り振り通知
+int intif_parse_GuildSkillUp(int fd)
+{
+ RFIFOHEAD(fd);
+ guild_skillupack(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
+ return 0;
+}
+// ギルド同盟/敵対通知
+int intif_parse_GuildAlliance(int fd)
+{
+ RFIFOHEAD(fd);
+ guild_allianceack(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOL(fd,14),
+ RFIFOB(fd,18),(char *) RFIFOP(fd,19),(char *) RFIFOP(fd,43));
+ return 0;
+}
+// ギルド告知変更通知
+int intif_parse_GuildNotice(int fd)
+{
+ RFIFOHEAD(fd);
+ guild_notice_changed(RFIFOL(fd,2),(char *) RFIFOP(fd,6),(char *) RFIFOP(fd,66));
+ return 0;
+}
+// ギルドエンブレム変更通知
+int intif_parse_GuildEmblem(int fd)
+{
+ RFIFOHEAD(fd);
+ guild_emblem_changed(RFIFOW(fd,2)-12,RFIFOL(fd,4),RFIFOL(fd,8), (char *)RFIFOP(fd,12));
+ return 0;
+}
+// ギルド会話受信
+int intif_parse_GuildMessage(int fd)
+{
+ RFIFOHEAD(fd);
+ guild_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12);
+ return 0;
+}
+// ギルド城データ要求返信
+int intif_parse_GuildCastleDataLoad(int fd)
+{
+ RFIFOHEAD(fd);
+ return guild_castledataloadack(RFIFOW(fd,2),RFIFOB(fd,4),RFIFOL(fd,5));
+}
+// ギルド城データ変更通知
+int intif_parse_GuildCastleDataSave(int fd)
+{
+ RFIFOHEAD(fd);
+ return guild_castledatasaveack(RFIFOW(fd,2),RFIFOB(fd,4),RFIFOL(fd,5));
+}
+
+// ギルド城データ一括受信(初期化時)
+int intif_parse_GuildCastleAllDataLoad(int fd)
+{
+ RFIFOHEAD(fd);
+ return guild_castlealldataload(RFIFOW(fd,2),(struct guild_castle *)RFIFOP(fd,4));
+}
+
+int intif_parse_GuildMasterChanged(int fd)
+{
+ RFIFOHEAD(fd);
+ return guild_gm_changed(RFIFOL(fd,2),RFIFOL(fd,6));
+}
+
+// pet
+int intif_parse_CreatePet(int fd)
+{
+ RFIFOHEAD(fd);
+ pet_get_egg(RFIFOL(fd,2),RFIFOL(fd,7),RFIFOB(fd,6));
+
+ return 0;
+}
+
+int intif_parse_RecvPetData(int fd)
+{
+ struct s_pet p;
+ int len;
+ RFIFOHEAD(fd);
+ len=RFIFOW(fd,2);
+ if(sizeof(struct s_pet)!=len-9) {
+ if(battle_config.etc_log)
+ ShowError("intif: pet data: data size error %d %d\n",sizeof(struct s_pet),len-9);
+ }
+ else{
+ memcpy(&p,RFIFOP(fd,9),sizeof(struct s_pet));
+ pet_recv_petdata(RFIFOL(fd,4),&p,RFIFOB(fd,8));
+ }
+
+ return 0;
+}
+int intif_parse_SavePetOk(int fd)
+{
+ RFIFOHEAD(fd);
+ if(RFIFOB(fd,6) == 1) {
+ if(battle_config.error_log)
+ ShowError("pet data save failure\n");
+ }
+
+ return 0;
+}
+
+int intif_parse_DeletePetOk(int fd)
+{
+ RFIFOHEAD(fd);
+ if(RFIFOB(fd,2) == 1) {
+ if(battle_config.error_log)
+ ShowError("pet data delete failure\n");
+ }
+
+ return 0;
+}
+
+int intif_parse_RenamePetOk(int fd)
+{
+ struct map_session_data *sd = NULL;
+ RFIFOHEAD(fd);
+ if((sd=map_id2sd(RFIFOL(fd,2)))==NULL ||
+ sd->status.char_id != RFIFOL(fd,6) ||
+ !session_isValid(sd->fd)) // Invalid session
+ return 0;
+ if (RFIFOB(fd,10) == 0) {
+ clif_displaymessage(sd->fd, msg_txt(280)); // You cannot use this name for your pet.
+ clif_send_petstatus(sd); //Send status so client knows oet name change got rejected.
+ return 0;
+ }
+ pet_change_name(sd, RFIFOP(fd,11),1);
+ return 0;
+}
+
+//----------------------------------------------------------------
+// Homunculus recv packets [albator]
+
+int intif_parse_CreateHomunculus(int fd)
+{
+ int len;
+ RFIFOHEAD(fd);
+ len=RFIFOW(fd,2)-9;
+ if(sizeof(struct s_homunculus)!=len) {
+ if(battle_config.etc_log)
+ ShowError("intif: create homun data: data size error %d != %d\n",sizeof(struct s_homunculus),len);
+ return 0;
+ }
+ merc_hom_recv_data(RFIFOL(fd,4), (struct s_homunculus*)RFIFOP(fd,9), RFIFOB(fd,8)) ;
+ return 0;
+}
+
+int intif_parse_RecvHomunculusData(int fd)
+{
+ int len;
+
+ RFIFOHEAD(fd);
+ len=RFIFOW(fd,2)-9;
+
+ if(sizeof(struct s_homunculus)!=len) {
+ if(battle_config.etc_log)
+ ShowError("intif: homun data: data size error %d %d\n",sizeof(struct s_homunculus),len);
+ return 0;
+ }
+ merc_hom_recv_data(RFIFOL(fd,4), (struct s_homunculus*)RFIFOP(fd,9), RFIFOB(fd,8));
+ return 0;
+}
+
+int intif_parse_SaveHomunculusOk(int fd)
+{
+ RFIFOHEAD(fd);
+ if(RFIFOB(fd,6) != 1) {
+ if(battle_config.error_log)
+ ShowError("homunculus data save failure for account %d\n", RFIFOL(fd,2));
+ }
+ return 0;
+}
+
+int intif_parse_DeleteHomunculusOk(int fd)
+{
+ RFIFOHEAD(fd);
+ if(RFIFOB(fd,2) != 1) {
+ if(battle_config.error_log)
+ ShowError("Homunculus data delete failure\n");
+ }
+
+ return 0;
+}
+//-----------------------------------------------------------------
+// inter serverからの通信
+// エラーがあれば0(false)を返すこと
+// パケットが処理できれば1,パケット長が足りなければ2を返すこと
+int intif_parse(int fd)
+{
+ int packet_len, cmd;
+ RFIFOHEAD(fd);
+ cmd = RFIFOW(fd,0);
+ // パケットのID確認
+ if(cmd<0x3800 || cmd>=0x3800+(sizeof(packet_len_table)/sizeof(packet_len_table[0])) ||
+ packet_len_table[cmd-0x3800]==0){
+ return 0;
+ }
+ // パケットの長さ確認
+ packet_len = packet_len_table[cmd-0x3800];
+ if(packet_len==-1){
+ if(RFIFOREST(fd)<4)
+ return 2;
+ packet_len = RFIFOW(fd,2);
+ }
+// if(battle_config.etc_log)
+// printf("intif_parse %d %x %d %d\n",fd,cmd,packet_len,RFIFOREST(fd));
+ if((int)RFIFOREST(fd)<packet_len){
+ return 2;
+ }
+ // 処理分岐
+ switch(cmd){
+ case 0x3800:
+ if (RFIFOL(fd,4) == 0xFF000000) //Normal announce.
+ clif_GMmessage(NULL,(char *) RFIFOP(fd,8),packet_len-8,0);
+ else if (RFIFOL(fd,4) == 0xFE000000) //Main chat message [LuzZza]
+ clif_MainChatMessage((char *)RFIFOP(fd,8));
+ else //Color announce.
+ clif_announce(NULL,(char *) RFIFOP(fd,8),packet_len-8,RFIFOL(fd,4),0);
+ break;
+ case 0x3801: intif_parse_WisMessage(fd); break;
+ case 0x3802: intif_parse_WisEnd(fd); break;
+ case 0x3803: mapif_parse_WisToGM(fd); break;
+ case 0x3804: intif_parse_Registers(fd); break;
+ case 0x3810: intif_parse_LoadStorage(fd); break;
+ case 0x3811: intif_parse_SaveStorage(fd); break;
+ case 0x3818: intif_parse_LoadGuildStorage(fd); break;
+ case 0x3819: intif_parse_SaveGuildStorage(fd); break;
+ case 0x3820: intif_parse_PartyCreated(fd); break;
+ case 0x3821: intif_parse_PartyInfo(fd); break;
+ case 0x3822: intif_parse_PartyMemberAdded(fd); break;
+ case 0x3823: intif_parse_PartyOptionChanged(fd); break;
+ case 0x3824: intif_parse_PartyMemberLeaved(fd); break;
+ case 0x3825: intif_parse_PartyMove(fd); break;
+ case 0x3826: intif_parse_PartyBroken(fd); break;
+ case 0x3827: intif_parse_PartyMessage(fd); break;
+ case 0x3830: intif_parse_GuildCreated(fd); break;
+ case 0x3831: intif_parse_GuildInfo(fd); break;
+ case 0x3832: intif_parse_GuildMemberAdded(fd); break;
+ case 0x3834: intif_parse_GuildMemberLeaved(fd); break;
+ case 0x3835: intif_parse_GuildMemberInfoShort(fd); break;
+ case 0x3836: intif_parse_GuildBroken(fd); break;
+ case 0x3837: intif_parse_GuildMessage(fd); break;
+ case 0x3839: intif_parse_GuildBasicInfoChanged(fd); break;
+ case 0x383a: intif_parse_GuildMemberInfoChanged(fd); break;
+ case 0x383b: intif_parse_GuildPosition(fd); break;
+ case 0x383c: intif_parse_GuildSkillUp(fd); break;
+ case 0x383d: intif_parse_GuildAlliance(fd); break;
+ case 0x383e: intif_parse_GuildNotice(fd); break;
+ case 0x383f: intif_parse_GuildEmblem(fd); break;
+ case 0x3840: intif_parse_GuildCastleDataLoad(fd); break;
+ case 0x3841: intif_parse_GuildCastleDataSave(fd); break;
+ case 0x3842: intif_parse_GuildCastleAllDataLoad(fd); break;
+ case 0x3843: intif_parse_GuildMasterChanged(fd); break;
+ case 0x3880: intif_parse_CreatePet(fd); break;
+ case 0x3881: intif_parse_RecvPetData(fd); break;
+ case 0x3882: intif_parse_SavePetOk(fd); break;
+ case 0x3883: intif_parse_DeletePetOk(fd); break;
+ case 0x3884: intif_parse_RenamePetOk(fd); break;
+ case 0x3890: intif_parse_CreateHomunculus(fd); break;
+ case 0x3891: intif_parse_RecvHomunculusData(fd); break;
+ case 0x3892: intif_parse_SaveHomunculusOk(fd); break;
+ case 0x3893: intif_parse_DeleteHomunculusOk(fd); break;
+ default:
+ if(battle_config.error_log)
+ ShowError("intif_parse : unknown packet %d %x\n",fd,RFIFOW(fd,0));
+ return 0;
+ }
+ // パケット読み飛ばし
+ RFIFOSKIP(fd,packet_len);
+ return 1;
+}