Jump to content
  • 0

creature_ai_script action "Phase Set" not working


Corsol

Question

Hi,

i'm trying to script via the creature_ai_scripts table a creature phase change when spawned.

Basically i use the EVENT_T_SPAWNED (value 11) iside the event_type column and the ACTION_T_SET_PHASE (value 22) in action1_type column to change the creature phase.

here is my SQL:

INSERT INTO mangos.creature_ai_scripts 
(id, creature_id, event_type, event_inverse_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, action1_type, action1_param1, action1_param2, action1_param3, action2_type, action2_param1, action2_param2, action2_param3, action3_type, action3_param1, action3_param2, action3_param3, comment) VALUES 

(3537001, 35370, 11, 0, 100, 0, 0, 0, 0, 0, 22, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Josiah Avery (worgen)- chage phase to 4 after spawn'),

The problem is that the event was triggered correctly but the action to set phase do nothing, and the creature won't change the phase as needed.

Anyone have some idea to solve this problem?

Thanks

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

You mix the two meanings of the "phase" term as related to the Mangos.

EventAI commands ACTION_T_SET_PHASE, ACTION_T_INC_PHASE, ACTION_T_RANDOM_PHASE, ACTION_T_RANDOM_PHASE_RANGE deal with the EventAI script phase of the creature. It is a mechanic allowing to create complicated enough mob's AIs. This phase enables/disables execution of the EventAI commands in conjunction with creature_ai_scripts.event_inverse_phase_mask table field.

Visibility phase mechanic, appeared since 3.x (our Two), allows to modify dynamiclaly the spawn set visible to the player in a location. It depends usually on the quests rewarded. (Note a GM under ".gm on" sees all phases at once). A creature/GO may be statically spawned in choosen visibility phase(s) using creature.phasemask table field. However, players are dynamically "transferred" from one phase to another using auras with AuraType SPELL_AURA_PHASE = 261.

So, if you wish to switch the visibility phase of a dynamically spawned creature, you have to find the respective aura and cast that aura upon the creature. You could start from spell_area. However, it may be better to search for the spells named LIKE '%phase%', and the best, for the spells with Effect=6 (aura) and EffectApplyAuraName=261, whose EffectMiscValue field contains the phasemask in question.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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