-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revscript MonsterType Spell Fixes #3903
Conversation
great! I would like to hear @soul4soul input on this as well |
https://github.com/otland/forgottenserver/blob/master/data/scripts/lib/register_monster_type.lua#L337-L354 |
Pretty sure you'll still get an error from here:
I believe that section is more target to melee attacks that include a condition along with it. Like this: {name ="melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -100, condition = {type = CONDITION_POISON, startDamage = 3, interval = 4000}},
|
#3499 |
Alright, great. I guess @soul4soul will have to check into adapting his system for this format. I reverted the changes for that part. However, the drunk spells are still an issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah #3499 has the best examples, for real tibia spells and conditions only these two formats would be used
This gives melee with a condition
{name = "melee", attack = 10, skill = 100, condition = { type = CONDITION_FIRE, minDamage = 50, maxDamage = 200, duration = 5000, interval = 1000}},
This is an attack that causes a condition only.
{name = "condition", chance = 1000, range = 1, condition = { type = CONDITION_ENERGY, minDamage = 10, maxDamage = 20, duration = 5000, interval = 1000}},
Looking at the source code of the converter it looks correct but I'll actually test it when I get a chance.
This could use a rebase and add back the outfits spells and it would be good to go. |
This reverts commit bd91637.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased against master
spell:setConditionDrunkenness(ability.drunkenness) | ||
end | ||
end | ||
if ability.drunkenness then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
Pull Request Prelude
Protocol version
Any
Changes Proposed
Spells aren't handled correctly in register_monster_type.lua, Not exactly sure if this is the fully correct way to handle these, but at least I am bringing the issue to everyones attention.
Issues addressed:
Within revscript monstertype lua files, spells named "condition" wouldn't be registered and would cause errors. Spells named "drunk" would create condition twice, once at line 281 and again at line 331, which would cause all sorts of crashes. You can reproduce these errors by adding a monster lua file and adding these types of spells below.
{name ="condition", interval = 2000, chance = 30, type = CONDITION_POISON, startDamage = 0, tick = 4000, minDamage = -440, maxDamage = -520, radius = 5, target = false, effect = CONST_ME_POISONAREA}
{name ="drunk", interval = 2000, chance = 10, drunkenness = 25, duration = 5000, range = 7, shootEffect = CONST_ANI_ENERGY}
The easiest way is to convert the current monster xml files into revscript using this tool:
https://otland.net/threads/ot-monster-converter.277546/
Note: You may need to create multiple files containing drunk spells in order to make the crash happen, not sure why though. Sometimes it crashes, sometimes it doesn't, the more files the easier it is to replicate.