537 Commits

Author SHA1 Message Date
ultramage
562e687322 Added config option 'quest_exp_rate' to adjust exp gained by the 'getexp' script command (followup to r11165).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11171 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-10 18:11:10 +00:00
skotlex
7233562a1a - Removed bonus bAddEffWhenHitShort as it is unneeded and unused.
- Corrected getpetinfo so it actually returns "null" when there's no pet and you request the name (the docs state it so).
- Also cleaned up a bit getpetinfo
- Added gethominfo (which behaves in the same way as getpetinfo).
- The 'maxcount' skill_db field now can store independant values per skill-level, required for Kamaitachi since it uses different range values per level.
- Corrected bonus3 bAutoSpell(WhenHit) to select target enemy (rather than self) for skills with inf self and inf2 'don't target self' (aka: auto-select target skills).
- Corrected map_foreachinpath to do a wall check for targets beyond the initially selected tile.
- Corrected Kamaitachi's range to be 9, and the path range to be 4+SkillLv


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11169 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-10 17:07:35 +00:00
skotlex
574c76e799 - Added support for the new party invite/reply packets from the latest client version.
- Cleared up some TODO's
- Added auto-rejecting party/guild invites when the target is disconnected from the server.
- Added a correction in the walking code to abort it when map_moveblock cancels the player's walking (by warping/knocking back),the default code would fail because unit_stopwalking would do nothing since the walk timer was already -1 in that moment.
- Corrected mob_randomwalk to use unsigned int for the tick variable.
- Changed the default @Main format to prevent crashes in the newer clients.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11134 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-07 07:31:58 +00:00
skotlex
5748269898 - Merged @whereis from my server (displays normal spawn maps for given mobs). This command should be working correctly considering I've been using it since July. I was meant to merge it as soon as I got my hard-drive back, but I kinda forgot @_@
- bonus3 autospell (and autospell when hit) will change the target to self when the skill to be casted is inf&4 (self skill).
- Corrected script homevolution not making the homunculus /swt if it is invoked when not loyal.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11110 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-03 03:35:42 +00:00
skotlex
f6c97de344 - Oops, forgot a very important check in homevolution D:
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11092 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-30 05:01:39 +00:00
skotlex
d25b5ad103 - Cleaned up a bit the homunculus evolution code, and fixed homevolution allowing the homunc to 're-evolve' even though it was already evolved.
- Optimized a bit the skillheal code in regards to Apple of Idun and Sanctuary


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11090 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-30 04:39:59 +00:00
ultramage
0072a0189e * Cleaned/clarified some #include relationships between headers
* Changed clif_sitting() to use 'bl' instead of 'sd' (for non-player objects)
* Removed way messed-up script function 'unitdeadsit'
* Tagged 'FIXME' lines written by myself

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11040 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-19 12:55:29 +00:00
ultramage
8076b535d4 * Fixed npc chatrooms not being deleted on npc unload/reload (crash)
* Modified chat code a bit for more clarity
- replaced double-indirection on 'owner' with a normal pointer
- separated some common functionality to 'chat_createchat()'

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11023 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-16 14:14:11 +00:00
ultramage
56d9a037a6 * Some serious code cleanups
- adjusted @reloadbattleconf to not depend on variable ordering
- changed all battle vars to 'int' (removes pointless duplicit coding)
- added min, max and default columns to battle config data structure
- added properly bounded values for these columns (or at least tried to)
- battle-conf loading will now complain if it finds unknown settings,
  and will reject values that are outside of the allowed range
