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

add new TableFile "pets.txt" #3336

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add new TableFile "pets.txt" #3336

wants to merge 1 commit into from

Conversation

ya4ept
Copy link
Contributor

@ya4ept ya4ept commented Jan 10, 2021

  1. this file contains the names of the monsters that the pets look like
  2. this file can be obtained from "data\luafiles514\lua\datainfo\petinfo.lua"
  3. this is an optional file

If a bot meets a pet "Alice", but before that time it has never seen this monster, then the pet type will always be "Unknown".
This patch fixes this problem.

Before:

----------------------------- Pet List -----------------------------
#   Name                      Type             Distance  Coordinates
0   Poring                    Unknown #1002    2.2       (275, 234)
--------------------------------------------------------------------

this file contains the names of the monsters that the pets look like
this file can be obtained from "data\luafiles514\lua\datainfo\petinfo.lua"
@ya4ept
Copy link
Contributor Author

ya4ept commented Jan 12, 2021

I have an idea for a better one:
1.we can add pet names to monsters.txt file.
2.add a function to overwrite the monsters.txt file if the monster name is different from the default

@alisonrag
Copy link
Contributor

I have an idea for a better one:
1.we can add pet names to monsters.txt file.
2.add a function to overwrite the monsters.txt file if the monster name is different from the default

need to check the code, but monster.txt uses the name given from server, sometimes some monsters has different names (event/quest)
Example:
assassin test quest

also take a look at:

openkore/src/Misc.pm

Lines 2320 to 2323 in 29fe641

# Resolve the name of a monster
# This function will only look at the data in monsters.txt
# DO NOT USE THIS FUNCTION when you want to get the real name of a monster,
# servers can change this name internally use getNPCName instead.

@ya4ept
Copy link
Contributor Author

ya4ept commented Jan 12, 2021

current logic:
We only add the name of the monster if its id is not found in monters.txt

If I write 1002 abracadabra to monsters.txt, then when poring is encountered, this value will never change.

I believe we should use the current logic (my second option) instead of adding a new file.
@alisonrag what do you think?

@alisonrag
Copy link
Contributor

alisonrag commented Jan 12, 2021

current logic:
We only add the name of the monster if its id is not found in monters.txt

If I write 1002 abracadabra to monsters.txt, then when poring is encountered, this value will never change.

I believe we should use the current logic (my second option) instead of adding a new file.
@alisonrag what do you think?

will this function be safe? what about assassin test? in this test a lot of same monster have different names
for every monster in the screen openkore will re-write the name in monsters.txt

to me the file is better, just like the ragexe

@ya4ept
Copy link
Contributor Author

ya4ept commented Jan 12, 2021

in this test a lot of same monster have different names
for every monster in the screen openkore will re-write the name in monsters.txt

Now the ml command reads the original names of the monsters without overwriting the monsters.txt file.
After my second patch we will rewrite monster names if the current name does not match monsters.txt

After the thief quest, most likely monsters.txt will contain incorrect monster names, but this will be corrected when the bot meets a real monster. Or we can add a dirty hack for this location

@alisonrag
Copy link
Contributor

alisonrag commented Jan 12, 2021

If attack logic use name given from server to me is ok update monsters.txt

@c4c1n6kr3m1
Copy link
Contributor

long long time ago, me :

  • made default monsters.txt from rathena
  • made option inside config to turn on/off force actor name Given from server to handle this assasin quest

@ya4ept
Copy link
Contributor Author

ya4ept commented Feb 26, 2021

do not merge this request yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants