|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Custom Custom Quests here |
08-18-2014, 03:27 PM
|
Sarnak
|
|
Join Date: Jun 2014
Posts: 69
|
|
Skills quest
So here a quest script i put together for a skill up NPC
http://pastebin.com/xFgexccX
first day i set him up he worked perfect i tested him etc (level by level) and my skills went up
now hes dead to the world
when i run questerrors i get this
script error: qst_npc_999248::EVENT_ITEM
|
|
|
|
08-29-2014, 02:52 PM
|
|
Dragon
|
|
Join Date: Nov 2008
Location: GA
Posts: 904
|
|
Syntax looks fine to me.
Code:
sub EVENT_SAY
{
if($text =~/Hail/i)
{
quest::say("Greetings $name. If you want me to set your skills for you, please say so and I will give you my [pricelist]. If you want me to [heal] you, please say so and I will do it for free.");
}
if($text=~/pricelist/i)
{
quest::say("I can set all skills to the following skill levels : level 20 = 10 pp // level 40 = 40 pp // level 60 = 80 pp // level 80 = 160 pp // level 100 = 320 pp // level 120 = 640 pp // level 150 = 1280 pp // level 200 = 2560 pp // level 250 = 5000 pp");
}
if($text=~/heal/i)
{
quest::selfcast(13);
}
}
sub EVENT_ITEM
{
if($platinum == 10)
{
quest::setallskills (20);
}
if($platinum == 40)
{
quest::setallskills (40);
}
if($platinum == 80)
{
quest::setallskills (60);
}
if($platinum == 160)
{
quest::setallskills (80);
}
if($platinum == 320)
{
quest::setallskills(100);
}
if($platinum == 640)
{
quest::setallskills(120);
}
if($platinum == 1280)
{
quest::setallskills(150);
}
if($platinum == 2560)
{
quest::setallskills(200);
}
if($platinum == 5000)
{
quest::setallskills(250);
}
}
However consider expanding your code to use character level and class skill max values. For instance if your character is level 34 wizard, this code would give max skills for a level 34 wizard. You can place it inside any if statement with your predetermined prerequisites.
Code:
{
my $CharClass = $client->GetClass();
for ($skillid = 0; $skillid < 74; $skillid++)
{
my $SkillValue = $client->MaxSkill($skillid, $CharClass, $ulevel);
$client->SetSkill($skillid, $SkillValue);
}
}
|
|
|
|
06-21-2015, 12:49 PM
|
Sarnak
|
|
Join Date: Jun 2014
Posts: 69
|
|
anyone any idea why this would not work? NPC responds to players and takes money but dose not give skills
|
|
|
|
06-24-2015, 06:19 PM
|
Sarnak
|
|
Join Date: Jun 2014
Posts: 69
|
|
sooo this is now quest
sub EVENT_SAY
{
if($text =~/Hail/i)
{
quest::say("Greetings $name. If you want me to set your skills for you, please say so and I will give you my [pricelist].");
}
if($text=~/pricelist/i)
{quest::say("I can set all skills to the following skill levels : level 20 = 10 pp // level 40 = 40 pp // level 60 = 80 pp // level 80 = 160 pp // level 100 = 320 pp // level 120 = 640 pp // level 150 = 1280 pp // level 200 = 2560 pp // level 250 = 5000 pp");}
}
}
sub EVENT_ITEM
{
if($platinum == 10)
{
quest::setallskill (20) ;
}
if($platinum == 40)
{
quest::setallskill (40);
}
if($platinum == 80)
{
quest::setallskill (60);
}
if($platinum == 160)
{
quest::setallskill (80);
}
if($platinum == 320)
{
quest::setallskill (100);
}
if($platinum == 640)
{
quest::setallskill (120);
}
if($platinum == 1280)
{
quest::setallskill (150);
}
if($platinum == 2560)
{
quest::setallskill (200);
}
if($platinum == 5000)
{
quest::setallskill (250);
}
}
should all work? but itg dosnt ...he gobbles plat and gives no skills :S
|
|
|
|
|
|
|
06-24-2015, 07:01 PM
|
|
Demi-God
|
|
Join Date: Nov 2007
Posts: 2,175
|
|
Getting it to where it is easier to read. Still responding to hails?
Code:
sub EVENT_SAY
{
if($text =~/Hail/i)
{
quest::say("Greetings $name. If you want me to set your skills for you, please say so and I will give you my [pricelist].");
}
if($text=~/pricelist/i)
{
quest::say("I can set all skills to the following skill levels : level 20 = 10 pp // level 40 = 40 pp // level 60 = 80 pp // level 80 = 160 pp // level 100 = 320 pp // level 120 = 640 pp // level 150 = 1280 pp // level 200 = 2560 pp // level 250 = 5000 pp");}
}
}
sub EVENT_ITEM
{
if($platinum == 10)
{
quest::setallskill(20);
}
if($platinum == 40)
{
quest::setallskill(40);
}
if($platinum == 80)
{
quest::setallskill(60);
}
if($platinum == 160)
{
quest::setallskill(80);
}
if($platinum == 320)
{
quest::setallskill(100);
}
if($platinum == 640)
{
quest::setallskill(120);
}
if($platinum == 1280)
{
quest::setallskill(150);
}
if($platinum == 2560)
{
quest::setallskill(200);
}
if($platinum == 5000)
{
quest::setallskill(250);
}
}
|
|
|
|
06-24-2015, 07:07 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,594
|
|
There was an extra }, try this:
Code:
sub EVENT_SAY {
my %h = (10 => 20,
40 => 40,
80 => 60,
160 => 80,
320 => 100,
640 => 120,
1280 => 150,
2560 => 200,
5000 => 250);
if($text =~/Hail/i) {
quest::say("Greetings $name. If you want me to set your skills for you, please say so and I will give you my " . quest::saylink("price list", 1) . ".");
} elsif($text=~/Price List/i) {
quest::say("I can set all skills to the following skill levels:");
quest::say("Level $h{$_}: " . quest::saylink($_, 1) . " Platinum") for (sort {$a <=> $b} @{[keys %h]});
} elsif ($text!~/Hail/i && $text!~/Price List/i && $text ~~ @{[keys %h]} && $client->TakeMoneyFromPP(($text * 1000), 1)) {
quest::setallskill($h{$text});
}
}
Last edited by Kingly_Krab; 06-24-2015 at 07:16 PM..
|
06-24-2015, 07:13 PM
|
Dragon
|
|
Join Date: Apr 2009
Location: California
Posts: 814
|
|
Such elegance you bring to otherwise crude and simple code, KK.
|
06-24-2015, 07:16 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,594
|
|
Yeah, just realized it didn't have saylinks so I added them. Not sure if making it more complex is elegant, but okay, haha.
|
06-24-2015, 07:19 PM
|
Dragon
|
|
Join Date: Apr 2009
Location: California
Posts: 814
|
|
So clicking the saylink for one of the options would take the money out of the character's inventory, as opposed to waiting for them to give it in a trade window. Clever and efficient, though likely less expected to the players.
|
06-24-2015, 07:43 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,594
|
|
Yeah, just the way I write things, it's more efficient to just take it all in one sweep.
|
06-25-2015, 08:08 AM
|
Sarnak
|
|
Join Date: Jun 2014
Posts: 69
|
|
King your awsome.... any idea on this one?
|
06-25-2015, 08:10 AM
|
Sarnak
|
|
Join Date: Jun 2014
Posts: 69
|
|
scratch that list bit... i completely bust second one so need to fix it
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 05:33 AM.
|
|
|
|
|
|
|
|
|
|
|
|
|