feat(SmartAI): Implement action type 115 "SMART_ACTION_RANDOM_SOUND"

This commit is contained in:
Stoabrogga
2019-01-26 23:16:16 +01:00
committed by Francesco Borzì
parent 9eb07a57d4
commit acf47073ab
3 changed files with 67 additions and 2 deletions

View File

@@ -369,7 +369,6 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has an action type that is not supported on 3.3.5a (%u), skipped.",
e.entryOrGuid, e.event_id, e.GetActionType());
return false;
case SMART_ACTION_RANDOM_SOUND:
case SMART_ACTION_SET_CORPSE_DELAY:
case SMART_ACTION_DISABLE_EVADE:
case SMART_ACTION_GO_SET_GO_STATE:
@@ -770,6 +769,19 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
if (!IsSoundValid(e, e.action.sound.sound))
return false;
break;
case SMART_ACTION_RANDOM_SOUND:
if (e.action.randomSound.sound1 && !IsSoundValid(e, e.action.randomSound.sound1))
return false;
if (e.action.randomSound.sound2 && !IsSoundValid(e, e.action.randomSound.sound2))
return false;
if (e.action.randomSound.sound3 && !IsSoundValid(e, e.action.randomSound.sound3))
return false;
if (e.action.randomSound.sound4 && !IsSoundValid(e, e.action.randomSound.sound4))
return false;
break;
case SMART_ACTION_SET_EMOTE_STATE:
case SMART_ACTION_PLAY_EMOTE:
if (!IsEmoteValid(e, e.action.emote.emote))