الموضوع : NPC | علشان تضيف البوينتات Agility | Strength| Spirit بســهوله
شرح الاضافة:
هتضيف دة في ملف NPC.CS
الكود:
#region Restart Points
case 137:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("Hey there " + client.Entity.Name + " I'm new system format points for free.");
dialog.Option("Vitality", 1);
dialog.Option("Agility", 2);
dialog.Option("Strength", 3);
dialog.Option("Spirit", 4);
dialog.Option("Thanks.", 255);
dialog.Send();
break;
}
case 1:
{
dialog.Text("Write your number Vitality points you want.");
dialog.Input("Vitality Points", 10, 10);
dialog.Send();
break;
}
case 2:
{
dialog.Text("Write your number Agility points you want.");
dialog.Input("Agility Points", 20, 10);
dialog.Send();
break;
}
case 3:
{
dialog.Text("Write your number Strength points you want.");
dialog.Input("Strength Points", 30, 10);
dialog.Send();
break;
}
case 4:
{
dialog.Text("Write your number Spirit points you want.");
dialog.Input("Spirit Points", 40, 10);
dialog.Send();
break;
}
case 10:
{
ushort atr = 0;
ushort.TryParse(npcRequest.Input, out atr);
if (client.Entity.Atributes >= atr)
{
client.Entity.Atributes -= atr;
client.Entity.Vitality += atr;
client.CalculateStatBonus();
client.CalculateHPBonus();
}
else
{
dialog.Text("Sorry you don't have enought points to restart.");
dialog.Option("I See.", 255);
dialog.Send();
break;
}
break;
}
case 20:
{
ushort atr = 0;
ushort.TryParse(npcRequest.Input, out atr);
if (client.Entity.Atributes >= atr && atr != 0)
{
client.Entity.Atributes -= atr;
client.Entity.Agility += atr;
client.CalculateStatBonus();
client.CalculateHPBonus();
atr = 0;
}
else
{
dialog.Text("Sorry you don't have enought points to restart.");
dialog.Option("I See.", 255);
dialog.Send();
break;
}
break;
}
case 30:
{
ushort atr = 0;
ushort.TryParse(npcRequest.Input, out atr);
if (client.Entity.Atributes >= atr && atr != 0)
{
client.Entity.Atributes -= atr;
client.Entity.Strength += atr;
client.CalculateStatBonus();
client.CalculateHPBonus();
atr = 0;
}
else
{
dialog.Text("Sorry you don't have enought points to restart.");
dialog.Option("I See.", 255);
dialog.Send();
break;
}
break;
}
case 40:
{
ushort atr = 0;
ushort.TryParse(npcRequest.Input, out atr);
if (client.Entity.Atributes >= atr && atr != 0)
{
client.Entity.Atributes -= atr;
client.Entity.Spirit += atr;
client.CalculateStatBonus();
client.CalculateHPBonus();
atr = 0;
}
else
{
dialog.Text("Sorry you don't have enought points to restart.");
dialog.Option("I See.", 255);
dialog.Send();
break;
}
break;
}
}
break;
}
#endregion
هتضيف السطر دة في Npc النافي كات
الكود:
137 Restart Point 2 9937 1002 317 258 0000