public override void OnSkillDamage(SkillArg arg, SkillAttackResult result, int dmg, int bonusCount) { base.OnSkillDamage(arg, result, dmg, bonusCount); System.Threading.Interlocked.Exchange(ref NPC.HP, NPC.MaxHP); if (arg.Caster is ActorPC pc) { foreach (ushort i in new ushort[] { 226, 229, 235, 238 }) { if (pc.Quests.ContainsKey(i)) { Quest quest = pc.Quests[i]; if (quest.Step == 2 || quest.Step == 3) { quest.Step = 3; quest.NextStep = 3; List <uint> skillIDs = new List <uint>(); skillIDs.Add(10120); skillIDs.Add(15201); skillIDs.Add(12251); skillIDs.Add(11129); skillIDs.Add(11111); if ((skillIDs.Contains(arg.Skill.ID)) && result.IsHit())//blade stab { quest.StepStatus = 1; switch (quest.Flag3) { case 7: quest.Flag3 = 15; break; case 15: quest.Flag3 = 23; break; case 23: { ProcessQuest(pc, 3, quest); SendNPCCommand("q226_2_finished"); Disappear(2339); //Reset combat status pc.Client().ChangeCombatStatus(false); return; } } UpdateQuest(pc, quest); Disappear(2339); } } } } } }
public override void OnSkillDamage(SkillArg arg, SkillAttackResult result, int dmg, int bonusCount) { base.OnSkillDamage(arg, result, dmg, bonusCount); System.Threading.Interlocked.Exchange(ref NPC.HP, NPC.MaxHP); if (arg.Caster is ActorPC pc) { foreach (ushort i in new ushort[] { 226, 229, 238 }) { if (pc.Quests.ContainsKey(i)) { Quest quest = pc.Quests[i]; if (quest.Step == 1 || quest.Step == 2 && quest.NextStep < 3) { quest.Step = 2; quest.NextStep = 2; if (((arg.Skill.ID == 10103) || (arg.Skill.ID == 10120) || (arg.Skill.ID == 11104) || (arg.Skill.ID == 15208)) && result.IsHit()) //blade stab { quest.StepStatus = 1; switch (quest.Flag3) { case 1: quest.Flag3 = 3; break; case 3: quest.Flag3 = 5; break; case 5: { quest.Flag3 = 7; quest.NextStep = 3; quest.Flag1 = 3; quest.Flag2 = 3; SendNPCCommand("q226_1_finished"); BeginTask(); Delay(3); SpawnNPCTask(673, 1542, -2146, 11145, 555, 280, 367); Delay(3); SpawnNPCTask(673, 1542, -2215, 11061, 555, 1, 367); Delay(3); SpawnNPCTask(673, 1542, -2144, 10968, 555, 75, 367); Delay(3); SpawnNPCTask(673, 1542, -2038, 10997, 555, 130, 367); Delay(3); SpawnNPCTask(673, 1542, -2038, 11112, 555, 205, 367); StartTask(); } break; } Disappear(2339); UpdateQuest(pc, quest); } } } } } }