summaryrefslogtreecommitdiff
path: root/src/map/npc.c
AgeCommit message (Collapse)AuthorFilesLines
2006-05-23- the charname request hack message has been downgraded to only include ↵skotlex1-2/+3
GM-invisible characters. - corrected clif_charnameack to send negative ID when a disguised player asks for it's own disguised name. - Cleaned up the disguised target-id checks taking into considering that the only character that sees a negative ID is the same disguised character. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6715 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23* Added 'setd' support for local NPC scope (') variables.Lance1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6704 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-22- Fixed some of the leaks.. still fixing..Lance1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6691 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-22* WARNING: New scripting system contains memory leakLance1-4/+6
TODO: Free all scripts using script_free_code() instead of old methods. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6690 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-15- When reading mapflags, when a map is set to be pvp or gvg, the other will ↵skotlex1-0/+9
be turned off (disables pvp mapflags in gvg maps for pk-servers) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6610 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-14* Bugfix on fake npcLance1-7/+12
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6585 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-11- Changed a bit the MAX_ZENY checks in trade.c to prevent overflows.skotlex1-34/+54
- Rewrote npc_selllist for a more proper-clean implementation. - Increased NPC_POWERUP's dex bonus to +25*lv - Moved TK_DOWNKICK's stun time from time to time2 - Added TK_TURNKICK's stun to splash-pushed mobs. Duration is 2secs (time2) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6557 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-08- Removed SP_DISGUISE from the bonus list.skotlex1-2/+3
- Moved Sharp Shooting display to the block with Auto-Counter (since that's the other skill that can show critical as well) - Corrected some fields in the still packet (guild emblem being stored as a Long when it should be Short) - Modified most fields of view_data to be unsigned shorts rather than signed ones. - On-Touch NPCs will now make you stop walking when you trigger them. - Reduced stun duration of most skills to 3 secs. - ShadowJump/JumpKick will make you land on the target's cell now. - Fixed Kaahi triggering only once per skill duration. - Added the kaahi_heal_timer to the list of status change functions. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6516 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-06- Added missing include <limits.h> to npc.c...skotlex1-0/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6499 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-05- Added a npc-script-event cache to avoid looking up event-scripts every ↵skotlex1-1/+103
time they need to be executed. Events cached are all those defined in script_config. - Since the cache holds direct pointers to the npcs/events, do NOT unload the related NPCs or you'll get dangling pointers. However, @reloadscript will work fine. - Set the etc_log to on to see a summary of npcs/events loaded for script execution on startup. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6494 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-02- Corrected a crash when sd is null in npc_eventskotlex1-1/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6440 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-01* Optimized fake npc system. Added npc_checknear back to npc_buysellsel.Lance1-7/+8
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6426 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-30Fixed scripts relying on older event calling methods.. Still searching for ↵Lance1-1/+1
other scripts.. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6396 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-29- Cleaned up unused variables in npc.cLance1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6383 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-29* Reverted npc_checknear to exclude check for class_ -1.Lance1-8/+9
* Removed npc_checknear in npc_buysellsel, npc_selllist and npc_buylist as enough preventive measures of hacking are already implemented. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6370 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-29- Clones can't be class-changed nowskotlex1-2/+2
- Readded the class == -1 distance check in npc_checknear - Replaced check sd->trade_partner for sd->state.trading in clif.c git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6356 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-29* Using malloc for memory allocations that doesn't need to be pre-initialized.Lance1-18/+17
* 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6355 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-25- Modified and simplified the random item group format. It now is ↵skotlex1-2/+0
<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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6275 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-25- Simplified npc_gettimerevent_tick so that it should return a tick value ↵skotlex1-18/+2
even after the last ontimer label has been reached. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6264 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-24- Fixed a typo when parsing the mob spawn files.skotlex1-4/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6256 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-24- Cleaned up @grind2skotlex1-0/+10
- Updated @monsterbig, @monstersmall to use the event 2 and 4 rather than the max_mob_db code check. - Modified override_mobs_names to work only on the mob spawn files. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6252 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-23git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6239 ↵shinomori1-1/+8
54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-20- Added support for n to specify minutes to @charban. skotlex1-0/+1
- Fixed a logic typo on the way dummy_npc_id was defined. - Added state.trading to specify when a trading has started. Now you should be able to walk around until the trade is either rejected or started. - Armor defense is no longer reduced by the amount of characters targetting you. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6192 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-19- Removed the max cap of autoloot so you are now allowed to set autoloot ↵skotlex1-0/+3
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6182 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-18- Removed message 592 from trade.cskotlex1-53/+59
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6159 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-18* Shinomori's method (kinda) of remote script execution with interaction.Lance1-2/+8
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6151 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-17- Changed the npc_id mismatch warning to be more informative.skotlex1-1/+1
- Modified @monster command to use map_search_freecell (prevents mobs spawning on non-walkable tiles) - Modified @nuke to invoke skill_cast_nodamage_id instead of the damage_id version (fixes sprite and splash damage for the skill) - Corrected Venom Knife's requiring two knives per use. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6124 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-16- Fixed mysql ping setting being in minutes rather than hours.skotlex1-0/+1
- Removed npc_event_sub from npc.h and moved it to npc.c - Cleaned up #warp to prevent spitting non-walkable tile warnings. - Changed the meaning of msg_athena 2, it is now "invalid target cell, randomizing". git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6114 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-16Optimized. (What am I thinking)Lance1-4/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6111 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-16Fix my fix.Lance1-3/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6110 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-16* Missing lines in npc_parse_script!Lance1-0/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6109 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-16* Experimental npc_event_doall_sub with queue and npc_id allocation when needed.Lance1-29/+41
* Added warnings to npc_scriptcont for easier debugging. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6106 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-13- Added an Info message when pinging the SQL servers.skotlex1-1/+0
- Changed line terminators back to *nix on map.c because otherwise it's impossible to run a diff between the stable and trunk versions of the file. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6043 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-12- Expanded the warp warning so that it also warns when a warps takes you to ↵skotlex1-9/+14
a non-walkable tile. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6019 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-08- Fixed @movenpcskotlex1-3/+7
- Cleaned up and improved the lootsearch routine to pick nearest item. - Added INVISIBLE_CLASS to the list of classes supported by npc_get_viewdata - Fixed trying to set the view_data for npcs who are located on a map, but have no visual data. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5959 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-08- Added function status_change_init to initialize all the sc timers. Added ↵skotlex1-6/+9
sc_data initialization to the npc structures who were missing them. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5953 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-05- Added inter config connection_ping_interval which specifies interval in ↵skotlex1-2/+2
hours at which mysql_ping's must be done on all connection handles to keep the mysql connection alive. Defaults to 0 (disabled) - Removed login sql handle from the map server as it isn't used for anything. - Made the login sql handle on the char-sql server be used only when gm_read_method 1 is enabled. - Small fixes to npc_enable, added BL_NPC handling on status_get_sc. - Added a path_search check in map_random_dir, so that the random direction picked up doesn't goes through walls and all that. - Some changes to close-confine, status start will fail when the source is not found or it doesn't has sc-data. - pc_setoption no longer changes the character's class when mounting/dismounting, it only changes the view-class. - The peco-crash-fix from the char servers is still needed. This packet must be wrong! We likely need to sniff it. - Modified the char-txt server to modify the class of mounted characters to their non-mounted version. Added an upgrade_svn file to handle the class update on the sql tables. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5902 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-03- Removed the flag variable from the npc_data structure. Disabled NPCs are ↵skotlex1-16/+13
now handled through nd->sc.option&OPTION_INVISIBLE checks. Should fix disable/enablenpc calls not working. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5889 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-02- Fixed npc_gettimerevent_tick returning the difference since the last ↵skotlex1-2/+2
triggered label instead of total elapsed time for the npc-timer. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5874 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-01* Should not exit when you can't find an NPC file.. Lance1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5845 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-01Fixed the dynamic shop system memory allocation and id_db problem. Added ↵Lance1-2/+2
sample script. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5842 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-01- Added structure view_data to handle sprite information for all characters ↵skotlex1-8/+26
(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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5833 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-30* Added execution of OnInterIfInit, OnCharIfInit and OnInterIfInitOnce on ↵Lance1-0/+6
script reload. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5806 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-29- Applied a fix to not do xs/ys checks on npc_doevent when the npc is not on ↵skotlex1-7/+10
a map. - You can't return to egg a pet that has run away now. - Added ers support to the delayed mob drops. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5800 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-28- Added a debug function to locate all "looping warps"skotlex1-0/+31
- Some cleanup of the skill-use functions in clif.c git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5787 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-24- Cleaned up a bit the npc undercharging item warning to specify when it is ↵skotlex1-3/+7
displaying overcharge/discount prices instead of the actual values. It should also prevent overflows. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5737 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-22- Merged the unit_data structure from jA for handling unit-related data ↵skotlex1-315/+57
(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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5707 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-17- Removed a block of code from skill_check_condition that actually belongs ↵skotlex1-1/+1
to status_check_skilluse. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5651 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-17Corrected nullpo_retv -> nullpo_ret since npc_unload is int.Lance1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5648 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-17Reappropriate my previous fix on map_foreachiddb, it's npc_unload's problem.Lance1-1/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5647 54d463be-8e91-2dee-dedb-b68131a5f0ec