pkcity world msg

10/03/2010 15:15 FadMucker#1
hey guys what im trying to achieve is to get the server to send a sendmsgtoall
when characters enter the pkcity map displaying there name and guild, which i achieved but then found that if a char isnt in a guild the msg doesnt activate.
Quote:
#region PKCity NPC
case 1616:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Do you wish to enter the PKCity?"));
GC.AddSend(Packets.NPCLink("Yes.", 1));
GC.AddSend(Packets.NPCLink("No.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{

GC.MyChar.Teleport(1507, 080, 111);
Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " from " + GC.MyChar.MyGuild.GuildName + " has entered the PKCity!", 2011, 0);
}
else
{
if (GC.MyChar.MyGuild != null)
{

Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " has entered the PKCity!", 2011, 0);
}
}


break;
}
#endregion
i tried to change what the msg said if a char wasnt in a guild but it doesnt work. can some1 please tell me what im missing or doing wrong?
thanks...
10/03/2010 16:24 .Beatz#2
Quote:
Originally Posted by FadMucker View Post
hey guys what im trying to achieve is to get the server to send a sendmsgtoall
when characters enter the pkcity map displaying there name and guild, which i achieved but then found that if a char isnt in a guild the msg doesnt activate.

i tried to change what the msg said if a char wasnt in a guild but it doesnt work. can some1 please tell me what im missing or doing wrong?
thanks...
Code:
#region PKCity NPC
case 1616:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Do you wish to enter the PKCity?"));
GC.AddSend(Packets.NPCLink("Yes.", 1));
GC.AddSend(Packets.NPCLink("No.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1 && GC.MyChar.Guild != null)
{
GC.MyChar.Teleport(1507, 080, 111);
Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " has entered the PKCity!", 2011, 0);
}
else
{
GC.MyChar.Teleport(1507, 080, 111);
Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " from " + GC.MyChar.MyGuild.GuildName + " has entered the PKCity!", 2011, 0);
}


break;
}
#endregion
Try this, I have NOT tested it.
10/03/2010 16:50 FadMucker#3
Quote:
Originally Posted by .Beatz View Post
Code:
#region PKCity NPC
case 1616:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Do you wish to enter the PKCity?"));
GC.AddSend(Packets.NPCLink("Yes.", 1));
GC.AddSend(Packets.NPCLink("No.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1 && GC.MyChar.Guild != null)
{
GC.MyChar.Teleport(1507, 080, 111);
Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " has entered the PKCity!", 2011, 0);
}
else
{
GC.MyChar.Teleport(1507, 080, 111);
Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " from " + GC.MyChar.MyGuild.GuildName + " has entered the PKCity!", 2011, 0);
}


break;
}
#endregion
Try this, I have NOT tested it.
nah dont work any other ideas?
10/03/2010 17:00 .Beatz#4
Quote:
Originally Posted by FadMucker View Post
nah dont work any other ideas?
Code:
#region PKCity NPC
case 1616:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Do you wish to enter the PKCity?"));
GC.AddSend(Packets.NPCLink("Yes.", 1));
GC.AddSend(Packets.NPCLink("No.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
GC.MyChar.Teleport(1507, 080, 111);
Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " from " + GC.MyChar.MyGuild.GuildName + " has entered the PKCity!", 2011, 0);
}
else if (Control == 1 && GC.MyChar.Guild == null)
{
GC.MyChar.Teleport(1507, 080, 111);
Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " has entered the PKCity!", 2011, 0);
}

break;
}
#endregion
If that does not work add me on msn and I will try and help you some more.
10/03/2010 17:06 _Vodka#5
@beatz, u didnt need to do it that, u could have done it simpler, like this ;)
Code:
                            #region PKCity NPC
                            case 1616:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Do you wish to enter the PKCity?"));
                                        GC.AddSend(Packets.NPCLink("Yes.", 1));
                                        GC.AddSend(Packets.NPCLink("No.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (Control == 1)
                                    {
                                        GC.MyChar.Teleport(1507, 080, 111);
                                        if (GC.MyChar.Guild != null)
                                            Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " from " + GC.MyChar.MyGuild.GuildName + " has entered the PKCity!", 2011, 0);
                                        else
                                            Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " has entered the PKCity!", 2011, 0);
                                    }
                                    break;
                                }
                            #endregion
10/03/2010 17:15 FadMucker#6
Quote:
Originally Posted by _Vodka View Post
@beatz, u didnt need to do it that, u could have done it simpler, like this ;)
Code:
                            #region PKCity NPC
                            case 1616:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Do you wish to enter the PKCity?"));
                                        GC.AddSend(Packets.NPCLink("Yes.", 1));
                                        GC.AddSend(Packets.NPCLink("No.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (Control == 1)
                                    {
                                        GC.MyChar.Teleport(1507, 080, 111);
                                        if (GC.MyChar.Guild != null)
                                            Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " from " + GC.MyChar.MyGuild.GuildName + " has entered the PKCity!", 2011, 0);
                                        else
                                            Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " has entered the PKCity!", 2011, 0);
                                    }
                                    break;
                                }
                            #endregion
thx dude works perfectly +rep
10/03/2010 17:43 Macnoo#7
Like .Beatz not tested it but is how i would of done it.


Code:
                            #region PKCity NPC
                            case 1616:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Do you wish to enter the PKCity?"));
                                        GC.AddSend(Packets.NPCLink("Yes.", 1));
                                        GC.AddSend(Packets.NPCLink("No.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (Control == 1)
                                    {
                                        GC.MyChar.Teleport(1507, 080, 111);
                                        Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " has entered the PKCity!", 2011, 0);
                                        if (GC.MyChar.MyGuild.GuildName != null)
                                        {
                                            GC.MyChar.Teleport(1507, 080, 111);
                                            Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " from " + GC.MyChar.MyGuild.GuildName + " has entered the PKCity!", 2011, 0);
                                        }
                                    }
                                    break;
                                }
                            #endregion
10/03/2010 18:13 .Beatz#8
Shurrup im tired rofl. Ah well at least it got done xD
10/03/2010 19:14 _Vodka#9
Quote:
Originally Posted by Macnoo View Post
Like .Beatz not tested it but is how i would of done it.


Code:
                            #region PKCity NPC
                            case 1616:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Do you wish to enter the PKCity?"));
                                        GC.AddSend(Packets.NPCLink("Yes.", 1));
                                        GC.AddSend(Packets.NPCLink("No.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (Control == 1)
                                    {
                                        GC.MyChar.Teleport(1507, 080, 111);
                                        Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " has entered the PKCity!", 2011, 0);
                                        if (GC.MyChar.MyGuild.GuildName != null)
                                        {
                                            GC.MyChar.Teleport(1507, 080, 111);
                                            Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " from " + GC.MyChar.MyGuild.GuildName + " has entered the PKCity!", 2011, 0);
                                        }
                                    }
                                    break;
                                }
                            #endregion
why do u keep use data not needed.
this one works pefect and got less useage.
Code:
                                        GC.MyChar.Teleport(1507, 080, 111);
                                        if (GC.MyChar.Guild != null)
                                            Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " from " + GC.MyChar.MyGuild.GuildName + " has entered the PKCity!", 2011, 0);
                                        else
                                            Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " has entered the PKCity!", 2011, 0);