Skip to content

add new TableFile "pets.txt"#3336

Open
ya4ept wants to merge 1 commit into
masterfrom
pets.txt
Open

add new TableFile "pets.txt"#3336
ya4ept wants to merge 1 commit into
masterfrom
pets.txt

Conversation

@ya4ept

@ya4ept ya4ept commented Jan 10, 2021

Copy link
Copy Markdown
Contributor
  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

ya4ept commented Jan 12, 2021

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

ya4ept commented Jan 12, 2021

Copy link
Copy Markdown
Contributor Author

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

alisonrag commented Jan 12, 2021

Copy link
Copy Markdown
Contributor

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

ya4ept commented Jan 12, 2021

Copy link
Copy Markdown
Contributor Author

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

alisonrag commented Jan 12, 2021

Copy link
Copy Markdown
Contributor

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

@c4c1n6kr3m1

Copy link
Copy Markdown
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

ya4ept commented Feb 26, 2021

Copy link
Copy Markdown
Contributor Author

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