537 Commits

Author SHA1 Message Date
skotlex
3838afbf52 - Fixed the label dup code, it now works correctly with const.txt switch labels.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9676 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-19 18:22:31 +00:00
skotlex
9d049827d7 - Reverted the dup-label check code since it has a bug that needs to be fixed first (it fails to recognize const.txt values)
- Reverted clif_skill_damage receiving the blewcount value since the whole code update that was involved didn't help any anyway.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9675 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-19 18:00:11 +00:00
skotlex
3b1e03537d - Merged Rayce's cleanups of the script engine that account for duplicate labels, non-numeric labels and makes the engine case-insensitive towards keywords like if/case/switch/etc/
- Added the icons for the Food boosts (need packet version 8 to get them).


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9673 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-19 15:27:53 +00:00
FlavioJS
8d7a0bd454 - Fixed the script engine not parsing strings in multibyte charsets correctly (should have been done in r9532).
Ref: http://www.eathena.ws/board/index.php?showtopic=132004

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9642 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-11 08:34:34 +00:00
FlavioJS
aa371b3af3 - Fixed the define script_lastdata, introduced by me at r9637 (had the wrong sign)
really hate these types of bugs, no more committing late for me >.>

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9639 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-10 14:57:54 +00:00
FlavioJS
4b78fc3c9f - Changes to script buildin functions:
* functions checking if a player is attached as soon as possible.
  * functions that required a player attached and would crash if none was 
    there terminate the script now. (others keep the current behaviour to 
    maintain full backward compatibility)
  * removed the unused flag argument in guildskill.
  * bonus,bonus2,bonus3,bonus4 use the same function now (remains the same 
    script-wise)
  * added an optional parameter to setcart,setfalcon,setriding so it's 
    possible to remove the cart/falcon/mount or select a specific cart
  * other cleanups

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9636 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-09 17:31:13 +00:00
ultramage
b0aa97039b Unimportant cleanups
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9633 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-08 16:50:54 +00:00
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
ultramage
fbe23f27a2 Undid the memset->malloc_set replacement
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9626 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-07 16:49:03 +00:00
ultramage
9f164c312b - re-added the duplicit nj/gs name messages in msg_athena
- renamed atcommand_sub to is_atcommand_sub (charcommand too)
- reformatted conf-tmpl's comments a bit
- and a fix to the stable changelog to make my last commit more descriptive

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9625 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-07 07:48:04 +00:00
FlavioJS
0cf60d9ca1 - Updated getitem and guardian entries in script_commands.txt.
- Fixed getitem trying to get <character ID> from the wrong argument.
- Now getitem can be run on scripts without a player attached if <character ID> is specified.
- Now the two last arguments of guardian are optional and independant of each other ("<event label>" and <guardian index>). This way the previous implementation and script_commands definition are still valid code.
- Now buildin function names and argument definitions are checked for validity before adding the function to the script engine.
  Argument definitions follow the pattern:
    (v|s|i|l)*\?*\*?
    v - value (string or int)
    s - string
    i - int
    l - label
    ? - one optional parameter
    * - unknown number of optional parameters

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9599 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-31 09:22:25 +00:00
FlavioJS
f863581174 - Part 3 of TheUltraMage's socket cleanup.
- Fixed the packet structure in mmo_char_send006b for PACKETVER 8.
- Removed search_str from add_str (add_str already searches for the string).
- Native script words like do,while,for,... are case insensitive now.
- Changed SCRIPT_HASH_SIZE to 1021 (prime hash sizes give better distributions).
- Added alternative hash implementations to the script engine (to try out later).

