Skip to content
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

Adding features from #998 #2807

Merged
merged 20 commits into from
Feb 3, 2022
Merged

Adding features from #998 #2807

merged 20 commits into from
Feb 3, 2022

Conversation

nekiro
Copy link
Member

@nekiro nekiro commented Mar 4, 2020

This pr resolves #998
I have added requested attributes, not sure if the bounty is still valid and to be claimed?

Usage for dynamic reflect, reflect chance and boosts

local item = player:addItem(8877, 1)
if item then
	item:setBoostPercent(COMBAT_PHYSICALDAMAGE, 200)
        item:setReflect(COMBAT_PHYSICALDAMAGE, {percent = 10, chance = 100})
end

New lua methods:

item:setReflect(combatType, reflect)
item:getReflect(combatType, total = true)

reflect = {percent = 0, chance = 0}
item:setBoostPercent(combatType, value)
item:getBoostPercent(combatType, total = true)

Total argument in both methods means return also the ability value (items.xml attributes)

I didn't implement, but they can be implemented if requested:

absorbpercentmonsters
absorbpercentplayers

and these too, cause they are achiveable through using boosts

increasemeleevalue
increasemeleepercent

increasemagicvalue
increasemagicpercent

increasehealingvalue
increasehealingpercent

@Znote
Copy link
Member

Znote commented Mar 11, 2020

Here is the new bounty link:
https://www.bountysource.com/issues/5013382-missing-item-attributes

It appears its still valid and possible to be claimed.

It appears to have tagged this PR as a solution.

@EPuncker
Copy link
Contributor

adding the following to a spike sword:

<attribute key="reflectpercentphysical" value="99" />
<attribute key="reflectchancephysical" value="99" />

won't work, and spams the server console with "99" (whatever number is used in the value)

edit: I noticed it only works with armors, not weapons 😝 , makes sense
edit2: Using reflectpercentall displays everything correct but with a "undefined" included, I don't know why

I don't know if you are taking suggestions in this PR since its pretty done already, but the system would be really complete having these:

Resist: reduce damage by x%
Absorb: reduce damage by x%, heal x%
Reflect: take full damage, deal x% to attacker
Deflect: reduce damage by x%, deal x% to attacker

thanks for this PR nekiro

and @Znote your bounty link is not working (internal server error)

@nekiro
Copy link
Member Author

nekiro commented Mar 20, 2020

@EPuncker did you just try to use reflect (which works when you get damage and it reflects it) on sword? How did you think that would work xD
Yeah all refers to all, undefined is one of the combat types, so its included too.

@Leo32onGIT
Copy link
Contributor

@DSpeichert label/review

@DSpeichert DSpeichert added the needs-testing Needs testing with screenshots label Apr 27, 2020
@MohamedRefaat

This comment has been minimized.

@nekiro
Copy link
Member Author

nekiro commented Apr 28, 2020

I will rework this pr, because using consts as numbers in custom attributes is unsafe, cause people can overwrite that by setting number values in custom attribute by accident. Safer approach is to use string values.

I'll just block these numbers from setCustomAttribute

Ended up reworking the code, lol

@DSpeichert DSpeichert marked this pull request as draft April 29, 2020 23:26
@nekiro nekiro closed this Aug 27, 2020
@nekiro nekiro reopened this Jan 17, 2021
@trzzu
Copy link

trzzu commented Mar 21, 2021

Reflect works good but boosts doesn't works.

I add to item attributes this line: <attribute key="boostpercentenergy" value="150" />
and its change nothing in player damage.

@Sansero1
Copy link

Sansero1 commented Jul 8, 2021

Reflect works good but boosts doesn't works.

I add to item attributes this line: <attribute key="boostpercentenergy" value="150" />
and its change nothing in player damage.

same problem here
@nekiro

@trzzu
Copy link

trzzu commented Sep 6, 2021

Boosts increase damage only on items, damage from spells not increase.

@EPuncker EPuncker added feature New feature or functionality and removed needs-testing Needs testing with screenshots labels Sep 9, 2021
@nekiro nekiro closed this Dec 26, 2021
@nekiro nekiro reopened this Jan 25, 2022
@nekiro nekiro marked this pull request as ready for review January 25, 2022 15:18
@DSpeichert
Copy link
Member

