---------------------------------------------------------------------
Here is a guide about how to code NPC's (Very basic)
There is 2parts, when creating NPC's.
The 2parts is NPCtalk and NPCdo
Both examples is build on same
NPCtalk = What the NPC says and wich choices you can choose.
ex.
Code:
if (CurrentNPC == 585858)
{
SendPacket(General.MyPackets.NPCSay("Make a choice"));
SendPacket(General.MyPackets.NPCLink("Yes", 1));
SendPacket(General.MyPackets.NPCLink("No", 2));
SendPacket(General.MyPackets.NPCLink("Just passing here", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
, 1)); is for control 1
, 2)); is for control 2
, 255)); is for end conversation or control
NPCdo = What the NPC do, when choosing a choice or when click on them. This is called the control.
ex.
Code:
if (CurrentNPC == 585858)
{
if (Control == 1)
{
SendPacket(General.MyPackets.NPCSay("You have choosed yes"));
SendPacket(General.MyPackets.NPCLink("I see", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
if (Control == 2)
{
SendPacket(General.MyPackets.NPCSay("You have choosed no"));
SendPacket(General.MyPackets.NPCLink("I see", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
is only for basic things
And for you that think this is not helping cause is easy, then there is some that just dont understand anything about coding and could use even the smallest help they can get.
And another thing im not a great coder, im trying to learn it
----------------------------------------------------------------------------------------
Here is some small codes you can add to conversation:(NPCdo)
For adding items to char:
Code:
MyChar.AddItem("ID#-Bonus+-Bless-Enchant-Gem1-Gem2", Amount, (uint)General.Rand.Next(36457836));
}
Code:
if (MyChar.ItemsInInventory < 40)
{
if (MyChar.CPs >= Amount)
{
MyChar.CPs -= Amount;
MyChar.AddItem("ID#-Bonus+-Bless-Enchant-Gem1-Gem2", Amount, (uint)General.Rand.Next(36457836));
SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
}
Code:
MyChar.LearnSkill(Skill ID#, Skill level); }
Code:
MyChar.Teleport(Map ID#, XPosition, YPosition); }
Silvers:
Code:
if (MyChar.Silvers >= Amount)
{
MyChar.Silvers -= Amount;
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
}
Code:
if (MyChar.CPs >= Amount)
{
MyChar.CPs -= Amount;
SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
}
Code:
if (MyChar.InventoryContains(Item ID#, Amount))
{
MyChar.RemoveItem(MyChar.ItemNext(Item ID#));
}






