summaryrefslogtreecommitdiff
path: root/src/map/pc.c
AgeCommit message (Collapse)AuthorFilesLines
2015-12-13Fixed an issue in the bonus2 bAddMonsterDropChainItem implementationHaru1-3/+3
- The item_chain and race arguments were swapped. - Thanks to pengc2010 for pointing it out Signed-off-by: Haru <haru@dotalux.com>
2015-12-13Corrected an error in bonus3 bAddMonsterDropItemHaru1-1/+1
- Follow-up to 9fef13d4d2e0eab3376ea95b3cb8783d48d19dda - Thanks to pengc2010 for pointing it out Signed-off-by: Haru <haru@dotalux.com>
2015-12-10Rename 'ITEMIDBATTLE_MANUAL100' to 'ITEMID_BATTLE_MANUAL100'.Jedzkie1-1/+1
2015-12-06Fixed issues with compound races in bonuses where they're handled as arraysHaru1-323/+203
- Corrected handling of RC_ALL in: * bAddRace * bSubRace * bMagicAddRace * bWeaponComaRace * bCriticalAddRace * bExpAddRace * bSPGainRace * bHPDrainValueRace * bSPDrainValueRace * bSPGainRaceAttack * bHPGainRaceAttack * bRaceTolerance * bHPDrainRateRace * bSPDrainRateRace * bSetDefRace * bSetMDefRace - Corrected out of bound array accesses (memory corruption) in: * bIgnoreMdefRate * bIgnoreDefRate Signed-off-by: Haru <haru@dotalux.com>
2015-12-06Replaced RC_BOSS/RC_NONBOSS bitmask combinations with RC_ALL bitmasksHaru1-25/+32
- Sources only Signed-off-by: Haru <haru@dotalux.com>
2015-12-06Refactored/fixed race handling for bonuses that store it as a bitmaskHaru1-63/+44
- The following bonuses now work correctly with RC_DemiPlayer, RC_NonDemiPlayer, RC_NonDemiHuman, RC_Nonplayer: * bIgnoreDefRace * bIgnoreMdefRace * bDefRatioAtkRace * bAddMonsterDropChainItem (bonus3) * bAddMonsterDropItem (bonus3) - A new function (map->race_id2mask) is provided, to easily and efficiently generate a bitmask from a race ID. - The RC_ALL race ID is mapped to RC_BOSS and RC_NONBOSS, for backwards compatibility. Signed-off-by: Haru <haru@dotalux.com>
2015-12-04Merge pull request #910 from dastgir/idleAndrei Karas1-0/+8
Added a function to update idle time
2015-12-04Added a function to update idle timeDastgir1-0/+8
2015-11-14Changed struct map_session_data::queues into a VECTOR and renamed to ↵Haru1-6/+5
::script_queues Signed-off-by: Haru <haru@dotalux.com>
2015-11-14Standardized script-queue related commandsHaru1-1/+1
- The commands queueadd, queueremove, queueopt, queuedel and qiclear now all return true (success) or false (failure). - Taken/extended from AnnieRuru's PR #847. - The constants HQO_OnDeath, HQO_OnLogOut, HQO_OnMapChange were renamed to QUEUEOPT_DEATH, QUEUEOPT_LOGOUT, QUEUEOPT_MAPCHANGE respectively. - The name of the variable @QMapChangeTo$ used during the QUEUEOPT_MAPCHANGE event has been renamed to @Queue_Destination_Map$. Signed-off-by: Haru <haru@dotalux.com>
2015-11-14Fix @QMapChangeTo$ not usable when HQO_OnMapChange triggeredAnnieRuru1-1/+1
- also add documentation for it
2015-11-14Renamed hQueue/hQueueIterator/hQueueOpt to latest standardsHaru1-6/+6
Signed-off-by: Haru <haru@dotalux.com>
2015-11-08Fixes missing new RC_ constants in some bonuses. Fixes #815Dastgir1-25/+102
2015-10-19rename malloc.c/h to memmgr.Andrei Karas1-1/+1
2015-10-13Return actual result from pc_insert_card.Andrei Karas1-1/+5
2015-10-11Fixed another compiler warning (follow-up to 5c22b63)Haru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Fixed various compiler warnings (follow-up to 5c22b63)Haru1-17/+17
Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Cleanup of the HPluginData implementation (second part)Haru1-4/+2
- Changed the hplugin_data_store's array into a VECTOR. Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Cleanup of the HPluginData implementation (First part)Haru1-18/+4
- Several explicit casts are removed, to have a slightly better type-checking at compile time. - A destructor function is provided, to remove code duplication. Signed-off-by: Haru <haru@dotalux.com>
2015-09-25More aggressive whitespace cleanup. Follow up to 51329e6Haru1-228/+202
Signed-off-by: Haru <haru@dotalux.com>
2015-09-24Add bl parameter to map_searchrandfreecell and map_addflooritem.Andrei Karas1-2/+2
2015-09-24Add bl parameter to getcell functions.Andrei Karas1-3/+3
2015-09-18Clarified the intent of several assignments inside conditional expressionsHaru1-5/+5
Signed-off-by: Haru <haru@dotalux.com>
2015-09-09Autotrade Struct to HPMdastgir1-1/+30
2015-08-15HPM compatibility improvementsHaru1-0/+1
Improved compatibility, portability and standards conformance. - Since it is not possible to portably and reliably re-use the core's symbols in plugins, symbols are no longer exported unless explicitly required, in the UNIX builds. This mimics the Windows behavior and adds HPM compatibility to OSes such as FreeBSD. Credits to Andrei Karas for making this possible. - For convenience, it is no longer necessary to call GET_SYMBOL, since the plugin will automatically import all the available symbols when it's loaded, depending on the included headers. - Plugins are now supposed to include the "common/hercules.h" header before including anything else. Incluing common/HPMi.h, common/cbasetypes.h or conf/core.h is no longer necessary, as those are guaranteed to be automatically included by hercules.h. - HPM API version bumped to 1.1. Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Moved session array into the socket interfaceHaru1-2/+2
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Added showmsg HPM interfaceHaru1-10/+4
- The showmsg interface is automatically imported into plugins by the HPM (just like previously, the various Show* functions were). This change requires no actions from plugin developers. - stdout_with_ansisequence is now available through showmsg->stdout_with_ansisequence - msg_silent is now available through showmsg->silent - console_msg_log is now available through showmsg->console_log - timestamp_format is now available through showmsg->timestamp_format - Plugin-safe macros are provided, so that all Show* and Clear* calls will require no changes. - vShowMessage is provided through the public API, as va_list variant of ShowMessage. - vShowMessage_ is no longer part of the public API. If necessary, va_list variants of the other Show* functions will be added at a later time as follow-ups. Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Cleaned up socket interfaceHaru1-2/+2
- Replaced some macro calls with the proper interface syntax - Removed useless macros and workarounds API changes summary: - WFIFOSET() can now be safely used both inside and outside socket.c - RFIFOSKIP() can now be safely used both inside and outside socket.c - do_close() is now sockt->close() - flush_fifo() is now sockt->flush() - flush_fifos() is now sockt->flush_fifos() - getips() is now sockt->getips() - host2ip() is now sockt->host2ip() - ip2str() is now sockt->ip2str() - ntows() is now sockt->ntows() - make_connection() is now sockt->make_connection() - make_listen_bind() is now sockt->make_listen_bind() - realloc_fifo() is now sockt->realloc_fifo() - realloc_writefifo() is now sockt->realloc_writefifo() - session_isActive() is now sockt->session_is_active() - session_isValid() is now sockt->session_is_valid() - set_defaultparse() is now sockt->set_defaultparse() - set_eof() is now sockt->eof() - set_noblocking() is now sockt->set_noblocking() - str2ip() is now sockt->str2ip() Signed-off-by: Haru <haru@dotalux.com>
2015-08-11Add n parameter to function pc_equipitem_pos.Andrei Karas1-2/+15
2015-08-11Fix issue #634. Delay actual item deletion after running item script.Andrei Karas1-2/+5
2015-08-10Move unequip item script function call into function ↵Andrei Karas1-4/+4
script_run_item_unequip_script.
2015-08-10Move equip item script function call into function script_run_item_equip_script.Andrei Karas1-3/+4
2015-08-10Move use item script function call into function script_run_use_script.Andrei Karas1-12/+7
2015-08-10Fixes #630, RC_NonBoss was including all races even if they weren't meant to be.Dastgir1-16/+16
2015-08-05Add optional parameter to warp script command for prevent stoping npc ↵Andrei Karas1-0/+1
scripts after warp.
2015-07-25Reduce memory usage in HPM in skill.cAndrei Karas1-26/+26
2015-07-18Move check cards related code into separate functions.Andrei Karas1-28/+70
This remove code duplicates and improve a bit code.
2015-07-08Update Unique ID system to match official now it cover all cash items ↵Ibrahim Hossam1-3/+4
include stackable ones. Implement ForceSerial option in Package Item Database to force serial for any item. Implement ForceSerial option in item database to force serial for any item. Implement Merge Client interface to merge stackable items with serial numbers ( check npc/other/item_merge.txt ).
2015-06-19Removed ".." from include directivesHaru1-45/+45
- Include directives are now directory-independent. - This will allow building plugins from other directories in future. Signed-off-by: Haru <haru@dotalux.com>
2015-06-12RC_Player, RC_DemiPlayer, RC_NonPlayer, RC_NonDemiPlayer, RC_All and Ele_All ↵Dastgir1-82/+424
implemented (ref:Herc@9d1fe3cd3855bb973c55bdf98909c25bb80ee97a)
2015-06-02Merge remote-tracking branch 'upstream/pr/530' into herculesHaru1-1/+5
2015-06-02Re-implemented clif->colormes to accept arbitrary colorsHaru1-14/+12
- Due to the backward-incompatible change, clif->colormes was renamed to clif->messagecolor_self (for similarity with clif->messagecolor). The 'color' argument is now a 0xRRGGBB color rather than a color_table index. - enum clif_colors is no longer needed, but 0xRRGGBB-based constants are now provided to replace the old COLOR_* values. Signed-off-by: Haru <haru@dotalux.com>
2015-06-01Followup in malufett's commit a5a8605Lemongrass31101-1/+5
2015-06-01Replaced some of the hardcoded values with constants (map)Haru1-83/+77
- Replaced several hardcoded values with the appropriate enums. - Added documentation for some hardcoded values that haven't been replaced by enums (yet) - Minor code legibility improvements. Signed-off-by: Haru <haru@dotalux.com>
2015-05-31Fixed Bug#8673malufett1-0/+19
-http://hercules.ws/board/tracker/issue-8673-gt-energy-gain/?gopid=25265#entry25265 -Fixed some skills related to spiritball, should now work like official. Signed-off-by: malufett <malufett.eat.my.binaries@gmail.com>
2015-05-19Fixed some issues reported by coverity scan [3/3]Haru1-10/+4
- Automatically zeroed variables are now zeroed in the correct size, regardless of padding. - Special thanks to Ind. Signed-off-by: Haru <haru@dotalux.com>
2015-05-18Removed duplicates of clif->msgtableHaru1-19/+19
- Removed clif->msgtable, and renamed clif->msg to clif->msgtable. - Removed clif->msgtable_num, and renamed clif->msg_value to clif->msgtable_num - Renamed clif->msg_skill to clif->msgtable_skill - Removed clif_viewequip_fail - Replaced hardcoded message IDs with constants (see enum clif_messages) Signed-off-by: Haru <haru@dotalux.com>
2015-05-17Follow-up to 5be01dcHaru1-2/+2
Fixed a swapped-variable typo. Special thanks to Michieru Signed-off-by: Haru <haru@dotalux.com>
2015-05-17Added bonus4 variant of bAddEff to specify a durationHaru1-8/+41
- When a duration value is specified, the effect will have a fixed, non-reducible duration, as required by item scripts. - Special thanks to Michieru Signed-off-by: Haru <haru@dotalux.com>
2015-04-10Fixed Bug#8615malufett1-1/+1
-http://hercules.ws/board/tracker/issue-8615-warning-after-compiling/?gopid=24928#entry24928