758 Commits

Author SHA1 Message Date
brianluau
c775425157 - Changed 'specialeffect' when <send_target> is SELF, it will display the effect to the attached RID (if there is one) instead of the npc. (topic:243842)
- Changed 'movenpc' to accept an optional argument for direction. (topic:206973)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14776 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-04-06 23:49:05 +00:00
ai4rei
04d4e18863 * Improved changes to script command 'waitingroom' from r14772.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14773 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-04-06 16:55:59 +00:00
ai4rei
fbb16c5ccb * Fixed script command 'warpwaitingpc' not checking, whether or not the player still has required amount of Zeny (since r14765).
- Fixed warping through 'warpwaitingpc' to savepoint would take the fee twice ( missing {} ).
- Fixed random warping through 'warpwaitingpc' would not take away fee Zeny at all.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14772 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-04-06 16:06:28 +00:00
Kisuka
bf12d754cc - Completed L0ne's 2007 request for 'waitingroom' to support required zeny and level.
- Updated NPC files which required the waitingroom update.
- Added Poring War script.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14765 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-04-05 06:00:20 +00:00
ai4rei
bba102a818 * Added separate character state for vending (like for buyingstore), instead of vender_id != 0 (follow up to r14682, related r14713).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14762 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-03-27 18:43:31 +00:00
ai4rei
015d2ae95c * Fixed @item2 and script command 'getitem2' not taking MAX_REFINE define into consideration (bugreport:4804).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14739 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-03-08 18:55:27 +00:00
ai4rei
6b74ef9b50 * Implemented search store info system (aka. vending and buying store search) together with related items.
- Requires 2010-08-03aRagexeRE or later and can be disabled in 'conf/battle/feature.conf'.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14732 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-03-06 19:16:09 +00:00
ai4rei
ffe2f08b20 * Fixed possible crash in script_reportdata, when a script string becomes NULL.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14731 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-03-05 08:53:26 +00:00
ai4rei
ce3f78556c * Implemented buying store system (aka. reverse vending, purchase shop) together with related skill and items, without NPCs.
- For SQL apply upgrade_svn14713_log.sql to upgrade tables `picklog` and `zenylog`; for TXT no action is necessary.
- Requires 2010-04-20aRagexeRE or later and can be disabled in 'conf/battle/feature.conf'.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14713 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-02-19 12:59:36 +00:00
ai4rei
531584b648 * Fixed a crash when script 'npctalk' is given too long string (bugreport:4759, related r2145).
- Fixed related buffer overflows in message related clif functions (since r1182, r14270).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14704 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-02-14 12:49:08 +00:00
ai4rei
9f2620f2fa * Fixed script command 'bpet' (Pet Incubator) displaying an empty egg list when attempting to hatch a pet while already having one out (bugreport:3313).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14702 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-02-09 11:27:27 +00:00
ai4rei
63321f205e * Moved script constant manipulation code into separate functions script_get_constant / script_set_constant. [Ai4rei]
- Added protection against overwriting existing names in script constant creation code.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14701 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-02-08 10:43:51 +00:00
ai4rei
4592b9832d * Updates to various client packets.
- Renamed clif_set0199 and clif_send0199 to clif_map_property and clif_map_property_mapall respectively and added an enumeration for currently known map properties.
- Renamed clif_set01D6 to clif_map_type and added an enumeration for currently known map types.
- Resolved undocumented field of packet 0x22e (ZC_PROPERTY_HOMUN) to attack range.
- Fixed aspd field of packet 0xbd (ZC_STATUS) getting filled with karma value.
- Removed commented clif_skillinfo (duplicate of clif_item_skill).
- Other minor comment updates and 'FIXME' assignments.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14698 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-02-08 00:37:33 +00:00
ai4rei
bc2ec92a4a * Replaced 'nameid < 500' checks in script commands 'countitem', 'countitem2' and 'autoequip' with stricter ones.
- This should stop meaningless itemdb_search warnings from said commands when an invalid item id is used.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14696 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-02-06 12:18:46 +00:00
ai4rei
0045508031 * Fixed closing 'switch' curly not causing script EOL processing to trigger, leading to the script line after the switch being handled as belonging to the curly-less statement block (bugreport:3273, since r3422).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14694 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-02-06 01:02:57 +00:00
ai4rei
7557d37013 * Various accumulated cleanups and fixes.
- Improved the compile speed for files which include common/socket.h on windows builds (related r10471).
- Moved FIFOSIZE_SERVERLINK define from common/mmo.h to common/socket.h (since it is a server connection FIFO size setting).
- Fixed script command 'areamobuseskill' canceling monster's skill cast before it determined it's new target, which could be 'none' (bugreport:3272, since r13897).
- Added a protection against attempts to read an empty backup / write to a full backup in skill_dance_switch as per TODO from r11347.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14690 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-31 12:39:54 +00:00
ai4rei
178cc183ab * Fixed a map-server crash, when a script attempts to call a local function, which has only a forward declaration. Such functions now count as script parse error (bugreport:4009, since r3422).
* Fixed definitions of local functions would set a label reference, even when their name was already taken (follow up to r14600, since r3422).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14675 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-16 12:51:27 +00:00
ai4rei
a4b7cce2c5 * Various accumulated insignificant fixes to documentation, examples and comments.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14674 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-15 20:12:51 +00:00
ai4rei
ad4e9bbee1 * Replaced remaining occurences of '-1' with 'INVALID_TIMER', where appropriate (follow up to r12998).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14670 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-14 21:00:38 +00:00
ai4rei
825df9dda1 * Fixed script command 'cleararray' setting 1 element more, than it is told to (bugreport:2047, since r12253).
- Fixed 'inaccessible element 127' issue in 'cleararray', 'setarray' (since r10813) and 'copyarray' (since r14608) script commands (bugreport:864, related r12253, follow up to r14608).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14663 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-10 20:45:18 +00:00
ai4rei
4cd68d40e1 * Made script command 'charisalpha' always return 1 when 'isaplha' is true, rather than to return the return value of 'isalpha' which is only defined as zero/non-zero and can be different from 1 (bugreport:2024, related r2003).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14661 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-10 09:56:19 +00:00
ai4rei
7c8ea87859 * Fixed script command 'deletearray' deleting incorrect amount of array elements from arrays with empty elements (bugreport:4628).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14652 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-06 06:00:30 +00:00
ai4rei
03933a951b * Fixed ends of statement blocks missing script EOL processing, thus causing 'next line' label (-) to misbehave in statement blocks without additional curly braces (bugreport:4417, since r3422).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14651 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-05 10:37:25 +00:00
ai4rei
75ca2f146a * Fixed improper use of itemdb_search. It does not return NULL but a dummy item, if the item id is invalid.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14642 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-30 17:23:54 +00:00
ai4rei
33d2446b11 * Collection of random insignificant changes.
- Added progress indication on map-server shutdown when objects are removed from maps, as it takes significant amount of time to complete.
- Moved ers_free in db_obj_vclear, so that the node pointer is not used for comparison after it has been freed.
- Some documentation of shop packets.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14639 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-29 21:31:36 +00:00
brianluau
85d04b3cfb - Added missing script_pushint() in 'checkweight' that were forgotten in r14629.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14631 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-26 22:22:04 +00:00
ai4rei
b0a320808c * Cleaned up script command checkweight.
- Replaced some code parts with calls to pc_checkadditem and pc_inventoryblank (follow up to r13735).
- Fixed item id not getting checked for validity properly.
* Moved MAX_AMOUNT check in pc_checkadditem to the top of the function, to prevent unnecessary inventory scan before it.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14629 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-26 16:42:39 +00:00
ai4rei
226fa32b4c * Fixed items, that get dropped at 100% chance, being reported in @iteminfo as 'available in the shops only' (since/replaces r3482).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14627 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-26 13:32:07 +00:00
ai4rei
e07b6c4caa * Updated script commands delitem and delitem2.
- Items are now deleted only if there is enough of them (as per r14395, related r13368).
- Not equipped items are now actually prioritized over equipped ones (related r200).
- Fixed item id not getting checked for validity.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14623 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-25 23:00:05 +00:00
ai4rei
b86d48e71a * Added script_setarray_pc for setting temporary character array variables outside of script.c without requiring them to use script-interal code (add_str and reference_uid).
- Applied script_setarray_pc to assignment of dynamic shop arrays (related r5841).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14613 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-21 23:23:06 +00:00
ai4rei
cbf4ef5dd5 * Replaced in-place generation of uid of script array elements with reference_uid macro (follow up to r10813).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14612 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-21 22:52:25 +00:00
ai4rei
7c90fd1bf1 * Fixed dynamic shop arrays @bought_nameid, @bought_quantity, @sold_nameid and @sold_quantity not getting reset to zero before use, thus providing attached script with wrong/old data, if it did not clear them by itself in previous call (bugreport:1574, since r5841).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14611 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-21 21:30:46 +00:00
ai4rei
e45ba2f126 * Replaced maximum script array size literals with a define (constant).
- Fixed an off-by-one mistake in copyarray, allowing to copy 1 element more into the target array, than allowed (since r10813).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14608 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-19 15:21:46 +00:00
ai4rei
867b706234 * Made the 'player not attached' script error also report the function it occured in, if available.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14602 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-18 01:19:16 +00:00
ai4rei
89dc57acdc * Fixed a crash, when script command 'doevent' is called without an attached player (bugreport:3973).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14601 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-17 23:41:02 +00:00
ai4rei
d59156d971 * Fixed label definitions silently overwriting built-in script functions (bugreport:2806, follow up to r8027).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14600 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-17 22:54:13 +00:00
ai4rei
f964fb6ec2 * Random script engine clean-ups that have accumulated over time.
- Resolved unnecessary script_getnum re-evaluation in a loop in script command 'npcshopdelitem' (since r7120).
- Script commands 'menu', 'select' and 'prompt' now warn, when there are more menu options, than the client can handle correctly (TODO from r10316).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14597 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-17 12:40:38 +00:00
ai4rei
ddca23e35d * Corrected type of second argument of script command 'setbattleflag' from string to number (bugreport:4640, topic:261833, since r5407, related r14577).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14593 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-15 23:50:42 +00:00
ai4rei
e7fec551b1 * Removed disabled backup of script command 'isequipped' (since r1605).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14586 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-12 18:06:14 +00:00
ai4rei
edfc3293e5 * Made script engine's DEBUG_DISASM block use script_op2name, rather than hardcoding operator names as per TODO from r13083 (related r9569, follow up to r10667).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14585 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-12 16:09:18 +00:00
ai4rei
6a0558d0c2 * Fixed impossible condition in soundeffect script command (since athena-dev-2.1.1-mod1046, related r5841).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14583 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-12 13:48:14 +00:00
ai4rei
adc89d50f4 * Updates to the playBGM functionality (since r14335).
- Removed impossible condition in playBGM script command (from soundeffect).
- Removed unused code (retrieving of a bl) in playBGMall (from soundeffectall).
- Made playBGMall default to 'entire server' when both map name and coordinates are omitted instead of printing an error.
- Updated documentation for playBGM and playBGMall to match actual behavior.
- Removed unused parameter 'bl' in clif_playBGM.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14582 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-12 13:10:08 +00:00
ai4rei
6aabf7c260 * Fixed script command setd always assuming value parameter to be a string, which causes hexadecimal and octal numbers not being handled properly (topic:261833, followup to r14577 and r14578).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14581 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-12 01:38:41 +00:00
brianluau
8c9202976a - Fixed argument declaration of 'setd' (topic:261833, related r14573).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14578 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-12 00:12:10 +00:00
ai4rei
6a684a566b * Added support for checking argument data type of built-in script functions (bugreport:1701, topic:261833, related r14573).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14577 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-11 21:52:27 +00:00
ai4rei
806daea231 * Replaced buildin_getpartyname_sub, buildin_getguildname_sub and buildin_getguildmaster_sub, which create only unnecessary overhead, with equivalent inlined code.
- Fixed a memory leak in getguildmasterid, when the guild leader was not online (bugreport:2743).
- Command getguildmasterid no longer requires the guild leader to be online.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14575 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-11 01:23:38 +00:00
ai4rei
e560ba458b * Revised argument declaration of all script commands according to the actual functions' argument usage.
- Fixed many script commands with fixed amount of optional parameters to no longer accept any amount of arguments (faulty declaration).
- Corrected use of dummy parameter for guildopenstorage in scripts.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14573 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-10 22:29:12 +00:00
ai4rei
e26ea94a2f * Reverted r14563, due to multiple issues which render the source malfunctioning or uncompilable. To be redone later (bugreport:4627).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14567 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-07 19:45:24 +00:00
Paradox924X
ca53ef6f4a Changed almost all instances of sprintf() to snprintf().
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14563 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-07 18:38:03 +00:00
ai4rei
c8cae9e659 * Removed clif_weather_sub and clif_misceffect2 in favor of clif_specialeffect_single and clif_specialeffect (all of them are ZC_NOTIFY_EFFECT2).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14541 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-02 12:08:44 +00:00