157 Commits

Author SHA1 Message Date
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
Lance
5120d7677c * [Scripting Engine Update] New variables are ready to be used.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6703 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23 08:22:53 +00:00
Lance
aaa3738ed9 Dunno what the hell the causing the errors when using '@variables, 'variables works fine.. something is messing up....
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6702 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23 08:01:40 +00:00
skotlex
98de35a4f7 - Fixed a possible null pointer in script command misc_effect
- Modified Investigate to take into consideration final def/vit-def rather than base values for damage adjustment.
- Added missing include unit.h in pet.c


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6695 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-22 14:38:18 +00:00
Lance
2870364349 - Fixed some of the leaks.. still fixing..
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6691 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-22 12:38:12 +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
3fbb543cfc * Speed up array size calculation and deletion.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6676 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-21 08:09:20 +00:00
Lance
fdfaf7ba79 * jA1983 script.c buildin_menu fix. Thanks to End_of_exam.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6665 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-20 15:01:47 +00:00
Lance
38703db7c9 git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6593 54d463be-8e91-2dee-dedb-b68131a5f0ec 2006-05-15 09:55:50 +00:00
Lance
f5631c0f3f * Added NPC event deprecated warnings to ease debugging old scripts.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6592 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-15 09:54:51 +00:00
skotlex
46d5c713cd - Updated cast times of Kaupe and Kaahi.
- Some small code cleanups.
- Sma has cast-dex reducable now.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6564 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-12 16:30:51 +00:00
skotlex
ae5d5020c0 - Changed wedding costumes to use setoption rather than changebase.
- Modified setoption so that flag 1 or no flag adds an option, and flag 0 removes it.
- Updated script_commands with the new behaviour.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6548 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-10 13:43:00 +00:00
skotlex
73b98ea723 - Updated setoption script command to receive a second (optional) argument flag. If the flag is 1, the option is added to what the player currently has; likewise using flag 2 removes only that option. No flag (or any other value) is the older behaviour of removing all other options and setting specificly what is passed.
- Updated script_commands information for setoption due to this change.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6538 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-09 21:09:53 +00:00
skotlex
05667b0fa9 - Script commands sc_start, sc_start2 and sc_start4 will now start regardless of sc defense of the target player (that is, they cannot be avoided)
- Fixed a possible counter overflow in attacked_count, changed the var size to unsigned char since the code can handle the overflow now.
- Multiple targets again reduces armor defense, as reported by Tharis.
- Increased dex increase of NPC_POWERUP to +20 per level.
- Fog of Wall's -50 hit reduction is now only for ranged attacks.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6528 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-09 17:08:09 +00:00
Lupus
a866920e15 removed old logs
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6510 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-07 09:50:37 +00:00
Lance
49fc4fe81d * Optimized fake npc system. Added npc_checknear back to npc_buysellsel.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6426 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-01 05:48:06 +00:00
skotlex
f95ab0abbe - If someone is expulsed from a guild while the guild storage is open, it will be auto-closed now.
- Modified battle_consume_ammo to prevent consuming multiple arrows on AC_SHOWER.
- Readded script command skillpointcount. (who removed it? <.<)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6406 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-30 18:41:05 +00:00
Lance
e70b7a0837 - and more typos
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6389 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-30 03:23:01 +00:00
Lance
91ea6a4e09 Fixed typo in script.c
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6388 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-30 03:18:14 +00:00
skotlex
f0fc466d8b - pc_resetskill flag can now be &2, it only returns the total amount of skill points spent, it doesn't does a reset.
- added script command skillpointcount. Returns total amount of skill points a char has (the value returned is the same that SkillPoint would have after invoking a skill reset)
- Modified Defender. Speed reduction is 35-5*lv%, damage reduction on devoted chars is 5+5*lv%. These values are custom, but should be closer to "reality" than what we have.
- When you have the wrong ammo type equipped, the equip arrows first message will be sent, as suggested by Haplo


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6384 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-29 20:51:07 +00:00
Lance
2fc07bb1c8 * Reverted npc_checknear to exclude check for class_ -1.
* Removed npc_checknear in npc_buysellsel, npc_selllist and npc_buylist as enough preventive measures of hacking are already implemented.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6370 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-29 13:25:12 +00:00
Lance
020b35d68a * Using malloc for memory allocations that doesn't need to be pre-initialized.
* Eliminated initializations for pointers returned by calloc.
* Moved grfio_final to do_init since it's not used after server boot.
* Optimized scripts to return CONSTSTR instead of allocating memory just to return a constant string. Some buildin functions still need work. 
* Disabled graph since it doesn't work yet.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6355 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-29 04:00:19 +00:00
skotlex
38a15cc4e1 - Fixed compilation error/warning on script command setbattleflag.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6323 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-27 18:27:43 +00:00
skotlex
6e1f885043 - Small change in the pet_ai that should stop the "strange" catch-up behaviour of pets when you are much faster than them.
- Corrected the unequip script of the wedding dress/tuxedo (it should be Class, not bClass)
- Changebase script command will also refresh the weapon sprites (in case you changed into Wedding/Xmas class)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6317 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-27 15:15:22 +00:00
skotlex
21b2151c97 - Added the missing clif_* calls to make changebase's view-class change update on the client.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6312 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-27 13:40:15 +00:00
Lupus
b662c487e4 updated 'setmapflag' script command
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6304 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-27 05:55:23 +00:00
skotlex
af55aa1e6e - Updated item_db.sql to current.
- Some small code-cleanups.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6298 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-26 23:01:55 +00:00
skotlex
d66d94cd80 - Item use interval is set to a default of 100ms now.
- Updated Full Buster so that the can't act delay carries on to the weapon attack delay and can't use item intervals.
- Added script command getbattleflag to retrieve the current value of a battle_config switch.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6296 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-26 21:12:08 +00:00
skotlex
56571363d2 - Wedding Dress/Tuxedo now handle view-change using the onequip/onunequip scripts.
- Removed special state changebase and view-change check on status_calc_pc


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6292 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-26 15:35:47 +00:00
Lance
33916be18e * Fixed typo in skill.c: skill_clear_group
* Fixed command descriptions in script_commands.txt
* Cosmetic changes to script.c

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6289 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-26 08:03:03 +00:00
skotlex
f983dc57c3 - Modified and simplified the random item group format. It now is <GroupID>,<ItemID>,<Rate>, where Rate normally is 1, greater numbers is the equivalent of adding the line multiple times.
- Added constants to identify all groups to db/const.txt
- Cleaned up and updated item_db to use these new constants (warning: item_db.sql needs to be updated!)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6275 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-25 18:05:40 +00:00
skotlex
5c222891f3 - Added script command escape_sql. It will return an escaped string for use in the sql_query script command (in case you want to use input of players in your queries).
- Removed the skill packet from TK_RUN as the client ignores the walkok packet sent right after it.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6262 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-24 23:09:12 +00:00
skotlex
8934d52b73 - Removed the max cap of autoloot so you are now allowed to set autoloot values above 100.
- Initialized w1/w2/w3/w4 before reading each npc line to avoid sending unread values to the parsers (for example, if w4 has a value in one line and none on the next, it will be parsed with the previous value of w4 on the following lines)
- Updated getpartymember to receive an int which specifies what to retrieve. 0: Character names (array $@partymembername$), 1 character char ids (array $@partymembercid), 2 character account ids (array $@partynameaid). By default it returns party member names.
- Updated script_commands.txt with the updated behaviour of getpartymember.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6182 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-19 18:44:01 +00:00
skotlex
c176a131f0 - Fixed the delete_timer (@summons, alchemist plants) not invoking unit_free, hence causing memory leaks and the like.
- Applied jA's patch to fix a bug in the scripting engine in regards to priority of operators. Thanks to End of Exam for the information.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6161 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-18 17:07:16 +00:00
skotlex
6b9fd3cf04 - Removed message 592 from trade.c
- Removed mapflag nopvp
- Added support for disabling mapflags on a mapflag line:
  comodo.gat	mapflag	nomemo <- turns on nomemo mapflag
  comodo.gat	mapflag	nomemo	off <- turns off nomemo mapflag