- added CHATROOM_TITLE_SIZE and CHATROOM_PASS_SIZE 
- partially cleaned up chatroom manipulation code
* Fixed 'Job_Professer' typo in mage jobchange quest

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11017 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-15 17:13:04 +00:00
ultramage
c8ff534024 - stable -> trunk sync
- battle.c and pc.c formatting
- fixed one badly defined npc shop format string
- removed the "selling item for no buying price" warning when the item has a buying price of 20 (see topic:157465)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10971 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-09 18:56:27 +00:00
ultramage
bc31c68ad5 The new functions now clear junk from the output buffer, this simplifies the code a bit.
Added a TODO for one emblem loading problem/crash.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10969 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-09 11:02:44 +00:00
ultramage
f5f77a5d51 * Cleaned up junk left in the code by the mapcache/mapindex update
- Added mapindex_getmapname(_ext) to help with ".gat" adding/removing
- Moved related processing to the interface (prevents duplicity)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10963 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-08 17:41:49 +00:00
skotlex
9e9847a83e - Fixed some missing max levels for npc skills
- Expanded isloggedin script command to support an optional argument (char id)
- Expanded warpparty command to accept target "Leader", this will warp the party to the leader.
- Added a summon structure to handle non-dead-branch mob-groups since the current implementation totally fails for mob groups that don't have MANY integrants
- Fixed mobs not attempting an IDLE skill right before unlocking a target.
- Removed a useless variable in the pet_data structure


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10961 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-08 01:55:58 +00:00
ultramage
ef0fff1720 * Removed ridiculous refine_posword config switch
* TODO: remove getequipname() func, it can be fully replaced by editing a few scripts, plus it doesn't do what the docs say it should do
* Fixed a silly mistake in the main script engine loop ('pos' variable)
* Fixed monter -> monster typos
* Compacted some script function code (fewer LoC -> faster trac :)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10923 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-28 19:21:40 +00:00
ultramage
5ba6e5f949 Fixed yet another script engine typo, this time in 'copyarray'
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10878 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-13 18:29:28 +00:00
ultramage
a07af78342 * Fixed typo in 'deletearray' messing up the script engine
* Added a check to pc_skill() to prevent crashes on unknown skill ids

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10868 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-08 19:24:48 +00:00
ultramage
4fced6485a Fixed a copy-paste typo messing up script variables pretty bad D:
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10850 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-04 08:04:55 +00:00
ultramage
aa3f4c7b18 Fixed a typo in script engine erroring when working with char params
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10848 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-03 19:26:08 +00:00
ultramage
8db83e248a - Re-coded 'soundeffectall'; removed the third parameter ('coverage')
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10844 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-03 15:15:23 +00:00
FlavioJS
f8e09d76d0 * Defined out a problematic piece code in conv_num.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10843 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-03 01:54:46 +00:00
FlavioJS
bde6a0ca4b * Added reporting of constant and param script data.
* Fixed an incorrect check in menu script command.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10842 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-03 00:18:51 +00:00
ultramage
1ed7f6c584 Cleaned up some parts of the code.
Removed obsolete script function 'hasitems'.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10838 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-01 15:26:53 +00:00
FlavioJS
a75ec9a547 * Changed the string hash of the script engine to SDBM.
* Reporting information about script data when an error occurs.
* More work on ticket #41 (array functions).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10813 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-06-26 21:03:31 +00:00
FlavioJS
2d1ad607c3 * Fixed script command sc_end not supporting the extra argument as stated in script_commands.txt.
* Script command getarg supports an extra argument with a default value that is returned if the requested argument doesn't exist.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10773 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-06-15 21:26:17 +00:00
FlavioJS
3e13b73efe git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10706 54d463be-8e91-2dee-dedb-b68131a5f0ec 2007-06-06 16:53:09 +00:00
ultramage
e1397576e6 - Fixed missing client update when 'return to savepoint' fails
- Fixed a bad copy-paste from r10028 letting players escape jail (char was dead on login, so statuses (SC_JAILED) couln't be applied)
- Added clif_standing() to clif_sitting(), and used them in clif.c
- Cleaned up clif.c a bit - clif_clearchar->clif_clearunit_area, clif_clearchar_id->clif_clearunit_single

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10668 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-06-03 14:43:34 +00:00
FlavioJS
f68f40f94d * Displaying op names instead of numbers in script engine errors.
* Fixed a bug introduced in the last rework of the fame ranking.
* Created safestrncpy that ensures the string is nul-terminated.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10667 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-06-02 20:19:40 +00:00
ultramage
0b618b9425 - Fixed @statall giving you +99 stats instead of setting them to 99
- Fixed npctalk and @npctalk displaying the # part of the name

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10619 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-25 20:54:47 +00:00
ultramage
ffbf79b895 Reformatting, warning fixes, unsigned char removal
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10618 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-25 19:37:58 +00:00
ultramage
dfdb5368c7 Corrected some weird fgets() statements, plus reformatted them
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10616 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-25 15:21:53 +00:00
ultramage
301d493855 - Added new flag to skill_castnodex.txt, to allow per-skill tweaking of cast time and delay reducibility by item scripts (cards and such)
- Fixed Martyr's Reckoning never triggering for gms with all skills
- Added MO_TRIPLEATTACK and RG_SNATCHER to @skillall's skill filter 
- Made gm_skill_unconditional bypass skill blocking (guild timer, etc)
- Reverted the weird delay_dependon_agi thing (r8923, r9055, r9059)
- Changed a few memsets to strncpy (reading past buffer is a bad idea)
- Sped up some memset operations (multiples of 4 are faster)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10613 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-23 21:23:36 +00:00
ultramage
4228b025e7 - Fixed one missed malloc->aMallocA typo, causing memory deallocation problems
- Some small trunk-stable formatting synchronization

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10595 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-20 20:40:34 +00:00
ultramage
711d01a128 Reformatting @_@
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10581 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-19 15:50:41 +00:00
ultramage
16671ef54f * Added Global chat and Main chat logging
- lowered the priority of the 'logging off during gw' filter

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10580 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-19 13:26:02 +00:00
ultramage
bac04aa3aa Corrected the problem with countitem2 (value wrapped-around in one case but not in the other, making comparisons fail)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10573 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-19 07:46:57 +00:00
FlavioJS
e54e285849 * Fixed warpwaitingpc not working (bug introduced in r10471).
there was a "sd != NULL" where it should be "sd == NULL"

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10499 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-07 05:18:39 +00:00
toms
ede6014fb9 Removed an unused variable in script.c
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10491 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-06 09:21:13 +00:00
FlavioJS
bc088a5ad8 * Removed the dependency on winsock.h for definitions, it's all winsock2.h now.
* Minor documentation/re-coding in chat.c.
* More work on ticket #41.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10471 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-05 14:50:07 +00:00
FlavioJS
c292b087b5 * Internal changes to the script engine:
- modulus division detects division by 0.
  dividing by zero stops the script and gives an error
- underflow/overflow messages differentiated (warnings)
- when a script function doesn't return a value, a C_NOP value is pushed 
  instead (avoids stack corruption)
- op_add merged with op_2+op_2num/op2_str
- better type checking in the operators, int/string is never assumed.
  The script ends when an invalid type is found.
- other minor code cleanups

Changes made in consequence of:
Ref: http://www.eathena.ws/board/index.php?s=&showtopic=149237&view=findpost&p=823195

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10379 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-28 09:57:29 +00:00
skotlex
b6e3783be6 - Updated the skill_db, some mob skills seem to be better to a range of -9 than 9.
- Corrected the pet_db information for Xmas Goblin and Rice Cake.
- Replaced all struct map_session_data to TBL_PC in script.c
- Pressure no longer vaporizes plants.
- Corrected pc_setregstr to handle a null str argument.
- Corrected @reloadbattleconf causing a add_timer_func "already existing function" error.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10326 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-23 19:08:34 +00:00
FlavioJS
f4907979c1 * Extended the functionality of StringBuf - length and appending a string.
* menu/select/prompt script functions support grouped and empty options.
  The selected option number is consistent with them.
* More work on ticket #41.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10316 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-22 15:45:37 +00:00
skotlex
36a86d07e4 - Corrected crash if itemskill is used without an attached player.
- Removed range checks for autospells as per UltraMage Aegis tests.
- Added chatID skill fail check to skill_check_condition
- Corrected @refresh not re-displaying your spirit spheres nor re-setting your cloth dye.
- Now the "number of attackers" in mob_dead is counted only from online characters on the same map.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10307 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-22 03:11:04 +00:00
skotlex
e120c937cc - Updated the autospell bonus scripts so you don't have to specify all the attack type criteria. If neither of BF_LONG/BF_SHORT is specified, the spell will trigger on both. If neither of BF_WEAPON/BF_MAGIC/BF_MISC is specified, the spell will trigger on BF_WEAPON, if neither of BF_NORMAL/BF_SKILL is specified, BF_SKILL is used if the trigger is BF_MAGIC/BF_MISC and BF_NORMAL is used if the attack is BF_WEAPON. This way the default when nothing is specified is BF_NORMAL|BF_WEAPON|BF_SHORT|BF_LONG.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10300 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-21 19:12:11 +00:00
skotlex
bdaf348a6d - Expanded the autospell structure to hold a flag, which contains the required Battle Flag conditions required for a skill to trigger.
- Added the required constants to const.txt to specify the autospell trigger properties.
- Added bonus5 bAutoSpell/bAutoSpellWhenHit. The new parameter is used to specify when the spell should trigger (melee/range + weapon/magic/misc attack), see item_bonus for details.
- Applied use of packet 0x28a (clif_changeoption2) to transmit opt3 changes. 


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10278 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-17 15:43:40 +00:00
skotlex
0aa57161b9 - Modified spirit of Wizard so that the consumption of 'Fragments' when blocking bounced spells will only consume 1 Fragment per skill casted, regardless of how many hits were reflected.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10207 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-10 16:19:32 +00:00
skotlex
b6bfcce712 - Modified status_get_sc_def to handle both rate and tick reductions. This way it can take care of the fact that curse rate/duration reductions are not reduced by the same stats.
- Removed wrong defines status_get_sc_def_[mdef/vit/int/luk], they actually had a rather undefined behaviour.
- The pc_max_status_def mob_max_status_def configs are now set on a 1-100% scale instead of 1.00-100.00%


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10206 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-10 15:34:49 +00:00
skotlex
e939ffd654 - Fixed crash if a script does a%0
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10200 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-09 20:27:01 +00:00
FlavioJS
a91b77d781 * Recoded and renamed the trim function in strlib to normalize_name. (didn't behave like a standard trim function, see function comment for what it does)
* Added a proper trim function to strlib.

* Other minor cleanups.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10199 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-09 20:21:17 +00:00
ultramage
5d3ea3da27 * Played around with MinGW a bit today...
- adjusted code so that it handles mingw-specific compatibility problems
- adjusted the makefile, mingw is not a subset of cygwin
* As an experiment Corrected many /W4 warnings on the txt login server

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10192 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-09 00:46:55 +00:00
ultramage
87c0efdc89 - Moved e_mail_check() and config_switch() to strlib.h
- Synchronized the login servers a bit

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10174 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-07 04:21:29 +00:00