Musicanship Skill

Made a small change or new addition to the Distro that makes a difference? You can post the changes here in .patch or .diff file format, for others to use or even added to the official Distro SVN!
Locked
User avatar
ELSoft
Journeyman Poster
Posts: 61
Joined: Sun Jun 18, 2006 7:45 pm

Musicanship Skill

Post by ELSoft »

Hi,

itemdesc.cfg

Code: Select all


Item 0x0EB1

{
	//Main Stuff
	Name            standingharp

	VendorSellsFor  90

	VendorBuysFor   30

	Weight          5


	//Scripts
	Script          :musicianship:musicianship

}


Item 0x0EB2

{
	//Main Stuff

	Name            harp

	VendorSellsFor  30

	VendorBuysFor   10

	Weight          2

	//Scripts
	Script          :musicianship:musicianship

}


Item 0x0EB3

{
	//Main Stuff

	Name            lute

	VendorSellsFor  40

	VendorBuysFor   15

	Weight          2


	//Scripts
	Script          :musicianship:musicianship

}


Item 0x0EB4

{
	//Main Stuff

	Name            lute2

	VendorSellsFor  40

	VendorBuysFor   15

	Weight          2


	//Scripts
	Script          :musicianship:musicianship

}


Item 0x0E9C

{
	//Main Stuff

    	Name            drum

	VendorSellsFor  50

	VendorBuysFor   20

	Weight          3


	//Scripts
	Script          :musicianship:musicianship
}


Item 0x0E9D

{
	//Main Stuff

	Name            tambourine

	VendorSellsFor  60

	VendorBuysFor   25

	Weight          1


	//Scripts
	Script          :musicianship:musicianship

}


Item 0x0E9E

{
	//Main Stuff

	Name            tambourine2

	VendorSellsFor  80

	VendorBuysFor   40

	Weight          1


	//Scripts	
	Script          :musicianship:musicianship

}

musicanship.src

Code: Select all

use basic;
use uo;

use os;


include ":attributes:attributeConstants";

include ":attributes:skillCheck";
include ":attributes:skills";

var music_config     := ReadConfigFile(":musicianship:musicianship");


program use_Musicianship(who, item)

	if ( !Accessible(item) )

		SendSysMessage(who, "You cannot access that.");

		return 0;
	elseif (CInt(GetObjProperty(who, "#LastMusic")) > ReadGameClock())

    		SendSysMessage(who, "You must wait a moment before playing again.");

    		return 0;

	elseif( !ReserveItem(item) )

		SendSysMessage(who, "You cannot use that");

		return 0;

	endif

	EraseObjProperty(who, "#IsMeditating");

	EraseObjProperty(who, "#HealTimer");

	SetObjProperty(who, "#LastMusic", CInt(ReadGameClock() + 2));


	var pts := AP_GetSkill(who, MUSICIANSHIP) + 10;

	if(pts < 10)

		pts := 10;

	endif

	if( SkillCheck(who, MUSICIANSHIP,-1, pts) )
		PlaySoundEffect(who, music_config[item.graphic].success);
	else	
		PlaySoundEffect(who, music_config[item.graphic].fail);
	endif


endprogram
musicanship.cfg

Code: Select all

##########################################################################

# Format for musicianship.cfg:

#

#     Intrument 0xf49   <- Objtype of the item

#     {

#      name	  harp      <- Name of the instrument

#      success    0x046     <- Success sound

#      fail       0x047     <- Fail sound

#     }

#

##########################################################################



Intrument 0x0EB1

{	

	Name	standingharp

	Success	0x044
	Fail	0x045

}


Intrument 0x0EB2

{	

	Name	harp

	Success	0x046
	Fail	0x047

}

Intrument 0x0EB3

{	

	Name	lute

	Success	0x04D
	Fail	0x04E

}

Intrument 0x0EB4

{	

	Name	lute2

	Success	0x04D
	Fail	0x04E

}

Intrument 0x0E9C

{	

	Name	drum

	Success	0x039
	Fail	0x03A

}

Intrument 0x0E9D

{	

	Name	tambourine

	Success	0x053
	Fail	0x054

}

Intrument 0x0E9E

{	

	Name	tambourine2

	Success	0x053
	Fail	0x054

}
Attachments
elsoft_musicanship_23082009.diff
(5.17 KiB) Downloaded 421 times
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: Musicanship Skill

Post by Tomi »

Added to 098 Distro
Locked