Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: full soul war quest (opentibiabr#2535)
Remember that for this quest to work properly, it is necessary to delete the old Soul War scripts (the repository had the quest divided into parts, and I completely redid it using modern features and systems, such as BossLever, Zones, EventCallback, and others). It is also necessary to update the soul war map, the new map is in the releases I won’t document all the changes here for obvious reasons; the quest is mostly written in Lua, so there are many monster scripts and other elements that were added or modified, making this a large pull request as a result. I thought about separating the pull request into smaller commits, but I came to the conclusion that this could cause confusion, since the quest would depend on several other commits to work correctly, so I decided to keep everything in one to avoid future "problems". Added talkactions: /distanceeffect (for testing distance effects) /testtaintconditions (for testing taint icons on player inventory bar) • The "Missing configuration for identifier" log has set to debug, since in cpp there are default values already to avoid putting all the values in lua • Fixed some EventCallbacks that were not properly passing arguments as references (using std::ref) • Added a check for EventCallbacks with the same names, improving the resource management of callbacks. Each time a callback was called, a new element was created in the vector. Now there will only be one and it will be reused with each execution • Passed some vectors from CreatureVector for copying, thus avoiding possible crashes when changing the vectors, it was necessary due to the change of maps in ebb and flow in real time (so the player can be in the creature vector during the vector reading and be removed) • Added new callback for MonsterType (lua scripts) called "onSpawn", which will execute whenever the creature is created • Added new callback for MonsterType (lua scripts) called "onPlayerAttack", which will be executed whenever a player attacks the monster, it should be used with care as the same callback will be valid for all instances of the same monster • Added new EventCallback called "playerOnThink", thus facilitating players' onThink • Added new EventCallbacks called "creatureOnCombat" and "mapOnLoad", to facilitate the development of the quest • Added a new function argument on the CreatureEvent "executeOnPrepareDeath" called "realDamage" • The Lua function "monster:setType" now includes a new argument called "restoreHealth" (boolean). This argument determines whether the function will restore the monster's health after setting its type. • The Lua function "player:addOutfit" now accept the "outfit name" and includes new argument called "addon" for setting the outfit's addon • New Lua function "player:sendCreatureAppear" to update the creature's appearance to the client (necessary for changing the ebb and flow maps, same reason I mentioned above, the player is on the map during the change, so it is necessary to send the update to the client) • Removed the exception for the message: "The map in folder 'x' is missing or corrupted", this prevents the console from stopping loading and closing the server, as in the case of a misconfigured worldchange. Co-authored-by: Pedro Henrique Alves Cruz <[email protected]>
- Loading branch information