[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

@ -643,6 +643,8 @@ void ScriptMgr::LoadScripts(ScriptMapMapName& scripts, const char* tablename)
}
case SCRIPT_COMMAND_PAUSE_WAYPOINTS: // 32
break;
case SCRIPT_COMMAND_XP_USER: // 33
break;
default:
{
sLog.outErrorDb("Table `%s` unknown command %u, skipping.", tablename, tmp.command);
@ -1690,6 +1692,18 @@ bool ScriptAction::HandleScriptStep()
((Creature*)pSource)->clearUnitState(UNIT_STAT_WAYPOINT_PAUSED);
break;
}
case SCRIPT_COMMAND_XP_USER: // 33
{
Player* pPlayer = GetPlayerTargetOrSourceAndLog(pSource, pTarget);
if (!pPlayer)
break;
if (m_script->xpDisabled.flags)
pPlayer->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_XP_USER_DISABLED);
else
pPlayer->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_XP_USER_DISABLED);
break;
}
default:
sLog.outError(" DB-SCRIPTS: Process table `%s` id %u, command %u unknown command used.", m_table, m_script->id, m_script->command);
break;