[Help Coding] NPC In Jail Make You Free When you ar white

09/09/2008 15:56 --thechoosenone--#1
yo the npc in jail (lotf) makes me free when im black:s how to change it so he can only make me free when i got 29pks? FIXED THANKS TO kafetao
and how to change the revive cords in the jail?
and how to make that when someone is sending to jail that everyone sees [Name of player] Have Been Sended To Jail For Killing To Much!
09/09/2008 16:16 --thechoosenone--#2
if (CurrentNPC == 104801)
{
if (Control == 1)
{
MyChar.Teleport(1002, 514, 355);
}

thats the jail npc now but how to make it so you can only leave when you got 29pks or less then 29pks
09/09/2008 17:33 kafetao#3
My Npc = Conquer global
Quote:
if (CurrentNPC == 1250)
{
SendPacket(General.MyPackets.NPCSay("Lucky for you, the player who killed you is willing to drop the murder charges "));
SendPacket(General.MyPackets.NPCSay("if you pay him according to what you did. But, if you did not do anything bad, "));
SendPacket(General.MyPackets.NPCSay("you can leave without any price."));
SendPacket(General.MyPackets.NPCLink("Ok! Let me get out from here!", 1));
SendPacket(General.MyPackets.NPCLink("Any chance of a discount?", 2));
SendPacket(General.MyPackets.NPCLink("I would rather rot in hell!", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}


if (CurrentNPC == 1250)
{
if (Control == 1)
{
if (MyChar.PKPoints >= 30)
{
SendPacket(General.MyPackets.NPCSay("You wont get out of jail soon.You have still " + MyChar.PKPoints + "pk points"));
SendPacket(General.MyPackets.NPCLink("Oh,ok.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
else
{
SendPacket(General.MyPackets.NPCSay("You are free to get out anytime you want.Do you really want to get out of jail now?"));
SendPacket(General.MyPackets.NPCLink("Yeah.", 3));
SendPacket(General.MyPackets.NPCLink("Nope.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (Control == 2)
{
SendPacket(General.MyPackets.NPCSay("The red named people with 30 - 99 PK Points need to pay 4,000,000 as "));
SendPacket(General.MyPackets.NPCSay("recognizance to leave here instantly. The black named people with 100 - 299 "));
SendPacket(General.MyPackets.NPCSay("PK Points need to pay 108 CPs. Those who have over 300 PK Points must "));
SendPacket(General.MyPackets.NPCSay("pay 540 CPs. Of course you may alternatively choose to wait until your turn to white named."));
SendPacket(General.MyPackets.NPCLink("Ok, I will pay.", 4));
SendPacket(General.MyPackets.NPCLink("I would rather stay here.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
if (Control == 3)
{
MyChar.Teleport(1002, 518, 356);
}
if (Control == 4)
{
if (MyChar.PKPoints < 30)
{
SendPacket(General.MyPackets.NPCSay("You are free to get out anytime you want.Do you really want to get out of jail now?"));
SendPacket(General.MyPackets.NPCLink("Yeah.", 3));
SendPacket(General.MyPackets.NPCLink("Nope.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
if (MyChar.PKPoints >= 30 && MyChar.PKPoints < 100)
{
SendPacket(General.MyPackets.NPCSay("The red named people with 30 - 99 PK Points need to pay 4,000,000 as "));
SendPacket(General.MyPackets.NPCSay("recognizance to leave here instantly."));
SendPacket(General.MyPackets.NPCLink("Here are 4,000,000 silver.", 5));
SendPacket(General.MyPackets.NPCLink("If so, I will stay here.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
if (MyChar.PKPoints >= 100 && MyChar.PKPoints < 300)
{
SendPacket(General.MyPackets.NPCSay("The black named people with 100 - 299 PK Points need to pay 108 CPs as "));
SendPacket(General.MyPackets.NPCSay("recognizance to leave here instantly."));
SendPacket(General.MyPackets.NPCLink("Here are 108 CPs.", 6));
SendPacket(General.MyPackets.NPCLink("If so, I will stay here.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
if (MyChar.PKPoints >= 300 )
{
SendPacket(General.MyPackets.NPCSay("Those who have over 300 PK Points must pay 540 CPs as "));
SendPacket(General.MyPackets.NPCSay("recognizance to leave here instantly."));
SendPacket(General.MyPackets.NPCLink("Here are 540 CPs.", 7));
SendPacket(General.MyPackets.NPCLink("If so, I will stay here.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (Control == 5)
{
if (MyChar.Silvers >= 4000000)
{
MyChar.Silvers -= 4000000;
MyChar.Teleport(1002, 518, 356);
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
}
else
{
SendPacket(General.MyPackets.NPCSay("Sorry, You do not have 4,000,000 Silvers."));
SendPacket(General.MyPackets.NPCLink("I see.", 255));
SendPacket(General.MyPackets.NPCLink("Just passing by.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (Control == 6)
{
if (MyChar.CPs >= 108)
{
MyChar.Teleport(1002, 518, 356);
MyChar.CPs -= 108;
SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
}
else
{
SendPacket(General.MyPackets.NPCSay("Sorry, You do not have 108 CPs."));
SendPacket(General.MyPackets.NPCLink("I see.", 255));
SendPacket(General.MyPackets.NPCLink("Just passing by.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (Control == 7)
{
if (MyChar.CPs >= 540)
{
MyChar.Teleport(1002, 518, 356);
MyChar.CPs -= 540;
SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
}
else
{
SendPacket(General.MyPackets.NPCSay("Sorry, You do not have 540 CPs."));
SendPacket(General.MyPackets.NPCLink("I see.", 255));
SendPacket(General.MyPackets.NPCLink("Just passing by.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
}
09/09/2008 17:45 --thechoosenone--#4
THANKS!
09/09/2008 18:44 glupkotrup#5
@kafetao Nice guide but you can make it simpler... At least I did :)
09/09/2008 18:46 Mouse>Pro#6
Quote:
Originally Posted by glupkotrup View Post
@kafetao Nice guide but you can make it simpler... At least I did :)
simpler? its copy and past:p
09/09/2008 19:05 glupkotrup#7
Lol I ment on simpler code (shorter)
09/09/2008 19:09 Mouse>Pro#8
Quote:
Originally Posted by glupkotrup View Post
Lol I ment on simpler code (shorter)
:p i know i was just playing with you xD
09/09/2008 21:18 glupkotrup#9
Lol... Bad boy. *cough* xD
09/09/2008 21:41 ~Yuki~#10
i could make the code smaller....
like 50%^^
09/09/2008 21:44 glupkotrup#11
I can make it smaller and 100%... If I change the font size xD
09/09/2008 22:08 Mouse>Pro#12
Quote:
Originally Posted by glupkotrup View Post
I can make it smaller and 100%... If I change the font size xD
hahahhaa xD
09/10/2008 01:54 Bottingpunk#13
Quote:
Originally Posted by lolmaster123 View Post
i could make the code smaller....
like 50%^^
You should

Quote:
Originally Posted by glupkotrup View Post
I can make it smaller and 100%... If I change the font size xD
roflmfao
09/10/2008 04:00 Bottingpunk#14
how would u make it so guards cap u at 30+ pk pts also so ppl can cap u to with like 20+ hits XD casue u can only 1 hit them to send them to jail kinda stupid -.-
09/13/2008 20:31 Mouse>Pro#15
Quote:
Originally Posted by --thechoosenone-- View Post

and how to make that when someone is sending to jail that everyone sees [Name of player] Have Been Sended To Jail For Killing To Much!
try this m8
Code:
if (PTarget.GetHitDie((uint)Damage))
                                        {
                                            Attacking = false;
                                            if (!Other.CanPK(LocMap))
                                                if (!PTarget.BlueName)
                                                    if (LocMap == 6000)
                                                    {
                                                        if (PTarget.PKPoints == 0 || PTarget.PKPoints > 0)
                                                        {
                                                            GotBlueName = DateTime.Now;
                                                            BlueName = true;
                                                            PKPoints += 0;
                                                            MyClient.SendPacket(General.MyPackets.Vital(UID, 6, PKPoints));

                                                        }
                                                    }
                                                    else if (PTarget.PKPoints < 30)
                                                    {
                                                        GotBlueName = DateTime.Now;
                                                        BlueName = true;
                                                        PKPoints += 10;
                                                        MyClient.SendPacket(General.MyPackets.Vital(UID, 6, PKPoints));
                                                        if ((PKPoints > 29 && PKPoints - 10 < 30) || (PKPoints > 99 && PKPoints - 10 < 100))
                                                        {
                                                            MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                                                            World.UpdateSpawn(this);
                                                        }
                                                    }
                                            if (LocMap != 6000)
                                            {
                                                if (PTarget.PKPoints > 100)
                                                {
                                                    PTarget.Teleport(6000, 028, 071);
                                                    World.SendMsgToAll(PTarget.Name + " was captured by  " + Name + " and sent automaticaly in jail.", "Police", 2008);
                                                }
                                            }
                                            World.PVP(this, PTarget, 14, 0);
                                            PTarget.PTarget = null;
                                            PTarget.MobTarget = null;
                                            PTarget = null;
                                        }
                                    }
                                    else
                                        PTarget = null;
                        }