summaryrefslogtreecommitdiff
path: root/src/map/npc.c
AgeCommit message (Collapse)AuthorFilesLines
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
2006-03-17* Fixed npc_cleanup_dbsub not removing key and caused pointer being freed ↵Lance1-0/+1
problem. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5645 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-17* Final fix on Juperos NPC.Lance1-1/+3
* 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5638 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-15- Added mapflag nodrop, fixed mapflag notrade.skotlex1-0/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5619 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-14- Some small cleanups of how @reloadscript works.skotlex1-4/+4
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5600 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-10- Added a few dummy times in skill_cast_db for some GS skills.skotlex1-1/+1
- Autoskills now won't trigger on maps where said skill are not allowed. - Some compilation warning fixes git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5565 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-10* Fixed a variable loopback problem on NPC shop price checking routine.Lance1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5559 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-06- Fixed npc_event doing a map-check when the npc is not on any map.skotlex1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5473 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-04- Fixed missing baby-dancer job in exp2.txtskotlex1-6/+2
- Added function battle_set_walkdelay in charge of updating walkdelays of characters based on two criterias: when the delay is induced by damage, if the current walk delay isn't over yet, do not update it. If the delay is instead caused by a skill, then the current walk delay cannot be decreased, only increased. - Removed the canmove tick reset on skill cast cancel; likewise it isn't updated on begin casting. pc_can_move uses a skilltimer check to know whether you can move or not. - Added GrandCross's can't move delay of 900ms to skill_cast_db - Added Finger Offensive's can't move delay of 200ms/lv to skill_cast_db git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5457 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-03- Added event 8 for mobspawns that should spawn with special ai set.skotlex1-1/+3
- Modified battle_check_target so that mobs with special ai's default enemy are mobs with no special ai. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5448 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-03- Trick dead now ends on logoutskotlex1-0/+3
- Added mapflag nocommand which blocks @/# commands unless your gm level is above gm_skill_unconditional's level. - Fixed weapon scripts not being executed unless the weapon was forged. - gm_skill_unconditional is now a no/gm-level setting instead of yes/no git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5446 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-02-21- Some fine-tuning of the warp portal code which prevents it from messing up ↵skotlex1-3/+10
other skills if you "precast" it. - Fixed the weapon refine code using sd->skillid instead of sd->menuskill_id - Fixed some npc_event error reports (three error where displaying at the exact same msg, making it impossible to tell which one of the three actually happened) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5356 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-02-20- Close confine won't get the bonus range on cast as other skills do due to ↵skotlex1-1/+1
exploits. - Fixed a bug in setnpctimer checking out the wrong variable. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5347 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-02-07- Fixed startnpctimer starting multiple timers if the npc timer was already ↵skotlex1-0/+7
started. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5208 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-02-06- Added define clif_deadsit to send the dead state into player packets if ↵skotlex1-1/+2
the player is in trick dead state. - Venom Splasher always hits (but splash damage targets can still avoid it) - Using autoloot with no arguments now toggles it between @autoloot 0 and @autoloot 100% - Falcon Assault now takes Blitz Beat lv5 as base damage. - Fixed pc_makesavestatus not updating status.option correctly. - Corrected Waterball so that higher levels can do insane amount of hits. - Altered slave behaviour. No more random walking, will stay within 2 cells of their master. - Reverted the Summon Slave behaviour to not adjust level based on number of current slaves. - Coma no longer sends SP to 1. - Updated Meteor so that when level 11 or more is casted, the area over which meteors fall is tripled. - Dark elemental characters are now inmune to Curse. - Fixed sc_data saving to sql buffer building method. Thanks to its_sparky. - Changed the map zone reading from using pow to a bit shift. - Experience has now been changed to unsigned int, and is read as such from the dbs. - Increased HT_DETECTING seek range to 7x7 - Added function map_foreachinrange which actually checks distance of nearing objects (unlike for each in area which uses a square area), may come handy for future code. - Corrected Venom Splasher: Being hit does not cancels it, works at 75% or less of target's HP, being hit normally while under the count has a chance of causing poison. Damage is +400% + 50*lv% git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5204 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-02-05- Small fix in pet_attack that would make pets not unlock their target in ↵skotlex1-1/+1
some situations. - Fixed invisible shops. callshop scrip command now works! - Added proper documentation of script command callshop git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5195 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-02-03* Crash fix in npc.c npc_timerevent.Valaris1-1/+1
was: struct timer_event_data *ted = (struct timer_event_data*)ted; changed: struct timer_event_data *ted = (struct timer_event_data*)data; Skotlex, I am assuming it's calling from the passed data var, If I'm wrong please fix it. I just know what was there was definitely not correct. [Valaris] git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5168 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-02-02- Improved the NPC timer system to enable to have multiple timers going on ↵skotlex1-37/+157
at a time with different players attached to each. Now npc event timers are of two types: attached or global. The global timers don't have a player attached and can be started/halted by anyone. The character timers have a player attached, and they can only be stopped by a script that has the same player attached. - Now player attached scripts will auto-abort when the atteched player quits the map server. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5167 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-02-02- Fixed some includes in skill.c and npc.c, thanks to 252-rer for finding it ↵skotlex1-5/+5
out. - Applied the entry reusage system to the battle delay damage structure. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5166 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-02-01- Fixed a typo bug in SC_STAR_COMFORT handling.skotlex1-7/+7
- Fixed a possible crash bug in SC_POISONREACT handling. - Simplified the skill trigger code for ST_PRESERVE, SG_FUSION, SG_*_COMFORT - Unified the status change variables into a single structure (sc_count, opt1, opt2, opt3, option, and the array of status change data) which should make it easier to handle sc related stuff. - TK_DODGE now won't trigger if your opt1 is set ;) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5154 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-01-30* Added 'restricted' mapflag, based on lordalfa patchKomurka1-0/+5
- you can set restriction zone on map (see mapflag/restricted.txt) - you can turn off item usage on certain restricted map in item_noequip.txt - you can turn off skill usage on certain restricted map in skill_nocast_db.txt git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5115 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-01-29AS OF SVN REV. 5901, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES ↵Valaris1-0/+2826
GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EVERYTHING ELSE GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5094 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-01-29Clearing trunk.Valaris1-2574/+0
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5091 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-04-07* Readded @disablenpccelest1-136/+193
* Fixed @reloadscript not removing old NPC's and monsters first * Some changes in mob and NPC unloading * Changed the original @disablenpc to @hidenpc git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1429 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-04-06Fixed and tweaked error messages in npc parsing [MouseJstr]amber1-4/+4
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1417 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-04-01Fixed some memory corruptions [MouseJstr]amber1-3/+6
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1370 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-03-31* Fixed a bug with InitTimer/StopTimercelest1-14/+14
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1358 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-03-29Fixe compile time problems with our mixed C++/C conformanceamber1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1328 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-03-25* Fixed indoorsrwstable.txt readingcelest1-1/+2
* Fixed @monsterbig/@monstersmall not working * Fixed @killmonster2 not working git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1293 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-03-24* Added 'map_charid2id'celest1-59/+13
* Changed monster damage logging to save char ID's * Implemented 'event_script_type' * Set Emsolute Develop as a learnable skill * Updated 'require_glory_guild' * Allow monsters to cast skills near themselves even when monster_nofootset is set to 'yes' * Print number of online users in online.txt/.html even if there's only 1 user git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1282 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-03-23* Fixed alot of memory leakscelest1-28/+64
* Added stray memory cleaning routine to db.c git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1275 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-03-22Check changelog ^^celest1-11/+8
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1267 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-03-18* Don't log SQL char actions if log_char is not enabled in char_athena.confcelest1-2/+2
* Updated shop_exp's calculation to give more exp * Some item and mob DB updates * Added Einbech/Einbroch warps git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1249 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-03-17* Added display script filename when a script error is found while parsingcelest1-3/+5
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1244 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-03-08git-svn-id: ↵shinomori1-2/+58
https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1213 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-03-08Reverted a jA change in event loadingcelest1-6/+6
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1209 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-03-07Replaced some free's with aFreecelest1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1208 54d463be-8e91-2dee-dedb-b68131a5f0ec