mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 19:31:59 +01:00
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:
@@ -2062,6 +2062,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;
|
||||
}
|
||||
|
||||
@@ -1259,6 +1259,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
case SMART_ACTION_JUMP_TO_POS:
|
||||
case SMART_ACTION_SEND_GOSSIP_MENU:
|
||||
case SMART_ACTION_GO_SET_LOOT_STATE:
|
||||
case SMART_ACTION_GO_SET_GO_STATE:
|
||||
case SMART_ACTION_SEND_TARGET_TO_TARGET:
|
||||
case SMART_ACTION_SET_HOME_POS:
|
||||
case SMART_ACTION_SET_HEALTH_REGEN:
|
||||
|
||||
@@ -552,8 +552,9 @@ enum SMART_ACTION
|
||||
SMART_ACTION_RANDOM_SOUND = 115, // soundId1, soundId2, soundId3, soundId4, soundId5, onlySelf
|
||||
SMART_ACTION_SET_CORPSE_DELAY = 116, // timer
|
||||
SMART_ACTION_DISABLE_EVADE = 117, // 0/1 (1 = disabled, 0 = enabled)
|
||||
SMART_ACTION_GO_SET_GO_STATE = 118, // state
|
||||
|
||||
SMART_ACTION_END = 118
|
||||
SMART_ACTION_END = 119
|
||||
};
|
||||
|
||||
struct SmartAction
|
||||
@@ -1020,6 +1021,11 @@ struct SmartAction
|
||||
uint32 flag;
|
||||
} goFlag;
|
||||
|
||||
struct
|
||||
{
|
||||
uint32 state;
|
||||
} goState;
|
||||
|
||||
struct
|
||||
{
|
||||
uint32 group;
|
||||
|
||||
Reference in New Issue
Block a user