Isn't this overlapping with #3864 ?

@nekiro
Copy link
Member Author

nekiro commented Jan 25, 2022

Isn't this overlapping with #3864 ?

no, increasedamage is most likely the only similarity

EPuncker
EPuncker previously approved these changes Jan 27, 2022
@nekiro
Copy link
Member Author

nekiro commented Feb 1, 2022

Reflect works good but boosts doesn't works.

I add to item attributes this line: <attribute key="boostpercentenergy" value="150" /> and its change nothing in player damage.

Reflect works good but boosts doesn't works.
I add to item attributes this line: <attribute key="boostpercentenergy" value="150" />
and its change nothing in player damage.

same problem here @nekiro

Boosts increase damage only on items, damage from spells not increase.

this was fixed with latest commit, test again

@EPuncker EPuncker merged commit a14f1fb into otland:master Feb 3, 2022
@tosty33
Copy link
Contributor

tosty33 commented Feb 3, 2022

Good to see that TFS is still being developed after all these years. I'm no longer active in the open tibia server community, but gonna assume that everything works fine as it got merged in the repository.

Bounty claim accepted, good work :)

@nekiro nekiro deleted the new-attributes branch February 3, 2022 18:23
@Zbizu
Copy link
Contributor

Zbizu commented Feb 4, 2022

conflict with mapeditor
https://github.com/otland/forgottenserver/blob/master/src/item.h#L110
https://github.com/Zbizu/rme/blob/master/source/iomap_otbm.h#L51

requesting moving them to 42 and 43 if possible (the longer we wait, the more people will end up having map/database conflicts)

@Zbizu Zbizu mentioned this pull request Feb 4, 2022
3 tasks
@nekiro nekiro mentioned this pull request Feb 16, 2022
DSpeichert pushed a commit that referenced this pull request Feb 16, 2022
Fix crash issue introduced in #2807
Codinablack pushed a commit to Codinablack/forgottenserver that referenced this pull request Apr 5, 2022
from otland#998, for more details, refer to the PR otland#2807 itself

(cherry picked from commit a14f1fb)
Codinablack pushed a commit to Codinablack/forgottenserver that referenced this pull request Apr 5, 2022
Fix crash issue introduced in otland#2807

(cherry picked from commit c82d332)
@Sansero1
Copy link

Sansero1 commented May 9, 2022

thank you for your great work , i really appreciate it .
some of the attributes that wasn't working works fine at the moment like (boostpercentdamage,boostpercentphysical) but
im trying to add healing percentage to an item like
<attribute key="boostpercenthealing" value="75" />
but it doesn't work at all , so if you can look again at it that would be great.

@EPuncker
Copy link
Contributor

EPuncker commented May 9, 2022

thank you for your great work , i really appreciate it . some of the attributes that wasn't working works fine at the moment like (boostpercentdamage,boostpercentphysical) but im trying to add healing percentage to an item like <attribute key="boostpercenthealing" value="75" /> but it doesn't work at all , so if you can look again at it that would be great.

have you registered it at movements.xml?

@Sansero1
Copy link

Sansero1 commented May 9, 2022

thank you for your great work , i really appreciate it . some of the attributes that wasn't working works fine at the moment like (boostpercentdamage,boostpercentphysical) but im trying to add healing percentage to an item like <attribute key="boostpercenthealing" value="75" /> but it doesn't work at all , so if you can look again at it that would be great.

have you registered it at movements.xml?

yes i have , same as i did with boostpercentdamage and boostpercentphysical.

@Sansero1
Copy link

guys , you still working on this healing attribute ?
cause im waiting for this to be solved.

@otland otland locked as resolved and limited conversation to collaborators Jun 29, 2022
@nekiro
Copy link
Member Author

nekiro commented Jun 29, 2022

guys , you still working on this healing attribute ? cause im waiting for this to be solved.

#4122
Here is the related issue, contribution is welcome.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing item attributes [$100]
10 participants