[c12582] Add support for XP-Gain disabling

This commit is contained in:
NeatElves 2013-05-31 10:25:13 +01:00 committed by Antz
parent 132e6245a7
commit e0192deaf6
7 changed files with 122 additions and 51 deletions

View file

@ -8087,6 +8087,15 @@ bool PlayerCondition::Meets(Player const* player, Map const* map, WorldObject co
}
return false;
}
case CONDITION_XP_USER:
{
switch (m_value1)
{
case 0: return player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_XP_USER_DISABLED);
case 1: return !player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_XP_USER_DISABLED);
}
return false;
}
default:
return false;
}
@ -8486,6 +8495,19 @@ bool PlayerCondition::IsValid(uint16 entry, ConditionType condition, uint32 valu
}
break;
}
case CONDITION_XP_USER:
{
if (value1 > 1)
{
sLog.outErrorDb("XP user condition (entry %u, type %u) has invalid argument %u (must be 0..1), skipped", entry, condition, value1);
return false;
}
if (value2)
sLog.outErrorDb("XP user condition (entry %u, type %u) has useless data in value2 (%u)!", entry, condition, value2);
break;
}
case CONDITION_NONE:
break;
default: