Page 1 of 1

Boosting Stone from 2-3 skills

Posted: Sat Jul 29, 2006 12:21 pm
by Senkrad
We have this script for character boosting of 2 skills and a stat, but we need it to boost 3 skills instead of 2. We currently dont have any developers to do this, so if someone could help us out with this we'd appreciate it.

Also, we need a good developer for our shard, if you are looking for a place go to http://avenginglegends.11.forumer.com/ and contact Avenging Angel.

From our Skillstone.Cfg:
/*
Author: MontuZ (MontuZ@aol.com) Feb 21, 2004.
Version: 1.0
Core: 093
Bugs: None. Atleast none that I know of..
PS: You know it was done by me when it's so clean.
*/

Use uo;
Use cfgfile;

Include "include/client";

Program OnUse_SkillStone( Who )

Var Boosted := GetObjProperty( who, "Detsoob" );
If( Boosted >= 2 )
SendSysmessage( who, "You've chosen 2 skills already.", FONT_NORMAL, 2595 );
Return;
Endif

Var mllayout := {
"Page 0",
"ReSizePic 350 200 3600 150 80",
"Text 390 220 2494 0",
"Button 370 222 2118 2117 1 0 1",
"Text 390 240 2494 1",
"Button 370 242 2118 2117 1 0 2",
};

Var mldata := {
"Boost Skills",
"Skip Boost",
};

Var Effect := SendDialogGump( who, mllayout, mldata );

If( !Effect )
SendSysMessage( who, "Cancelled.", FONT_NORMAL, 2600 );
Return;
Endif

Case( Effect[0] )

1:
ChangeFromSkillList( who );

2:
SetObjProperty( who, "SkippedBoost", 1 );
SendSysmessage( who, "Alrighty.", FONT_NORMAL, 2600 );

EndCase

EndProgram

Function ChangeFromSkillList( who )

Var layout2 := array(
"Page 0",
"ReSizePic 0 0 3600 250 450",
"Text 75 30 2494 0",
);

Var data2 := array(
"Select a Skill"
);

Var cfg := ReadConfigFile( ":combat:modenchantdesc" );
Var count := 0;
Var done := 0;
Var page := 1;
Var perpage := 17;
Var y := 55;
Var i;

layout2.append( "page " + page );
If( SKILLID__HIGHEST > perpage )
layout2.append( "Button 150 406 5540 5541 0 " + ( page + 1 ) );
Endif

For( i := 1; i <= SKILLID__HIGHEST + 1; i := i + 1 )
If( done == perpage )
done := 0;
page := page + 1;
y := 55;

layout2.append( "Page " + page );
layout2.append( "Button 80 406 5537 5538 0 " + ( page - 1 ) );
If( SKILLID__HIGHEST > ( count + perpage ) )
layout2.append( "button 150 406 5540 5541 0 " + ( page + 1 ) );
Endif
Endif

layout2.append( "Text 25 " + y + " 2597 " + len( data2 ) );
layout2.append( "Button 200 " + ( y + 5 ) + " 2104 2103 1 0 " + i );
data2.append( cfg[i-1].Skill );

y := y + 20;
done := done + 1;
count := count + 1;
Endfor

Var res := SendDialogGump( who, layout2, data2 );

If( !res[0] )
SendSysmessage( who, "Cancelled.", FONT_NORMAL, 2595 );
Return;
Endif

Var Boosted := GetObjProperty( who, "Detsoob" );

If( !Boosted )
SendSysMessage( who, "First Skill Set to 130", FONT_NORMAL, 2600 );
SetBaseSkillBaseValue( who, res[0]-1, 1300 );
SetObjProperty( who, "Detsoob", 1 );
ChangeFromSkillList( who );
Endif

If( Boosted >= 2 )
SendSysmessage( who, "You've chosen 2 skills already.", FONT_NORMAL, 2595 );
Elseif( Boosted == 2 )
EraseObjProperty( who, "Detsoob" );
SetObjProperty( who, "Detsoob", 3 );
Elseif( Boosted == 1 )
SendSysMessage( who, "Second Skill Set to 130", FONT_NORMAL, 2600 );
SetBaseSkillBaseValue( who, res[0]-1, 1300 );
EraseObjProperty( who, "Detsoob" );
SetObjProperty( who, "Detsoob", 2 );
BoostStat( Who );
Endif

EndFunction

Function BoostStat( Who )

// Text X = <- +>, Y = Up- Down+, Hue, Rank

Var mllayout := {
"Page 0",
"ReSizePic 350 200 3600 160 120",
"Text 370 220 2494 0",

"Text 390 240 2494 1",
"Button 370 245 2104 2103 1 0 1",

"Text 390 260 2494 2",
"Button 370 265 2104 2103 1 0 2",

"Text 390 280 2494 3",
"Button 370 285 2104 2103 1 0 3",
};

