Index: pkg/items/weapons/useScripts/bladed.src =================================================================== --- pkg/items/weapons/useScripts/bladed.src (revision 1665) +++ pkg/items/weapons/useScripts/bladed.src (working copy) @@ -10,7 +10,8 @@ include ":timeutils:time"; include ":lumberjacking:lumberJack"; include ":brainai:npcUtil"; - +include "include/objtype"; +include "include/sounds"; program use_Bladed(mobile, tool) SendSysMessage(mobile, "What would you like to use that on?"); var targ := TargetCoordinates(mobile); @@ -30,20 +31,36 @@ endprogram function CarveItems(mobile, tool, item) + SendSysMessage(mobile, "In Carve Items"); + + tool := tool; // These lines are to stop stupid "var not used" compiler warnings. if ( item.IsA(POLCLASS_CORPSE) ) CarveCorpse(mobile, item); item.SetSkinned(1); return 1; endif - //elseif ( fish ) - // Fish? - // return 1; - //endif + if(is_fish(item.objtype)) + var multiplier; + if((item.objtype >= UOBJ_FISH_START) && (item.objtype <= UOBJ_FISH_END) ) + multiplier := 4; + else + multiplier := 2; + endif + var num_steaks := (multiplier * item.amount); + PlaySoundEffect(mobile, SFX_SLICE); + if(DestroyItem(item)) + CreateItemInBackpack(mobile, UOBJ_FISHSTEAK, num_steaks); + SendSysMessage(mobile, "You carve the fish steaks and put them in your backpack"); + endif + return 1; + endif + return 1; endfunction function CarveMobiles(mobile, tool, targ) + tool := tool; if ( !CheckLineOfSight(mobile, targ) ) SendSysMessage(mobile, "You can not see that."); return 0; @@ -52,6 +69,8 @@ targ.graphic := 223; // Bald sheep CreateItemInContainer(mobile.backpack, "wool", 3); return 1; + else + SendSysMessage(mobile, "You can't get any more wool from that sheep."); endif endif @@ -59,6 +78,8 @@ endfunction function CarveObject(mobile, tool, objtype) + tool := tool; + mobile := mobile; if ( LJ_IsTree(objtype) ) // Give kindling; return 1; @@ -87,4 +108,18 @@ SendSysMessage(mobile, "You carve the corpse..."); return 1; -endfunction \ No newline at end of file +endfunction + +function is_fish(theobj) + // Check for large fish + if((theobj >= UOBJ_FISH_START) && (theobj <= UOBJ_FISH_END) ) + return 1; + // Check for small fish + elseif ((theobj >= UOBJ_SFISH_START) && (theobj <= UOBJ_SFISH_END)) + return 1; + else + return 0; + endif + +endfunction + Index: pkg/mobiles/brainAI/config/npcdesc.cfg =================================================================== --- pkg/mobiles/brainAI/config/npcdesc.cfg (revision 1665) +++ pkg/mobiles/brainAI/config/npcdesc.cfg (working copy) @@ -81,7 +81,7 @@ // Settings other scripts use... - // CProps (eww!) + } NPCTemplate IntrinsicArcher @@ -164,7 +164,7 @@ // Settings other scripts use... - // CProps (eww!) + } ########################################## @@ -231,7 +231,7 @@ // Settings other scripts use... - // CProps (eww!) + } NPCTemplate DarkBorer @@ -298,7 +298,7 @@ FoodType Meat PackType Arachnid - // CProps (eww!) + } NPCTemplate FireBeetle @@ -365,7 +365,7 @@ FoodType Meat TameSkill 93.9 - // CProps (eww!) + } NPCTemplate GayUnicorn @@ -427,7 +427,7 @@ // Animal Lore Info FoodType Veggie - // CProps (eww!) + } NPCTemplate PhaseSpider-U9 @@ -500,7 +500,7 @@ FoodType Meat PackType Arachnid - // CProps (eww!) + } NPCTemplate Rigger @@ -563,7 +563,7 @@ // Animal Lore Info FoodType Meat - // CProps (eww!) + } NPCTemplate Skeleton-U9 @@ -630,7 +630,7 @@ // Settings other scripts use... DeathScript :death:deathScripts/skeleton - // CProps (eww!) + } NPCTemplate Zombie-U9 @@ -697,7 +697,7 @@ // Settings other scripts use... DeathScript :death:deathScripts/zombie - // CProps (eww!) + } NPCTemplate Trogdor @@ -765,7 +765,7 @@ // Settings other scripts use... - // CProps (eww!) + } NPCTemplate Skunk @@ -830,7 +830,7 @@ FoodType Veggie TameSkill 34.5 - // CProps (eww!) + } NPCTemplate PopperFrog @@ -898,7 +898,7 @@ // Animal Lore Info FoodType Fish - // CProps (eww!) + } NPCTemplate BullFrog @@ -969,7 +969,7 @@ FoodType Fish TameSkill 23.1 - // CProps (eww!) + } NPCTemplate GiantToad @@ -1039,7 +1039,7 @@ FoodType Fish TameSkill 77.1 - // CProps (eww!) + } @@ -1104,7 +1104,7 @@ NameTemplate Human_Male EquipTemplate FullPlate - // CProps (eww!) + CProp GuardKill i1 } @@ -1158,7 +1158,7 @@ NameTemplate Human_Male EquipTemplate Villager_1 - // CProps (eww!) + CProp GuardKill i1 // Begging @@ -1215,7 +1215,7 @@ NameTemplate Human_Male EquipTemplate Villager_1 - // CProps (eww!) + CProp GuardKill i1 // Begging @@ -1292,7 +1292,7 @@ FoodType Fish TameSkill 47.1 - // CProps (eww!) + } NPCTemplate BrownBear @@ -1363,7 +1363,7 @@ PackType Bear TameSkill 41.1 - // CProps (eww!) + } NPCTemplate BlackBear @@ -1434,7 +1434,7 @@ PackType Bear TameSkill 35.1 - // CProps (eww!) + } NPCTemplate Bird @@ -1505,7 +1505,7 @@ FoodType Veggie TameSkill -1 - // CProps (eww!) + } NPCTemplate Bull @@ -1576,7 +1576,7 @@ PackType Bull TameSkill 71.1 - // CProps (eww!) + } NPCTemplate Cat @@ -1645,7 +1645,7 @@ PackType Feline TameSkill -1 - // CProps (eww!) + } NPCTemplate Chicken @@ -1714,7 +1714,7 @@ FoodType Grain TameSkill -1 - // CProps (eww!) + } NPCTemplate Cow @@ -1784,7 +1784,7 @@ FoodType Veggie TameSkill 11.1 - // CProps (eww!) + } NPCTemplate Deer @@ -1853,7 +1853,7 @@ FoodType Veggie TameSkill 23.1 - // CProps (eww!) + } NPCTemplate Eagle @@ -1922,7 +1922,7 @@ FoodType Fish TameSkill 17.1 - // CProps (eww!) + } NPCTemplate Goat @@ -1991,7 +1991,7 @@ FoodType Veggie TameSkill 11.1 - // CProps (eww!) + } NPCTemplate GreatHart @@ -2060,7 +2060,7 @@ FoodType Veggie TameSkill 59.1 - // CProps (eww!) + } NPCTemplate GrizzlyBear @@ -2131,7 +2131,7 @@ PackType Bear TameSkill 59.1 - // CProps (eww!) + } NPCTemplate LLama @@ -2199,7 +2199,7 @@ FoodType Grain TameSkill 35.1 - // CProps (eww!) + } NPCTemplate Panther @@ -2268,7 +2268,7 @@ PackType Feline TameSkill 53.1 - // CProps (eww!) + } NPCTemplate Pig @@ -2335,7 +2335,7 @@ FoodType Veggie TameSkill 11.1 - // CProps (eww!) + } NPCTemplate PolarBear @@ -2406,7 +2406,7 @@ PackType Bear TameSkill 35.1 - // CProps (eww!) + } NPCTemplate Rabbit @@ -2478,7 +2478,7 @@ FoodType Veggie TameSkill -1 - // CProps (eww!) + } NPCTemplate Rat @@ -2548,7 +2548,7 @@ FoodType Fish TameSkill -1 - // CProps (eww!) + } NPCTemplate Sheep @@ -2620,7 +2620,7 @@ FoodType Veggie TameSkill 11.1 - // CProps (eww!) + } NPCTemplate Snake @@ -2687,7 +2687,7 @@ FoodType Eggs TameSkill 59.1 - // CProps (eww!) + } @@ -2762,7 +2762,7 @@ FoodType Meat TameSkill 5.2 - // CProps (eww!) + } ########################################## @@ -2850,7 +2850,7 @@ Spell Explosion 5 Spell FlameStrike 5 - // CProps (eww!) + } NPCTemplate EarthElemental @@ -2917,7 +2917,7 @@ // Settings other scripts use... - // CProps (eww!) + } NPCTemplate FireElemental @@ -2997,7 +2997,7 @@ // Loot groups Loot ElementalFire - // CProps (eww!) + } NPCTemplate WaterElemental @@ -3077,7 +3077,7 @@ Spell Lightning 11 Spell EnergyBolt 5 - // CProps (eww!) + } ########################################## @@ -3147,7 +3147,7 @@ // Settings other scripts use... NameTemplate Ogre - // CProps (eww!) + } NPCTemplate Ettin2 @@ -3213,7 +3213,7 @@ // Settings other scripts use... NameTemplate Ogre - // CProps (eww!) + } ########################################## @@ -3289,7 +3289,7 @@ PackType Equine TameSkill 29.1 - // CProps (eww!) + } NPCTemplate Unicorn @@ -3354,7 +3354,7 @@ FoodType Veggie TameSkill 95.1 - // CProps (eww!) + } @@ -3428,7 +3428,7 @@ PackType Canine TameSkill -1 - // CProps (eww!) + } NPCTemplate DireWolf @@ -3496,7 +3496,7 @@ PackType Canine TameSkill 83.1 - // CProps (eww!) + } NPCTemplate GreyWolf @@ -3565,7 +3565,7 @@ PackType Canine TameSkill 53.1 - // CProps (eww!) + } NPCTemplate TimberWolf @@ -3634,7 +3634,7 @@ PackType Canine TameSkill 23.1 - // CProps (eww!) + } NPCTemplate WhiteWolf @@ -3703,7 +3703,7 @@ PackType Canine TameSkill 65.1 - // CProps (eww!) + } @@ -3780,7 +3780,7 @@ // Animal Lore Info FoodType Meat - // CProps (eww!) + } NPCTemplate LizardMan2 @@ -3852,7 +3852,7 @@ // Animal Lore Info FoodType Meat - // CProps (eww!) + } NPCTemplate LizardMan3 @@ -3924,7 +3924,7 @@ // Animal Lore Info FoodType Meat - // CProps (eww!) + } ########################################## @@ -3998,7 +3998,7 @@ // Animal Lore Info FoodType Meat - // CProps (eww!) + } NPCTemplate Ogre @@ -4068,7 +4068,7 @@ // Animal Lore Info FoodType Meat - // CProps (eww!) + } ########################################## @@ -4142,7 +4142,7 @@ // Animal Lore Info FoodType Meat - // CProps (eww!) + } NPCTemplate OrcMage @@ -4217,7 +4217,7 @@ // Animal Lore Info FoodType Meat - // CProps (eww!) + } NPCTemplate Orc1 @@ -4287,7 +4287,7 @@ // Animal Lore Info FoodType Meat - // CProps (eww!) + } NPCTemplate Orc2 @@ -4357,7 +4357,7 @@ // Animal Lore Info FoodType Meat - // CProps (eww!) + } ########################################## @@ -4432,7 +4432,7 @@ // Animal Lore Info FoodType Fish - // CProps (eww!) + } NPCTemplate RatMan2 @@ -4503,7 +4503,7 @@ // Animal Lore Info FoodType Fish - // CProps (eww!) + } NPCTemplate RatMan3 @@ -4574,7 +4574,7 @@ // Animal Lore Info FoodType Fish - // CProps (eww!) + } ########################################## @@ -4644,7 +4644,7 @@ FoodType Fish TameSkill 23.1 - // CProps (eww!) + } @@ -4717,7 +4717,7 @@ // Animal Lore Info FoodType Meat - // CProps (eww!) + } NPCTemplate Troll2 @@ -4785,7 +4785,7 @@ // Animal Lore Info FoodType Meat - // CProps (eww!) + } NPCTemplate Troll3 @@ -4853,7 +4853,7 @@ // Animal Lore Info FoodType Meat - // CProps (eww!) + } @@ -4992,7 +4992,7 @@ // Settings other scripts use... - // CProps (eww!) + } NPCTemplate Liche @@ -5079,7 +5079,7 @@ Spell FlameStrike 10 Spell ManaVampire 25 - // CProps (eww!) + } NPCTemplate Skeleton @@ -5146,7 +5146,7 @@ // Settings other scripts use... - // CProps (eww!) + } NPCTemplate SkeletalKnight @@ -5213,7 +5213,7 @@ // Settings other scripts use... - // CProps (eww!) + } NPCTemplate Zombie @@ -5280,7 +5280,7 @@ // Settings other scripts use... - // CProps (eww!) + } NPCTemplate Wraith @@ -5347,5 +5347,79 @@ // Settings other scripts use... - // CProps (eww!) -} \ No newline at end of file + +} + +// Aquatic Life + +NPCTemplate SeaSerpent +{ + // Primary NPC information + Name a sea serpent + Script :brainAI:brain + ObjType 0x96 + Color 0 + TrueColor 33784 + Gender 0 + AR 35 + RunSpeed 100 + Alignment evil + Category Aquatic + + // Attributes + Strength 225 + Intelligence 85 + Dexterity 85 + Magery 80 + Tactics 70 + Wrestling 75 + MagicResistance 75 + + // Vitals + HITS 225 + MANA 85 + STAM 85 + MoveMode S + + + // Intrinsic Weapon + AttackSpeed 30 + AttackDamage 2d10 + AttackAttribute Wrestling + AttackHitSound 0x1C1 + AttackMissSound 0x239 + AttackHitScript :combat:mainHitScript + + // Brain AI Settings + AISetting AreaSize i10 + AISetting CycleWait i10 + AISetting FleeLevel i10 // 10% + AISetting IdleTicks i10 + AISetting SleepWait i100 + AISetting SpellWords i0 + AISetting CastWait i6 + AISetting MinRange i1 + AISetting MaxRange i10 + + // Brain AI Nerves + AIScript Combat :brainAI:scripts/combat/spellCombat + AIScript EnterArea :brainAI:scripts/enterArea/generic + AIScript Init :brainAI:scripts/init/generic + AIScript LeftArea :brainAI:scripts/leftArea/generic + AIScript LookAround :brainAI:scripts/lookAround/findAttackables + AIScript Sleep :brainAI:scripts/sleep/generic + AIScript ShouldWatch :brainAI:scripts/shouldWatch/targetPlayers + + // Skinning Info + SkinningItem SerpentScale 2 + + // Settings other scripts use... + NameTemplate Orc + Spell FireBall 25 + + // Animal Lore Info + FoodType Meat + + +} + Index: pkg/skills/fishing/config/icp.cfg =================================================================== --- pkg/skills/fishing/config/icp.cfg (revision 0) +++ pkg/skills/fishing/config/icp.cfg (revision 0) @@ -0,0 +1,21 @@ +# $Id: icp.cfg 375 2006-06-17 19:26:32Z austinheilman $ +# +# +ICP Register +{ + Name Fishing + Version 2.0 + Description The POL 0.98 Distro Fishing skill. + Description Submitted by Yukiko - Hope Lives Shard Project. + + Creator POL Distro Team + C_Email distro@polserver.com + + Maintainer POL Distro Team + M_Email distro@polserver.com + + #Script cmdlevel path + + #TextCmd cmdlevel path + +} Index: pkg/skills/fishing/config/itemdesc.cfg =================================================================== --- pkg/skills/fishing/config/itemdesc.cfg (revision 0) +++ pkg/skills/fishing/config/itemdesc.cfg (revision 0) @@ -0,0 +1,233 @@ +Item 0x0dbf +{ + Name FishingPole + Script fishing + VendorSellsFor 15 + VendorBuysFor 7 + bowcraft 35 + bomat 3 + time 2 +} + +item 0xA360 +{ +Name sosbottle +Desc SOS Bottle +script SOSBottle +graphic 0x099F +} + + +item 0xA363 +{ +Name sosmessage +Desc SOS Message +script SOSMessage +graphic 0x14ED +} + +item 0xA365 +{ +Name sostile +Desc water +graphic 0x993 +decay 180 +} + +Container 0x9E40 +{ + Name soschest + desc metal chest + graphic 0xe40 + Gump 0x004A + MinX 44 + MaxX 143 + MinY 65 + MaxY 140 + RequiresAttention 0 + movable 1 + MaxItems 125 + MaxWeight 400 + weight 5 + CanInsertScript ::canInsert + OnInsertScript ::onInsert + CanRemoveScript ::canRemove + OnRemoveScript ::onRemove +} + +Item 0x0EA4 // painting +{ + Name paiting1 + desc painting + VendorSellsFor 600 + VendorBuysFor 225 +} + +Item 0x0EA8 // painting +{ + Name paiting2 + desc painting + VendorSellsFor 600 + VendorBuysFor 225 +} + +Item 0x0EA7 // painting +{ + Name painting3 + desc painting + VendorSellsFor 600 + VendorBuysFor 225 +} + +Item 0x0E9F // painting +{ + Name painting4 + desc painting + VendorSellsFor 300 + VendorBuysFor 75 +} + +Item 0x0EA0 // painting +{ + Name painting5 + desc painting + VendorSellsFor 300 + VendorBuysFor 75 +} + +Item 0x0EA3 // painting +{ + Name painting6 + desc painting + VendorSellsFor 600 + VendorBuysFor 225 +} + +Item 0x0EA6 // painting +{ + Name painting7 + desc painting + VendorSellsFor 600 + VendorBuysFor 225 +} + +Item 0x0EE7 // painting +{ + Name painting8 + desc painting + VendorSellsFor 300 + VendorBuysFor 75 +} + +Item 0x0EC9 // painting +{ + Name painting9 + desc painting + VendorSellsFor 300 + VendorBuysFor 75 +} + +Item 0x1397 +{ + Name pillow + desc pillow + dyeable 1 +} + +Item 0x13a4 +{ + Name pillow1 + desc pillow + dyeable 1 +} + +Item 0x13a5 +{ + Name pillow2 + desc pillow + dyeable 1 +} + +Item 0x13a6 +{ + Name pillow3 + desc pillow + dyeable 1 +} + +Item 0x13a7 +{ + Name pillow4 + desc pillow + dyeable 1 +} + +Item 0x13a8 +{ + Name pillow5 + desc pillow + dyeable 1 +} + +Item 0x13a9 +{ + Name pillow6 + desc pillow + dyeable 1 +} + +Item 0x139aa +{ + Name pillow7 + desc pillow + dyeable 1 +} + +Item 0x13ab +{ + Name pillow8 + desc pillow + dyeable 1 +} + +Item 0x13ac +{ + Name pillow9 + desc pillow + dyeable 1 +} + +Item 0x13ad +{ + Name pillow10 + desc pillow + dyeable 1 +} + +Item 0x13ae +{ + Name pillow11 + desc pillow + dyeable 1 +} + +Item 0x163a +{ + Name pillow12 + desc pillow + dyeable 1 +} + +Item 0x163b +{ + Name pillow13 + desc pillow + dyeable 1 +} + +Item 0x163c +{ + Name pillow14 + desc pillow + dyeable 1 +} Index: pkg/skills/fishing/config/sosarea.cfg =================================================================== --- pkg/skills/fishing/config/sosarea.cfg (revision 0) +++ pkg/skills/fishing/config/sosarea.cfg (revision 0) @@ -0,0 +1,60 @@ +sosarea 1 +{ +x 2634 +y 3201 +range 20 +} +sosarea 2 +{ +x 3894 +y 2322 +range 25 +} +sosarea 3 +{ +x 2972 +y 2360 +range 25 +} +sosarea 4 +{ +x 2507 +y 2460 +range 25 +} +sosarea 5 +{ +x 2311 +y 2065 +range 25 +} +sosarea 6 +{ +x 2521 +y 1834 +range 25 +} +sosarea 7 +{ +x 2521 +y 1411 +range 25 +} +sosarea 8 +{ +x 2979 +y 1277 +range 25 +} +sosarea 9 +{ +x 3839 +y 907 +range 25 +} +sosarea 10 +{ +x 3712 +y 339 +range 25 +} Index: pkg/skills/fishing/fishing.src =================================================================== --- pkg/skills/fishing/fishing.src (revision 0) +++ pkg/skills/fishing/fishing.src (revision 0) @@ -0,0 +1,290 @@ +use uo; +use cfgfile; +use os; +use util; +use math; + +include ":attributes:attributes"; +include "include/objtype"; +include ":loot:lootParser"; +include ":crafting:old/include/toolWear"; +include "include/sysEvent"; + +program use_fishpole(who, fishingpole) + if ( !ReserveItem(fishingpole) ) + SendSysMessage(who, "That is already in use."); + return 0; + elseif( (!fishingpole.movable) || !ReserveItem(fishingpole) ) + SendSysMessage(who, "You cannot use that"); + return 0; + endif + if(!IsFishingPoleEquipped(who, fishingpole)) + SendSysMessage(who, "You have to equip that to go fishing!"); + return 0; + endif + + EraseObjProperty(who, "#IsMeditating"); + EraseObjProperty(who, "#HealTimer"); + + var targetsquare := TargetCoordinates(who); + if(!targetsquare) + return; + endif + var locinfo:= GetMapInfo( targetsquare.x, targetsquare.y, who.realm ); + if(IsValidTarget(who, targetsquare, locinfo)) + PerformAction(who, 0x9); + var newsplash := CreateItemAtLocation(targetsquare.x, targetsquare.y, targetsquare.z, 0x352d, 1, who.realm); + newsplash.movable := 0; + PlaySoundEffect(who, 0x240); + sleepms(400); + set_critical(1); + DestroyItem(newsplash); + set_critical(0); + newsplash := CreateItemAtLocation(targetsquare.x, targetsquare.y, targetsquare.z, 0x352e, 1, who.realm); + newsplash.movable := 0; + sleepms(400); + set_critical(1); + DestroyItem(newsplash); + set_critical(0); + newsplash := CreateItemAtLocation(targetsquare.x, targetsquare.y, targetsquare.z, 0x352f, 1, who.realm); + newsplash.movable := 0; + sleepms(400); + set_critical(1); + DestroyItem(newsplash); + set_critical(0); + newsplash := CreateItemAtLocation(targetsquare.x, targetsquare.y, targetsquare.z, 0x3530, 1, who.realm); + newsplash.movable := 0; + sleepms(400); + set_critical(1); + DestroyItem(newsplash); + set_critical(0); + sleepms(1500); + if(!isSOS(who, targetsquare)) + var difficulty; + if(targetsquare.objtype) + difficulty := GetHarvestDifficulty("fish", targetsquare.x, targetsquare.y, targetsquare.objtype, who.realm); + else + difficulty := GetHarvestDifficulty("fish", targetsquare.x, targetsquare.y, locinfo.landtile, who.realm); + endif + if(difficulty == error) + SendSysMessage(who, "There doesn't seem to be any fish here"); + return 0; + endif + var successrate := SkillCheck(who, FISHING, difficulty,200); + if(successrate > 0) + var fishreturned := HarvestResource("fish", targetsquare.x, targetsquare.y, 1, 1, who.realm); + if(!fishreturned) + SendSysMessage(who, "Oops, you let that one get away!"); + return 0; + endif + var catchtype := GetTheCatch(who); + if(CreateItemInContainer(who.backpack, catchtype, 1)) + // For now we'll use the crafting tool wear function to determine if our pole breaks. + CheckToolWear (who, fishingpole, FISHING); + // This next call replaces the old "AwardPoints" function call. Hopefully it works right. + CheckSkillAdvance(who, FISHING, difficulty, 50); + endif + else + if(RandomInt(100)< 1) + // A saeserpent appears if crit fail occurs. + CriticalFailure(who, targetsquare); + else + SendSysMessage(who, "They don't seem to be biting today"); + endif + endif + endif + endif + return 1; +endprogram + +function IsInRange(who, x, y, z) + z := z; + var xd, yd; + var retval := 1; + xd := Abs(who.x - x); + yd := Abs(who.y - y); + + if((xd > 6)||(yd > 6)) + retval := 0; + endif + + return retval; +endfunction + +function IsWater(thistile, locinfo) + if(thistile.objtype) + if((thistile.objtype >= 0x1797)&&(thistile.objtype <= 0x179c)) + return 1; + elseif((thistile.objtype >= 0x346e)&&(thistile.objtype <= 0x3485)) + return 1; + elseif((thistile.objtype >= 0x3490)&&(thistile.objtype <= 0x34ab)) + return 1; + elseif((thistile.objtype >= 0x34b5)&&(thistile.objtype <= 0x34d5)) + return 1; + endif + + else + + if((locinfo.landtile >= 0x00a8)&&(locinfo.landtile <= 0x00ab)) + return 1; + elseif((locinfo.landtile >= 0x0136)&&(locinfo.landtile <= 0x0137)) + return 1; + elseif((locinfo.landtile >= 0x3ff0)&&(locinfo.landtile <= 0x3ff3)) + return 1; + endif + endif + return 0; +endfunction + +function IsValidTarget(who, targetsquare, locinfo) + var retval := 1; + + if(!IsWater(targetsquare, locinfo)) + SendSysMessage(who, "You can't fish there!"); + retval := 0; + elseif(!IsInRange(who, targetsquare.x, targetsquare.y, targetsquare.z)) + SendSysMessage(who, "That is too far away"); + retval := 0; + elseif(!CheckLosAt(who, targetsquare.x, targetsquare.y, targetsquare.z)) + SendSysMessage(who, "That location is not in your line of sight!"); + retval := 0; + endif + + return retval; +endfunction + +function GetTheCatch(who) + var fishtype; + var currentskill := GetAttribute(who, FISHING); + var thisone := RandomInt(100)+ 1; + var magicfish_array := {0xA368, 0xA369, 0xA36A, 0xA36B, 0xA36C, 0xA36D, 0xA36E, 0xA36F}; + + if(thisone <= 75) + fishtype := RandomInt(UOBJ_SFISH_END - UOBJ_SFISH_START)+ UOBJ_SFISH_START; + SendSysMessage(who, "You catch two small fish!"); + elseif(thisone <= 94) + fishtype := RandomInt(UOBJ_FISH_END - UOBJ_FISH_START)+ UOBJ_FISH_START; + SendSysMessage(who, "You catch a nice one!"); + elseif(thisone <= 96) + if(RandomInt(currentskill) >= 50) + // boots th-boot shoes sandals + var bootarray := array(0x170b, 0x1711, 0x170f, 0x170d); + fishtype := bootarray[RandomInt(4)+ 1]; + SendSysMessage(who, "You catch some soggy footwear!"); + else + fishtype := RandomInt(UOBJ_FISH_END - UOBJ_FISH_START)+ UOBJ_FISH_START; + SendSysMessage(who, "You catch a nice fish!"); + endif + elseif(thisone <= 98) + fishtype := magicfish_array[RandomDiceRoll(1d8)]; + SendSysMessage(who, "You caught aodd fish!"); + elseif(thisone <= 99) + if(RandomInt(currentskill) >= 50) + fishtype := "level" +(RandomInt(2)+ 1)+ "map"; + SendSysMessage(who, "You find an old tattered map!"); + else + fishtype := RandomInt(UOBJ_FISH_END - UOBJ_FISH_START)+ UOBJ_FISH_START; + SendSysMessage(who, "You catch a nice fish!"); + endif + else + if(GetAttribute(who, FISHING) >= 95) + fishtype := "sosbottle"; + SendSysMessage(who, "You find a message in a bottle!"); + else + fishtype := RandomInt(UOBJ_FISH_END - UOBJ_FISH_START)+ UOBJ_FISH_START; + SendSysMessage(who, "You catch a nice fish!"); + endif + endif + + return fishtype; +endfunction + +function CriticalFailure(who, targetsquare) + + var it := CreateNpcFromTemplate("seaserpent", targetsquare.x, targetsquare.y, targetsquare.z, 0, who.realm); + if(it) + SendSysMessage(who, "Oops, that's not a fish!"); + var event := struct{"type":=SYSEVENT_ENGAGED, "source":=who}; + SendEvent(it, event); + endif + +endfunction + +function IsFishingPoleEquipped(who, fishingpole) + if((!Accessible(who, fishingpole)) || (Distance(who, fishingpole)> 1)) + return 0; + endif + foreach item in ListEquippedItems(who) + if(fishingpole.serial == item.serial) + return 1; + endif + endforeach + return EquipItem(who, fishingpole); +endfunction + +function GetSOSTreasure(who, targetsquare, sosmsg) + targetsquare := targetsquare; + if(SkillCheck(who, FISHING, 80, 200) > 0) + var itemcfg := ReadConfigFile(":*:itemdesc"); + var it, oldname; + if(RandomInt(100)< 75) + var newitem; + var artarray; + case(RandomInt(3)) + // shells + 0: newitem := RandomInt(0x0fcc - 0x0fc4)+ 0x0fc4; + // paintings and portraits + 1: artarray := array(0xea4, 0xea8, 0xea7, 0xe9f, 0xea0, 0xea3, 0xea6); + newitem := artarray[RandomInt(7) + 1]; + // pillows + 2: artarray := array(0x1397, 0x13a4, 0x13a5, 0x13a6, 0x13a7, 0x13a8, 0x13a9, 0x13ab, 0x13ac, 0x13ad, 0x13ae, 0x163a, 0x163b, 0x163c); + newitem := artarray[RandomInt(14) + 1]; + endcase + it := CreateItemInBackpack(who, newitem, 1); + oldname := it.name; + if((!oldname) || (oldname == "")) + oldname := itemcfg[newitem].desc; + endif + it.name := oldname + " [Recovered from a shipwreck]"; + it.movable := 1; + SendSysMessage(who, "You caught something interesting!"); + else + SendSysMessage(who, "You catch a sunken treasure!"); + var chest := CreateItemInBackpack(who, 0x9e40, 1); + case(RandomInt(4) + 1) + 1: chest.graphic := 0xe40; + 2: chest.graphic := 0xe41; + 3: chest.graphic := 0xe7c; + 4: chest.graphic := 0x9ab; + endcase + chest.name := "metal chest [Recovered from a shipwreck]"; + chest.movable := 1; + // Set-up to create loot. + Loot_Generate(chest, "Chestspawn" + RandomDiceRoll(1d5)); + DestroyItem(sosmsg); + endif + else + SendSysMessage(who, "Something big just slipped off your hook!"); + endif + return 0; +endfunction + +function isSOS(who, targetsquare) + var packitems; + packitems := EnumerateItemsInContainer(who.backpack); + var i, sosx, sosy; + for(i := 1; i <= len(packitems); i := i + 1) + if((packitems[i].objtype == 0xa363)) + sosx := GetObjProperty(packitems[i], "tileX"); + sosy := GetObjProperty(packitems[i], "tileY"); + var xd, yd; + xd := Abs(targetsquare.x - sosx); + yd := Abs(targetsquare.y - sosy); + if((xd <= 6)&&(yd <= 6)) + GetSOSTreasure(who, targetsquare, packitems[i]); + return 1; + endif + endif + endfor + return 0; +endfunction Index: pkg/skills/fishing/pkg.cfg =================================================================== --- pkg/skills/fishing/pkg.cfg (revision 0) +++ pkg/skills/fishing/pkg.cfg (revision 0) @@ -0,0 +1,5 @@ +Enabled 1 +Name fishing +Maintainer Distro Team +Email pol-distro-support@sourceforge.net +Version 2.0 Index: pkg/skills/fishing/SOSBottle.src =================================================================== --- pkg/skills/fishing/SOSBottle.src (revision 0) +++ pkg/skills/fishing/SOSBottle.src (revision 0) @@ -0,0 +1,51 @@ +use uo; +use cfgfile; +use os; +use util; + +//include "include/client"; +//include "include/objtype"; +//include "include/startEqp"; +//include "include/dist"; +//include "include/canAccess"; + +program use_bottle( who, bottle ) + + EraseObjProperty(who, "#IsMeditating"); + EraseObjProperty(who, "#HealTimer"); + + if ( !ReserveItem(bottle) ) + SendSysMessage(who, "That is already in use."); + return 0; + elseif( (!bottle.movable) || !ReserveItem(bottle) ) + SendSysMessage(who, "You cannot use that"); + return 0; + endif + + var cfg := ReadConfigFile("sosarea"); + if (!cfg) + SendSysMessage(who, "Could not read sosarea.cfg"); + endif + + var maxi := GetConfigMaxIntKey(cfg); + var elem := cfg[RandomInt(maxi)+1]; + var X := CInt(elem.x)+RandomInt(CInt(elem.range)*2) - CInt(elem.range); + var Y := CInt(elem.y)+RandomInt(CInt(elem.range)*2) - CInt(elem.range); + UnloadConfigFile("sosarea"); + SetObjProperty(bottle, "tileX", X); + SetObjProperty(bottle, "tileY", Y); + var message := CreateItemInContainer(who.backpack, 0xa363); + + if(!message) + DestroyItem(bottle); + SendSysMessage(who, "You cannot make out the writing on the message!"); + return 0; + endif + + SetObjProperty(message, "tileX", X); + SetObjProperty(message, "tileY", Y); + SetObjProperty(message, "msgnum", RandomInt(4)); + SendSysMessage(who, "You have extracted a message from the bottle!"); + DestroyItem(bottle); + return 1; +endprogram Index: pkg/skills/fishing/SOSMessage.src =================================================================== --- pkg/skills/fishing/SOSMessage.src (revision 0) +++ pkg/skills/fishing/SOSMessage.src (revision 0) @@ -0,0 +1,80 @@ +use uo; +use cfgfile; +use os; +use util; +use math; + +program use_message( who, message ) + + EraseObjProperty(who, "#IsMeditating"); + EraseObjProperty(who, "#HealTimer"); + + if ( !ReserveItem(message) ) + SendSysMessage(who, "That is already in use."); + return 0; + elseif( (!message.movable) || !ReserveItem(message) ) + SendSysMessage(who, "You cannot use that"); + return 0; + endif + + + var tox := GetObjProperty(message, "tileX"); + var toy := GetObjProperty(message, "tileY"); + var msgindex := GetObjProperty(message, "msgnum"); + + if( tox.errortext || toy.errortext) + syslog("bad message "+tox+" "+toy); + DestroyItem(message); + SendSysMessage(who, "The message is garbled beyond your ability to read!"); + return 0; + endif + var layout := array( "page 0", + "resizepic 0 0 3500 300 200", + "button 110 140 1148 1149 1 0 1", + "text 20 30 0 0", + "text 20 50 0 1", + "text 20 70 0 2"); + var data := array(); + var coords := ToSextant(tox, toy); + case (msgindex) + 0: data[1] := "Help, our ship is sinking! We are"; + data[2] := "at coordinates " + coords + "! Please"; + data[3] := "hurry, we are slipping away fast!"; + 1: data[1] := "We are under attack by a gigantic"; + data[2] := "sea serpent! We are at coordinates"; + data[3] := + coords + "! Please help us!"; + 2: data[1] := "A savage beast has holed our ship."; + data[2] := "We are at location " + coords + "!"; + data[3] := "We will hang on as long as possible."; + 3: data[1] := "We have encountered a terrible storm"; + data[2] := "at coordinates " + coords + "!"; + data[3] := "The ship may capsize soon, hurry!"; + endcase + SendDialogGump( who, layout, data ); +endprogram + +function ToSextant(x, y) + var latitude_direction, longitude_direction; + var latitude_degrees, longitude_degrees; + var latitude_minutes, longitude_minutes; + latitude_degrees := (y-1624)*0.087890625; + longitude_degrees := (x-1323)*0.0703125; + + if(latitude_degrees < 0) + latitude_direction := "N"; + else + latitude_direction := "S"; + endif + + if(longitude_degrees < 0) + longitude_direction := "W"; + else + longitude_direction := "E"; + endif + + latitude_degrees := Abs(latitude_degrees); + longitude_degrees := Abs(longitude_degrees); + latitude_minutes := CInt((CInt((latitude_degrees-Floor(latitude_degrees))*100)*60)/100); + longitude_minutes := CInt((CInt((longitude_degrees-Floor(longitude_degrees))*100)*60)/100); + return(Floor(latitude_degrees) + "o " + latitude_minutes + "'" + latitude_direction + ", " + Floor(longitude_degrees) + "o " + longitude_minutes + "'" + longitude_direction); +endfunction Index: scripts/include/objtype.inc =================================================================== --- scripts/include/objtype.inc (revision 0) +++ scripts/include/objtype.inc (revision 0) @@ -0,0 +1,214 @@ +///////////////////////////////////////////////////////////////////////////// +// +// include/objtype.inc - Object Type definitions +// +// TODO: consider moving these into include/client.inc +// or, moving CID_XX constants in here +// +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// +// 0x0000 to 0x3FFF - "Standard" objects +// +///////////////////////////////////////////////////////////////////////////// + +const UOBJ_STONEWALL_NS := 0x005f; +const UOBJ_STONEWALL_EW := 0x0060; +const UOBJ_GUARDS := 0xa340; +const UOBJ_FISHSTEAK := 0x097a; + +const UOBJ_BOX := 0x09aa; + +const UOBJ_FISH_START := 0x09cc; +const UOBJ_FISH_END := 0x09cf; + +const UOBJ_SFISH_START := 0x0dd6; +const UOBJ_SFISH_END := 0x0dd9; + +const UOBJ_KINDLING := 0x0de1; +const UOBJ_CAMPFIRE := 0x0de3; +const UOBJ_EMBERS := 0x0de9; +const UOBJ_ASHES := 0x0dea; + +const UOBJ_BANDAGE := 0x0e21; +const UOBJ_BLANK_SCROLL := 0x0e34; + +const UOBJ_BANKBOX := 0x0e40; + +const UOBJ_DRUM := 0x0e9c; +const UOBJ_TAMB := 0x0e9d; +const UOBJ_HARP := 0x0eb2; +const UOBJ_LUTE := 0x0eb3; + +const UOBJ_SPELLBOOK := 0x0efa; + +const UOBJ_POISON_POTION := 0x0f0a; +const UOBJ_EMPTY_BOTTLE := 0x0f0e; + +const UOBJ_GEM_START := 0x0f0f; +const UOBJ_GEM_END := 0x0f30; + +const UOBJ_SHOVEL := 0x0f39; + +const UOBJ_XBOW := 0x0f4f; + +const UOBJ_BLUE_MOONGATE := 0x0f6c; + + + +const UOBJ_CLAY := 0xee19; +const UOBJ_SAND := 0xee18; + + + + +const UOBJ_BLACK_PEARL := 0x0f7a; +const UOBJ_BLOOD_MOSS := 0x0f7b; +const UOBJ_BRIMSTONE := 0x0f7f; +const UOBJ_FERTILE_DIRT := 0x0f81; +const UOBJ_EXECUTIONERS_CAP := 0x0f83; +const UOBJ_GARLIC := 0x0f84; +const UOBJ_GINSENG := 0x0f85; +const UOBJ_MANDRAKE_ROOT := 0x0f86; +const UOBJ_NIGHTSHADE := 0x0f88; +const UOBJ_OBSIDIAN := 0x0f89; +const UOBJ_PIG_IRON := 0x0f8a; +const UOBJ_SULFUROUS_ASH := 0x0f8c; // CHECKME spelling +const UOBJ_SPIDER_SILK := 0x0f8d; +const UOBJ_VOLCANIC_ASH := 0x0f8f; + + +const UOBJ_DEAD_WOOD := 0x0f90; + +const UOBJ_CLOTH := 0x0f95; + +const UOBJ_THREAD_START := 0x0fa0; +const UOBJ_THREAD_END := 0x0fa1; + +const UOBJ_ANVIL1 := 0x0faf; +const UOBJ_ANVIL2 := 0x0fb0; +const UOBJ_SMALL_FORGE := 0xfb1; // see also UOBJ_FORGE_START..UOBJ_FORGE_END +const UOBJ_FORGE1 := 0x19a2; +const UOBJ_FORGE2 := 0x19a6; +const UOBJ_FORGE3 := 0x1982; +const UOBJ_FORGE4 := 0x1996; +const UOBJ_FORGE5 := 0x199a; +const UOBJ_FORGE6 := 0x198e; +const UOBJ_FORGE7 := 0x1992; +const UOBJ_FORGE8 := 0x1986; +const UOBJ_FORGE9 := 0x198a; + +const UOBJ_COPPER_KEY := 0x100e; +const UOBJ_GOLD_KEY := 0x100f; +const UOBJ_IRON_KEY := 0x1010; +const UOBJ_KEY_RING := 0x1011; +const UOBJ_MAGIC_KEY := 0x1012; +const UOBJ_RUSTY_IRON_KEY := 0x1013; + +const UOBJ_CLOCK := 0x104c; +const UOBJ_CLOCK_FRAME := 0x104e; +const UOBJ_CLOCK_PARTS := 0x104f; +const UOBJ_AXLE_AND_GEARS := 0x1051; +const UOBJ_GEARS := 0x1053; +const UOBJ_HINGE := 0x1055; +const UOBJ_SEXTANT := 0x1057; +const UOBJ_SEXTANT_PARTS := 0x1059; +const UOBJ_AXLE := 0x105b; +const UOBJ_SPRINGS := 0x105d; + + + +const UOBJ_LOOM_START := 0x105f; +const UOBJ_LOOM_END := 0x1066; + +const UOBJ_DUMMYSWING_NS := 0x1071; +const UOBJ_DUMMYFREEZE_NS := 0x1070; +const UOBJ_DUMMYSWING_EW := 0x1075; +const UOBJ_DUMMYFREEZE_EW := 0x1074; + +const UOBJ_BLOOD := 0x122d; + +const UOBJ_BOW := 0x13b2; +const UOBJ_HEAVY_XBOW := 0x13fd; + +const UOBJ_MAP1 := 0x14eb; +const UOBJ_MAP2 := 0x14ec; +const UOBJ_ROLLED_MAP1 := 0x14ed; +const UOBJ_ROLLED_MAP2 := 0x14ee; + +const UOBJ_HOUSE_DEED1 := 0x14ef; +const UOBJ_SHIP_DEED1 := 0x14f1; +const UOBJ_SHIP_DEED2 := 0x14f2; + +const UOBJ_CHEST := 0x1940; + +const UOBJ_FORGE_START := 0x197a; // see also UOBJ_SMALL_FORGE +const UOBJ_FORGE_END := 0x19a9; + +const UOBJ_FEATHER := 0x1bd1; +const UOBJ_SHAFTS := 0x1bd4; +const UOBJ_LOGS := 0x1bdd; + +const UOBJ_GLASS := 0xee20; + +const UOBJ_ARM := 0x1cec; +const UOBJ_LEG := 0x1ce2; +const UOBJ_TRUNK := 0x1cee; +const UOBJ_HEART := 0x1cef; +const UOBJ_HEAD := 0x1dae; + +const UOBJ_TINKER_TOOLS := 0x1ebc; + + +const UOBJ_RUNE := 0x1f14; + +const UOBJ_CORPSE := 0x2006; + +const UOBJ_PARAFIELD_NS := 0x3967; +const UOBJ_PARAFIELD_EW := 0x3979; +const UOBJ_POISONFIELD_NS := 0x3914; +const UOBJ_POISONFIELD_EW := 0x3920; +const UOBJ_EFIELD_NS := 0x3947; +const UOBJ_EFIELD_EW := 0x3956; + +const GID_PLANK_EXTENDED_FACING_WEST := 0x3ed5; +const GID_PLANK_RETRACTED_FACING_WEST := 0x3eb1; +const GID_PLANK_EXTENDED_FACING_EAST := 0x3ed4; +const GID_PLANK_RETRACTED_FACING_EAST := 0x3eb2; +const GID_PLANK_EXTENDED_FACING_SOUTH := 0x3e84; +const GID_PLANK_RETRACTED_FACING_SOUTH := 0x3e85; +const GID_PLANK_EXTENDED_FACING_NORTH := 0x3e89; +const GID_PLANK_RETRACTED_FACING_NORTH := 0x3e8a; + +// ick! these are fine for humans, but not true for items.. +// these are more of a CID. +const UOBJ_HUMAN_MALE := 0x190; +const UOBJ_HUMAN_FEMALE := 0x191; + +///////////////////////////////////////////////////////////////////////////// +// +// 0x4000 to 0x4FFF - Multis +// +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// +// 0x5000 to 0xEFFF - To Be Determined +// +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// +// 0xF000 to 0xFFFF - Reserved by system +// +///////////////////////////////////////////////////////////////////////////// + + // + // Ship Components + // +const EXTOBJ_TILLERMAN := 0xf010; +const EXTOBJ_PORT_PLANK := 0xf011; +const EXTOBJ_STARBOARD_PLANK := 0xf012; +const EXTOBJ_HOLD := 0xf013; Index: scripts/include/sounds.inc =================================================================== --- scripts/include/sounds.inc (revision 1665) +++ scripts/include/sounds.inc (working copy) @@ -109,6 +109,7 @@ SFX_HIT_21 := 0x14A, SFX_HIT_22 := 0x14B, SFX_LIGHTNING := 0x2A, + SFX_LOCKPICK := 0x242, SFX_MAGIC_ARROW := 0x1E6, SFX_MYSTERY_3 := 0x246, SFX_PARALYZED := 0x20C, @@ -116,18 +117,18 @@ SFX_SPIRIT_SPEAK := 0x24B, SFX_STRENGTH := 0x1EF, SFX_TELEPORT := 0x1FF, + SFX_UNLOCK := 0x200, SFX_WAVE_1 := 0x13, SFX_WAVE_2 := 0x14, SFX_WEAKEN := 0x1E7 endenum enum CUSTOM_SOUNDS + SFX_SLICE := 0x57, SFX_SOUND_SCRUNCH := 0x58, SFX_USE_LEATHER := 0x5A, SFX_SPELL_FAIL := 0x5D, // Really SFX_ALIGATOR_1 - SFX_ITEM_SWARM := 0x91b, - SFX_LOCKPICK := 0x242, - SFX_UNLOCK := 0x200 + SFX_ITEM_SWARM := 0x91b endenum enum DOOR_SOUNDS