1946 Commits

Author SHA1 Message Date
skotlex
048bd9bd8f - Added a division by zero check in mob_dead to prevent the (impossible) case where a mob dies with received damage of zero.
- Fixed compilation errors with SC_FLING...


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6821 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 16:01:02 +00:00
skotlex
dc7581d42d - 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.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6820 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 15:48:43 +00:00
skotlex
8f5c155fb4 - Cleaned up some status_get functions.
- Optimized a bit the SC_PROVOKE code (to use val3/val4)
- Fixed draining when the amount drained is negative (invoke zap rather than heal)
- Implemented GS_FLING as per the current skill description.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6819 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 15:25:28 +00:00
skotlex
ffce913970 - Fixed pc_readparam/pc_setparam to use battle_status.hp/sp rather than status.hp/sp, fixes scripts reading the wrong Hp/Sp values
- Added some missing SC_* entries on the initial listing (potion related and speed up ones)
- Fixed function declaration of map_getcellp()


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6817 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 14:10:22 +00:00
Lance
559987d438 * [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

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6816 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 10:27:02 +00:00
Lance
bdac5d6c09 [Optimized ]
Removed unused variable (account_id) in storage_guild_storagesaved.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6815 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 10:12:26 +00:00
Lance
a28e9d802c [Optimized]
- Removed unused checks for unsigned data type and possible logic error for char type (gcc treats char as unsigned).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6814 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 09:53:45 +00:00
Lance
a796714516 [Fix]: Ressurect instead of making you die again when logging in.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6811 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 02:15:16 +00:00
Lance
f1edfd7ba4 - Relogging in with 0 HP didn't trigger dead event.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6810 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 01:58:43 +00:00
skotlex
f2cedb537e - Added functions status_revive, pc_revive and mob_revive to handle revival (it doesn't handles player respawning, though)
- Corrected alive, raisemap, raiseall to use these functions.
- Updated resurrection/mob-kaizel to use status_revive
- Added SC_BLADESTOP to the skill enum at the beginning of status.c (fixes Bladestop causing an unknown status change message)
- Fixed MSS_DEAD state skills not triggering.
- Corrected some compilation warnings on the merc.* files. 


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6807 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-28 17:58:56 +00:00
Lance
f77f199488 - Reverted buildin_setd to use NULL as reference.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6802 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-28 14:11:01 +00:00
Lance
d9de89b463 [Fixed] script functions that doesn't pass references, thanks to End_of_exam.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6801 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-28 14:05:03 +00:00
Lance
025d6e6a01 * [ Protected ] : clif_parse_LGMmessage from possible hacks
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6797 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-28 11:29:43 +00:00
skotlex
2466911af0 - Fixed unable to store n items into storage unless n was the total amount of items you had.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6794 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-28 05:29:01 +00:00
Lance
bb1b0409a1 - Suppressed compilation warnings (unsigned and signed mismatches)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6793 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-28 03:24:03 +00:00
skotlex
df08df8e5d - Addded missing include of limits.h to battle.c
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6792 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-27 19:10:21 +00:00
skotlex
856240443d - 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)
- Cleaned up TBL_PC, TBL_MOB, TBL_PC and mob_db structures to use status_data.
- Set the NPC-Change Attribute duration on Time1, updated their max to 1 in the db.
- Berserk's HP cost interval is now defined as time2.
- Split damage received functions into pc_damage/pc_dead and mob_damage/mob_dead
- Rewrote the @heal related functions to use the new status_* healing functions.
- 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)
- Splitted mob_once_spawn into two. mob_once_spawn_sub creates the mob instance without spawning it.
- Added defines for Elements (ELE_*)
- Modified battle_calc_(weapon/magic/misc)_attack to use the status data structure.
- 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
- Cleaned up pet.c to stop invoking status_calc_pc when unnecessary
- Modified skill_calc_heal to take into account the MEDITATION bonus.
- Cleaned up code of Adjustment, Madness Cancel and other GS/NJ skills inside skill_check_condition
- Added status change SC_MODECHANGE which handles mob state changes (this SC is continous until manually ended, eg: like Weight50)
- 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.
- Modifed SC_DANCING to store speed-change in val3 (it is shared with skill duration...)
- Added StatusChangeFlagTable to store which statuses are changed by each SC
- Added SCB_* constants to specify the different stats that each sc changes. SCB_PC is the only one that means a change hardcoded in status_calc_pc, the rest are handled by status_calc_bl
- Added some helper functions to simplify with basic status calculations (status_base_atk, status_calc_misc, status_base_pc_maxhp, status_base_pc_maxsp)
- Added status_calc_mob which calculates initial status and special base status alterations (HP changes, stat changes due to big/small mobs, etc)
- Made all the status_calc functions static.
- Added status_calc_bl_sub_pc for PC related calculations that must happen after status-change adjustments.
- 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.
- Added status_get_status_data and status_get_base_status to retrieve the bl objects current status_data and basic status_data (current never returns null, instead it returns a dummy structure with basic data)
- The main switch in status_change_start now only sets the tick and val values, therefore it is skipped when loading (flag&4)
- Cleaned up status_change_start and replaced many of the ex-japanese comments for english ones.
- Changed Hiding to store the speed penalty on val3. val4 stores interval SP cost.
- Changed Chase Walk to store Speed adjustment on val3, sp cost in val4
- Changed Cloaking to store speed penalty on val3, val4&2 signals wall-present, val4&1 is infinite cloaking.
- Changed Wind walk to store speed bonus on val3
- Rewrote Marionette Control to store the status to add/substract in val3/val4, it now works on anyone (players/mobs)
- Changed Improve concentration to store Card bonuses (which are not counted for total % increase) on val3/val4
- Changed SC_ADRENALINE, SC_CONCENTRATION, SC_ANGELUS, SC_IMPOSITIO, SC_MELTDOWN, SC_TRUESIGHT, SC_SUN_COMFORT, SC_MOON_COMFORT, SC_STAR_COMFORT, SC_QUAGMIRE, SC_GATLINGFEVER to store the bonus modifiers in their val values rather than calculate them in status_calc_*
- Status_change_start/end will use clif_status_load rather than clif_status_change when related bl is not on a map.
- Modified status_change_timer to use the status_charge function rather than directly substracting SP
- Added SC_ELEMENTALCHANGE to modify someone's base defense element.
- 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_steal_coin
- 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.
- Cleaned up mob_dead code.
- Removed paramb, parame from struct map_session_data, replaced them by param_bonus[6],param_equip[6]
- mob special ai state 3 signals summon flora.
- Moved petDB pet_hungry_timer vars from TBL_PC to TBL_PET
- Cleaned up some pet functions, made the menu functions receive as argument both pet and master.
- Clones will copy a player's base status rather than battle status (so status-change alterations are not cloned)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6791 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-27 18:08:30 +00:00
blackhole89
9cf042b0ee Fix possible compile mistakes in there. >_>
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6790 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-27 17:15:04 +00:00
Lance
56a69db8bd And another possible crash
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6783 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-26 23:43:41 +00:00
Lance
4519951609 * Fixed crashing in mob.c
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6782 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-26 23:36:36 +00:00
Lance
2681e4127b * Patches to allow everything to work right. + 1 more sample script.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6779 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-26 18:54:07 +00:00
Lance
7e5a2c9c34 Added a few more events in..
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6776 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-26 11:58:13 +00:00
Lance
1e01e1c404 git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6773 54d463be-8e91-2dee-dedb-b68131a5f0ec 2006-05-26 10:18:06 +00:00
Lance
dffe836f3b git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6772 54d463be-8e91-2dee-dedb-b68131a5f0ec 2006-05-26 10:11:08 +00:00
Lance
b2b5a789a3 git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6771 54d463be-8e91-2dee-dedb-b68131a5f0ec 2006-05-26 09:57:26 +00:00
Lance
8320520472 * Mob control engine tested 99% working so far.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6770 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-26 09:46:45 +00:00
Lance
e43f38bb0d * Change scripting engine's NPC scope vars to dot (.) style.
* Improved and (should be fully) fixed the mob control engine. 

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6769 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-26 07:21:48 +00:00
Lance
63438cde12 * Fixed typos in char.c
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6766 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-26 06:11:35 +00:00
DracoRPG
d94ebfdd53 I'm still here!
Rewrote fame ranking lists

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6764 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-26 01:35:17 +00:00
skotlex
7ff7ce4a39 - Simplified ASC_BREAKER by making it a BF_WEAPON attack with an additional int-based damage component (which is added right before elemental modifiers).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6760 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-25 19:15:17 +00:00
Lupus
d5dd578e57 added noVending mapflag. Tested. + custom Market Place NPC, fixed MSG strings
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6755 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-25 16:26:17 +00:00
skotlex
0840bc1c5a - Increased capacity for Account Variables to 64
- Reverted Intravision implementation to that of stable's.
- Corrected Login Server taking it's first argument as both login config and lan config.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6751 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-25 13:54:31 +00:00
Lance
c7535fdff4 * Fixed mob control commands.
* Fixed memory leak in scripts (again). Still have a few lying.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6749 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-25 12:04:09 +00:00
eaac
5df56ea5bc * Fix to the slave AI problem, by Skotlex
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6742 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-25 00:42:49 +00:00
skotlex
2fe91c5e7d - Item sharing now shares the same rules as exp sharing (no sharing when dead, or idle, etc)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6737 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-24 19:15:27 +00:00
skotlex
e6d15ee6a9 - Fixed summoned slaves being able to cast onspawn summon-skills (slaves aren't supposed to be able to call minions)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6735 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-24 18:45:25 +00:00
skotlex
8c547af427 - The clif_skill_poseffect packet will not be invoked in Snap unless the skill was successful. May fix the client-position lag.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6734 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-24 18:09:58 +00:00
skotlex
9eb0eab0a7 - Corrected item script for dead branch and poring box
- Removed that npc-warp warning as requested by Playtester.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6732 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-24 17:29:58 +00:00
skotlex
1641349382 - Merged item_db.sql from stable :B
- Added a missing line (how did it get lost?) in mob_spawn to set aggressive state for angry mobs.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6731 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-24 16:47:10 +00:00
skotlex
9776045b22 - Corrected SL KA* spells not working on other Soul Linkers.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6727 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-24 14:45:30 +00:00
skotlex
6a7fd3930f - 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.
- Corrected a pair of incorrect sql query parsing logic in the login-sql ban request packet.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6724 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-24 13:42:12 +00:00
Zido
3d73de5545 - Fixed wedding sprite staying active after unequip.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6719 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23 20:40:41 +00:00
skotlex
8b29b1574f - Some cleanup of run_script, should fix the memory leak there.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6718 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23 18:16:25 +00:00
skotlex
0c8a59d012 - the charname request hack message has been downgraded to only include GM-invisible characters.
- corrected clif_charnameack to send negative ID when a disguised player asks for it's own disguised name.
- Cleaned up the disguised target-id checks taking into considering that the only character that sees a negative ID is the same disguised character.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6715 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23 15:43:40 +00:00
skotlex
ed8a9e9848 - 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.
- The move-enable condition checks for skills are now checked for only when on skill use, not at cast-end time.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6714 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23 15:08:37 +00:00
skotlex
e7a25fdeac - Corrected clif parse name request failing on disguised characters.
- Corrected Soul Drain draining from all non-ground-based skills including non-magic attacks.
- Corrected pc_setoption to change the option and then change class. changing option-wedding will automatically convert the view-class as well.
- 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.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6709 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23 13:51:42 +00:00
Lance
81efffac73 * Fixed typo (this time it's not my fault) in script_reload() clearing the same db each time o_o
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6708 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23 10:59:36 +00:00
Lance
6dc8e549e4 Reloadscript cleanup
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6707 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23 10:40:54 +00:00
Lance
c243406d9e Crash prevention
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6706 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23 10:34:08 +00:00
Lance
56005cb610 * Fixed sleep command.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6705 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23 09:54:27 +00:00