Tibia-WindBot / lucas-library

1 stars 4 forks source link

added 2 new functions #2

Closed Mistgun closed 7 years ago

Mistgun commented 8 years ago

Added pvpsafeworld() and currencityname() functions.

leonardofalk commented 7 years ago

I think you could put pvpworld as well, so we can save some time in a future update

function pvpworld()
    return not pvpsafeworld()
end

Lucas' lib overrides mine, so there's no problem having it in both files.

rmobis commented 7 years ago

@leonardofalk I don't think those are equivalent...

Also, I just realized the name of the functions seems quite weird. What is a pvp safe world? @Mistgun

TheJoshGriffith commented 7 years ago

A PVP unsafe world (such as Calva) is one where shooting an area rune will give you PZ regardless of your PVP status (red fist mode). All hardcore and retro worlds fall into this category, but regular PVP and optional PVP do not. It's very useful to know the difference for hopefully obvious reasons.

Mistgun commented 7 years ago

Exactly means what Josh said, maybe name isn't so accurate but I couldn't came with anything better.

rmobis commented 7 years ago

The name is ok, it is just the code that was confusing me. Now, this is just a suggestion, but don't you think it would be clearer to rewrite the function like this:

function pvpsafeworld()
    return not table.find({'Chrona', 'Morta', 'Mortera', 'Calva', 'Calvera', 'Eldera', 'Dolera', 'Inferna'}, $worldname)
end
Mistgun commented 7 years ago

Can be :)

rmobis commented 7 years ago

Good, I'm merging this.

Thanks for the contribution, @Mistgun.