26 Commits

Author SHA1 Message Date
FlavioJS
da5d22b67f - Fixed the sleep timers not being removed when the an npc was being unloaded and when reloading scripts.
Ref: http://www.eathena.ws/board/index.php?showtopic=131464

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9629 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-07 17:59:25 +00:00
FlavioJS
266f66cfff - Applied the rest of Rayce's suggestions and fixes (http://www.eathena.ws/board/index.php?showtopic=129185)
- warn_cmd_no_comma, warn_func_no_comma, warn_cmd_mismatch_paramnum are now warn_func_mismatch_paramnum and it only prevents showing the error, as it was probably intended in the first place. (correct me if i'm wrong)
- Merged the parsing of function calls in the script engine, removing the parse_cmd hackery, and made "heal (.@val+rand(0xff))&0xff,0;" valid again.
- Fixed a bug in eye_of_hellion.txt and a bug in hunter.txt

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9569 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-25 06:15:46 +00:00
FlavioJS
e75a8eca56 - Change strncpy to memcpy when parsing switches in the script engine since it's guaranteed to be a word of that size (skip_word).
- Made scriptlabel_db duplicate the key. When str_buf is reallocated, the keys in scriptlabel_db could become invalid, causing a crash in npc_convertlabel_db.
( removed the readded >=0x81 equivalent )
- Now npc_convertlabel_db clears scriptlabel_db after using it.
- parse_script has an extra parameter options. At the moment it only indicates if scriptlabel_db should be used or not.
- Fixed "UINT_MAX undeclared" on systems that don't declare it in limits.h

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9557 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-22 05:27:03 +00:00
skotlex
6bbec4a65d - Added an answer to a FlavioJS's comment, and added a question myself (npc.c/script.c respectively)
- Fixed add_str in script.h not being updated to const char as well. But why do we really need such a script-engine low-level function exposed to the rest of files? :/
- Moved the strip unequip code to before deleting the timer, this fixes trying to "re-strip" someone causing the skill to fail and on top of that terminate their current strip effect.
- Added an ugly work around to the issue of skills with additional effect causing opt1 status when they have just terminated them (in short, you shouldn't be able to hit someone with, say, sleep, and then have the same skill cause them stun, since both are opt1 values).
- Reading of TK Mission variables will now happen if you are a TK-class character regardless of whether you know TK_MISSION or not. Should fix being able to reset skills to reset your Mission data.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9537 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-20 15:54:11 +00:00
FlavioJS
40b389bc42 - Changed the script source from unsigned char* to const char*.
- Updated plugins Makefile.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9532 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-20 07:17:18 +00:00
FlavioJS
637ae9a4dc - Massive EOL normalization & 'svn:eol-style native' flag setting for all txt/conf/h/c files.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9410 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-05 13:23:07 +00:00
skotlex
7c8ec5366e - Reverted declaration of run_script to normal since it appears there's no longer any memory leaks related to it.
- Returned the MAX_PC_BONUS value to 10.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8928 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-10-03 16:19:14 +00:00
skotlex
4e9c745bdf - Corrected SC_INTRAVISION not starting.
- Small cleanups (line terminators, indenting)
- Fixed crash when attempting to read a Label as a string on a script (thanks to End of Exam)
- Fixed possible crash when changing a chat-room's owner (thanks to End of Exam)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8639 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-09-05 19:49:38 +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
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
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
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
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
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
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
e051037bce * Dynamic shops support with script callback. (needs testing)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5841 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-01 07:29:54 +00:00
Lance
e804a51220 * Fixed misleading and inaccurately documented events and added a missing flag.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5649 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-17 16:47:21 +00:00
Valaris
2178a86317 AS OF SVN REV. 5901, 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.  EVERYTHING ELSE
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5094 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-01-29 16:10:48 +00:00
Valaris
fd99753f8e Clearing trunk.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5091 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-01-29 16:00:45 +00:00
amber
0b091d02ee PCRE updates
git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1157 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-02-22 05:01:20 +00:00
celest
899b3ebeeb * Fixed a typo in quests/all_quest.txt
* Set 'killerrid' and do PCKillEvent before calling PCDieEvent
* Added some new script event related options to script config
* Added 10 of the new card effects on the 2/15's patch
* Minor rewrites on self and enemy weapon/armor breaking
* Added missing code for 'bBreakWeaponRate' and 'bBreakWeaponRate' effects
* Added missing code for 'bAddStealRate' effect
* Removed redundant 'infinite_autospell' in map_session_data

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1116 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-02-16 08:25:45 +00:00
(no author)
5618dc9edc Made some more changes, reverted some old ones
git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@969 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-01-23 21:52:55 +00:00
celest
0e8dc29b2d * Completed adding packet DB reading
* Added Shinomori's suggestions for npc timers,
* Removed checking for script event timers' length, and added Shinomori's changes

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@947 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-01-10 15:25:24 +00:00
celest
5055b2da21 * Added 'max_eventtimer_length' to script_athena.conf
* Removed PCLoginEvent requiring 'PCLoginEvent' for the player to be set to 1 first to be activated

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@945 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-01-10 10:58:12 +00:00
amber
d479e29aee Fixed some file types
git-svn-id: https://svn.code.sf.net/p/rathena/svn/athena@172 54d463be-8e91-2dee-dedb-b68131a5f0ec
2004-11-14 16:18:26 +00:00
(no author)
706e785091 git-svn-id: https://svn.code.sf.net/p/rathena/svn/athena@2 54d463be-8e91-2dee-dedb-b68131a5f0ec 2004-11-04 23:25:09 +00:00