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 ****
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
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
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
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