- Cleaned up and optimized the restricted/zones mapflag. Restricted cards will just not work in disallowed maps rather than blocking the compounded equipement from being used.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6159 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-18 16:01:26 +00:00
Lance
95f2b0089f Modifying st->oid is dangerous. Using sd->state.using_fake_npc as identifier instead.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6152 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-18 11:43:18 +00:00
Lance
c0b1eb7787 * Shinomori's method (kinda) of remote script execution with interaction.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6151 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-18 11:40:36 +00:00
Zido
736c2bd9ca Refer to changelog
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6141 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-17 19:12:01 +00:00
skotlex
97af776e02 - Added special_state changebase to identify when a character has a special-view associated with some equipment to correctly revert the look when you take off said equipment (fixes tuxedo/wedding dress when you use modify_wedding_display: yes)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6002 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-12 02:55:39 +00:00
skotlex
42c6f89d86 - Multiple optimizations to the unit_data auto-chase upgrade, also simplified the mob and pet ai routines.
- Simplified the walk routines to half the number of timers required for walking.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5982 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-11 04:10:41 +00:00
Zido
2113db40cb - Wedding Sprites fixed
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5957 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-08 09:28:02 +00:00
skotlex
16e8d42194 - Fixed script command mapwarp.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5895 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-03 22:05:14 +00:00
Lance
85843bfe0f * Should not exit when you can't find an NPC file..
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5845 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-01 09:48:17 +00:00
Lance
63eb37dc33 typo
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5844 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-01 09:40:31 +00:00
Lance
dcc37512f0 bl.subtype check.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5843 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-01 09:40:09 +00:00
Lance
008b473603 Fixed the dynamic shop system memory allocation and id_db problem. Added sample script.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5842 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-01 09:37:50 +00:00