Var mldata := {
"( Boost a Stat )",
"Strength",
"Dexterity",
"Intelligence",
};

Var Effect := SendDialogGump( who, mllayout, mldata );

If( !Effect )
SendSysMessage( who, "Last chance to boost a stat.", FONT_NORMAL, 2600 );
BoostStat( Who );
Return;
Endif

Case( Effect[0] )

1:
SetBaseStrength( Who, 130 );
SendSysMessage( who, "Now choose a race.", FONT_NORMAL, 2600 );
2:
SetBaseDexterity( Who, 130 );
SendSysMessage( who, "Now choose a race.", FONT_NORMAL, 2600 );
3:
SetBaseIntelligence( Who, 130 );
SendSysMessage( who, "Now choose a race.", FONT_NORMAL, 2600 );

EndCase

EndFunction

Posted: Sat Jul 29, 2006 12:41 pm
by Yukiko
I tried to compile this script and after removing the trailing commas from the gump array definitions that there is an undefined function.

Here's the ouitput from ecompile:

Code: Select all

Compiling: D:\POl95--96\scripts\textcmd\player\boost.src
Token '(' cannot follow token 'SetBaseSkillBaseValue'
Function SetBaseSkillBaseValue() is not defined.
Error compiling statement at D:\POl95--96\scripts\textcmd\player\boost.src, Line 117
Error in IF statement starting at File: D:\POl95--96\scripts\textcmd\player\boost.src, Line 115
Error compiling statement at D:\POl95--96\scripts\textcmd\player\boost.src, Line 115
Error in function 'ChangeFromSkillList', File: D:\POl95--96\scripts\textcmd\player\boost.src, Line 117

Error in function 'ChangeFromSkillList'.
File: D:\POl95--96\scripts\textcmd\player\boost.src, Line 117
Execution aborted due to: Error compiling file
What version of POL are you using?

Posted: Sat Jul 29, 2006 12:48 pm
by Yukiko
OK
Got it to compile

You need to add this line after the first "include":

include "include/attributes";

Now I'll take a look at how it works...

Posted: Sat Jul 29, 2006 12:51 pm
by Senkrad
Yea im not sure what pol it is, i believe its 95 with zh3 scripts.

The boosting stone is an item that we click on to get to the actions.
Item 0x9A87
{
Name BoostStone
Desc Boost Stone
weight 2000000
Graphic 0x0ED4
movable 0
Script :zuluitems:skillstone
DestroyScript ::maindestroy
decay 0
}

Posted: Sat Jul 29, 2006 12:55 pm
by Yukiko
Looks like it is as simple as changing one number.

Find this section of code:

Code: Select all

If( Boosted >= 2 ) 
SendSysmessage( who, "You've chosen 2 skills already.", FONT_NORMAL, 2595 ); 
Elseif( Boosted == 2 ) 
EraseObjProperty( who, "Detsoob" ); 
SetObjProperty( who, "Detsoob", 3 ); 
Elseif( Boosted == 1 ) 
SendSysMessage( who, "Second Skill Set to 130", FONT_NORMAL, 2600 ); 
SetBaseSkillBaseValue( who, res[0]-1, 1300 ); 
EraseObjProperty( who, "Detsoob" ); 
SetObjProperty( who, "Detsoob", 2 ); 
BoostStat( Who ); 
Endif 

In this line "If( Boosted >= 2 ) " change the '2' to a '3' and I think that will do what you want it to do.

You will also have to remove the trailing commas from all the array definitions. Also I had trouble with the skills list gump coming up with <uninitialized object> for the names of the skills. So I am not sure what is happening there but if the script is working for you then just change the 2 to a 3 and compile it.

Posted: Sat Jul 29, 2006 1:04 pm
by Senkrad
Well, let me describe what it does initially, u click on the rock, and it lets you boost one skill to 1 (with the gump to choose the skill) then lets you do the secound, then goes to stat boosting.

What I want is to do a third boost before the stat boosting. I messed with it before and i got to the point it did this but i had to click on the rock again. (as in: boosted 2 skills then it closed. Then I clicked again, boosted the 3rd then the stat)

Posted: Sat Jul 29, 2006 2:10 pm
by Yukiko
Obviously that fix didn't work.

I'm still working omn it but have to go to work right now.

Sorry I couldn't help you today.

Posted: Sat Jul 29, 2006 2:11 pm
by Yukiko
Yes. I am having that same problem. You use the script the second time to get the third skill and stat boost gump.
Have to look at it tomorrow though.

Posted: Sat Jul 29, 2006 4:42 pm
by Senkrad
Hey I figured it out, homie, thanks for tryin. :P

Posted: Sun Jul 30, 2006 11:35 am
by Yukiko
No worries but now you've got to post the script because if you don't the curiosity will kill me.