[Release]2 NPCS

05/23/2009 19:56 ih8you#1
Hi its me again

Flame will be Reported

I Coded these 100% Myself

The NPCS are, CP admin and A Npc that trades gold for cps and cps for gold. Both tested on a LOTF source 100% work

First CP Admin

Code:
                            if (CurrentNPC == 1234)
                            {
                                SendPacket(General.MyPackets.NPCSay("Hi, " + MyChar.Name +  " Would you like to trade a DragonBall for 215 cps or a DBScroll for 2150 cps?"));
                                SendPacket(General.MyPackets.NPCLink("I would Like to trade a DragonBall for 215cps.", 1));
                                SendPacket(General.MyPackets.NPCLink("I would Like to trade a DBScroll for 2150 cps.", 2));
                                SendPacket(General.MyPackets.NPCLink("No thanks.", 255));
                                SendPacket(General.MyPackets.NPCSetFace(30));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
And Controls...
Code:
                            if (CurrentNPC == 1234)
                            {
                                if (Control == 1)
                                {
                                    if (MyChar.InventoryContains(1088000, 1))
                                    {
                                        MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        MyChar.CPs += 215;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.NPCSay("Here is your 215 cps. GoodLuck"));
                                        SendPacket(General.MyPackets.NPCLink("Thanks", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Sorry, You dont have a DragonBall"));
                                        SendPacket(General.MyPackets.NPCLink("Oh sorry", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
                                if (Control == 2)
                                {
                                    if (MyChar.InventoryContains(720028, 1))
                                    {
                                        MyChar.RemoveItem(MyChar.ItemNext(720028));
                                        MyChar.CPs += 2150;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.NPCSay("Here is your 2150 cps. GoodLuck"));
                                        SendPacket(General.MyPackets.NPCLink("Thanks", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Sorry, You dont have a DbScroll"));                                        SendPacket(General.MyPackets.NPCLink("Oh sorry", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
Now For the gold to cps and cps to gold NPC

Code:
                            if (CurrentNPC == 2345)
                            {
                                SendPacket(General.MyPackets.NPCSay("Hi, " + MyChar.Name + " Would you like to trade 400 cps for 400k or 400k for 400cps?"));
                                 SendPacket(General.MyPackets.NPCLink("I would Like 400cps please", 1));
                                SendPacket(General.MyPackets.NPCLink("I would Like 400k please",  2));
                                SendPacket(General.MyPackets.NPCLink("No thanks", 255));
                                SendPacket(General.MyPackets.NPCSetFace(30));
                                SendPacket(General.MyPackets.NPCFinish());
And controls ...

Code:
                            if (CurrentNPC == 2345)
                            {
                                if (Control == 1)
                                {
                                    if (MyChar.Silvers >= 400000)
                                    {
                                        MyChar.Silvers -= 400000;
                                        MyChar.CPs += 400;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.NPCSay("Here is your 400 cps. GoodLuck"));
                                        SendPacket(General.MyPackets.NPCLink("Thanks", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Sorry, You dont have 400k"));
                                        SendPacket(General.MyPackets.NPCLink("Oh sorry", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
                                if (Control == 2)
                                {
                                    if (MyChar.CPs >= 400)
                                    {
                                        MyChar.CPs -= 400;
                                        MyChar.Silvers += 400000;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.NPCSay("Here is your 400k. GoodLuck"));
                                        SendPacket(General.MyPackets.NPCLink("Thanks", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Sorry, You dont have 400cps"));
                                        SendPacket(General.MyPackets.NPCLink("Oh sorry", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
Tell me if The Controls are the wrong way around xD
Press Thanks!!
05/23/2009 20:14 $HaDoW#2
simple :) I have a better one ^_^ but this will wokr perftect for newbies ^_^
Good Job Btw update this
it should be "Sorry, You dont have a DbScroll"
05/23/2009 20:20 tanelipe#3
Change this
PHP Code:
if (MyChar.CPs == 400
to
PHP Code:
if (MyChar.CPs >= 400
And it'll work 105%
05/23/2009 20:24 ih8you#4
Quote:
Originally Posted by tanelipe View Post
Change this
PHP Code:
if (MyChar.CPs == 400
to
PHP Code:
if (MyChar.CPs >= 400
And it'll work 105%
ok, should i do it to of (MyChar.Silvers >= 400000) too

Quote:
Originally Posted by $HaDoW View Post
simple :) I have a better one ^_^ but this will wokr perftect for newbies ^_^
Good Job Btw update this
it should be "Sorry, You dont have a DbScroll"
kk and ty, I'm only just learning how to code, not that good yet
05/23/2009 20:27 tanelipe#5
Yes.
05/23/2009 20:28 ih8you#6
Did it, Thanks
05/23/2009 21:27 PeTe Ninja#7
good release =] , and anyone who says he didnt code the cp admin then let me tell you this... try doing cp admin and click no for the control on a regular LOTF it will still take your db =]

+k :D even though i wont use lol good release though
05/23/2009 22:39 ih8you#8
Quote:
Originally Posted by PeTe Ninja View Post
good release =] , and anyone who says he didnt code the cp admin then let me tell you this... try doing cp admin and click no for the control on a regular LOTF it will still take your db =]

+k :D even though i wont use lol good release though
Woo Thanks, I got no idea what to do next though =S
05/23/2009 22:59 2coolforu2#9
Quote:
Originally Posted by ih8you View Post
Woo Thanks, I got no idea what to do next though =S
Nice release, Maybe for your next release you can try to make a command called /hide (name or me). It would be for Gm's to be able to use it to hide from players asking for stuff.
05/23/2009 23:22 ih8you#10
Quote:
Originally Posted by 2coolforu2 View Post
Nice release, Maybe for your next release you can try to make a command called /hide (name or me). It would be for Gm's to be able to use it to hide from players asking for stuff.
so like, when a player whisper a gm, the command makes them think the gm is offline

so, when a gm comes on and types /hide me and a normal player whispers the gm they get the message hes offline?
05/24/2009 06:04 2coolforu2#11
Quote:
Originally Posted by ih8you View Post
so like, when a player whisper a gm, the command makes them think the gm is offline

so, when a gm comes on and types /hide me and a normal player whispers the gm they get the message hes offline?
Well youc an also make that but also make the GM invisable to players but visable to other GM's.
05/24/2009 06:10 PeTe Ninja#12
hey mark you know how i said make wisper command you dont need now lol i just said it because i thoght you can do it but its released now in the dex sourcel ol
05/24/2009 11:20 ih8you#13
lol, cool, i need to find out where to start on the invisable command
05/24/2009 13:10 $HaDoW#14
start working on Vending and release it ! and you will be the hero !
05/24/2009 15:29 sec0nd2n0ne#15
Quote:
Originally Posted by ih8you View Post
Hi its me again

Flame will be Reported

I Coded these 100% Myself

The NPCS are, CP admin and A Npc that trades gold for cps and cps for gold. Both tested on a LOTF source 100% work

First CP Admin

Code:
                            if (CurrentNPC == 1234)
                            {
                                SendPacket(General.MyPackets.NPCSay("Hi, " + MyChar.Name +  " Would you like to trade a DragonBall for 215 cps or a DBScroll for 2150 cps?"));
                                SendPacket(General.MyPackets.NPCLink("I would Like to trade a DragonBall for 215cps.", 1));
                                SendPacket(General.MyPackets.NPCLink("I would Like to trade a DBScroll for 2150 cps.", 2));
                                SendPacket(General.MyPackets.NPCLink("No thanks.", 255));
                                SendPacket(General.MyPackets.NPCSetFace(30));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
And Controls...
Code:
                            if (CurrentNPC == 1234)
                            {
                                if (Control == 1)
                                {
                                    if (MyChar.InventoryContains(1088000, 1))
                                    {
                                        MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        MyChar.CPs += 215;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.NPCSay("Here is your 215 cps. GoodLuck"));
                                        SendPacket(General.MyPackets.NPCLink("Thanks", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Sorry, You dont have a DragonBall"));
                                        SendPacket(General.MyPackets.NPCLink("Oh sorry", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
                                if (Control == 2)
                                {
                                    if (MyChar.InventoryContains(720028, 1))
                                    {
                                        MyChar.RemoveItem(MyChar.ItemNext(720028));
                                        MyChar.CPs += 2150;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.NPCSay("Here is your 2150 cps. GoodLuck"));
                                        SendPacket(General.MyPackets.NPCLink("Thanks", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Sorry, You dont have a DbScroll"));                                        SendPacket(General.MyPackets.NPCLink("Oh sorry", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
Now For the gold to cps and cps to gold NPC

Code:
                            if (CurrentNPC == 2345)
                            {
                                SendPacket(General.MyPackets.NPCSay("Hi, " + MyChar.Name + " Would you like to trade 400 cps for 400k or 400k for 400cps?"));
                                 SendPacket(General.MyPackets.NPCLink("I would Like 400cps please", 1));
                                SendPacket(General.MyPackets.NPCLink("I would Like 400k please",  2));
                                SendPacket(General.MyPackets.NPCLink("No thanks", 255));
                                SendPacket(General.MyPackets.NPCSetFace(30));
                                SendPacket(General.MyPackets.NPCFinish());
And controls ...

Code:
                            if (CurrentNPC == 2345)
                            {
                                if (Control == 1)
                                {
                                    if (MyChar.Silvers >= 400000)
                                    {
                                        MyChar.Silvers -= 400000;
                                        MyChar.CPs += 400;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.NPCSay("Here is your 400 cps. GoodLuck"));
                                        SendPacket(General.MyPackets.NPCLink("Thanks", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Sorry, You dont have 400k"));
                                        SendPacket(General.MyPackets.NPCLink("Oh sorry", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
                                if (Control == 2)
                                {
                                    if (MyChar.CPs >= 400)
                                    {
                                        MyChar.CPs -= 400;
                                        MyChar.Silvers += 400000;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.NPCSay("Here is your 400k. GoodLuck"));
                                        SendPacket(General.MyPackets.NPCLink("Thanks", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Sorry, You dont have 400cps"));
                                        SendPacket(General.MyPackets.NPCLink("Oh sorry", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
Tell me if The Controls are the wrong way around xD
Press Thanks!!
Hi im new to this and I looked everywhere for the information on how to add a script to the database. I wondering how do i load the script to the database. I know how to open the npc database and create a npc and how to make it show anywhere on any map but my question is where do i add these codes? I would imagen i can make a new folder and save your script to be 1234Guard.cs or something like that but how i make the server load the file when someone calls the guard?Like where do i save the code part and then where do i save the command. any input would be greatly appreciated as i am new with coding and dont know how the server works lol.