Originally Posted by Korvacs
Your referring to a smart little npc in birthvillage that you spoke to before leaving for Twin City, he teaches you varioius skills depending on your class, the fading to black could well be the colour overlay packet (used for day and night time), and you can send a string to play a sound.
In my old source it looked like this, although i never did the fading and the sound:
Code:
case 269:
switch (NpcDialog)
{
case 0:
{
if (Client.Hero.Skills.FindSkill(1250) || Client.Hero.Skills.FindSkill(1300) || Client.Hero.Skills.FindSkill(5010) || Client.Hero.Skills.FindSkill(5050))
{
if (!((Hashtable)InternalDatabase.QuestTracker[Client.Hero.GameKeys]).Contains(269))
((Hashtable)InternalDatabase.QuestTracker[Client.Hero.GameKeys]).Add(269, true);
Core.EnqueueOwner(PointerPackets.Dialog(Client.Conn, ((NPC)InternalDatabase.Npcs[Client.Hero.LastNPC]).GetDialog(4)));
foreach (Option TOption in (((NPC)InternalDatabase.Npcs[Client.Hero.LastNPC]).GetDialog(4)).Options)
{
if (TOption.Text == null)
break;
Core.EnqueueOwner(PointerPackets.Option(Client.Conn, TOption));
}
Core.EnqueueOwner(PointerPackets.Dialog(Client.Conn, new Dialog(255, "", DialogType.Face, null), ((NPC)InternalDatabase.Npcs[Client.Hero.LastNPC]).Face, 2570));
Core.EnqueueOwner(PointerPackets.Option(Client.Conn, new Option(255, "", DialogType.End)));
return false;
}
return true;
}
case 3:
if (!((Hashtable)InternalDatabase.QuestTracker[Client.Hero.GameKeys]).Contains(269))
{
if (Client.Hero.Class != 100 && Client.Hero.Class != 40)
{
((Hashtable)InternalDatabase.QuestTracker[Client.Hero.GameKeys])[190] = true;
((Hashtable)InternalDatabase.QuestTracker[Client.Hero.GameKeys]).Add(269, true);
Dialog NewDialog = new Dialog();
Item NewItem = new Item();
Skill TSkill = new Skill();
string[] Skills = new string[3];
byte Learn = (byte)Async_GameServer.RND.Next(0, 3);
switch (Learn)
{
case 0:
TSkill = new Skill(1250, 0, 0, SkillType.Skill);
NewItem = new Item(510003, ItemUID.ItemUIDGen(), 0, 0, 0, 1198, Gems.NoSocket, Gems.NoSocket, ItemType.Inventory, WeaponExtra.None);
NewItem.ItemsData = Item.GetItemStat(510003);
Skills[0] = "WideStrike";
Skills[1] = "WoodGlaive";
Skills[2] = "glaives";
break;
case 1:
TSkill = new Skill(1300, 0, 0, SkillType.Skill);
NewItem = new Item(540003, ItemUID.ItemUIDGen(), 0, 0, 0, 1198, Gems.NoSocket, Gems.NoSocket, ItemType.Inventory, WeaponExtra.None);
NewItem.ItemsData = Item.GetItemStat(540003);
Skills[0] = "Halt";
Skills[1] = "RatanLonghammer";
Skills[2] = "longhammers";
break;
case 2:
TSkill = new Skill(5010, 0, 0, SkillType.Skill);
NewItem = new Item(561003, ItemUID.ItemUIDGen(), 0, 0, 0, 1198, Gems.NoSocket, Gems.NoSocket, ItemType.Inventory, WeaponExtra.None);
NewItem.ItemsData = Item.GetItemStat(561003);
Skills[0] = "Snow";
Skills[1] = "WoodWand";
Skills[2] = "wands";
break;
case 3:
TSkill = new Skill(5050, 0, 0, SkillType.Skill);
NewItem = new Item(530003, ItemUID.ItemUIDGen(), 0, 0, 0, 1198, Gems.NoSocket, Gems.NoSocket, ItemType.Inventory, WeaponExtra.None);
NewItem.ItemsData = Item.GetItemStat(530003);
Skills[0] = "Boreas";
Skills[1] = "WoodPoleaxe";
Skills[2] = "poleaxes";
break;
}
NewDialog = new Dialog(3, "You are so talented that you've learned " + Skills[0] + ". I will send you a " + Skills[1] + ". You can arm it after some training. " + Skills[0] + " will be activated automatically and become more powerful as you use " + Skills[2], DialogType.Text, new Option[1] { new Option(5, "Thank you very much!", DialogType.Link) });
Core.EnqueueOwner(PointerPackets.Dialog(Client.Conn, NewDialog));
Core.EnqueueOwner(PointerPackets.Option(Client.Conn, NewDialog.Options[0]));
Core.EnqueueOwner(PointerPackets.Dialog(Client.Conn, new Dialog(255, "", DialogType.Face, null), ((NPC)InternalDatabase.Npcs[NpcID]).Face, 2570));
Core.EnqueueOwner(PointerPackets.Option(Client.Conn, new Option(255, "", DialogType.End)));
InternalDatabase.CreateSkill(Client.Hero.CharId, TSkill);
Core.EnqueueOwner(PointerPackets.SendSkill(Client.Conn, TSkill));
Client.Hero.Skills.AddSkill(TSkill);
Client.Hero.Inventory.AddItem(NewItem);
InternalDatabase.CreateItem(Client.Hero.CharId, NewItem);
Core.EnqueueOwner(PointerPackets.ItemInfo(Client.Conn, NewItem, CreationType.Create));
return false;
}
}
Core.EnqueueOwner(PointerPackets.Dialog(Client.Conn, ((NPC)InternalDatabase.Npcs[Client.Hero.LastNPC]).GetDialog(4)));
foreach (Option TOption in (((NPC)InternalDatabase.Npcs[Client.Hero.LastNPC]).GetDialog(4)).Options)
{
if (TOption.Text == null)
break;
Core.EnqueueOwner(PointerPackets.Option(Client.Conn, TOption));
}
Core.EnqueueOwner(PointerPackets.Dialog(Client.Conn, new Dialog(255, "", DialogType.Face, null), ((NPC)InternalDatabase.Npcs[Client.Hero.LastNPC]).Face, 2570));
Core.EnqueueOwner(PointerPackets.Option(Client.Conn, new Option(255, "", DialogType.End)));
return false;
default:
return true;
}
That is just the "dynamic" dialog, as i used to call it, all of the rest of it is the same and doesnt have any special interactions, so it was loaded from a txt file.
|