Lua:
GuildEmblems_t Player::getGuildEmblem(const Player* player) const
{
if (!player) {
return GUILDEMBLEM_NONE;
}
const Guild* playerGuild = player->getGuild();
if (!playerGuild) {
return GUILDEMBLEM_NONE;
}
if (player->getGuildWarVector().empty()) {
if (guild == playerGuild) {
return GUILDEMBLEM_MEMBER;
} else {
return GUILDEMBLEM_OTHER;
}
} else if (guild == playerGuild) {
return GUILDEMBLEM_ALLY;
} else if (isInWar(player)) {
return GUILDEMBLEM_ENEMY;
}
return GUILDEMBLEM_NEUTRAL;
}
is there any way to check if the player is with GUILDEMBLEM it is possible to attack even if it is a nopvp server
Lua:
const Tile* playerTile = target->getTile();
if (g_game.getWorldType() == WORLD_TYPE_NO_PVP && (not playerTile->hasFlag(TILESTATE_PVPZONE)) ) {
if (attacker->getPlayer() || (attackerMaster && attackerMaster->getPlayer())) {
if (target->getPlayer()) {
if (!isInPvpZone(attacker, target)) {
return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER;
}
}
if (target->isSummon() && target->getMaster()->getPlayer()) {
if (!isInPvpZone(attacker, target)) {
return RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE;
}
}
}
}
Last edited: