252 Commits

Author SHA1 Message Date
skotlex
98d0cb73fd - Fixed a crash on the mobspawn script command.
- Made SC_FLEET increase batk as well as watk.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8444 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-22 21:26:17 +00:00
skotlex
9f8cee903c - updated (more or less) the sql-files/item_db2.sql file.
- Some insignificant cleanups.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8429 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-22 14:54:29 +00:00
skotlex
d359756066 - getnameditem will now also work on stackable items
- 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.
- Fixed Resurrect Homunculus's % to 20*lv%


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8426 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-22 14:09:01 +00:00
skotlex
200813da7e - Adjusted Glittering's success rate to 20+10*lv%
- Corrected isequipped() so that cards will not be tagged as "used up" unless all the specified items were found.
- 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.
- Fixed ASC_BREAKER's misc damage part not having the ignore-element flag set.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8406 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-21 17:55:19 +00:00
skotlex
cb54955cc4 - Fixed the Autosave routine not working when there's only one player online.
- Disabled command @rain since the client no longer supports it anyway.
- Fixed delitem not checking for the first slot's card, also optimized it so that it doesn't checks on the other slots.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8399 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-21 14:05:24 +00:00
skotlex
b5508efe38 - 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.
- Should have fixed the signed/unsigned comparison warnings in the main regen function. 
- Fixed Energy Coat consuming 10x less SP per hit than it should.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8339 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-18 13:49:24 +00:00
skotlex
00f4aecb26 - Added support for hexadecimal values in the const.txt file.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8321 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-16 20:13:19 +00:00
skotlex
1079f53d4c - Spirit of Wizard will now consume an item 7321 each time it blocks reflected magic.
- 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)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8320 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-16 19:50:52 +00:00
skotlex
ee8298bb8a - Cleaned up some of the pet related @/# commands, same for some script commands.
- 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)
- Pet offensive skills who's inf value is self will be casted on the pet now (for stuff like Grand Cross)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8301 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-15 21:12:45 +00:00
skotlex
41f2f3ca40 - Increased Run's walk speed bonus to 25->50%
- 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.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8275 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-14 16:30:14 +00:00
skotlex
6f3c9a6dc7 - Fixed two instances in the login-sql server where the ip in the log-login table was being stored backwards.
- 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).
- 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)
- Corrected that extra comma at the end of the Kaensin layout setup.
- Some cleanups on trade_tradeaccept to prevent packets being resent when they shouldn't.
- Corrected that ALLOW NULL thingie on main.sql


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8229 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-10 14:25:32 +00:00
skotlex
4fe5bc0478 - Got rid of the "i might be used uninitialized on this function" warning in `buildin_getpartyleader'
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8199 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-09 02:29:11 +00:00
skotlex
85655282d4 - Adjusted the order in which option/sc change packets are sent to match Aegis's
- Added script command getpartyleader through which you can retrieve various information of a party's leader.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8162 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-07 16:19:42 +00:00
skotlex
8c98388bc5 - 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.
- Changed name of the setting log_pick to log_filter since that's what it does now.
- 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.
- Cleaned a bit the contents of log_athena.conf


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8129 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-04 16:38:54 +00:00
skotlex
5d9e6b4a71 - GAHH, I am sick tired of typing TBL_HOMUNCULUS/BL_HOMUNCULUS all over the place. The idea is that the TBL* versions are supposed to be easier to use than the standard structure definition, but using TBL_HOMUNCULUS as an alias to struct homun_data kinda beats the purpose! Renamed them all to TBL_HOM/BL_HOM.
- Fixed using the right-hand weapon's size modifiers regardless of which weapon was being used.
- 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.
- Removed variable hd from status_calc_bl as it's not needed.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8112 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-03 19:45:12 +00:00
skotlex
8d7c008a65 - Fixed Defender Raising Walk speed instead of diminishing it.
- Swaped val3/val4 of defender so that all walking penalty skills store said penalty in val3.
- Added a check on status-change load to prevent loading speed-affecting status when their speed adjustment is 0 (prevents division by zero)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8061 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-02 17:06:16 +00:00
skotlex
abcf47cd67 - Fixed script code data not being free'd if a player quits in the middle of a script.
- 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)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8057 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-02 15:40:25 +00:00
skotlex
7f0c0e574c - Added the missing lines to enable script command "kickwaitingroomall"
- Magic Rod's can-act delay will no longer be applied when you absorb a spell.
- Fixed Don't Forget Me increase speed instead of decreasing it.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8031 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-01 14:52:22 +00:00
skotlex
65e0327024 - Modified setlabel so that the script engine barks when you are trying to use the same label name as a constant or variable name.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8027 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-01 13:52:17 +00:00
skotlex
f4f3eff4cd - Fixed a possible crash in the main script engine when restoring previous script.
- 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)
- Fixed a pair of free -> aFree used on stacks, which would lead to memory manager reporting leaks where there aren't.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8000 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-31 15:05:58 +00:00
toms
e61a6fb306 Removed ugly struct cast in login.c
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.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7975 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-29 23:06:03 +00:00
toms
b1f19b525f Added a return value to buildin_rid2name if rid is invalid
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7973 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-29 18:46:20 +00:00
toms
685a894908 Fixed segmentation fault in script engine when calling something which is not a function
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7971 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-29 15:30:41 +00:00
toms
8dca441de7 Fixed segmentation fault in script engine when activating DEBUG_RUN flag
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7970 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-29 15:10:00 +00:00
toms
0f58cb2c3e Fixed "conversion from 'double' to 'int', possible loss of data"
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7939 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-28 09:45:30 +00:00
skotlex
8f5f5ce14c - Fixed a missing initialization in run_script_main.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7933 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-28 03:16:39 +00:00
skotlex
67d547ed31 - Added missing include of limits.h in script.c
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7932 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-28 02:51:33 +00:00
skotlex
c9e9b3b75b - Synced the script.c file with as much data as possible from jA's:
- 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.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7926 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-27 21:00:19 +00:00
skotlex
932107f772 - 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)
- 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.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7922 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-27 15:44:57 +00:00
skotlex
9d056a75f1 - Some code cleanup of HLIF_MOON in regards to the number of hits and damage equation.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7900 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-26 19:12:00 +00:00
skotlex
7cd47130d0 - 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.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7895 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-26 15:12:50 +00:00
skotlex
0f8d093a2c - 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.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7886 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-25 22:18:53 +00:00
skotlex
e66ac3dfce - 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.
- Added flag 0x002 (no reiteration) to Deluge/Volcano/Violent Gale (skill_unit_db)
- Removed the noreturn mapflag check from script command warp.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7858 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-24 17:28:13 +00:00
skotlex
c914fc106a - Fixed buildin_isequip not working correctly with non-cards.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7838 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-23 16:40:46 +00:00
skotlex
7e68dd7948 - Added source reporting when you do an invalid int&str or str&int operation on a script.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7782 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-20 23:13:22 +00:00
DracoRPG
15dd140846 Orn's and Albator's Homunculus system, finally, YAY!!
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7706 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-17 00:15:33 +00:00
skotlex
6ec9580e34 - Fixed the value range checks added by Zido on pc_bonus (some of them were even redundant...)
- Fixed script command "recovery".


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7654 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-13 13:55:58 +00:00
skotlex
a6c3f3a1fc - Coded @reset.
- Reenabled @changesex
- 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.
- Cleaned up code of @item
- Added define UNKNOWN_ITEM_ID (512 = apple)
- Added IT_* enumation item_Types to identify said data from items.
- 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.
- 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.
- Removed itemdb.c considering item ids above 20000 as invalid.
- Cleaned up script commands getitem and card-counting related ones. 
- Cleaned up a bit more pc_isequip


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7613 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-11 16:32:37 +00:00
blackhole89
c6d03de26b warpportal(x,y,"tmap",tx,ty) - Creates a skill warp portal on the map. battle_check_target modified to allow NPC-owned skill units to proceed.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7612 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-11 15:58:40 +00:00
skotlex
5251ce7944 - 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)
- Applied k3dt fixes to pet-hatching, ice-wall check, and wedding skills.
- Fixed endow skills calling the skill no damage packet twice.
- Fixed a crash on warpwaitingpc when the chat-room is empty.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7580 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-08 17:13:39 +00:00
skotlex
a4d0df735d - Rewrote all the item restriction functions so that they will take into account slotted card restrictions as well.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7552 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-06 21:22:20 +00:00
skotlex
31832cfdc7 - Added EQP_/EQI_ constants in pc.h to identify equip position and equip indexes, makes equipping related code much easier to read.
- Also 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.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7550 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-06 18:47:11 +00:00
skotlex
33bbefb989 - Added mapflag "nochat" to prevent chatting rooms from being created.
- Corrected some of the sleep checks when the char id does not matches with the char-id expected by the script engine.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7423 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-30 16:53:56 +00:00
skotlex
1b7a54c893 - Moved item group enumeration from itemdb.h to map.h
- Cleanup in itemheal related code, fixed the item heal group bonus not working on Groups beyond 7.
- Fixed pet's loot not being moved to your inventory on logout.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7419 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-30 13:53:13 +00:00
Lance
a7644e81ac git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7393 54d463be-8e91-2dee-dedb-b68131a5f0ec 2006-06-29 12:34:32 +00:00
Lance
304665e8c0 git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7392 54d463be-8e91-2dee-dedb-b68131a5f0ec 2006-06-29 09:14:35 +00:00
Lance
706355eda6 git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7390 54d463be-8e91-2dee-dedb-b68131a5f0ec 2006-06-29 08:55:12 +00:00
Lance
671522e47c git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7389 54d463be-8e91-2dee-dedb-b68131a5f0ec 2006-06-29 08:51:13 +00:00
Lance
aa70823081 * [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. 

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7388 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-29 08:47:14 +00:00
skotlex
3ce9e8c6e6 - Added a check in script command "set_option" so that invoking "set_option(0)" removes Cart/Peco/Falcon, as expected by scripts.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7381 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-28 23:10:14 +00:00