Index: items/instruments/pkg.cfg =================================================================== --- items/instruments/pkg.cfg (revisión: 0) +++ items/instruments/pkg.cfg (revisión: 0) @@ -0,0 +1,8 @@ + +Enabled 1 +Name instruments + +Version 1.0 + +CoreRequired 98 + Cambios de propiedades en items/instruments/pkg.cfg ___________________________________________________________________ Añadido: svn:executable + * Index: items/instruments/include/musicinstruments.inc =================================================================== --- items/instruments/include/musicinstruments.inc (revisión: 0) +++ items/instruments/include/musicinstruments.inc (revisión: 0) @@ -0,0 +1,75 @@ + +use uo; + +CONST SUCCESS_SOUND := 0X1; +CONST FAIL_SOUND := 0X2; + + +/* + * MIP_FindInBackPack(mobile) + * + * Purpose + * Find an instrument inside the mobile. + * + * Parameters + * mobile: a mobile reference + * + * Return value + * Returns the reference of an instrument in the mobile + * Returns 0 if there is no intrument in the mobile + * + */ + +function MIP_FindInBackPack(mobile) + return Instruments_FindInContainer( mobile.backpack ); +endfunction + +/* + * MIP_FindInContainer(container) + * + * Purpose + * Find an instrument inside the container. + * + * Parameters + * container: a Container reference + * + * Return value + * Returns the reference of an instrument in the container + * Returns 0 if there is no intrument in the container + * + */ + +function MIP_FindInContainer(container) + foreach item in EnumerateItemsInContainer(container) + if( item.IsInstrument() ) + return item; + endif + endforeach + return 0; +endfunction + +/* + * MIP_FindAllInContainer(container) + * + * Purpose + * Find all the instruments inside a container. + * + * Parameters + * container: a Container reference + * + * Return value + * Returns the reference of an array of all the instruments in the container + * + */ + +function MIP_FindAllInContainer(container) + var instruments := array; + foreach item in EnumerateItemsInContainer(container) + if( item.IsInstrument() ) + instruments.append(item); + endif + endforeach + return instruments; +endfunction + + Cambios de propiedades en items/instruments/include/musicinstruments.inc ___________________________________________________________________ Añadido: svn:executable + * Index: items/instruments/config/icp.cfg =================================================================== --- items/instruments/config/icp.cfg (revisión: 0) +++ items/instruments/config/icp.cfg (revisión: 0) @@ -0,0 +1,9 @@ + +ICP Register +{ + Name Instruments + Version 1.0 + Description Use scripts for instruments stuff. + + // Script cmdlevel path +} Cambios de propiedades en items/instruments/config/icp.cfg ___________________________________________________________________ Añadido: svn:executable + * Index: items/instruments/config/itemdesc.cfg =================================================================== --- items/instruments/config/itemdesc.cfg (revisión: 0) +++ items/instruments/config/itemdesc.cfg (revisión: 0) @@ -0,0 +1,119 @@ + +Item 0x0EB1 +{ + //Main Stuff + Name standingharp + VendorSellsFor 90 + VendorBuysFor 30 + Weight 5 + + //Scripts + Script :musicianship:instrument/use + MethodScript instrument/methods + + //Custom Values + CProp SuccessSound i68 + CProp FailSound i69 +} + +Item 0x0EB2 +{ + //Main Stuff + Name harp + VendorSellsFor 30 + VendorBuysFor 10 + Weight 2 + + //Scripts + Script :musicianship:instrument/use + MethodScript instrument/methods + + //Custom Values + CProp SuccessSound i70 + CProp FailSound i71 +} + +Item 0x0EB3 +{ + //Main Stuff + Name lute + VendorSellsFor 40 + VendorBuysFor 15 + Weight 2 + + //Scripts + Script :musicianship:instrument/use + MethodScript instrument/methods + + //Custom Values + CProp SuccessSound i77 + CProp FailSound i78 +} + +Item 0x0EB4 +{ + //Main Stuff + Name lute2 + VendorSellsFor 40 + VendorBuysFor 15 + Weight 2 + + //Scripts + Script :musicianship:instrument/use + MethodScript instrument/methods + + //Custom Values + CProp SuccessSound i77 + CProp FailSound i78 +} + +Item 0x0E9C +{ + //Main Stuff + Name drum + VendorSellsFor 50 + VendorBuysFor 20 + Weight 3 + + //Scripts + Script :musicianship:instrument/use + MethodScript instrument/methods + + //Custom Values + CProp SuccessSound i57 + CProp FailSound i58 +} + +Item 0x0E9D +{ + //Main Stuff + Name tambourine + VendorSellsFor 60 + VendorBuysFor 25 + Weight 1 + + //Scripts + Script :musicianship:instrument/use + MethodScript instrument/methods + + //Custom Values + CProp SuccessSound i83 + CProp FailSound i84 +} + +Item 0x0E9E +{ + //Main Stuff + Name tambourine2 + VendorSellsFor 80 + VendorBuysFor 40 + Weight 1 + + //Scripts + Script :musicianship:instrument/use + MethodScript instrument/methods + + //Custom Values + CProp SuccessSound i83 + CProp FailSound i84 +} Cambios de propiedades en items/instruments/config/itemdesc.cfg ___________________________________________________________________ Añadido: svn:executable + * Index: items/instruments/instrument/methods.src =================================================================== --- items/instruments/instrument/methods.src (revisión: 0) +++ items/instruments/instrument/methods.src (revisión: 0) @@ -0,0 +1,25 @@ + +use uo; + +include ":instruments:musicinstruments"; + +program Install() + return 1; +endprogram + +exported function IsInstrument(instrument) + instrument := instrument; // Avoid compiler warning + return 1; +endfunction + +exported function Play(instrument, who, type) + if( type == SUCCESS_SOUND ) + PlaySoundEffect(who, GetObjProperty(instrument,"SuccessSound") ); + elseif( type == FAIL_SOUND ) + PlaySoundEffect(who, GetObjProperty(instrument,"FailSound") ); + else + return error{"errortext":="Invalid type of play for the instrument."}; + endif + return 1; +endfunction + Cambios de propiedades en items/instruments/instrument/methods.src ___________________________________________________________________ Añadido: svn:executable + * Index: skills/musicianship/pkg.cfg =================================================================== --- skills/musicianship/pkg.cfg (revisión: 1652) +++ skills/musicianship/pkg.cfg (copia de trabajo) @@ -1,5 +1,6 @@ Enabled 1 -Name musicanship +Name musicianship Version 1.0 -CoreRequired 97 +CoreRequired 98 + Index: skills/musicianship/musicianship.src =================================================================== --- skills/musicianship/musicianship.src (revisión: 1652) +++ skills/musicianship/musicianship.src (copia de trabajo) @@ -1,39 +0,0 @@ -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 Index: skills/musicianship/config/icp.cfg =================================================================== --- skills/musicianship/config/icp.cfg (revisión: 1652) +++ skills/musicianship/config/icp.cfg (copia de trabajo) @@ -1,6 +0,0 @@ -ICP Register -{ - Name Musicanship - Version 1.0 - Description Musicanship Skill -} Index: skills/musicianship/config/musicianship.cfg =================================================================== --- skills/musicianship/config/musicianship.cfg (revisión: 1652) +++ skills/musicianship/config/musicianship.cfg (copia de trabajo) @@ -1,61 +0,0 @@ -########################################################################## -# 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 -} - Index: skills/musicianship/config/itemdesc.cfg =================================================================== --- skills/musicianship/config/itemdesc.cfg (revisión: 1652) +++ skills/musicianship/config/itemdesc.cfg (copia de trabajo) @@ -1,84 +0,0 @@ - -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 -} Index: skills/musicianship/instrument/use.src =================================================================== --- skills/musicianship/instrument/use.src (revisión: 0) +++ skills/musicianship/instrument/use.src (revisión: 0) @@ -0,0 +1,36 @@ +use basic; +use uo; +use os; + +include ":attributes:attributes"; +include ":instruments:musicinstruments"; + +program use_Instrument(who, item) + + if( !Accessible(who, 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) > 0 ) + item.Play(who, SUCCESS_SOUND); + else + item.Play(who, FAIL_SOUND); + endif + +endprogram Cambios de propiedades en skills/musicianship/instrument/use.src ___________________________________________________________________ Añadido: svn:executable + *