I need some support for a booster script!

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
UO_maniac

I need some support for a booster script!

Post by UO_maniac »

Here there ive just got a shard up and running and i am having some difficulty with the booster script. I have a booster script where when a client logs in they can select 1 skill up to 130% and 1 stat to 130, but i am having trouble compiling it, keeps coming up with errors. Can someone please give me some helpful instructions or can someone supply me with a valid working booster script either for a stone, gate or for when clients log in.

Thankyou guys.
UO_maniac

Post by UO_maniac »

the script i have is a working 093 script, can someone help me change it to a working 095, thanks..
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

it would help if you posted the compiler error. It could be one of a huge number of things.
UO_maniac

Post by UO_maniac »

/*
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";
Include "include/attributes";

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



If( Boosted >= 3 )
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
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

the last 12 lines

Code: Select all

If( Boosted >= 3 )
	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
are not within the program or a function...
User avatar
MontuZ
Forum Regular
Posts: 338
Joined: Fri Feb 10, 2006 8:08 am

Post by MontuZ »

MontuZ (MontuZ@aol.com) Feb 21, 2004.
LMFAO. That shit is old, that's like one of my first pieces of work. I'm sorry for such sad codemanship, lol.
UO_maniac

Post by UO_maniac »

Could someone please supply my shard with a working booster script, it would be greatly appreciated.
Dev Impy
Neophyte Poster
Posts: 30
Joined: Thu Aug 10, 2006 6:38 am

Post by Dev Impy »

Unreal wrote:
MontuZ (MontuZ@aol.com) Feb 21, 2004.
LMFAO. That shit is old, that's like one of my first pieces of work. I'm sorry for such sad codemanship, lol.
Yes i was using it on a 093 Pol server Called Sosarian Legends. Worked well.

Any Hints. Doc on how to convert it to a 095 base?

Needa get this baby running with 100 1 stat 100 1 skill.

all i can think of is using setskilbyattributes

but i suck at this,

Some one feel like chipping in?
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

Try this script.

I whipped it out today. Did a little testing. I think it will do what you need. Boosts one chosen skill and one chosen stat.

Code: Select all

/////////////////
// Boost skill
// Boosts chosen skill and stat
//
// Maintainer Yukiko
// Version 1.0
// date : 5-Sep-2006
/////////////////

use uo;
use cfgfile;
use os;
use util;
include "include/client";
include "include/objtype";
include "include/utility";
include "include/attributes";

const    SKILL_BOOST := 100;    // Skill boost amount
const    STAT_BOOST := 100;     // Stat Boost Amount

program boost ( who )

var input, skill, stat;

var choicelayout :=
    {
    "page 0",
    "resizepic 10 10 3600 525 575",
    "text 212 30 500 0",
    "button 30 70 2103 2104 1 0 1",
    "text 45 65 500 1",
    "button 30 95 2103 2104 1 0 2",
    "text 45 90 500 2",
    "button 30 120 2103 2104 1 0 3",
    "text 45 115 500 3",
    "button 30 145 2103 2104 1 0 4",
    "text 45 140 500 4",
    "button 30 170 2103 2104 1 0 5",
    "text 45 165 500 5",
    "button 30 195 2103 2104 1 0 6",
    "text 45 190 500 6",
    "button 30 220 2103 2104 1 0 7",
    "text 45 215 500 7",
    "button 30 245 2103 2104 1 0 8",
    "text 45 240 500 8",
    "button 30 270 2103 2104 1 0 9",
    "text 45 265 500 9",
    "button 30 295 2103 2104 1 0 10",
    "text 45 290 500 10",
    "button 30 320 2103 2104 1 0 11",
    "text 45 315 500 11",
    "button 30 345 2103 2104 1 0 12",
    "text 45 340 500 12",
    "button 30 370 2103 2104 1 0 13",
    "text 45 365 500 13",
    "button 30 395 2103 2104 1 0 14",
    "text 45 390 500 14",
    "button 30 420 2103 2104 1 0 15",
    "text 45 415 500 15",
    "button 30 445 2103 2104 1 0 16",
    "text 45 440 500 16",
    "button 30 470 2103 2104 1 0 17",
    "text 45 465 500 17",
    "button 30 495 2103 2104 1 0 18",
    "text 45 490 500 18",
    "button 30 520 2103 2104 1 0 19",
    "text 45 515 500 19",
    "button 30 545 2103 2104 1 0 20",
    "text 45 540 500 20",

    "button 210 70 2103 2104 1 0 21",
    "text 225 65 500 21",
    "button 210 95 2103 2104 1 0 22",
    "text 225 90 500 22",
    "button 210 120 2103 2104 1 0 23",
    "text 225 115 500 23",
    "button 210 145 2103 2104 1 0 24",
    "text 225 140 500 24",
    "button 210 170 2103 2104 1 0 25",
    "text 225 165 500 25",
    "button 210 195 2103 2104 1 0 26",
    "text 225 190 500 26",
    "button 210 220 2103 2104 1 0 27",
    "text 225 215 500 27",
    "button 210 245 2103 2104 1 0 28",
    "text 225 240 500 28",
    "button 210 270 2103 2104 1 0 29",
    "text 225 265 500 29",
    "button 210 295 2103 2104 1 0 30",
    "text 225 290 500 30",
    "button 210 320 2103 2104 1 0 31",
    "text 225 315 500 31",
    "button 210 345 2103 2104 1 0 32",
    "text 225 340 500 32",
    "button 210 370 2103 2104 1 0 33",
    "text 225 365 500 33",
    "button 210 395 2103 2104 1 0 34",
    "text 225 390 500 34",
    "button 210 420 2103 2104 1 0 35",
    "text 225 415 500 35",
    "button 210 445 2103 2104 1 0 36",
    "text 225 440 500 36",
    "button 210 470 2103 2104 1 0 37",
    "text 225 465 500 37",
    "button 210 495 2103 2104 1 0 38",
    "text 225 490 500 38",
    "button 210 520 2103 2104 1 0 39",
    "text 225 515 500 39",
    "button 210 545 2103 2104 1 0 40",
    "text 225 540 500 40",

    "button 390 70 2103 2104 1 0 41",
    "text 405 65 500 41",
    "button 390 95 2103 2104 1 0 42",
    "text 405 90 500 42",
    "button 390 120 2103 2104 1 0 43",
    "text 405 115 500 43",
    "button 390 145 2103 2104 1 0 44",
    "text 405 140 500 44",
    "button 390 170 2103 2104 1 0 45",
    "text 405 165 500 45",
    "button 390 195 2103 2104 1 0 46",
    "text 405 190 500 46",
    "button 390 220 2103 2104 1 0 47",
    "text 405 215 500 47",
    "button 390 245 2103 2104 1 0 48",
    "text 405 240 500 48",
    "button 390 270 2103 2104 1 0 49",
    "text 405 265 500 49",
    "button 390 295 2103 2104 1 0 50",
    "text 405 290 500 50"
    };


     var choicedata :=
    {
    "alchemy",
    "anatomy",
    "animallore",
    "archery",
    "armslore",
    "begging",
    "blacksmithy",
    "bowcraft",
    "camping",
    "carpentry",
    "cartography",
    "cooking",
    "detectinghidden",
    "enticement",
    "evaluatingintelligence",
    "evalint",
    "fencing",
    "fishing",
    "forensicevaluation",
    "healing",
    "herding",
    "hiding",
    "inscription",
    "itemid",
    "lockpicking",
    "lumberjacking",
    "macefighting",
    "magery",
    "magicresistance",
    "meditation",
    "mining",
    "musicianship",
    "parry",
    "peacemaking",
    "poisoning",
    "provocation",
    "removetrap",
    "snooping",
    "spiritspeak",
    "stealing",
    "stealth",
    "swordsmanship",
    "tactics",
    "tailoring",
    "animaltaming",
    "tasteidentification",
    "tinkering",
    "tracking",
    "veterinary",
    "wrestling"
    };
     var name :=
     {
     "Choose skill:",
    "alchemy",
    "anatomy",
    "animallore",
    "archery",
    "armslore",
    "begging",
    "blacksmithy",
    "bowcraft",
    "camping",
    "carpentry",
    "cartography",
    "cooking",
    "detectinghidden",
    "enticement",
    "evaluatingintelligence",
    "evalint",
    "fencing",
    "fishing",
    "forensicevaluation",
    "healing",
    "herding",
    "hiding",
    "inscription",
    "itemid",
    "lockpicking",
    "lumberjacking",
    "macefighting",
    "magery",
    "magicresistance",
    "meditation",
    "mining",
    "musicianship",
    "parry",
    "peacemaking",
    "poisoning",
    "provocation",
    "removetrap",
    "snooping",
    "spiritspeak",
    "stealing",
    "stealth",
    "swordsmanship",
    "tactics",
    "tailoring",
    "animaltaming",
    "tasteidentification",
    "tinkering",
    "tracking",
    "veterinary",
    "wrestling"
    };
    
   
    input := SendDialogGump( who, choicelayout, name);
    input := input[0];
    skill := choicedata[input];
    SetAttributeBaseValue(who, skill, Cint(SKILL_BOOST * 10));

    SendSysMessage (who, skill);

    choicedata :=
    {
        "dexterity",
        "intelligence",
        "strength"
    };
    
    name :=
    {
        "Choose Stat:",
        "dexterity",
        "intelligence",
        "strength"
    };
    
    choicelayout :=
    {
    "page 0",
    "resizepic 10 10 3600 200 150",
    "text 50 30 500 0",
    "button 30 70 2103 2104 1 0 1",
    "text 45 65 500 1",
    "button 30 95 2103 2104 1 0 2",
    "text 45 90 500 2",
    "button 30 120 2103 2104 1 0 3",
    "text 45 115 500 3"
    };
    
    input := SendDialogGump( who, choicelayout, name);
    input := input[0];
    stat := choicedata[input];
    SetAttributeBaseValue(who, stat, STAT_BOOST * 10);
    DoRecalcVitals(who);

endprogram
Dev Impy
Neophyte Poster
Posts: 30
Joined: Thu Aug 10, 2006 6:38 am

Post by Dev Impy »

Nice ill give it a go!

Fucken Champ!!! Again im Sitting here Thanking you.. lol

i need learn to script better eheh only basic atm.
Dev Impy
Neophyte Poster
Posts: 30
Joined: Thu Aug 10, 2006 6:38 am

Post by Dev Impy »

Bad news?

Code: Select all

Compiling: C:\Pol\pkg\opt\Booster\booster.src
Token '(' cannot follow token 'DoRecalcVitals'
Function DoRecalcVitals() is not defined.
Error compiling statement at C:\Pol\pkg\opt\Booster\booster.src, Line 284
Error detected in program body.
Error occurred at C:\Pol\pkg\opt\Booster\booster.src, Line 284
Execution aborted due to: Error compiling file
Compileing error....
can any1 help thats same sorta thing i got on my script
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

The script is written using POL 95 Distro attributes.inc file.

The function DoRecalcVitals I'll post below. Make sure it is in the attributes.inc file on your system.

Code: Select all

Function DoRecalcVitals( mob )
  set_critical(1);
  if(mob.acctname)
    if(mob.ip)
      RecalcVitals(mob);
    endif
  else
    RecalcVitals(mob);
  endif
  set_critical(0);
endfunction
Post Reply