summaryrefslogtreecommitdiff
path: root/src/map/script.c
AgeCommit message (Collapse)AuthorFilesLines
2017-04-24Removed hard coded values on @cashmount and setcashmount.Jedzkie1-9/+17
2017-04-24Fix some issues in the unit controlling script commandsHaru1-110/+101
- Fixes some issues detected by coverity (UDT_TYPE not working in getunitdata, invalid comparisons due to type mismatch) - Fixes some incorrect typecasts This is a follow-up to a6ca899ac (PR #1584) Signed-off-by: Haru <haru@dotalux.com>
2017-04-23Merge pull request #1584 from Smokexyz/masterHaru1-0/+1600
Implementation of unit controlling script commands.
2017-04-13add missing _pc in set_reggumi1-4/+4
2017-04-12fix 1b0d3bd "add getvariableofpc() buildin"gumi1-1/+0
2017-04-12fix a16fbb3 "allow character and account variables to reference another ↵gumi1-26/+139
registry"
2017-04-11Fixes a minor typo in buildin_setequipoptionsmokexyz1-2/+2
Related to the order of the arguments.
2017-04-09Merge pull request #1598 from Smokexyz/IROHaru1-2/+243
Implementation of Item Options System.
2017-04-09Merge pull request #1657 from mekolat/getunits2Haru1-0/+100
add getunits() buildin
2017-04-08add getunits() buildingumi1-0/+100
2017-04-04Implementation of unit controlling script commands.Smokexyz1-0/+1600
Setunitdata <GID>, <DataType>, <Val1> {, <Val2>, <Val3>} Getunitdata <GUID>, <DataType> {, <Variable>} Getunitname <unit id> Setunitname <unit id>, <name> Performs alteration and retrieval of real-time unit data for a game object of the types - NPCs, Pets, Monsters, Homunuculus', Mercenaries, Elementals. Applicable data types (available as script constants) - UDT_TYPE: Unit Type value (BL_MOB, BL_NPC, BL_PET, BL_ELEM, BL_MER, BL_HOM) UDT_SIZE: Unit Size UDT_LEVEL: Level UDT_HP: Current HP UDT_MAXHP: Max HP UDT_SP: SP UDT_MAXSP: MAX SP UDT_MASTERAID: Master Account ID (for Summons) UDT_MASTERCID: Master Char ID (for Summons) UDT_MAPIDXY: Warp a Unit to a map. UDT_WALKTOXY: Make a unit walk to certain co-ordinates. UDT_SPEED: Unit Speed UDT_MODE: Mode (Mobs) UDT_AI: Unit AI Type UDT_SCOPTION: Status Options. UDT_SEX: mm Sex. UDT_CLASS: Class of the unit. UDT_HAIRSTYLE: Hair Style of the unit. UDT_HAIRCOLOR: Hair Color. UDT_HEADBOTTOM: Headgear Bottom Sprite. UDT_HEADMIDDLE: Headgear Middle Sprite. UDT_HEADTOP: Headegar Top Sprite. UDT_CLOTHCOLOR: Cloth Color. UDT_SHIELD: Shield Sprite. UDT_WEAPON: Weapon Sprite. UDT_LOOKDIR: Face direction. UDT_CANMOVETICK:Stop a unit from move for n seconds. UDT_STR: Unit STR. UDT_AGI: Unit AGI. UDT_VIT: Unit VIT. UDT_INT: Unit INT. UDT_DEX: Unit DEX. UDT_LUK: Unit LUK. UDT_ATKRANGE: Attack range of a unit. UDT_ATKMIN: Min Atk of a unit. UDT_ATKMAX: Max Atk of a unit. UDT_MATKMIN: Min MATK of a unit. UDT_MATKMAX: Max MATK of a unit. UDT_DEF: DEF. UDT_MDEF: MDEF. UDT_HIT: HIT. UDT_FLEE: FLEE. UDT_PDODGE: Perfect Dodge. UDT_CRIT: Critical Rate. UDT_RACE: Race. (Eg. string constants RC_DemiHuman or Integer 7). UDT_ELETYPE: Element. (Eg. string constants Ele_Neutral or Integer 0). UDT_ELELEVEL: Element Level (int). UDT_AMOTION: AMotion Rate (int). UDT_ADELAY: ADelay Rate (int). UDT_DMOTION: DMotion Rate (int). UDT_HUNGER: Hunger Rate (int) - for summons. UDT_INTIMACY: Intimacy Rate (int) - for summons. UDT_LIFETIME: LifeTime (int) - for summons. UDT_MERC_KILLCOUNT: Kill count for mercenaries (int). UDT_STATPOINT: Status Points (int) - for npcs. Addition of AI constants as well. Documentation is included. Credits: [rA](https://github.com/rathena/rathena/commit/2cee5b6ff1bf53c4ae53bc1278b09ae84b8a0a76) & [Smokexyz](https://github.com/Smokexyz)
2017-04-04Implementation of Item Options System.Smokexyz1-2/+243
Allows the infusing of equipments with bonus item options. This feature is constrained to clients of packet versions greater than or equal to `20150226`. Item Options and their effects are defined server-side in `db/item_options.conf` and client side in `data/luafiles514/lua files/datainfo/addrandomoptionnametable.lub` The ID of the option must tally with the correct index of the description provided in the client side lua file to avoid bugs. IT_OPT_* keys and MAX_ITEM_OPTIONS macro are also exported from the source as constants. An additional flag `disable_options` has been added to sql, and as `DisableOptions: true/false (boolean, defaults to false !!for equipments only!!)` to item_db.conf files. Script commands documentation is also included. SQL file updates are included. Credits: [Smokexyz](https://github.com/Smokexyz) Style and Script Fixes by [Asheraf](https://github.com/Asheraf) Initial design Idea by [secretdataz](https://github.com/secretdataz)
2017-03-31Merge pull request #1544 from HerculesWS/1543-fixsmokexyz1-6/+8
getstatus() Update
2017-03-28add gettimer() buildingumi1-0/+95
2017-03-12Merge pull request #1610 from mekolat/timer2Haru1-17/+37
allow the PC timer buildins to run on another player
2017-03-12Minor optimizations for the warpguild implementationHaru1-12/+13
Follow-up to ebb77e29f343531b508f8c37b32826afbb5f240d Signed-off-by: Haru <haru@dotalux.com>
2017-03-12Merge pull request #1496 from Emistry/scriptcommand_warpguildHaru1-28/+33
Updated *warpguild() script command.
2017-03-05allow to use addtimercount on another playergumi1-2/+6
2017-03-05fix code style in buildin_addtimercountgumi1-4/+5
2017-03-05allow to use deltimer on another playergumi1-2/+6
2017-03-05fix code style in buildin_deltimergumi1-2/+3
2017-03-05allow to use addtimer on another playergumi1-2/+6
2017-03-05make addtimer return success or failuregumi1-2/+6
2017-03-05fix code style in buildin_addtimergumi1-4/+6
2017-03-05Merge pull request #1589 from mekolat/strinfo2Haru1-58/+77
allow strcharinfo() and strnpcinfo() to take a GID
2017-03-05Update *warpguild() script command.Emistry Haoyan1-28/+33
- Added optional parameter to warp member from target map. - Update to loop guild member using `g->member[]` data.
2017-02-26add getvariableofpc() buildingumi1-2/+51
2017-02-26allow character and account variables to reference another registrygumi1-15/+59
2017-02-26fix code style in set_reggumi1-19/+32
2017-02-26fix indentation in set_reggumi1-44/+44
2017-02-26fix code style in script_array_srcgumi1-5/+6
2017-02-26fix indentation in script_array_srcgumi1-22/+22
2017-02-26fix code style in get_valgumi1-17/+22
2017-02-26fix indentation in get_valgumi1-52/+52
2017-02-26Revert "allow to get vars of other players with getd"gumi1-210/+96
This reverts commit eb5fc0076764d2f604e6a484fe144988f6e9da9b.
2017-02-26Merge pull request #1586 from mekolat/getd2Ridley1-96/+210
Allow getd to get vars if other players
2017-02-26Added option to show classchange only to one player (#1587)Guilherme G. M1-8/+19
* Added option to show classchange only to one player
2017-02-25allow strcharinfo() and strnpcinfo() to take a GIDgumi1-58/+77
2017-02-25allow to get vars of other players with getdgumi1-96/+210
2017-02-25add chr() and ord() buildinsgumi1-1/+26
2017-01-17Fixes #1543Dastgir Pojee1-6/+8
Infinite Duration status would result in error since there was no timers attached to it. Added a condition to check if status is having infinite duration and return value according to it.
2016-12-03Remove the platform-dependent variables from struct status_dataHaru1-1/+1
`struct status_data::class_` was platform dependent since c30bb75ec50624429bff7b4106db4be0fda366d6 in order to silence some compile warnings (uint32 on 64 bit builds and uint16 on 32 bit builds). It's now been changed to the correct type, int32, on all platforms. Since the change has potential to silently break third party code, the variable was renamed to `class`. Signed-off-by: Haru <haru@dotalux.com>
2016-12-03Ensure that pc->addfame() increments the correct fame pointsHaru1-9/+9
The function now takes the rank type as argument, rather than guessing it from the character's class. If the wrong fame point type for the current character is requested, the request is ignored. This fixes some (unofficial) edge cases where a Taekwon or an Alchemist refined a signed item, they could obtain rank points. Signed-off-by: Haru <haru@dotalux.com>
2016-12-03Clarify some Job Class vs MapID confusion (2/2)Haru1-6/+6
This commit ensures that `sd->job` and related variables only contain MapIDs (i.e. the serverside optimized values, where High Novice is MAPID_NOVICE | JOBL_UPPER) and are never checked against the client-based Job Class values. As a rule of thumb, from now on, when a variable is named `job` or `jobid`, it is intended to contain a MapID and not a Job Class ID. The type of such variable shall be an unsigned `uint16` or `uint32`. To ensure that related third party code is also verified when this commit is merged, the variable `struct map_session_data::class_ (i.e. `sd->class_`) is renamed to `job`. Some issues in related lines are also fixed, including: - The atcommand `@mount` would not check properly that the requesting character is a 2nd class Swordsman type. - `pc->addfame()` would silently accept invalid MapIDs, sending unknown values to the client (more on this in a subsequent commit). - `pc->famerank()` would not use the passed job as a bitmask, causing the caller to have to mask it beforehand (more on this in a subsequent commit). - The Soul Linker check in TK_JUMPKICK wasn't future-proof (no harm caused currently). - Gunslingers would be able to be targeted by Spiritual Bestowment (`MO_KITRANSLATION`) and Spiritual Sphere Absorption (`MO_ABSORBSPIRITS`) due to a faulty check introduced when the Rebellion class was implemented (causing unintended interaction with Coins). Signed-off-by: Haru <haru@dotalux.com>
2016-12-03Clarify some Job Class vs MapID confusion (1/2)Haru1-14/+14
This commit ensures that `sd->status.class` and related variables only contain Job Classes (i.e. the client-compatible values, where High Novice 4001) and are never checked against the bitmask-based MapID values. As a rule of thumb, from now on, when a variable is named `class`, it is intended to contain a Job Class ID and not a MapID. The type of such variable shall be a signed `int16` or `int`. To ensure that related third party code is also verified when this commit is merged, the variable `struct mmo_charstatus::class_ (i.e. `sd->status.class_`) is renamed to `class`. Some issues in related lines are also fixed, including: - A wrong check in the char server would prevent the correct detection of babies in code related to the family exp sharing. - Baby Arch Bishops would not be affected by Eucharistica. - A wrong check would cause the `questinfo()` script command not to display its information for most classes (except 1-1 classes). - Map IDs and Job Classes were mixed up in `itemdb_jobid2mapid()` and `itemdb_jobmask2mapid()` for 1-1 classes (causing currently no harm, since they just happen to coincide). - The Baby Sura class would not cause parties to be marked as containing a monk type character (for SLS Team Up purposes). - Baby Geneticists would bypass the cart check when trying to equip ammunitions. - Baby Mechanics would bypass the Mado Gear check when trying to equip ammunitions. - Transcendent Shadow Chasers would lose the Stalkers' ability to clone transcendent skills. Signed-off-by: Haru <haru@dotalux.com>
2016-12-02Fixed a null-pointer dereference in BUILDIN(makeitem2)Haru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-12-02Merge pull request #1405 from Emistry/scriptcommand_makeitem2Haru1-0/+85
Add *makeitem2 script command.
2016-12-01Fixed areawarp cell checkLemongrass31101-1/+4
The script command areawarp has been checking the wrong target map for ages. It has been checking the mapindex rather than the mapid and therefore returned a wrong result. Original commit: rathena/rathena@ac2ba09
2016-11-20Removed support for apostrophes in constantsHaru1-1/+1
Supporting apostrophes (`'`) inside constants or variables is no longer necessary thanks to the more strict AegisName ruleset we're using now. Signed-off-by: Haru <haru@dotalux.com>
2016-10-22Implemented SC_BITESCAR:Dastgir Pojee1-2/+5
Cannot be reset by dispell. Cannot be healed by item/NPC once in BITESCAR. Heal Skill would end the BiteScar Effect.