138 Commits

Author SHA1 Message Date
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
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
f2e352bb0f * Fixed compiler warnings.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5838 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-01 05:30:12 +00:00
skotlex
e9c44b50c8 - Added structure view_data to handle sprite information for all characters (equipment, weapons, hair, dyes, etc). Unified a bunch of clif functions now that you only need to handle the view_data (so instead of clif_spawn[pc/mob/npc/pet] you just have clif_spawn)
- Fixed the clif_change_class packet (it should check for non players classes, not a class above MAX_PC_CLASS), it fixes morphing enemies.
- Rewrote the way cloth dye packets are resent to optimize bandwidth usage.
- Fixed the npc_item_flag thing (enable_items/disable_items script command)
- Rewrote the disguise implementation to be bandwidth friendly.
- Modified the hide options to change your class to INVISIBLE_CLASS, since such classes don't even get their view packets sent around.
- Rewrote several clif functions to adapt to the new view_data class;
- Added class 139 to npcdb_checkid which was required by some npcs in the swordman quest? o.O


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5833 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-01 02:23:56 +00:00
Lance
343deba71c * April fool! Improved soundeffectall script command. (No, this is not a lie)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5832 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-01 02:11:23 +00:00
foruken
57ce40d17a Added year day return in gettime function. gettime(8) returns 1~366
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5816 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-30 18:09:09 +00:00
skotlex
323a04f86d - Modified script commands atcommand/charcommand to execute even if there isn't a player attached. They'll use a dummy player data with the same position/name as the script's owner (usually an npc)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5738 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-24 21:02:44 +00:00
Lance
b8116f49db * Minor cleanups.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5712 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-23 07:08:31 +00:00
skotlex
7a8371273a - Merged the unit_data structure from jA for handling unit-related data (attack times, walking, auto-attack timers, skill related data)
- Modified unit_skillcastcancel to receive flag&2, which stands for "cancel casting only if current skill is cancellable"
- Battle config options changed from yes/no to BL_TYPE settings: skillrange_by_distance, skill_noreiteration, skill_nofootset, gvg_traps_target_all, skill_log, attack_direction_change, auto_counter_type
- Clif.c will disconnect sessions that send an unknown command packet above 0x30000 instead of just ignoring it.
- Cleaned up/rewrite of the pet ai, same for pet_calc_pos
- Implemented use of mob variable attacked_players as it is used on jA
- Cleaned up error reporting during mob-skill loading to be less spamy with non-loaded mobs.
- Corrected water_height reading. I forgot to give credits to LittleWolf for providing the water-reading function :X


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5707 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-22 23:58:16 +00:00
Lance
0e1c1ec72e * Fixed event_kill_pc to behave like what it should instead of another replication of event_death. Added script function rid2name to convert bl ids to name.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5663 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-19 05:14:59 +00:00
Lance
6ef4e75bb4 * Recoded getmobdata script function. Fixed mob_damage typo sd -> mvp_sd. Cleanep up confusing indentation in clif.c.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5661 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-19 04:36:53 +00:00
Lupus
9a51949029 added script function 'getmonsterinfo'
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5659 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-18 14:41:02 +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
skotlex
a8aba5331a - removed auto-attaching of player-run scripts in initnpctimer. You must use attachnpctimer!
- updated juperos elevator script to invoke attachnpctimer as it should be.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5643 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-17 13:42:14 +00:00
Lance
ceea8fde6c * Final fix on Juperos NPC.
* Fix on initnpctimer not attaching rid.
* Fix on OnTouch ignoring -1 NPCs.
* Fix on @reloadscript crashing due to passing non BL_SKILL bl to a function that accepts only BL_SKILL bl.
* Added area NPC detection in clif_parseLoadEndAck.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5638 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-17 06:39:58 +00:00
Lance
2d6182f027 * Fixed compiler warning in script.c get_mob_data.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5635 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-17 03:47:08 +00:00
Lance
d5cf7d95e0 * mob_chat_sub fix. Added buildin_pcblockmove.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5628 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-16 16:08:01 +00:00
Lance
46bdee18f9 * BL_PC and BL_MOB control script commands (experimental).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5627 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-16 15:39:49 +00:00
skotlex
8955a37a9b - Added mapflag nodrop, fixed mapflag notrade.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5619 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-15 21:07:00 +00:00
skotlex
d842b9f68d - Fixed script command warpparty looking for an attached player even when it is not needed.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5592 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-13 20:16:27 +00:00