Register for your free account! | Forgot your password?

Go Back   elitepvpers > Conquer Online 2 > CO2 PServer - Discussions / Questions
You last visited: Today at 18:50

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

 

[Request] How to make a wishes tree

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2006
Posts: 94
Received Thanks: 28
[Request] How to make a wishes tree

hello everyone.

i wanna know, if it is possible to make something like... a wish tree, a player talk with the tree, and then he can writte his wish on it, and that wish, will be saved in a text file in a source folder with the infos:

character name, wish, date of wish.


please help



masternek is offline  
Old   #2
 
elite*gold: 0
Join Date: Dec 2005
Posts: 231
Received Thanks: 85
I'm sure you can. just use a stream writer to write the wish name and w/e you want into a file. Problem is I think you will have to use NPCLink2 which correct me if I'm wrong has a limit in the length. so your "wish" can only be so long. I'll double check this.


dragon89928 is offline  
Thanks
1 User
Old   #3
 
elite*gold: 0
Join Date: Dec 2006
Posts: 94
Received Thanks: 28
can you do something like... a lil guide? o.o
masternek is offline  
Old   #4
 
elite*gold: 0
Join Date: Dec 2005
Posts: 231
Received Thanks: 85
you'd wanna do something like

in npcdialog:
Code:
#region wish tree
                            case 999999: // make sure you change this to the npc you want to use
                                {

                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("What is your wish?"));
                                        GC.AddSend(Packets.NPCLink2("Type in your wish", 1));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    else if (Control == 1)
                                    {
                                        string wish = ReadString(Data);
                                        if (wish != null)
                                        {
                                            string path = "C:\\OldCODB\\wish.txt";
                                            StreamWriter SW;
                                            if (File.Exists(path))
                                            {
                                                SW = File.AppendText(path);
                                                SW.WriteLine(GC.MyChar.Name + ": " + wish);
                                                //will write  --   Name: My wish
                                                SW.Close();
                                                Console.WriteLine("A new wish has been made!");
                                            }
                                            else
                                            {
                                                SW = File.CreateText(path);
                                                SW.WriteLine(wish);
                                                SW.Close();
                                                Console.WriteLine("A new wish has been made!");
                                            }
                                        }
                                        GC.AddSend(Packets.NPCSay("Your Wish has been added into the file"));
                                        GC.AddSend(Packets.NPCLink2("Thanks", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    break;
                                }
                            #endregion
i didn't test this code. It should work though.


dragon89928 is offline  
Thanks
2 Users
Old   #5
 
elite*gold: 0
Join Date: Dec 2006
Posts: 94
Received Thanks: 28
it worked! you are awesome! thank you so much

by the way.. i have a last question... how can i make an item talk? like... open a dialogue
masternek is offline  
Old   #6
 
elite*gold: 0
Join Date: May 2010
Posts: 298
Received Thanks: 57
Like the boxes in lady luck ?

Give the NPC the mesh of the weapon.
MonstersAbroad is offline  
Old   #7
 
elite*gold: 0
Join Date: Dec 2006
Posts: 94
Received Thanks: 28
item name: DragonPot

item id: 710868

i dont know if its like the boxes, in my server, the boxes dont talk xD
masternek is offline  
Old   #8
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,740
Received Thanks: 5,268
Code:
                    Char.MyClient.DialogNPC = 666111;
                    PacketHandling.NPCDialog.Handle(Char.MyClient, null, 666111, 0);
                    Char.MyClient.EndSend();
Should be able to make do with that.
Just remember you need to add an npc entry in npcdialog.cs and npcs.txt
Arcо is offline  
Thanks
1 User
Old   #9
 
elite*gold: 0
Join Date: Dec 2006
Posts: 94
Received Thanks: 28
thx, arco, but where do i put this code?

Char.MyClient.DialogNPC = 666111;
PacketHandling.NPCDialog.Handle(Char.MyClient, null, 666111, 0);
Char.MyClient.EndSend();

i put in packet.cs?

help? o.O
masternek is offline  
Old   #10
 
elite*gold: 0
Join Date: May 2010
Posts: 630
Received Thanks: 130
u put in command, npccontrol, whereever you want it to send it from.
.Summer is offline  
Old   #11
 
elite*gold: 0
Join Date: Dec 2006
Posts: 94
Received Thanks: 28
wesdr

a lil guide please? xD
masternek is offline  
Old   #12
 
elite*gold: 0
Join Date: Dec 2006
Posts: 94
Received Thanks: 28
so...?
masternek is offline  
Old   #13
 
elite*gold: 0
Join Date: May 2010
Posts: 630
Received Thanks: 130
When do you want it to come up?
.Summer is offline  
Old   #14
 
elite*gold: 0
Join Date: Dec 2005
Posts: 231
Received Thanks: 85
using arco's example, when an event that you want to happen is triggered and you want to send the box you would go:

Code:
bool someEventIsTriggered = true;
if (someEventIsTriggered){
	foreach(Game.Character Char in Game.World.H_Chars){
	Char.MyClient.DialogNPC = 666111;
	PacketHandling.NPCDialog.Handle(Char.MyClient, null, 666111, 0);
	Char.MyClient.EndSend();
	}
}
dragon89928 is offline  
Old   #15
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,740
Received Thanks: 5,268
Was hoping you'd be able to learn from what I gave you...
Guess not.
Btw stop double posting.
In character.cs with using items.
case 710868:
Char.MyClient.DialogNPC = 666111;
PacketHandling.NPCDialog.Handle(Char.MyClient, null, 666111, 0);
Char.MyClient.EndSend();
break;


Arcо is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
[Request] NAGC Skill Tree Uncap?
Title says. Is there any possible hack to uncap the 35 limit to infinity?
7 Replies - Grand Chase
Best Wishes from Hungary
Hi to ALL ! :D enjoy the life's goods :cool:
2 Replies - Say Hello
Druid Tree form buff without tree Form
My buddy and i were screwing around the other day in Mech and we figured out a way to have a working tree form buff for the party but not be in tree...
5 Replies - WoW Exploits, Hacks, Tools & Macros



All times are GMT +1. The time now is 18:50.


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.