Register for your free account! | Forgot your password?

You last visited: Today at 04:42

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

Advertisement



[Question]Bloody hell

Discussion on [Question]Bloody hell within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2005
Posts: 72
Received Thanks: 7
[Question]****** hell

Code:
def npc(Client, Option):
    if(Option == 0):
        Text("Well " + Client.Name + " heading to the Isle of Specialists?" )
        Link("Yeah.", 1)
        Link("Not this time.", 255)
    if(Option == 1):
        Text("Enjoy your stay there.")        
        Link("I will, thanks.", 255)
        Teleport(088, 038, 1010, Client)
        Finish()
    return 0
So this is an NPC (obviously for teleportation) that I'm making whom will be in all cities and ****.

Code:
def npc(Client, Option):
    if(Option == 0):
        Text("Hey, " + Client.Name + " you are looking to go to the North Marsh?")
        if(Client.Level > 90):
            Text("It appears you are indeed strong enough to go. Are you ready?")
            Link("Lets do this.", 1)
            Link("On second thought...", 255)
        else:
            Text("You're not ready for what lies beyond, are you sure you want to go?")
            Link("I'll take my chances.", 2 )
            Link( "You're probably right, I'll come back.." , 255 )
        Finish()
    if(Option == 1):
        Text("Best of luck, and be careful.")
        Teleport(824, 571, 1015, Client)
    if(Option == 2):
        Text("As you wish, be careful." )
        Teleport(824, 571, 1015, Client)
        Link("Sweet.", 255)
        Finish()
    return 0
is one I already made, the first is giving me an error the second isn't. anyone seeing an error I'm not? fresh eyes and all that ****
nushizu is offline  
Old 02/11/2013, 02:42   #2
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
i duno what programming language is that written at but here is some points that should fuck this code up
you should better use switch or at least a if else with a braces "{}"
the second one is working just because when it match the if it continue to the rest of that case (the normal code flow) , personally this way is so fucked up and make it even harder to trace
maybe you should try something like

Code:
def npc(Client, Option):
switch(option)
{
case 0:
{
        Text("Hey, " + Client.Name + " you are looking to go to the North Marsh?");
if(Client.Level > 90):
{
            Text("It appears you are indeed strong enough to go. Are you ready?");
            Link("Lets do this.", 1);
            Link("On second thought...", 255);
}
else
{
            Text("You're not ready for what lies beyond, are you sure you want to go?");
            Link("I'll take my chances.", 2 );
            Link( "You're probably right, I'll come back.." , 255 );
}
        Finish();
break;
}

case 1:
{
        Text("Best of luck, and be careful.");
        Teleport(824, 571, 1015, Client);
        Finish();
break;
}

case 2:
{
        Text("As you wish, be careful." );
        Teleport(824, 571, 1015, Client);
        Link("Sweet.", 255);
        Finish();
break;
}
}
maybe you can even merge case 1/2 with a level check

Code:
def npc(Client, Option):
switch(option)
{
case 0:
{
        Text("Hey, " + Client.Name + " you are looking to go to the North Marsh?");
if(Client.Level > 90):
{
            Text("It appears you are indeed strong enough to go. Are you ready?");
            Link("Lets do this.", 1);
            Link("On second thought...", 255);
}
else
{
            Text("You're not ready for what lies beyond, are you sure you want to go?");
            Link("I'll take my chances.", 1 );
            Link( "You're probably right, I'll come back.." , 255 );
}
        Finish();
break;
}

case 1:
{
if(Client.Level > 90):
{
        Text("Best of luck, and be careful.");
        Teleport(824, 571, 1015, Client);
        Finish();
}
else
{
        Text("As you wish, be careful." );
        Teleport(824, 571, 1015, Client);
        Link("Sweet.", 255);
        Finish();
}
break;
}
}
you should run the project from visual studio , add break point there and see the code flow and you should understand what's wrong
go for it is offline  
Old 02/11/2013, 03:06   #3
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
PHP Code:
def npc(ClientOption):
    if(
Option == 0):
        
Text("Well " Client.Name " heading to the Isle of Specialists?" )
        
Link("Yeah."1)
        
Link("Not this time."255)
        
Finish()
    if(
Option == 1):
        
Text("Enjoy your stay there.")        
        
Link("I will, thanks."255)
        
Teleport(0880381010Client)
        
Finish()
    return 

fixed, you forgot Finish() in first case
_DreadNought_ is offline  
Old 02/11/2013, 03:14   #4
 
elite*gold: 0
Join Date: Oct 2005
Posts: 72
Received Thanks: 7
I figured it out, the error was with the coordinates. you can't use "088, 038, 1010" it would have to be written "88, 38, 1010" thanks though
nushizu is offline  
Reply


Similar Threads Similar Threads
Suche Rush act 2 hell -act 4 hell
06/09/2012 - Diablo 3 Trading - 0 Replies
Hey Wenn sich jemand gold dazu verdinnen will einfach im spiel anschreiben Raven#2322 preis ist verhandelbar zahle mit Diablo 3 gold Push nun von act 2 kull bis act 4 diablo rush gesucht pn hier oder ingame
A small question about Bloody-Silkroad Lillium !
09/18/2011 - SRO Private Server - 1 Replies
I Am Getting c8 Error in login in ! is my account is buggy or it is from the whole server ?
WTF?hell what the hell?question!!!
01/01/2011 - Conquer Online 2 - 3 Replies
hey i have a dilemma...when i wear my elite armor lvl 87+2 birdmans hit me 1.. and when i wear my lvl 100 armor unique 1 sock +3 they hit me 3...wtf?def is higher but? i am shocked why they hit my more even the overall def is with 300+ higher with lvl 100 armor lol
[Question]How The Hell is SWSRO going To Add lvl 100 Cap Without Jangan Cave?!?!
07/16/2009 - SRO Private Server - 20 Replies
#Close
L2 Bloody Hell x10
12/05/2007 - Lin2 Private Server - 0 Replies
L2 Bloody Hell Interlude Lineage2 Server *Just Started* *True Lineage2 at 10x Rates* ..:L2 Bloody Hell:.. No Spawn PK (Protection System for 120 seconds) Skill can be learned without Spell Books



All times are GMT +1. The time now is 04:42.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.