Skip to content

Commit e5fbe40

Browse files
committed
Added bowcrafting back into the Classic Distro. I don't know why/how it got removed or maybe
never added.
1 parent b53e6ca commit e5fbe40

2 files changed

Lines changed: 117 additions & 6 deletions

File tree

pkg/systems/combat/config/itemdesc.cfg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ Armor 0x1419
795795
}
796796

797797
Armor 0x2407
798-
{
798+
{
799799
Name hornedhelm
800800
Desc Horned Helm
801801
AR 25
@@ -2082,6 +2082,7 @@ Weapon 0x15004
20822082
Name fletchersknife
20832083
desc fletcher's knife
20842084
Graphic 0xEC5
2085+
Script ::bladed
20852086
Speed 55
20862087
Damage 2d4
20872088
Attribute Fencing
@@ -3150,7 +3151,7 @@ Weapon 0x1CAB5
31503151
{
31513152
Name Bow5
31523153
Script selectammo
3153-
Graphic 0x26CC
3154+
Graphic 0x26CC
31543155
Speed 60
31553156
Damage 8d6
31563157
Attribute Archery
@@ -3344,7 +3345,7 @@ Item 0x1999B
33443345
desc poisoned bolt%s
33453346
graphic 0x1bfb
33463347
ProjectileAnim 0x1bfe
3347-
color 0x8042
3348+
color 0x8042
33483349
CProp OnHit a1:S17::combat:poisonHit
33493350
VendorSellsFor 50
33503351
VendorBuysFor 10

scripts/items/bladed.src

Lines changed: 113 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use cfgfile;
22
use uo;
33
use os;
44
use util;
5+
56
include "include/client";
67
include ":attributes:attributes";
78
include "include/string";
@@ -13,10 +14,11 @@ include "include/noto";
1314
include "include/crafting";
1415
include ":gumps:requestGump";
1516

17+
var bowcraftconfigfile := ReadConfigFile("bowcraft");
1618

1719
program use_blade(who, blade)
1820
var craftingbag := FindCraftingbag (who);
19-
21+
2022
EraseObjProperty(who, "IsMeditating");
2123
EraseObjProperty(who, "HealTimer");
2224
if(!can_access(who, blade))
@@ -36,7 +38,9 @@ program use_blade(who, blade)
3638
endif
3739
endif
3840
var checkme := use_on.item.objtype;
39-
if (use_on.mobile.graphic == CID_SHEERED_SHEEP)
41+
if((checkme == 0x1BDD) || (checkme == 0x1bd7))
42+
CarveLogs( who, blade, use_on.item );
43+
elseif (use_on.mobile.graphic == CID_SHEERED_SHEEP)
4044
SendSysMessage(who, "You cannot get any more wool from that sheep", color := 33);
4145
return 0;
4246
elseif (use_on.mobile.graphic == CID_SHEEP)
@@ -277,4 +281,110 @@ function make_jack_o_latern(who, blade, pumpkin)
277281
SendSysMessage(who,"That ain't no pumpkin.");
278282
endif
279283
endfunction
280-
284+
285+
function CarveLogs(who, blade, logs)
286+
if(logs.movable == 0)
287+
SendSysMessage(who, "You cannot use those logs.");
288+
return;
289+
endif
290+
if((!Accessible(who, logs)) or (!CheckLineOfSight(who, logs)) or (dist(who, logs) > 2))
291+
SendSysMessage(who, "You cannot use that");
292+
return;
293+
endif
294+
if(!logs.container)
295+
if(Distance(who, logs) > 2)
296+
SendSysMessage(who, "That is too far away");
297+
return;
298+
endif
299+
endif
300+
var creatable := CreatableObjects(who, blade, logs);
301+
var selection := SelectMenuItem2(who, "BowcraftCarving");
302+
if(!selection)
303+
return;
304+
endif
305+
var what := selection.objtype;
306+
if(!Accessible(who, logs))
307+
SendSysMessage(who, "I can't access the logs to make that.");
308+
return;
309+
endif
310+
var objectconfig := FindConfigElem(bowcraftconfigfile, what);
311+
if(!objectconfig)
312+
return;
313+
endif
314+
var material := CInt(GetConfigString(objectconfig, "Material"));
315+
if(material > logs.amount)
316+
SendSysMessage(who, "You don't have enough logs to make that.");
317+
return;
318+
endif
319+
var difficulty := GetConfigInt(objectconfig, "Difficulty");
320+
var pointvalue := GetConfigInt(objectconfig, "PointValue");
321+
var bow := 0;
322+
Detach();
323+
PlaySoundEffect(who, 0x5a);
324+
PerformAction(who, 0x021);
325+
sleep(2);
326+
PlaySoundEffect(who, 0x5a);
327+
PerformAction(who, 0x021);
328+
sleep(2);
329+
PlaySoundEffect(who, 0x5a);
330+
PerformAction(who, 0x021);
331+
sleep(2);
332+
PlaySoundEffect(who, 0x5a);
333+
PerformAction(who, 0x021);
334+
sleep(2);
335+
if(SkillCheck(who, BOWCRAFT, difficulty, pointvalue))
336+
if(what == UOBJ_SHAFTS)
337+
var amt := logs.amount;
338+
if(DestroyItem(logs))
339+
CreateItemInBackpack(who, what, amt);
340+
CheckToolWear (who, blade, BOWCRAFT);
341+
SendSysMessage(who, "You create some shafts and place them in your pack." );
342+
endif
343+
elseif (what == UOBJ_BOW)
344+
if(SubtractAmount(logs, material))
345+
bow := CreateItemInBackpack(who, what);
346+
CheckToolWear (who, blade, BOWCRAFT);
347+
SendSysMessage(who, "You create a bow and place it in your pack.");
348+
SetName(bow, "a bow");
349+
endif
350+
elseif (what == UOBJ_XBOW)
351+
if(SubtractAmount(logs, material))
352+
bow := CreateItemInBackpack(who, what);
353+
CheckToolWear (who, blade, BOWCRAFT);
354+
SendSysMessage(who, "You create a crossbow and place it in your pack.");
355+
SetName(bow, "a crossbow");
356+
endif
357+
elseif (what == UOBJ_HEAVY_XBOW)
358+
if(SubtractAmount(logs, material))
359+
bow := CreateItemInBackpack(who, what);
360+
CheckToolWear (who, blade, BOWCRAFT);
361+
SendSysMessage(who, "You create a heavy crossbow and place it in your pack.");
362+
SetName(bow, "a heavy crossbow");
363+
endif
364+
else
365+
SendSysMessage(who, "I don't know how to make that.");
366+
return;
367+
endif
368+
if((RandomInt(CInt(GetEffectiveSkill(who,SKILLID_BOWCRAFT)) + 1) > (difficulty + 20)) && (bow != 0))
369+
setquality(who, bow);
370+
// var skill := GetEffectiveSkill(who, SKILLID_BOWCRAFT);
371+
// ExceptionalFameMod(who, skill, difficulty, pointvalue);
372+
endif
373+
else
374+
SubtractAmount(logs, (RandomInt(5) + 1));
375+
SendSysMessage(who, "You destroy some logs.");
376+
endif
377+
endfunction
378+
379+
function setquality(who, bow)
380+
var tname := TruncateArticle(bow.name);
381+
if(CInt(AP_GetSkill(who, BOWCRAFT)) >= 99)
382+
bow.name := "an exceptional " + tname + " [crafted by " + who.name + "]";
383+
else
384+
bow.name := "an exceptional " + tname;
385+
endif
386+
bow.quality := bow.quality + 0.2;
387+
bow.hp := bow.maxhp;
388+
SendSysMessage(who, "You created an exceptional item.");
389+
endfunction
390+

0 commit comments

Comments
 (0)