252 Commits

Author SHA1 Message Date
skotlex
4f1911ae63 - Fixed indentation on int_pet.c (how did it got messed up?)
- Added mapflag "loadevent", now load-map script events will ONLY trigger on maps with this mapflag on, rather than every map.
- High Jump can now be used in all versus maps.
- Added Kaite's opt3 value, taken from jA
- 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 act arrives. In short: they are guaranteed to be saved after a char logs out.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7358 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-27 14:54:01 +00:00
Lance
fa2cd64215 * [Added]:
- buildin_unitkill just for kicks.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7338 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-26 04:32:50 +00:00
Lance
219f26b6a0 * [Optimized]:
- Setting of variables with defined scope in some frequently executed script events.
* [Added]: 
- Missing script_require_trigger flags for some power hungry events.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7325 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-24 02:41:32 +00:00
Lance
5ca017e91a git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7311 54d463be-8e91-2dee-dedb-b68131a5f0ec 2006-06-23 12:22:43 +00:00
Lance
ec2fc0e437 * [Fixed]:
- MAPREGSQL overloading SQL table with temperory map registries.
- Incorrect perfomance calculation for MAPREGSQL loading and saving. 

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7310 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-23 11:47:27 +00:00
Lance
67ff295ba4 * [Removed]:
- Redundant mob name copying. (it's already copied in mob_parse_dataset)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7292 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-22 13:16:45 +00:00
Lance
a800be65ec git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7234 54d463be-8e91-2dee-dedb-b68131a5f0ec 2006-06-18 02:54:17 +00:00
Lance
61cf41923c * [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]

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7233 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-18 02:42:41 +00:00
Lance
58b728cc4a * [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.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7219 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-17 07:48:10 +00:00
Lance
971900f126 * [Added]:
- Added option #25 to buildin_setmobdata to set the callback_flag.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7203 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-16 14:46:15 +00:00
skotlex
63c259b4c8 - Fixed and cleaned up script command 'equip'
- Fixed 'autoequip' items.
- Fixed Aspd not being updated in your status window after Agi/Dex increasing statuses take effect.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7179 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-15 14:15:16 +00:00
blackhole89
f7fa729e23 git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7164 54d463be-8e91-2dee-dedb-b68131a5f0ec 2006-06-14 17:13:56 +00:00
Lance
0ec9bef7cb * [Improved]:
- script_save_mapreg for MapregSQL Saving to display perfomance only in slow queries. 

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7150 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-14 08:00:48 +00:00
Lance
a51eda844c Another mistake.. shit
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7126 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-13 10:45:43 +00:00
Lance
4a226bec3a Fix again >_<
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7125 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-13 10:40:56 +00:00
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