Welcome to AC Web.
Results 1 to 7 of 7
  1. #1


    Join Date
    May 2008
    Location
    Land Called Finland.
    Posts
    667

    Red face Searching & (Need help to find) something.


    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Hey everyone.

    Does anyone know spell id for ghoul rise animation? It is that animation when dk summons ghoul and it rises from ground like hand showing and it pulls up? I need that spell for my project for custom npc.

  2. #2


    Join Date
    Nov 2015
    Location
    Library of Elchea
    Posts
    656
    It's not a spell visual ID unfortunately.
    It's the respawn animation of the creature itself, you can test it by spawning in 24995 (3.3.5)

  3. #3

  4. #4
    Innovation & Emulation

    Join Date
    Feb 2008
    Location
    Great Britain
    Posts
    1,820
    The animation is triggered from setting the creatures BYTES_1 value from 9 (underground) to 0 (normal).

    I do that in this code snippet:
    Code:
    local function SetHostile(eventId, delay, repeats, pUnit)
    	pUnit:SetFaction(17)
    	pUnit:SetUInt32Value(UNIT_FIELD_FLAGS, 0) -- attackable, targetable
    end
    
    local function SetDisplay(eventId, delay, repeats, pUnit)
    	pUnit:SetDisplayId(24991 + math.random(1, 7))
    end
    
    local function SpawnFromGround(eventId, delay, repeats, pUnit)
    	pUnit:SetUInt32Value(UNIT_FIELD_BYTES_1, 0) -- above ground
    	pUnit:RegisterEvent(SetHostile, 4000, 1)
    end
    
    local function ZombieMinion(event, pUnit, extra)
    	pUnit:SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FIELD_FLAG_UNTARGETABLE + UNIT_FIELD_FLAG_UNATTACKABLE)
    	pUnit:SetUInt32Value(UNIT_FIELD_BYTES_1, 9) -- underground
    	pUnit:RegisterEvent(SpawnFromGround, 2000, 1)
    	pUnit:RegisterEvent(SetDisplay, 1000, 1)
    end
    
    RegisterCreatureEvent(zombieMinionID, 5, ZombieMinion)
    https://github.com/stoneharry/Zombie...ation.lua#L100

    The initial display ID of the creature is a invisible NPC to stop the creature being spawned above the ground then going underground. It spawns the creature, sets the display ID to a random ghoul one and sets the flags and bytes to be untargetable, unselectable, and underground. After a timer it sets it to be targetable and above ground then to become hostile.

    The creature is spawned with faction 35 (friendly to all) and set to 17 (hostile to all) after becoming visible.

    3.3.5a flag constants defined here: https://github.com/stoneharry/Zombie..._Constants.ext
    Code:
    OBJECT_END 						= 0x0006
    UNIT_NPC_EMOTESTATE 			= OBJECT_END + 0x004D
    UNIT_FIELD_BYTES_1 				= OBJECT_END + 0x0044
    UNIT_FIELD_BYTES_2 				= OBJECT_END + 0x0074
    UNIT_FIELD_FLAGS 				= OBJECT_END + 0x0035
    UNIT_FIELD_FLAG_UNTARGETABLE	= 33554434
    UNIT_FIELD_FLAG_UNATTACKABLE	= 2
    UNIT_FIELD_FLAG_C_UNATTACKABLE	= 770
    UNIT_FIELD_CHANNEL_OBJECT 		= OBJECT_END + 0x000E
    UNIT_CHANNEL_SPELL 				= OBJECT_END + 0x0010
    GAMEOBJECT_BYTES_1				= OBJECT_END + 0x000B
    This can be seen in action in this video: https://youtu.be/VMB_TnqlnDo?t=301
    Last edited by stoneharry; 10-08-2019 at 05:43 PM.

  5. #5
    The actual animation itself is getting played automatically by the client if a object is getting created via update_object updatetype create_object2. Alternatively you can hack it as posted above via byte flags or you can also handle this via emote_oneshot_emerge and emote_state_submerged emotes. It's up to you. The emerge animation however should get played automatically when you don't use a ancient core that does not have dynamic spawns and its followup commits merged.

  6. #6
    Innovation & Emulation

    Join Date
    Feb 2008
    Location
    Great Britain
    Posts
    1,820
    Quote Originally Posted by Dreadii View Post
    The actual animation itself is getting played automatically by the client if a object is getting created via update_object updatetype create_object2. Alternatively you can hack it as posted above via byte flags or you can also handle this via emote_oneshot_emerge and emote_state_submerged emotes. It's up to you. The emerge animation however should get played automatically when you don't use a ancient core that does not have dynamic spawns and its followup commits merged.
    The data required to achieve this effect is not a generic feature. I don't think setting the bytes is a 'hack'. Dynamic spawns doesn't even mean anything, that's a emulator specific feature defined by the person who wrote it. Handling the data in a generic solution is great, but 'dynamic spawns' is one way of doing it.

  7. #7


    Join Date
    May 2008
    Location
    Land Called Finland.
    Posts
    667

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Quote Originally Posted by stoneharry View Post
    The animation is triggered from setting the creatures BYTES_1 value from 9 (underground) to 0 (normal).

    I do that in this code snippet:
    Code:
    local function SetHostile(eventId, delay, repeats, pUnit)
    	pUnit:SetFaction(17)
    	pUnit:SetUInt32Value(UNIT_FIELD_FLAGS, 0) -- attackable, targetable
    end
    
    local function SetDisplay(eventId, delay, repeats, pUnit)
    	pUnit:SetDisplayId(24991 + math.random(1, 7))
    end
    
    local function SpawnFromGround(eventId, delay, repeats, pUnit)
    	pUnit:SetUInt32Value(UNIT_FIELD_BYTES_1, 0) -- above ground
    	pUnit:RegisterEvent(SetHostile, 4000, 1)
    end
    
    local function ZombieMinion(event, pUnit, extra)
    	pUnit:SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FIELD_FLAG_UNTARGETABLE + UNIT_FIELD_FLAG_UNATTACKABLE)
    	pUnit:SetUInt32Value(UNIT_FIELD_BYTES_1, 9) -- underground
    	pUnit:RegisterEvent(SpawnFromGround, 2000, 1)
    	pUnit:RegisterEvent(SetDisplay, 1000, 1)
    end
    
    RegisterCreatureEvent(zombieMinionID, 5, ZombieMinion)
    https://github.com/stoneharry/Zombie...ation.lua#L100

    The initial display ID of the creature is a invisible NPC to stop the creature being spawned above the ground then going underground. It spawns the creature, sets the display ID to a random ghoul one and sets the flags and bytes to be untargetable, unselectable, and underground. After a timer it sets it to be targetable and above ground then to become hostile.

    The creature is spawned with faction 35 (friendly to all) and set to 17 (hostile to all) after becoming visible.

    3.3.5a flag constants defined here: https://github.com/stoneharry/Zombie..._Constants.ext
    Code:
    OBJECT_END 						= 0x0006
    UNIT_NPC_EMOTESTATE 			= OBJECT_END + 0x004D
    UNIT_FIELD_BYTES_1 				= OBJECT_END + 0x0044
    UNIT_FIELD_BYTES_2 				= OBJECT_END + 0x0074
    UNIT_FIELD_FLAGS 				= OBJECT_END + 0x0035
    UNIT_FIELD_FLAG_UNTARGETABLE	= 33554434
    UNIT_FIELD_FLAG_UNATTACKABLE	= 2
    UNIT_FIELD_FLAG_C_UNATTACKABLE	= 770
    UNIT_FIELD_CHANNEL_OBJECT 		= OBJECT_END + 0x000E
    UNIT_CHANNEL_SPELL 				= OBJECT_END + 0x0010
    GAMEOBJECT_BYTES_1				= OBJECT_END + 0x000B
    This can be seen in action in this video: https://youtu.be/VMB_TnqlnDo?t=301
    Yeah Thanks stoneharry! I can make script with SmartAI to get it work.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •