537 Commits

Author SHA1 Message Date
Lance
a9d6cac947 Fix
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7124 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-13 10:40:14 +00:00
Lance
161ef37fc6 Fix
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7122 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-13 10:34:21 +00:00
Lance
63edd59586 Fix
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7121 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-13 10:21:32 +00:00
Lance
7a27be9727 * [Fixed]:
- buildin_npcshopitem not allocating extra 1 block of terminator.
[Added]: 
- Modified versions of Dj-Yhn's buildin_npcshopdelitem and buildin_npcshopadditem 

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7120 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-13 10:12:59 +00:00
Lance
c165ff1eb6 * [Optimized]:
- buildin_npcshopitem memory allocation to calculate before reallocating.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7105 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-12 16:18:08 +00:00
skotlex
55df062534 - 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.
- party Hp updates are no longer done each time the Hp is modified, but together with the party xy timer.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7083 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-10 03:58:15 +00:00
Lance
c9702bfa25 git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7076 54d463be-8e91-2dee-dedb-b68131a5f0ec 2006-06-09 18:09:17 +00:00
Lance
73afac7540 * [Fixed]:
- Execution of sleep/sleep2 more than once will hang the script_state.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7075 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-09 16:10:44 +00:00
skotlex
d7a3b4d7e4 - Added pc_calcexp to calculate individual exp bonuses acquired from exp's source (race bonus cards, SG Exp skills, pk-mode higher level exp)
- pc_gain_exp now also receives the source of the exp, when said source exists, bonuses are applicated as needed.
- Added status_kill when capturing a mob, should take care of the mob not respawning after caputed.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7037 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-07 18:57:21 +00:00
Lance
dc71d18c29 * [Improved]:
- mob_dead not to remove script controlled monsters with player sprites. (can be removed later using removemob command, it can be resurrected too :D)
* [Added]:
- buildin_mobdeadsit :D 

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7024 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-07 02:51:50 +00:00
Lance
26e1b07f72 [Fixed]:
- Restoration and saving of sd->npc_id must be done every time. 

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6904 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-01 00:50:22 +00:00
Lance
4d978e0930 [Fixed]:
- Logic errors in run_script

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6875 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-31 05:27:49 +00:00
Lance
8236d2c93f [Improved]:
- Fake NPC interface to use real NPCs.
- Scripting interface to restore and save sd->npc_id.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6873 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-31 03:52:56 +00:00
Lance
e266a08f7c [Optimized]:
- clif_specialeffect to use the enums.
[Improved]: 
- buildin_specialeffect and buildin_specialeffect2 to accept effect area definition.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6855 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 18:13:16 +00:00
skotlex
1d027c8db8 - 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.
- 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)
- Cleaned up pc_dead to take advantage of the fact that status changes are not ended until after the function.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6852 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 17:06:55 +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
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
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
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
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
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
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
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
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
Lance
fa084e111c * Added 'setd' support for local NPC scope (') variables.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6704 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23 08:35:22 +00:00
Lance
5120d7677c * [Scripting Engine Update] New variables are ready to be used.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6703 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23 08:22:53 +00:00
Lance
aaa3738ed9 Dunno what the hell the causing the errors when using '@variables, 'variables works fine.. something is messing up....
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6702 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23 08:01:40 +00:00
skotlex
98de35a4f7 - Fixed a possible null pointer in script command misc_effect
- Modified Investigate to take into consideration final def/vit-def rather than base values for damage adjustment.
- Added missing include unit.h in pet.c


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6695 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-22 14:38:18 +00:00
Lance
2870364349 - Fixed some of the leaks.. still fixing..
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6691 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-22 12:38:12 +00:00
Lance
a7e5993400 * WARNING: New scripting system contains memory leak
TODO: Free all scripts using script_free_code() instead of old methods. 

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6690 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-22 12:15:49 +00:00
Lance
3fbb543cfc * Speed up array size calculation and deletion.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6676 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-21 08:09:20 +00:00
Lance
fdfaf7ba79 * jA1983 script.c buildin_menu fix. Thanks to End_of_exam.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6665 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-20 15:01:47 +00:00
Lance
38703db7c9 git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6593 54d463be-8e91-2dee-dedb-b68131a5f0ec 2006-05-15 09:55:50 +00:00
Lance
f5631c0f3f * Added NPC event deprecated warnings to ease debugging old scripts.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6592 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-15 09:54:51 +00:00
skotlex
46d5c713cd - Updated cast times of Kaupe and Kaahi.
- Some small code cleanups.
- Sma has cast-dex reducable now.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6564 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-12 16:30:51 +00:00
skotlex
ae5d5020c0 - Changed wedding costumes to use setoption rather than changebase.
- Modified setoption so that flag 1 or no flag adds an option, and flag 0 removes it.
- Updated script_commands with the new behaviour.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6548 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-10 13:43:00 +00:00
skotlex
73b98ea723 - 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.
- Updated script_commands information for setoption due to this change.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6538 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-09 21:09:53 +00:00
skotlex
05667b0fa9 - 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)
- Fixed a possible counter overflow in attacked_count, changed the var size to unsigned char since the code can handle the overflow now.
- Multiple targets again reduces armor defense, as reported by Tharis.
- Increased dex increase of NPC_POWERUP to +20 per level.
- Fog of Wall's -50 hit reduction is now only for ranged attacks.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6528 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-09 17:08:09 +00:00
Lupus
a866920e15 removed old logs
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6510 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-07 09:50:37 +00:00
Lance
49fc4fe81d * Optimized fake npc system. Added npc_checknear back to npc_buysellsel.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6426 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-01 05:48:06 +00:00