ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   How to determine PvE/PvP (https://www.esoui.com/forums/showthread.php?t=2459)

klaro00 11/23/14 05:03 AM

How to determine PvE/PvP
 
Hi,

if I wanted to find out wether I am in a PvP or in a PvE zone (or, to be more precise: wether all NPCs, mobs and players ar on level 50 or not), what would be the safest way? The following method seems to do what I need.

Lua Code:
  1. local function isInPVEZone()
  2.     return (GetMapContentType() ~= MAP_CONTENT_AVA)
  3. end
  4.  
  5. local function isInPVPZone()
  6.     return (GetMapContentType() == MAP_CONTENT_AVA)
  7. end

I just like to know if this code works under all circumstances. Is it the correct approach to investigate the result of "GetMapContentType()"? Maybe there is another, better, safer way to find out if I am currently in PvP or PvE? Can someone confirm that this way of testing for PvP/PvE is correct?

// Klaro

Ayantir 11/23/14 05:52 AM

Lua Code:
  1. IsPlayerInAvAWorld()
returns true if player is in AvA world.

klaro00 11/24/14 01:25 AM

Thank you.

// Klaro

Phinix 09/11/21 05:46 PM

Quote:

Originally Posted by Ayantir (Post 13415)
Lua Code:
  1. IsPlayerInAvAWorld()
returns true if player is in AvA world.

Will this return true for battlegrounds as well?

Scootworks 09/12/21 12:33 AM

https://wiki.esoui.com/PvP_Zone_Detection

zelenin 09/13/21 07:08 AM

Quote:

Originally Posted by Phinix (Post 44706)
Will this return true for battlegrounds as well?

Code:

if IsPlayerInAvAWorld() or IsActiveWorldBattleground() then

Phinix 09/13/21 09:48 PM

Thanks for clarifying. That link is very helpful with the visual layout of the overlap of different functions.


All times are GMT -6. The time now is 04:12 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI