Wie kriege ich den npc dazu mit einem timer etwas zu machen

Hallo,

ich möchte gerne wissen wie ich einen NPC dazu bekomme, wenn ich den KilledMonsterCredit bekommen habe, sich zu verbeugen dann etwas zu sagen und dann zu despawnen mit einem timer. ich hab alles versucht bekommen es leider nicht hin. ( Bin noch newbie !!!)

bei mir macht er immer alles gleichzeitig.

class mob_Test : public CreatureScript
{
public:
mob_Test() : CreatureScript(“Test”) { }

CreatureAI* GetAI(Creature* creature) const
{
return new mob_Test_AI(creature);
}

struct mob_Test_AI : public ScriptedAI
{
mob_Test_AI(Creature* creature) : ScriptedAI(creature) {}

void Reset()
{
me->SetReactState(REACT_DEFENSIVE);
me->setFaction(2357);
}

void DamageTaken(Unit* attacker, uint32& damage)
{
if (me->HealthBelowPctDamaged(5, damage))
{
if (attacker && attacker->GetTypeId() == TYPEID_PLAYER)
attacker->ToPlayer()->KilledMonsterCredit(54586, 0);
me->CombatStop();
me->SetFullHealth();
me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
Talk(0);
me->setFaction(35);
me->DespawnOrUnsummon(3000);
damage = 0;
}
}

void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;

DoMeleeAttackIfReady();
}
};
};
Danke im voraus

Gruß

Ironhead

kannst du rein über sai lösen

beispiel am npc 1337:

– Mountaineer Gwarth SAI SET @ENTRY := 1337; UPDATE creature_template SET AIName=“SmartAI” WHERE entry=@ENTRY; DELETE FROM smart_scripts WHERE entryorguid=@ENTRY AND source_type=0; INSERT INTO smart_scripts (entryorguid,source_type,id,link,event_type,event_phase_mask,event_chance,event_flags,event_param1,event_param2,event_param3,event_param4,action_type,action_param1,action_param2,action_param3,action_param4,action_param5,action_param6,target_type,target_param1,target_param2,target_param3,target_x,target_y,target_z,target_o,comment) VALUES (@ENTRY,0,0,0,25,0,100,0,0,0,0,0,42,0,1,0,0,0,0,1,0,0,0,0,0,0,0,“Mountaineer Gwarth - On Reset - Set Invincibility Hp 1%”), (@ENTRY,0,1,2,2,0,100,0,0,5,0,0,2,35,0,0,0,0,0,1,0,0,0,0,0,0,0,“Mountaineer Gwarth - Between 0-5% Health - Set Faction 35”), (@ENTRY,0,2,3,61,0,100,0,0,5,0,0,5,66,0,0,0,0,0,1,0,0,0,0,0,0,0,“Mountaineer Gwarth - Between 0-5% Health - Play Emote 66”), (@ENTRY,0,3,0,61,0,100,0,0,5,0,0,41,3000,0,0,0,0,0,1,0,0,0,0,0,0,0,“Mountaineer Gwarth - Between 0-5% Health - Despawn In 3000 ms”), (@ENTRY,0,4,0,2,0,100,0,0,5,0,0,33,54586,0,0,0,0,0,2,0,0,0,0,0,0,0,“Mountaineer Gwarth - Between 0-5% Health - Quest Credit ‘’”);

mit invinciblehp kannst du ihn ‘unkillbar’ machen

OK. Also zu kompliziert gedacht von mir. Danke