[RELEASE] GUILD CONTROLLER

02/13/2009 13:01 PeTe Ninja#1
hi im pete,

this release is the guild controller that teleports you to random spots, have fun you can change the coords too >.<


( goes in client.cs )



NPC DIALOG

Code:
if (CurrentNPC == 600) // Guild Controller
                            {
                                SendPacket(General.MyPackets.NPCSay("Would you like to enter Guild Wars? Soon if you die you will have to wait!")); // NPC Dialog
                                SendPacket(General.MyPackets.NPCLink("Oh Yes Please!", 1)); // Your Respond ( Also Control 1)
                                SendPacket(General.MyPackets.NPCLink("No No No, It's Too Scary!", 255)); // Your Respond ( Also Makes you Exit the NPC Dialog because of 255)
                                SendPacket(General.MyPackets.NPCSetFace(30)); // Sets the face << vital to make npc work
                                SendPacket(General.MyPackets.NPCFinish()); // completes the npc << vital to make npc work
                            }
NPC DO

Code:
if (CurrentNPC == 600) // Guild Controller Do
                                {
                                    if (Control == 1) // What it does for your Respond
                                    {
                                        Random R = new Random(); // New Random
                                        int Nr = R.Next(1, 10); // "Randomally" Picks a number 1-10 
                                        if (Nr == 1) //Random Spot 1
                                        {
                                            MyChar.Teleport(1038, 351, 341);
                                        }
                                        if (Nr == 2) //Random Spot 2
                                        {
                                            MyChar.Teleport(1038, 335, 345);
                                        }
                                        if (Nr == 3) //Random Spot 3
                                        {
                                            MyChar.Teleport(1038, 309, 369);
                                        }
                                        if (Nr == 4) //Random Spot 4
                                        {
                                            MyChar.Teleport(1038, 283, 340);
                                        }
                                        if (Nr == 5) //Random Spot 5
                                        {
                                            MyChar.Teleport(1038, 310, 327);
                                        }
                                        if (Nr == 6) //Random Spot 6
                                        {
                                            MyChar.Teleport(1038, 318, 297);
                                        }
                                        if (Nr == 7) //Random Spot 7
                                        {
                                            MyChar.Teleport(1038, 347, 309);
                                        }
                                        if (Nr == 8) //Random Spot 8
                                        {
                                            MyChar.Teleport(1038, 337, 320);
                                        }
                                        if (Nr == 9) //Random Spot 9
                                        {
                                            MyChar.Teleport(1038, 309, 293);
                                        }
                                        if (Nr == 10) //Random Spot 10
                                        {
                                            MyChar.Teleport(1038, 371, 300);
                                        }
                                    }
                                }

umm good luck with your server.. this is made for lotf if you dont like it, DONT USE IT??!!!?? i like lotf , its my buddy

ill be home in about 7-8 hours, going to school early today because mom has to go to work early so she drop me off at our school daycare spot =]
02/13/2009 14:19 μZane#2
May I suggest actually using else - if statements? I don't see a point comparing a number multiple times (like you are doing by only using if statements). You could also check the "Optimize code" checkbox in your settings and then use switch statement. (Which then will basically be same as else - if statement)
02/13/2009 14:29 yuko#3
doesn't really maters, you can make a random x y that stays between the map array

the point is, he released a basic npc that does a random number between 1 and 10 this could be usefull for ppl that want to make random items for gift or what ever.

there are multiple ways to make this, if - else if - cases ...

nice pete
02/13/2009 15:13 _Emme_#4
Quote:
if (Nr == 1) //Random Spot 1
{
MyChar.Teleport(1038, 351, 341);
}
if (Nr == 2) //Random Spot 2
{
MyChar.Teleport(1038, 335, 345);
}
if (Nr == 3) //Random Spot 3
{
MyChar.Teleport(1038, 309, 369);
}
if (Nr == 4) //Random Spot 4
{
MyChar.Teleport(1038, 283, 340);
}
if (Nr == 5) //Random Spot 5
{
MyChar.Teleport(1038, 310, 327);
}
if (Nr == 6) //Random Spot 6
{
MyChar.Teleport(1038, 318, 297);
}
if (Nr == 7) //Random Spot 7
{
MyChar.Teleport(1038, 347, 309);
}
if (Nr == 8) //Random Spot 8
{
MyChar.Teleport(1038, 337, 320);
}
if (Nr == 9) //Random Spot 9
{
MyChar.Teleport(1038, 309, 293);
}
if (Nr == 10) //Random Spot 10
{
MyChar.Teleport(1038, 371, 300);
}
MyChar.Teleport(1038, (ushort)General.Rand.Next(310, 360), (ushort)General.Rand.Next(297, 304));

Would work like the same way.
02/13/2009 16:21 Kital82#5
Quote:
SendPacket(General.MyPackets.NPCSetFace(30)); // Sets the face << vital to make npc work
This isn't vital to make the npc work ...
02/13/2009 16:26 yuko#6
@ eme
yes it would work the same way
but you could have let him do the thinking for it
he won't learn if he see the solution
02/13/2009 17:25 Korvacs#7
Quote:
Originally Posted by EmmeTheCoder View Post
MyChar.Teleport(1038, (ushort)General.Rand.Next(310, 360), (ushort)General.Rand.Next(297, 304));

Would work like the same way.
Not if you want 10 fixed point positions like real TQ which im assuming is what this guy has gone for.
02/13/2009 17:40 yuko#8
so far i know tq did random points when gw isn't activated ones it is activated it will stay on one place ...
02/13/2009 18:27 Korvacs#9
Quote:
Originally Posted by yuko View Post
so far i know tq did random points when gw isn't activated ones it is activated it will stay on one place ...
When gw is running you get teleported to one of like 10 fixed locations, and it decides randomly which one you will spawn at, it isn't completely random like emme's suggestion.
02/13/2009 18:51 yuko#10
possible :-) i don't really go to gw on tq's server it rare i even get on it with there bussy messages :p
anyway my suggestion is make a Private server that doesn't copy tq's servers would be nice to see what you (general) have dun with it
02/13/2009 19:52 _Emme_#11
Quote:
Originally Posted by Korvacs View Post
Not if you want 10 fixed point positions like real TQ which im assuming is what this guy has gone for.
Ofcourse, but I think people would not really care if they spawned at one of the ten positions, not sure tough, but there is other ways than the way Pete showed us today, maybe if I got time I'll show people how to do that.

Good release anyways Pete, keep it up. Also, try to code things in general, that would work in any privateserver source, or can be related to privateservers in any way.
02/13/2009 20:00 Korvacs#12
Quote:
Originally Posted by EmmeTheCoder View Post
Ofcourse, but I think people would not really care if they spawned at one of the ten positions, not sure tough, but there is other ways than the way Pete showed us today, maybe if I got time I'll show people how to do that.

Good release anyways Pete, keep it up. Also, try to code things in general, that would work in any privateserver source, or can be related to privateservers in any way.
If you just use a rand you could spawn on invalid cords, off the map or inside an npc :rolleyes:
02/13/2009 20:08 _Emme_#13
Very true, you use that code on your own risk:p
02/13/2009 21:09 PeTe Ninja#14
Quote:
Originally Posted by yuko View Post
@ eme
yes it would work the same way
but you could have let him do the thinking for it
he won't learn if he see the solution
what solution lol, i didnt ask for one nor need one :D, i like mine
02/13/2009 23:41 yuko#15
you would never have tought about changing the x and the y in one line
thats what i was talking about if you read the whole thing ...

also something
did you try your npc?
because if you have payed attention
you'll never get your random to 10
but i think you know that