removed int_homun.c from header section of the VS8 map project files

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9588 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-28 19:11:40 +00:00
skotlex
74e263086a - Applied Rayce's suggestion to improve the script hash size usage. eA now uses a hash of 1024.
- The str hash report can be printed by turning on the etc_log


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9577 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-27 14:40:04 +00:00
skotlex
58bb9be68a - Cleaned up some more the code so it works for -DTURBO
- Cleaned the pvpoff @ and script commands.
- mob_get_random_id now has two additional flags to specify that the monster to acquire should not be a boss type (4) or that it should give exp (8).
- TK_MISSION will now pick any mob from the DB as long as it is not a boss type and it gives base exp.
- Fixed the double-stone issue when hitting a petrified character.
- Minor cleanups


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9573 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-26 15:07:18 +00:00
FlavioJS
dd92bd13fd - a couple of warnings fixed
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9572 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-25 08:21:49 +00:00
FlavioJS
8751fbd631 - Fixed buildin_getscrate, thanks Trancid.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9571 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-25 07:28:15 +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
11cb7227b2 - Fallback for parenthesis argument lists in the script engine. "func (exp) , ..." is valid again.
Why didn't I think of this earlier? /hmm

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9565 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-23 07:09:24 +00:00
FlavioJS
52245f90b9 - Moved "#include <limits.h>" to cbasetypes.h to ensure it's included before checking if UINT_MAX has been defined.
- Minor changes in pc_readdb related to max_level being unsigned.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9561 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-23 03:24:32 +00:00
skotlex
fa1c4b2e47 - Simplified the global function "getJobName"
- Simplified function agitcheck so it isn't crash prone. Now it takes no arguments, and will return whether WoE is on or not.
- Updated bundled scripts as required for this change.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9559 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-22 15:38:30 +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
6e0309bb2c - Applied Rayce's suggestions and fixes to the script engine (http://www.eathena.ws/board/index.php?showtopic=129185)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9554 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-21 18:12:29 +00:00
skotlex
39a8fa2eb6 - Changed a certain snprintf to strncpy, you really really really REALLY shouldn't use snprintf with a format argument that may contain unpredictable string sequences!
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9550 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-21 15:44:39 +00:00
FlavioJS
45036c5c06 - readded the >=0x81 equivalent until I figure out where the script engine is 'being naughty' O.o
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9547 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-21 03:14:41 +00:00
FlavioJS
15258dfdb0 - Moved md5calc to common
- Answered Skotlex's question and fixed "warning: comparison is always false due to limited range of data type" by restricting script words to ASCII characters only.
- Applied "svn:eol-style native" to makefiles and project files

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9544 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-21 01:16:30 +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
72bebf27fc - Now root script functions calls can have parenthesis (will take any parenthesis after the function as the start of the argument list).
This means "func (exp),exp;" isn't valid anymore and has to be changed to "func exp,exp;" or "func((exp),exp);" or something like that.
- Updated swordman.txt and knight.txt accordingly.

