Register for your free account! | Forgot your password?

You last visited: Today at 23:03

  • Please register to post and access all features, it's quick, easy and FREE!

 

[Release] Activate/Un-Activate NPC by Command.

Reply
 
Old   #1
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,159
[Release] Activate/Un-Activate NPC by Command.

So ive seen alot of you wanted this, well here it is, coded this in about 4minutes total and never tested it,so you will probably be the first one.

So, all you actually do is to make the server check if xxx is activated, if it is, it shows the real npc chat, if it isnt, it tells you that it isnt. And you activate/unactivate the xxx with a command. Well here you are:



In General.cs , under : public static System.Timers.Timer Thetimer;

Code:
public static bool CanTalkToNPC = false;

Search for : if (Splitter[0] == "/ServerRestart")

Above that , add:


Code:
if (Splitter[0] == "/startnpc")
                                        {
                                            string K = "";
                                            if (General.CanTalkToNPC)
                                            {
                                            K = "un-activated!";
                                           General.CanTalkToNPC = false;
                                            }
                                            if (!General.CanTalkToNPC)
                                            {
                                            K = "activated!";
                                            General.CanTalkToNPC = true;
                                             }
                                             World.SendMsgToAll("The xxxx NPC has been " + K, "NPCHandeler", 2005);
                                         }
This is how the command works:
If you type /startnpc , it will check if the npc is activated. If the npc(s) is activated, they will be un activated, and vice versa. Also it announce the status of the npc.





And this is an example of how to NPC code work:

Search for : if (CurrentNPC == 12)

Until you get to the NPC TALK


Above, add this:



Code:
if (CurrentNPC == 1339)
                            {
                                if (!General.CanTalkToNPC)
                                {
                                    SendPacket(General.MyPackets.NPCSay("This NPC is not started yet. Please wait for an announcment!"));
                                    SendPacket(General.MyPackets.NPCLink("Okay.", 255));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                                else
                                {
                                    SendPacket(General.MyPackets.NPCSay("Hello there! Want me to teleport you to xxxx?"));
                                    SendPacket(General.MyPackets.NPCLink("Sure", 1));
                                    SendPacket(General.MyPackets.NPCLink("Just passing by..", 255));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                            }
Now that is an example how it could look like.



Hope it gave you any ideas or/and knowledge. Atleast I hope I helped someone.


Emme



_Emme_ is offline  
Thanks
7 Users
Old   #2
 
elite*gold: 0
Join Date: Oct 2008
Posts: 430
Received Thanks: 176
Hmmm... I never thought of doing something like this. Probably won't test this itself, but it gives me an idea. Setting NPC's to some sort of timer, in which at certain times they'll appear for quests or what not, and the rest of the time, have their location switched to an unreachable map.


Incariuz is offline  
Old   #3
 
elite*gold: 0
Join Date: Sep 2008
Posts: 331
Received Thanks: 136
Thanks emme So Much
!DeX! is offline  
Old   #4
 
elite*gold: 0
Join Date: Jan 2007
Posts: 1,031
Received Thanks: 58
Quote:
Originally Posted by E*PvPers View Post
Thanks emme So Much
Im still Waiting to get hacked Mr.(Hacker) lol And Still i didnt Get it ... hmm lets see ,maybe your just full of ****?


damianpesta is offline  
Old   #5
 
elite*gold: 0
Join Date: Sep 2008
Posts: 331
Received Thanks: 136
Quote:
Originally Posted by damianpesta View Post
Im still Waiting to get hacked Mr.(Hacker) lol And Still i didnt Get it ... hmm lets see ,maybe your just full of ****?
wanne try Give me ur IP and tell Bye bye to ur PC
!DeX! is offline  
Old   #6
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,159
Press thanks if you liked this, e.x used it, got ideas, or just like it.

And for the timer, thats very easy. Add a timer in the SingleNPC class as I call it, of lets say 10 minutes. Now, start the NPC + the timer by using a command, like this:

if (Splitter[0] == "/start")
{
SingleNPC G = new SingleNPC(INFO HERE, ALSO THE TIMER HERE);
Spawn G;
}

Now a timer is started, on what time you defined it to in the code above. Now you can do like this for the timer:


if (Timer_Elapsed)
{
foreach (DictionaryEntry DE in NPCs.AllNPCs)
{
SingleNPC Npc = (SingleNPC)DE.Value;

if (Npc.UID == NPCUIDHERE)
Npc.X == 999;
Npc.Y == 999;
Npc.Map == 999;
}
}



Well something like that, I never actually did this and it was directly coded in e*pvp
_Emme_ is offline  
Thanks
2 Users
Old   #7
 
elite*gold: 0
Join Date: Sep 2008
Posts: 259
Received Thanks: 64
Emme i love u so much
that was much easier then i thought
i thought it was so difficult xD
~jochemke~ is offline  
Old   #8
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,159
press thanks then..
_Emme_ is offline  
Old   #9
 
elite*gold: 0
Join Date: Sep 2008
Posts: 259
Received Thanks: 64
rofl forgot to do that
tnx for remembering
keep up the good work

ps: u gonna release more these days?
~jochemke~ is offline  
Old   #10
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,159
Sure,just gimme ideas.
_Emme_ is offline  
Old   #11
 
elite*gold: 0
Join Date: Sep 2008
Posts: 259
Received Thanks: 64
well about the treasure hunt when the box drops something u can't pick it up
how to fix that?
~jochemke~ is offline  
Old   #12
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,159
You cant pick it up? Wierd, well lets see if someone else got that error. Besides, post in the thread for that subject.
_Emme_ is offline  
Old   #13
 
elite*gold: 0
Join Date: Jan 2007
Posts: 1,031
Received Thanks: 58
Quote:
Originally Posted by E*PvPers View Post
wanne try Give me ur IP and tell Bye bye to ur PC
What Kind of Hacker Needs IP to Pwn Someones Comp? I lol'd now ... seriously get a life rather than talking **** just like 10 year old kid
damianpesta is offline  
Old   #14
 
elite*gold: 0
Join Date: Sep 2008
Posts: 259
Received Thanks: 64
Quote:
Originally Posted by EmmeTheCoder View Post
You cant pick it up? Wierd, well lets see if someone else got that error. Besides, post in the thread for that subject.
kk posted in treasure hunt topic
~jochemke~ is offline  
Old   #15
 
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 153
You can't do **** with only an IP.
The only way you can even connect to the host is through an open port, or a bridging program. If they're blocking their router, you have no access.
Even then, you can't connect unless a program is running on the port, which means you'd have to install it some way.


tao4229 is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
[please]help me to activate any hack
i downloaded a lot of hacks and follow the explanations and dont sucsses to activate any hack. i faild all please help me in this. im very want...
12 Replies - Dekaron
[Release] Activate Fireworks
this is 100% my work don't spam with useless posts since so many requests i decided to make it very simple just place the code in character.cs...
28 Replies - CO2 PServer Guides & Releases
Activate Items???????????
Haven't played CO for a month, installed win 7 and took a bit to get CO running again. Started playing today and I click on a pot and I get a message...
3 Replies - CO2 Main - Discussions / Questions
sf new patched how to activate the old WH
how to make new WH because i'm seek and tired beeing seen by those waller that i've been playing with i need to make revenge... pls help:rtfm:
2 Replies - Soldier Front
An1 know how to activate multiclient now?
hey guys.. before the 3rd beta.. the trick to open another client for sro is to right click on the icon and choose run as.. it perfectly work.. but...
1 Replies - SRO Main - Discussions / Questions



All times are GMT +1. The time now is 23:03.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.