Core/SmartScript: update ACTION_GO_SET_GO_STATE

GO_STATE_ACTIVE             = 0,                        // show in world as used and not reset (closed door open)
GO_STATE_READY              = 1,                        // show in world as ready (closed door close)
GO_STATE_ACTIVE_ALTERNATIVE = 2                         // show in world as used in alt way and not reset (closed door open by cannon fire)

Credits to Sunwell
This commit is contained in:
Kittnz
2016-12-27 19:00:57 +01:00
parent 591fba5810
commit 072ea761c6
3 changed files with 22 additions and 1 deletions

View File

@@ -2054,6 +2054,20 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (IsGameObject(*itr))
(*itr)->ToGameObject()->SetLootState((LootState)e.action.setGoLootState.state);
delete targets;
break;
}
case SMART_ACTION_GO_SET_GO_STATE:
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsGameObject(*itr))
(*itr)->ToGameObject()->SetGoState((GOState)e.action.goState.state);
delete targets;
break;
}