Jump to content
  • CreatureEventAI Action Type Needs Syncing with Zero and One


    Chucksta
    • Status: Completed
      Main Category: Database
      Sub-Category: Creature
      Version: 0.20 Milestone: 0.20-newbeginnings Priority: Normal
      Implemented Version: 0.20

    Differing settings between Two and the other cores

    [quote=Olion]There is an annoying difference in EventAI action definitions. Zero:
    ACTION_T_SET_STAND_STATE = 47, // StandState, unused, unused
    ACTION_T_CHANGE_MOVEMENT = 48, // MovementType, WanderDistance, unused
    ACTION_T_SUMMON_UNIQUE = 49, // CreatureId, Target, SpawnId
    ACTION_T_EMOTE_TARGET = 50, // EmoteId, TargetGuid

    Two:
    ACTION_T_SUMMON_UNIQUE = 47, // CreatureId, Target, SpawnId
    ACTION_T_SET_STAND_STATE = 48, // StandState, unused, unused
    ACTION_T_CHANGE_MOVEMENT = 49, // MovementType, WanderDistance, unused

    I suppose it would be better to unify it throughout the cores, or else this will not be the last ACID/EAI problem of such type.[/quote]

    Basically, Two needs to be changed to how Zero and One are set up.


    Besides the server core, there will also be a number of database entries that will need changing:


    User Feedback

    Recommended Comments

    [B][SIZE=3]Server side changes[/SIZE][/B]

    [B]CreatureEventAI.h[/B] from line 127
    [PHP] ACTION_T_SET_STAND_STATE = 47, // StandState, unused, unused
    ACTION_T_CHANGE_MOVEMENT = 48, // MovementType, WanderDistance, unused
    ACTION_T_SUMMON_UNIQUE = 49, // CreatureId, Target, SpawnId
    ACTION_T_EMOTE_TARGET = 50, // EmoteId, TargetGuid[/PHP]


    other changes/additions to make:

    [B][COLOR="#800080"]ACTION_T_EMOTE_TARGET[/COLOR][/B]

    [B]CreatureEventAI.h[/B] new code (for Two): from line 426 approximately
    [PHP]
    struct
    {
    uint32 creatureId;
    uint32 target;
    uint32 spawnId;
    } summon_unique;
    // ACTION_T_EMOTE_TARGET = 50[/PHP]


    [B]CreatureEventAI.cpp[/B] new code (for Two): in function ProcessAction( )
    [PHP]
    case ACTION_T_EMOTE_TARGET:
    {
    Unit* pCreature = m_creature->GetMap()->GetCreature(ObjectGuid(HIGHGUID_UNIT, action.emoteTarget.targetGuid));
    if (!pCreature)
    {
    sLog.outErrorEventAI("Event %d. Cannot find creature by guid %d", EventId, action.emoteTarget.targetGuid);
    return;
    }


    m_creature->SetFacingToObject(pCreature);
    m_creature->HandleEmote(action.emoteTarget.emoteId);
    break;
    }[/PHP]


    [B][COLOR="#800080"]ACTION_T_SUMMON_UNIQUE[/COLOR][/B]

    CreatureEventAIMgr.cpp - function CheckUnusedAISummons()
    [PHP]
    switch (action.type)
    {
    case ACTION_T_SUMMON_ID:
    case ACTION_T_SUMMON_UNIQUE:
    {
    if (action.summon_id.spawnId)
    { idx_set.erase(action.summon_id.spawnId); }
    break;
    }
    default: break;
    }[/PHP]

    CreatureEventAIMgr.cpp - function LoadCreatureEventAI_Scripts()
    [PHP]

    case ACTION_T_SUMMON_UNIQUE: //47
    if (!sCreatureStorage.LookupEntry(action.summon_unique.creatureId))
    { sLog.outErrorEventAI("Event %u Action %u uses nonexistent creature entry %u.", i, j + 1, action.summon_unique.creatureId); }
    IsValidTargetType(temp.event_type, action.type, action.summon_unique.target, i, j + 1);
    if (m_CreatureEventAI_Summon_Map.find(action.summon_unique.spawnId) == m_CreatureEventAI_Summon_Map.end())
    { sLog.outErrorEventAI("Event %u Action %u summons missing CreatureEventAI_Summon %u", i, j + 1, action.summon_unique.spawnId); }
    break;[/PHP]

    ---------------------------------------------

    [B][SIZE=3]Database side changes[/SIZE][/B]

    [B]creature_ai_scripts[/B]

    [B]ACTION_T_SET_STAND_STATE[/B]
    Right now in Two, after applying the start-up fixes, there are 0 entries using 47 (ACTION_T_SUMMON_UNIQUE), and 6 entries using 48 (ACTION_T_SET_STAND_STATE); this is checking the fields: action1_type, action2_type, and action3_type.

    So, we can safely change the records that use 48 to 47 (value should also be changed in CreatureEventAI.h)

    [COLOR="#0000FF"]UPDATE creature_ai_scripts SET action1_type = 47 WHERE id IN (454207, 840003, 1684701, 1029903, 2861201);
    UPDATE creature_ai_scripts SET action2_type = 47 WHERE id = 1722601;[/COLOR]

    [B]ACTION_T_SUMMON_UNIQUE[/B]
    Not currently used in Two, so nothing needs to be done.

    [B]ACTION_T_CHANGE_MOVEMENT[/B]
    Not currently used in Two, so nothing needs to be done.

    Link to comment
    Share on other sites

    Corrections/changes made to server core. Currently building...
    VS, and cmake (Linux)

    ----------------------------------------------

    Build successful... going in-game and checking logs

    -----------------------------------------------

    Successfuly passed the Travis build :D

    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use