Only changed this because it was very annoying when I was creating the sample localized npc.
Don't expect more changes unless something similar happens again. Bottom line: we're in soft feature freeze and moving to eApp...

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9536 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-20 11:50:44 +00:00
FlavioJS
78b52bbb4b - Replaced our fix for "mes ();" crashing by jA's version. see trunk[8867] and stable[8927]
- Merged the fix for & having the same precedence as << and >> from jA.
- Merged the C_OP3 operator from jA: test ? if_true : if_false

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9533 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-20 09:09:21 +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
skotlex
e445c551c2 - Fixed SC_STRIPWEAPON failing on two-handed weapons.
- Minor changes.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9529 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-20 00:44:52 +00:00
skotlex
b19f78a17c - Fixed the setting hom_setting not being read at all.
- Minor cleanups


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9525 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-19 20:33:35 +00:00
skotlex
b8a2a5f905 - Added function skill_strip to handle stripping code. The RG strip skills and GS_DISARM use it now.
- Modified the strip-related status changes so they handle removing the equipped item instead of leaving it up to the skill-code. They return 0 when nothing could be stripped.
- Cleaned some the MD_DETECTOR code.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9499 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-14 18:15:24 +00:00
skotlex
84f8ec45d5 - Modified the skill damage packet and the knockback packets to mimic aegis sent packets for such skills.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9471 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-12 14:53:53 +00:00
toms
912fc7a427 Fixed npc commands atcommand & charcommand not working with a custom command_symbol
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9431 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-07 12:55:00 +00:00
FlavioJS
6fda364348 - Moved START_ACCOUNT_NUM and END_ACCOUNT_NUM from login.h to mmo.h and changed clif_guess_PacketVer to use that.
- Made the script engine big-endian compatible. (i know it's pointless because of the move to eApp, but just couldn't resist :S)
- Commented out the remnants of ladmin packet parsing in map-server.
- Added a warning when a player has an invalid packet version (shouldn't happen)

PS- also added info on clif_guild_basicinfo packet fields, if anyone is interested

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9408 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-05 07:24:29 +00:00
skotlex
1424d93e12 - Repairing items via scripts no longer displays "item has been repaired"
- Status Recovery again makes mobs unlock their current target.
- Moved requesting party/guilds from the char-server from pc_authok to pc_reg_received, since map_nick2sd and map_getallsd won't work until the characters are authentified. Also removed the guild master setting from clif_parse_LoadEndAck to pc_reg_received since guild master setting will work there.
- Fixed homun hunger timer being started on login even when hom is vaporized/dead.
- Fixed mvp exp attacker bonus applying incorrectly.
- Removed duplicate msg_athena.conf entries 619 and 620 for Ninja/Gunslinger.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9401 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-04 15:37:09 +00:00
skotlex
231f495291 - Removed sd->sex since it's redundant (we can always use sd->status.sex)
- If somehow a player logs out and it's saved with 0 hp, on login his state will be set to dead as well so he can respawn (otherwise that leads to a stuck char)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9398 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-03 19:46:43 +00:00
Lance
e82fd31056 * Added buildin_checkvending and buildin_checkchatting.
modified   Changelog-Trunk.txt
modified   src/map/script.c


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9395 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-03 09:37:36 +00:00
skotlex
8e68089e85 - Fixed passive mobs becoming increasingly unlikely to retaliate to attacks after they got inflicted by a disabling status change.
- Changed the "is_boss" define to check for mode MD_BOSS instead of giving mvp exp.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9384 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-02 01:49:27 +00:00
skotlex
2de8486627 - Fixed txt-converter compilation.
- Added my_global.h include to login converter
- Removed sd->char_id since we can use sd->status.char_id instead.
- Small speedup in STRECOVERY, and made it not unlock a mob's target.
- Fixed GS_GROUNDDRIFT consuming ammo when it's time expires (so it was consuming 2 grenades instead of one). Also added a "explosion effect" when their time runs out.
- gvg_dungeon mapflag won't set pvp related mapflags anymore, pc_dead will force pvp ranking gain/loss on gvg_dungeon maps now.
- Now when coming out of hiding land-effects will trigger on the character.
- Made the pc_setpos message when being placed on an unwalkable tile tell you which player triggered it.
- Fixed land effects not taking effect inmediately on map-load when the invincible timer is disabled.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9374 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-01 17:17:09 +00:00
Lance
b59e7b8596 Minor tweak in
modified   src/map/script.c


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9373 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-01 04:06:18 +00:00
skotlex
b421d38216 - Added overflow protection to @main whisper parsing.
- Fixed a bug in slaves_inherit_speed
- Miscellanous silly cleanups (format, unnecessary assignments, comments, etc)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9367 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-29 20:11:12 +00:00
skotlex
964ede96d5 - Fixed uninitialized variable fd being used in WFIFOHEAD in a few clif functions.
- Some cleaning in the script.c functions that invoke the clif functions to make sure a null sd is never passed.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9308 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-24 13:53:21 +00:00
Lance
05b2d83b43 * Completed Reddozen's hanging mapwarp code to support party and old syntax.
modified   Changelog-Trunk.txt
modified   src/map/script.c


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9305 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-24 05:25:01 +00:00
Lance
9b4d416b15 git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9269 54d463be-8e91-2dee-dedb-b68131a5f0ec 2006-11-20 12:43:39 +00:00
Lance
11e7a6e143 - atcommand and charcommand backwards compatibility
modified   src/map/script.c


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9268 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-20 12:39:27 +00:00
Lance
d4e444ebd4 - Removed security check since source level patch is applied. Reverted select(), created prompt().
modified   Changelog-Trunk.txt
modified   npc/airports/airships.txt
modified   npc/cities/amatsu.txt
modified   npc/cities/gonryun.txt
modified   npc/cities/hugel.txt
modified   npc/cities/lighthalzen.txt
modified   npc/cities/niflheim.txt
modified   npc/cities/valkyrie.txt
modified   npc/custom/eAAC_Scripts/disguiser.txt
modified   npc/custom/eAAC_Scripts/quest_warper.txt
modified   npc/custom/jobs/jobmaster.txt
modified   npc/events/idul_fitri.txt
modified   npc/jobs/1-1e/gunslinger.txt
modified   npc/jobs/1-1e/ninja.txt
modified   npc/jobs/novice/novice.txt
modified   npc/merchants/kunai_maker.txt
modified   npc/merchants/novice_exchange.txt
modified   npc/merchants/refine.txt
modified   npc/other/comodo_gambling.txt
modified   npc/other/dts_warper.txt
modified   npc/other/marriage.txt
modified   npc/other/powernpc.txt
modified   npc/quests/Lvl4_weapon_quest.txt
modified   npc/quests/gunslinger_quests.txt
modified   npc/quests/quests_ein.txt
modified   npc/quests/quests_umbala.txt
modified   npc/sample/monster_controller.cpp
modified   src/map/script.c



git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9267 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-20 10:11:20 +00:00
Lance
22de482fce * Hack protection from packet monkeys in clif_parse_NpcSelectMenu.
modified   Changelog-Trunk.txt
modified   src/map/clif.c
modified   src/map/map.h
modified   src/map/script.c



git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9261 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-19 06:08:49 +00:00
Lance
97919b1a6f * Added 'cancel' button parsing in buildin_select menu system. Now scripts will continue to load if 'cancel' is pressed and 255 will be returned.
modified   Changelog-Trunk.txt
modified   notice.txt
modified   src/map/script.c


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9258 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-19 04:15:32 +00:00
Lance
3bfc48996a * Fixed potential crash in IRC processing message with '%' using *printf.
* Fixed memory leaking caused by homun_data not freed when removed.

* Minor adjustments to sign/unsign in script commands.

modified   Changelog-Trunk.txt
modified   src/map/irc.c
modified   src/map/script.c
modified   src/map/unit.c


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9245 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-17 16:48:04 +00:00