Getting my Items to work now..

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 095. Note: Core 095 is no longer officially supported.

Moderator: POL Developer

Post Reply
Breg
New User
Posts: 27
Joined: Sat Dec 09, 2006 11:58 am

Getting my Items to work now..

Post by Breg »

So I went through and added most of the graphics and obytypes for my items it would be one Phoenix Ore and one Phoenix Ingot for smithing purposes and the like. For some reason once I have them all in and try to use them near a forge to smelt or with a smith hammer they do not work whatsoever prompting "you cant smelt that" or "you and only use this one ingots". if someone could find a detailed solution with me this would be greatly appreciated.
User avatar
CWO
POL Expert
Posts: 1158
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: Getting my Items to work now..

Post by CWO »

You have to add these objtypes into your smelting and smith hammer scripts. If you're double clicking the ore while standing near a forge, check the use script for the ore, if you're using the forge and targeting the ore, check the use script for forges. The smith's hammer the same. Check its use script.
Breg
New User
Posts: 27
Joined: Sat Dec 09, 2006 11:58 am

Re: Getting my Items to work now..

Post by Breg »

Okay didnt think of that brilliance isnt an attribute of mine.... also I got another nasty confusing error while compiling Server/pkg/skills/harvesting/mining/smelting.src saying that the lablel
UOBJ_PHOENIX_ORE: SmeltOre( character, ore, UOBJ_PHOENIX_INGOT, 53, 108);
can only come after REPEAT, CASE, FOREACH and ect ect, at the least it wont allow me to compile, but I'll add it to my hammer and forge scripts pronto and see what I get its not imperitive that this ore is mineable in the first place since its pretty and shiny
Breg
New User
Posts: 27
Joined: Sat Dec 09, 2006 11:58 am

Re: Getting my Items to work now..

Post by Breg »

Okay to further make things worse.. heres the scripts..
This script calls for the smiths hammer aswell as for the forge im not so worried about but I have added to the 3 or for itemdesc files I have in my Blacksmithy skills folder and it still seems to be givin me the same dead end..

Code: Select all

/////////////////
// make_blacksmith_items.src
//
// Use a smithy hammer to either repair arms & armor or
// to work with metal to create new items. You need to be
// skillful to work with the rarer metals.
//
// TODO: remove hardcoding of skill pointvalue
//
// Author: DreamWeaver:
//              original
//         Racalac:
//              colored items
// Updates: Dream Weaver 6/3/99 handled item quality an HP to new specs
//          Ignatius     99/06/10 added name of maker to exceptional items.		
//	    S!tH	 9/05/2001 All coloured mods run through ingots.cfg.
//				   -4 qualities.
// Updates: Repsak completedly changed the way mining works, now GM have to
// place vains (.makevein) for players to be able to find special ore.
// crap ore, like dull copper/copper/bronze, and iron can be found anywhere on the map.
// the higher skill in mining the more ore per chop.
////////////////


use uo;
use cfgfile;
use os;
use util;
use basicio;

include "include/client";
include "include/attributes";
include "include/objtype";
include "include/yesno";
include "include/string";
include "include/magicitems";
include "include/makemenu";
include "blacksmithy";
include "include/class";
include "include/trainingskill";
include "include/crafting";
include "gump";


Var primaryskill:=SKILLID_BLACKSMITHY;
var secondaryskill:=SKILLID_ARMSLORE;
var skillname:="Blacksmithy";
var menu_cfg_file := ReadConfigFile(":blacksmithy:menu");
var cfg_file := ReadConfigFile( "items" );
var resources_file := ReadConfigFile( ":blacksmithy:ingots" );





var itemcfg   := ReadConfigFile(":combat:itemdesc");
var smith_cfg := ReadConfigFile( ":blacksmithy:items" );            //what can i make ?
var ingotscfg := ReadConfigFile( ":blacksmithy:ingots" );    //what ingots exists ?
var itemname,noncrafted;
var ingots;

// called when a player double-clicks a hammer or other blacksmith tool
program use_hammer( character, hammer )

    if (GetObjProperty (character, "NoHit") > readgameclock() )
        PrintTextAbovePrivate (character, "I feel disheartened and I am not in the mood to do so.", character);
        return;
    endif
        var data := {};
        data[1] := "blacksmithy";
        data[2] := ReadGameClock();
        data[3] := 7;
        SetObjProperty(character, "LastUsedSkill", data );
        TrainingSkill(character, data[3]);
        EraseObjProperty(character, "StopCrafting");
    var craftingbag := FindCraftingBag(character);
    var mount := GetEquipmentByLayer( character, 25 );
    if ( mount )
            PrintTextAbovePrivate( character, "You cannot smith while mounted.", character );
            return;
    endif


    if (! IsHammerEquipped(character, hammer) )
            SendSysMessage(character, "You have to equip that to craft!");
            return;
    endif

    SendSysMessage( character, "What would you like to use that on?" );
    var use_on := Target( character );
    if( !use_on )
        SendSysMessage( character, "Targetting cancelled" );
        return;
    endif

    
    if (!Accessible(character, use_on) )
 	SendSysMessage(character, "You can't reach that!");
	return;
    endif

    if (!ReserveItem(use_on) )
        SendSysMessage(character, "You can't use that right now.");
        return;
    endif

    if( is_weapon_armor(use_on) )
         var near_items := ListItemsNearLocation(character.x, character.y, character.z,2);
         foreach item in near_items
              if ((item.objtype == UOBJ_ANVIL1) || (item.objtype == UOBJ_ANVIL2))
                   RepairBlacksmithyItem( character, use_on, SKILLID_BLACKSMITHY );
                   return;
              endif
         endforeach
         SendSysMessage( character, "You must be near an anvil to repair items!" );
         return;
    endif


    if( !isIngot(use_on.objtype) )
        SendSysMessage( character, "You can only use that on ingots!" );      
        return;
    endif

    if( !CheckSkillForDifferentMetals( character, use_on, hammer ) )
        SendSysMessage( character, "You have no chance to successfully work with that metal." );
        return;
    endif
   
    if (use_on.movable == 0 )
        SendSysMessage(character, "Its locked down.");
        return;
    endif

    var near_items := ListItemsNearLocation(character.x, character.y, character.z,2);
    foreach item in near_items
         if ((item.objtype == UOBJ_ANVIL1) || (item.objtype == UOBJ_ANVIL2))
              MakeBlacksmithItems(character, use_on, craftingbag);
              return;
         endif
    endforeach
    SendSysMessage( character, "You must be near an anvil to smith items!" );

endprogram


function is_weapon_armor(what)
   
    if ( IsMetalWeapon(what) || IsMetalArmor(what) || IsMetalShield(what) )
        return 1;
    else
        return 0;
    endif
endfunction

function MakeBlacksmithItems( character, ingots, craftingbag )
    var skill, bonusskill;          //skill needed to create the item
    var element;        // entry in smith_config
    var material;       //amount of material needed to create the item
    var points, retval, maxhp, quality, itemname, time, hasquality;

   
    if ( !Accessible( character, ingots))
        SendSysMessage( character, "You don't have any ingots!" );
        return;
    endif
   
    if (!smith_cfg)
        SendSysMessage(character, "Could not open blacksmith.cfg");
        return;
    endif

    //calls the SelectWhatToMakeFromMenu function found in makemenu.inc, in /scripts/include
    var what := sendCraftGump(character, skillname, primaryskill, menu_cfg_file, "mainmenu", ingots.amount);
    if (!what || CINT(what)==CINT(1025))
	 SendSysMessage(character, "Canceled.");
	 return;
    endif
    maxhp := (itemcfg[what].maxhp);
    element := FindConfigElem( smith_cfg,what ); //need to make sure the key reflects the menu return value
   
    if (element)
        material := GetConfigInt( element, "material" );
        skill := GetConfigInt( element, "skill" );
        itemname := GetConfigString( element, "Name");
        points := GetConfigInt( element, "points" );
        time := GetConfigInt( element, "time" );
        hasquality := GetConfigInt( element, "hasquality" );
    else
        print("Bad stuff goin on!");
    endif

    var metalelem, newcolour, bonuspoints, bonushp, prefix, suffix, enchantments, dmgmod, armmod, cashmod, baseskill;
    metalelem := FindConfigElem( ingotscfg, ingots.objtype );

 if( metalelem)
		dmgmod := GetConfigInt( metalelem, "damageMod" );
		armmod := GetConfigInt( metalelem, "armourMod" );
		bonusskill := GetConfigInt( metalelem, "bonusSkill" );
		newcolour := GetConfigInt( metalelem, "newColour" );
		bonuspoints := GetConfigInt( metalelem, "bonusPoints" );
		bonushp := GetConfigInt( metalelem, "bonusHp" );
		prefix := GetConfigString( metalelem, "prefix" );
		suffix := GetConfigString( metalelem, "suffix" );
		enchantments := GetConfigString( metalelem, "enchantments" );
		enchantments := SplitWords( enchantments );
		points := CInt((points * bonuspoints) / 100);
                skill := CInt(skill);
		baseskill := CInt((skill * bonusskill) / 100);

		cashmod := GetConfigInt( metalelem, "minSkill" ) / 50;
		if( skill > 99.0 )
			skill := 99.0;
		endif
		itemname := prefix + " " + itemname + " " + suffix;
	endif

////////////////////////////////////////////////////////////////////////////////////////////
//This is something so that higher smiths find it easier to craft stuff.
//Uncomment & modify if you want.
////////////////////////////////////////////////////////////////////////////////////////////
//	local noSkillSub := GetConfigInt( metalElem, "noSkillSub" );
//	if( !noSkillSub )
//		if( skill > 86 )
//			local tSkill := GetSkill( character, SKILLID_BLACKSMITHY ) - 86;
//			if( tSkill > 0 )
//				skill := skill - tSkill;
//			endif
//		endif
//	endif
////////////////////////////////////////////////////////////////////////////////////////////

	if( !cashmod || cashmod < 1.0 )
		cashmod := 1.0;
	endif
////////////////////////////////////////////////////////////////////////////////////////////
//For AutoLoop: Uncomment this and the endwhile lower down.
////////////////////////////////////////////////////////////////////////////////////////////
    var mx := character.x;
    var my := character.y;
    var doLoop := 1;
    var calledLoopGump := 0;
 	noncrafted:= 0;
    while( GetAmount(ingots)+1 > material && mx == character.x && my == character.y && doLoop && noncrafted==0 && !GetObjProperty (character,"StopCrafting"))

    if( !calledLoopGump )
	doLoop := YesNo( character, "Autoloop?" );
	calledLoopGump := 1;
    endif
////////////////////////////////////////////////////////////////////////////////////////////
        if( GetAmount(ingots) < material )
           PerformAction(character, ANIM_ATTACK_1HAND_DOWN);
           retval := PlaySoundEffect(character, SFX_ANVIL);
           sleepms(2100);
           SendSysMessage( character, "You do not have enough ingots." );
           return;
        endif

        if(character.cmdlevel < 3)
            var i := 0;
            for(i; i < time; i := i +1)
                 PerformAction(character, ANIM_ATTACK_1HAND_DOWN);
                 retval := PlaySoundEffect(character, SFX_ANVIL);
                 sleepms(2100);
            endfor
        endif

	if( metalelem )

           if(CheckSkill( character, SKILLID_BLACKSMITHY, baseskill, modify_points(character, SKILLID_BLACKSMITHY, points) ))

              var theitem:= CreateItemInContainer(craftingbag, what, 1 ); 
               if (!theitem)
		theitem:=createitematlocation(character.x,character.y,character.z,what,1); 
		endif
              if (theitem) //they sucessfully create the item
                ReleaseItem( theitem );
		//SetObjProperty( theitem, "cashMod", cashMod );

		if( metalelem )
				theitem.color := ingots.color;
                        if(!hasquality)
                             return;
                        endif
			theitem.maxhp := theitem.maxhp + bonushp;
			SetObjProperty( theitem, "Enchantments", enchantments );
                        SetObjProperty( theitem, "IngotType", ingots.objtype );
                        SetObjProperty( theitem, "Material", prefix + " ingots" );
			if (character.cmdlevel>2)
                        SetObjProperty( theitem, "GMcrafted", character.acctname );
			endif

		endif

	        theitem.ar_mod := CInt(armmod);
	        theitem.dmg_mod := CInt(dmgmod);

		//Exceptional Quality Etc
		modifyQuality( character, points, quality, itemname, theitem, baseskill, ingots );
              SubtractAmount( ingots, material );
              else
			PrintTextAbovePrivate(character, "*Your backpack is full!*", character);
			noncrafted:=1;
			return;
      	      endif  //theitem

           else  //checkskill
            SubtractAmount( ingots, RandomInt(material) );
            SendSysMessage( character, "You destroy some ingots." );
           endif //checkskill
	endif //metalElem
////////////////////////////////////////////////////////////////////////////////////////////
    endwhile  //autoloop
////////////////////////////////////////////////////////////////////////////////////////////
EraseObjProperty (character,"StopCrafting");

endfunction

function oldmodifyQuality( who, points, quality, itemname, theitem, skill, ingots )

		var eskill := CInt( 100 - (((GetEffectiveSkill( who, SKILLID_BLACKSMITHY))+1 ) - skill));
                if(eskill <= 50)
                   eskill := 50;
                endif
		var askill := CInt( 100 - (((GetEffectiveSkill( who, SKILLID_BLACKSMITHY))+21) - skill));
                if(askill <= 30)
                   askill := 30;
                endif
                var nskill := CInt( 100 - (((GetEffectiveSkill( who, SKILLID_BLACKSMITHY))+56) - skill));
                if(nskill <= 5)
                   nskill := 5;
                endif
                var rint := RandomInt(100)+1;

                var armsskill := CInt(GetEffectiveSkill( who, SKILLID_ARMSLORE) / 3) - 15;
                if(armsskill <= -6)
                   armsskill := -6;
                endif
                eskill := CInt(eskill - armsskill);

		points := 0;

		if(rint > eskill)
                    var bskill := GetEffectiveSkill( who, SKILLID_BLACKSMITHY);
                    if(bskill > 95)
                         var elitechance := bskill - 99;
                         if(elitechance > 25)
                            elitechance := 25;
                         endif
                         var reint := RandomInt(100)+1;
                         if(reint < elitechance)
                            //Elite Quality 130%
                            theitem.quality := 1.3;
                            theitem.hp := theitem.maxhp;
                            theitem.hp := theitem.hp + 30;
                            add_special_ingot_bonus( who, theitem, ingots );
                           
                            var newname := SendTextEntryGump( who, "Choose name for the elite item", 50);
                            if(newname)
                               SetName(theitem, "-" + newname + "-" );
                            else
                               SetName(theitem, "an elite " + itemname);
                            endif
                            SendSysMessage( who, "You create an elite " + itemname + "and place it in your pack." );
                            SetObjProperty(theitem, "craftedby", "crafted by " + who.name);
                            SetObjProperty(theitem, "elite", 1);
                            SetObjProperty(theitem, "name", itemname);
                            return;
                         else
                         endif
                    else
                    endif
		    //Exceptional Quality 120%
                    theitem.quality := 1.2;
                    theitem.hp := theitem.maxhp;
                    theitem.hp := theitem.hp + 10;
                    add_special_ingot_bonus( who, theitem, ingots );
                    SetName(theitem, "an exceptional " + itemname);
                    SendSysMessage( who, "You create an exceptional " + itemname + "and place it in your pack." );
                    SetObjProperty(theitem, "craftedby", "crafted by " + who.name);
		elseif(rint > askill)
		    //Above Average Quality 100%
                    theitem.quality := 1;
                    theitem.hp := theitem.maxhp;
                    theitem.hp := theitem.hp + 7;
                    add_special_ingot_bonus( who, theitem, ingots );
                    SetName(theitem, "a quality " + itemname );
                    SendSysMessage( who, "You create a quality " + itemname + "and place it in your pack." );
		elseif(rint > nskill)
		    //Normal Quality 90%
                    theitem.quality := 0.9;
                    theitem.hp := theitem.maxhp;
                    theitem.hp := theitem.hp + 5;
                    add_special_ingot_bonus( who, theitem, ingots );
                    SetName(theitem, "a " + itemname );
                    SetName(theitem, itemname );
                    SendSysMessage( who, "You create " + AddArticle(itemname) +  "and place it in your pack." );
		else
		    //Below Quality 70%
                    theitem.quality := 0.7;
                    theitem.hp := theitem.maxhp;
                    theitem.hp := theitem.hp + 2;
                    add_special_ingot_bonus( who, theitem, ingots );
                    SetName(theitem,  "a below average quality " + itemname );
                    SendSysMessage( who, "You create a below average quality " + itemname + "and place it in your pack." );
		endif
endfunction

function modifyQuality( who, points, quality, itemname, theitem, skill, ingots )
		
var elite_chance, exceptional_chance, quality_chance, normal_chance;
var playersskill:=GetEffectiveSkill( who, SKILLID_ARMSLORE);
var qualitychances:=Randomint(100)+1;	
var players_blacksmithy:=GetEffectiveSkill( who, SKILLID_BLACKSMITHY);

		if (playersskill>skill+20)
			elite_chance:=10;
			exceptional_chance:=100;
		elseif (playersskill>skill+10)
			elite_chance:=5;
			exceptional_chance:=90;
			quality_chance:=100;
		elseif (playersskill>skill)
			elite_chance:=2;
			exceptional_chance:=30;
			quality_chance:=60;
			normal_chance:=100;
		elseif (playersskill+10>skill)
			elite_chance:=0;
			exceptional_chance:=10;
			quality_chance:=30;
			normal_chance:=80;
		elseif (playersskill+10<skill)
			elite_chance:=0;
			exceptional_chance:=1;
			quality_chance:=10;
			normal_chance:=30;
		elseif (playersskill+20<skill)
			elite_chance:=0;
			exceptional_chance:=0;
			quality_chance:=5;
			normal_chance:=15;
		endif

if (players_blacksmithy<90)
			elite_chance:=0;
endif


	if (who.cmdlevel>1)
		sendsysmessage(who, "Skill: "+skill);
		sendsysmessage(who, "Elite Chance: "+elite_chance);
		sendsysmessage(who, "Exceptional Chance: "+exceptional_chance);
		sendsysmessage(who, "Quality Chance: "+quality_chance);
		sendsysmessage(who, "Normal Chance: "+normal_chance);
		sendsysmessage(who, "Quality chance: "+qualitychances);
	endif

	if (qualitychances<elite_chance)
		theitem.quality := 1.3;
		theitem.hp := theitem.maxhp;
		theitem.hp := theitem.hp + 30;
		add_special_ingot_bonus( who, theitem, ingots );
		var newname := SendTextEntryGump( who, "Choose name for the elite item", 50);
			if(newname)
				SetName(theitem, "-" + newname + "-" );
			else
				SetName(theitem, "an elite " + itemname);
			endif
		SendSysMessage( who, "You create an elite " + itemname + "and place it in your pack." );
		SetObjProperty(theitem, "craftedby", "crafted by " + who.name);
		SetObjProperty(theitem, "elite", 1);
		SetObjProperty(theitem, "name", itemname);
	elseif (qualitychances<exceptional_chance)
		theitem.quality := 1.2;
		theitem.hp := theitem.maxhp;
		theitem.hp := theitem.hp + 10;
		add_special_ingot_bonus( who, theitem, ingots );
		SetName(theitem, "an exceptional " + itemname);
		SendSysMessage( who, "You create an exceptional " + itemname + "and place it in your pack." );
		SetObjProperty(theitem, "craftedby", "crafted by " + who.name);
	elseif (qualitychances<quality_chance)
		theitem.quality := 1;
		theitem.hp := theitem.maxhp;
		theitem.hp := theitem.hp + 7;
		add_special_ingot_bonus( who, theitem, ingots );
		SetName(theitem, "a quality " + itemname );
		SendSysMessage( who, "You create a quality " + itemname + "and place it in your pack." );
	elseif (qualitychances<normal_chance)
		theitem.quality := 0.9;
		theitem.hp := theitem.maxhp;
		theitem.hp := theitem.hp + 5;
		add_special_ingot_bonus( who, theitem, ingots );
		SetName(theitem, "a " + itemname );
		SetName(theitem, itemname );
		SendSysMessage( who, "You create " + AddArticle(itemname) +  "and place it in your pack." );
	else
		theitem.quality := 0.7;
		theitem.hp := theitem.maxhp;
		theitem.hp := theitem.hp + 2;
		add_special_ingot_bonus( who, theitem, ingots );
		SetName(theitem,  "a below average quality " + itemname );
		SendSysMessage( who, "You create a below average quality " + itemname + "and place it in your pack." );
	endif

endfunction
function CheckSkillForDifferentMetals( character, ingot, tool )

	var ingotelem := FindConfigElem( ingotscfg, ingot.objtype );
	var minskill := GetConfigInt( ingotelem, "minSkill" );

	//Special Smithy Tool Requirements
	var toolprop := GetConfigString( ingotelem, "reqProp" );
	if( toolprop && toolprop != "error" );
		if( !GetObjProperty( tool, toolprop ) )
			SendSysMessage( character, "You require a special tool to work with these ingots." );
			return 0;
		endif
	endif

	var toolench := GetConfigString( ingotelem, "reqEnch" );
	if( toolench && toolench != "error" )
		var tenchantments := GetObjProperty( tool, "Enchantments" );
		var hasench := 0;
		foreach ench in tenchantments
			if( ench == toolench )
				hasench := 1;
			endif
		endforeach
		if( !hasench )
			SendSysMessage( character, "You require a specially enchanted tool to work with these ingots." );
			return 0;
		endif
	endif

	if( CheckHisSkill( character, minskill ) )
		return 1;
	else
		return 0;
	endif

endfunction

function CheckHisSkill( character, skill )

    var his_skill := GetEffectiveSkill( character, SKILLID_BLACKSMITHY );

    if( his_skill >= skill )
        return 1;
    else
        return 0;
    endif

endfunction

function IsHammerEquipped(me,hammer)

	if ( (!Accessible(me, hammer)) || (Distance(me, hammer) > 1) )
        	return 0;
    	endif

	if ( hammer.movable == 0 )
        	return 0;
    	endif

    	foreach item in ListEquippedItems(me)
    		if (hammer.serial == item.serial )
			return 1;
		endif
	endforeach

	return EquipItem(me, hammer );

endfunction

function add_special_ingot_bonus(who, theitem, ingots )

	case( Hex(ingots.objtype))
             "0x6550": b_DullCopper( theitem );
             "0x6551": b_Copper( theitem );
             "0x6552": b_bronze( theitem );
             "0x6553": b_iron( theitem );
             "0x6554": b_verite( theitem );
             "0x6555": b_syntian( theitem );
             "0x6556": b_azurite( theitem );
             "0x6557": b_executor( theitem );
             "0x6558": b_radlius( theitem );
             "0x6559": b_aughlite( theitem );
             "0x655A": b_spiritstone( theitem );
             "0x655B": b_devilsclaw( theitem );
             "0x655C": b_shadow( theitem );
             "0x655D": b_gloom( theitem );
             "0x655E": b_devilstooth( theitem );
             "0x655F": b_pyrite( theitem );
             "0x6560": b_agapite( theitem );
             "0x6561": b_malachite( theitem );
             "0x6562": b_kryztal( theitem );
             "0x6563": b_gold( theitem );
             "0x6564": b_velvite( theitem );
             "0x6565": b_snograz( theitem );
             "0x6566": b_valorite( theitem );
             "0x6567": b_fatigue( theitem );
             "0x6568": b_wraithsbone( theitem );
             "0x6569": b_scarlelite( theitem );
             "0x656A": b_onyx( theitem );
             "0x656B": b_coral( theitem );
             "0x657B": b_solar( theitem );
             "0x657C": b_startear( theitem );
             "0x657D": b_silver( theitem );
             "0x657E": b_lunar( theitem );
             "0x657F": b_royal( theitem );

             // SPECIAL ORES
             "0x656C": b_deamonsfear( theitem );
             "0x656D": b_deamonrock( theitem );
             "0x656E": b_molten( theitem );

             // Specialist Ores [DWARVEN]
             "0x656F": b_lhiolite( theitem );
             "0x6570": b_gredstinuel( theitem );
             "0x6571": b_glacial( theitem ); //Glacial for us
             "0x6572": b_tekrhan( theitem );
             "0x6573": b_hekhranish( theitem );
             "0x6574": b_dwarfishorkanian( theitem );
             "0x6575": b_aorkrhan( theitem );
             "0x6576": b_auropian( theitem );

             // Radlius Series [RADLIUS]
             "0x6577": b_shalrius( theitem );
             "0x6578": b_ghuronius( theitem );
             "0x6579": b_keltrunius( theitem );

             // Gargoyles
             "0x657A": b_atrintium( theitem );
             
             // Special Ores
             "0x64F7": b_mithril( theitem );
             "0x64F9": b_adamantium( theitem );
             "0xF58":  b_electrical( theitem );
             "0xF59":  b_magnetic ( theitem );
             "0xF5B":  b_winterite ( theitem );
             "0xF5A":  b_molten ( theitem );
             "0x6580": b_rosesteel ( theitem );
             "0x658A": b_crimsonite ( theitem );
	     "0xFFFD": b_phoenix ( theitem);
             
	default: return( theitem ); //something funky has happened - return item unchanged
	endcase
endfunction

function b_DullCopper( theitem )
SetObjProperty(theitem, "dca",1); //for special Abilitys Later
endfunction

function b_Copper( theitem )
SetObjProperty(theitem, "coa",1); //for special Abilitys Later
endfunction

function b_bronze( theitem )
SetObjProperty(theitem, "bro",1); //for special Abilitys Later
endfunction

function b_iron( theitem )
SetObjProperty(theitem, "iro",1); //for special Abilitys Later
endfunction

function b_verite( theitem )
SetObjProperty(theitem, "ver",1); //for special Abilitys Later
endfunction

function b_syntian( theitem )
SetObjProperty(theitem, "syn",1); //for special Abilitys Later
endfunction

function b_azurite( theitem )
SetObjProperty(theitem, "azu",1); //for special Abilitys Later
SetObjProperty(theitem, "dexdrain", 25);
endfunction

function b_executor( theitem )
SetObjProperty(theitem, "exe",1); //for special Abilitys Later
SetObjProperty(theitem, "ratmanslaying", 1);
endfunction

function b_radlius( theitem )
SetObjProperty(theitem, "rad",1); //for special Abilitys Later
SetObjProperty(theitem, "blocking", 6);
endfunction

function b_aughlite( theitem )
SetObjProperty(theitem, "aug",1); //for special Abilitys Later
SetObjProperty(theitem, "protdexdrain", 5);
endfunction

function b_spiritstone( theitem )
SetObjProperty(theitem, "spi",1); //for special Abilitys Later
SetObjProperty(theitem, "blocking", 3);
endfunction

function b_devilsclaw( theitem )
SetObjProperty(theitem, "dcl",1); //for special Abilitys Later
SetObjProperty(theitem, "ophidianslaying", 1);
endfunction

function b_shadow( theitem )
SetObjProperty(theitem, "sha",1); //for special Abilitys Later
endfunction

function b_gloom( theitem )
SetObjProperty(theitem, "glo",1); //for special Abilitys Later
SetObjProperty(theitem, "dismount", 1);
endfunction

function b_devilstooth( theitem )
SetObjProperty(theitem, "dto",1); //for special Abilitys Later
SetObjProperty(theitem, "lizardmanslaying", 1);
endfunction

function b_pyrite( theitem )
SetObjProperty(theitem, "pyr",1); //for special Abilitys Later
SetObjProperty(theitem, "orcslaying", 1);
endfunction

function b_agapite( theitem )
SetObjProperty(theitem, "aga",1); //for special Abilitys Later
SetObjProperty(theitem, "protparalyze", 15);
endfunction

function b_malachite( theitem )
SetObjProperty(theitem, "mal",1); //for special Abilitys Later
SetObjProperty(theitem, "poisonresist", 15);
endfunction

function b_kryztal( theitem )
SetObjProperty(theitem, "kry",1); //for special Abilitys Later
SetObjProperty(theitem, "weaponbreaking", 1);
endfunction

function b_gold( theitem )
SetObjProperty(theitem, "gol",1); //for special Abilitys Later
endfunction

function b_velvite( theitem )
SetObjProperty(theitem, "dsp",1); //for special Abilitys Later
SetObjProperty(theitem, "blocking", 10);
endfunction

function b_rosesteel( theitem )
SetObjProperty(theitem, "ros",1); //for special Abilitys Later
SetObjProperty(theitem, "blocking", 6);
endfunction

function b_mithril( theitem )
SetObjProperty(theitem, "mth",1); //for special Abilitys Later
SetObjProperty(theitem, "blocking", 30);
endfunction

function b_snograz( theitem )
SetObjProperty(theitem, "sno",1); //for special Abilitys Later
SetObjProperty(theitem, "poison", 5);
endfunction

function b_valorite( theitem )
SetObjProperty(theitem, "val",1); //for special Abilitys Later
endfunction

function b_fatigue( theitem )
SetObjProperty(theitem, "fat",1); //for special Abilitys Later
SetObjProperty(theitem, "protmanadrain", 15);
endfunction

function b_wraithsbone( theitem )
SetObjProperty(theitem, "wra",1); //for special Abilitys Later
SetObjProperty(theitem, "vampire", 5);
endfunction

function b_scarlelite( theitem )
SetObjProperty(theitem, "sca",1); //for special Abilitys Later
SetObjProperty(theitem, "damreflect", 10);
endfunction

function b_crimsonite( theitem )
SetObjProperty(theitem, "sca",1); //for special Abilitys Later
SetObjProperty(theitem, "damreflect", 5);
endfunction

function b_onyx( theitem )
SetObjProperty(theitem, "ony",1); //for special Abilitys Later
SetObjProperty(theitem, "allelement", 10);
SetObjProperty(theitem, "manadrain", 10);
endfunction

function b_empyrean( theitem )
SetObjProperty(theitem, "emp",1); //for special Abilitys Later
SetObjProperty(theitem, "allelement", 15);
SetObjProperty(theitem, "extra_damage", 5);
endfunction

function b_deamonsfear( theitem )
SetObjProperty(theitem, "dfe",1); //for special Abilitys Later
SetObjProperty(theitem, "deamonslaying", 1);
endfunction

function b_deamonrock( theitem )
SetObjProperty(theitem, "dro",1); //for special Abilitys Later
SetObjProperty(theitem, "damreflect", 15);
endfunction

function b_deamonskull( theitem )
SetObjProperty(theitem, "dsk",1); //for special Abilitys Later
endfunction

function b_lhiolite( theitem )
SetObjProperty(theitem, "lhi",1); //for special Abilitys Later
SetObjProperty(theitem, "fireresist", 25);
endfunction

function b_gredstinuel( theitem )
SetObjProperty(theitem, "gre",1); //for special Abilitys Later
SetObjProperty(theitem, "coldresist", 25);
endfunction

function b_winterite( theitem )
SetObjProperty(theitem, "win",1); //for special Abilitys Later
SetObjProperty(theitem, "coldresist", 20);
endfunction

function b_glacial( theitem )
SetObjProperty(theitem, "gla",1); //for special Abilitys Later
SetObjProperty(theitem, "cold", 5);
SetObjProperty(theitem, "coldresist", 5);
endfunction

function b_tekrhan( theitem )
SetObjProperty(theitem, "tek",1); //for special Abilitys Later
SetObjProperty(theitem, "terathanslaying", 1);
endfunction

function b_hekhranish( theitem )
SetObjProperty(theitem, "hek",1); //for special Abilitys Later
SetObjProperty(theitem, "dragonslaying", 1);
endfunction

function b_dwarfishorkanian( theitem )
SetObjProperty(theitem, "dor",1); //for special Abilitys Later
SetObjProperty(theitem, "trollslaying", 1);
endfunction

function b_aorkrhan( theitem )
SetObjProperty(theitem, "aor",1); //for special Abilitys Later
SetObjProperty(theitem, "manadrain", 10);
SetObjProperty(theitem, "protparalyze", 10);
endfunction

function b_auropian( theitem )
SetObjProperty(theitem, "aur",1); //for special Abilitys Later
SetObjProperty(theitem, "allelement", 25);
endfunction

function b_shalrius( theitem )
SetObjProperty(theitem, "sha",1); //for special Abilitys Later
SetObjProperty(theitem, "sha",1);
endfunction

function b_ghuronius( theitem )
SetObjProperty(theitem, "ghu",1); //for special Abilitys Later
SetObjProperty(theitem, "shock", 1);
endfunction

function b_keltrunius( theitem )
SetObjProperty(theitem, "kel",1); //for special Abilitys Later
SetObjProperty(theitem, "extra_damage", 20);
endfunction

function b_atrintium( theitem )
SetObjProperty(theitem, "atr",1); //for special Abilitys Later
SetObjProperty(theitem, "paralyze", 10);
endfunction

function b_solar( theitem )
SetObjProperty(theitem, "sol",1); //for special Abilitys Later
SetObjProperty(theitem, "fire", 3);
SetObjProperty(theitem, "fireresist", 3);
endfunction

function b_molten( theitem )
SetObjProperty(theitem, "sol",1); //for special Abilitys Later
SetObjProperty(theitem, "fire", 5);
SetObjProperty(theitem, "fireresist", 5);
endfunction

function b_volcanic( theitem )
SetObjProperty(theitem, "sol",1); //for special Abilitys Later
SetObjProperty(theitem, "fire", 1);
SetObjProperty(theitem, "fireresist", 1);
endfunction

function b_startear( theitem )
SetObjProperty(theitem, "sta",1); //for special Abilitys Later
SetObjProperty(theitem, "cold", 3);
SetObjProperty(theitem, "coldresist", 3);
endfunction

function b_coral( theitem )
SetObjProperty(theitem, "cor",1); //for special Abilitys Later
SetObjProperty(theitem, "cold", 1);
SetObjProperty(theitem, "coldresist", 1);
endfunction

function b_silver( theitem )
SetObjProperty(theitem, "sil",1); //for special Abilitys Later
SetObjProperty(theitem, "silver", 1);
endfunction

function b_lunar( theitem )
SetObjProperty(theitem, "lun",1); //for special Abilitys Later
SetObjProperty(theitem, "elec", 3);
SetObjProperty(theitem, "elecresist", 3);
endfunction

function b_electrical( theitem )
SetObjProperty(theitem, "ele",1); //for special Abilitys Later
SetObjProperty(theitem, "elec", 1);
SetObjProperty(theitem, "elecresist", 1);
endfunction

function b_magnetic( theitem )
SetObjProperty(theitem, "mag",1); //for special Abilitys Later
SetObjProperty(theitem, "elec", 5);
SetObjProperty(theitem, "elecresist", 5);
endfunction

function b_royal( theitem )
SetObjProperty(theitem, "roy",1); //for special Abilitys Later
SetObjProperty(theitem, "magicresist", 20);
endfunction

function b_adamantium( theitem )
SetObjProperty(theitem, "adm",1); //for special Abilitys Later
SetObjProperty(theitem, "damreflect", 30);
endfunction

function b_phoenix( theitem )
SetObjProperty(theitem, "pho",1); //for special Abilitys Later
SetObjProperty(theitem, "allelement", 35);
SetObjProperty(theitem, "fire", 35);
endfunction
Blacksmithy.inc

Code: Select all

///////////////////
//  Allows the user to try to repair a blacksmithy item
///////////////////

include "include/attributes";

function RepairBlacksmithyItem(byref character, byref item, repair_skill)


	if (!item.maxhp || !item.quality)
		SendSysMessage(character, "That item cannot be repaired.");
		return;
	endif

	//if the item is in full repair, try to do special stuff
	if (item.hp >= item.maxhp)
		if ( GetObjProperty(item,"ownerserial") )
			SendSysMessage(character, "That has an owner's mark!");
			return;
		endif
		DoSpecialBlacksmithingStuff(character, item, repair_skill);
		return;
	endif

	//make sure the item is good enough to be repairable
	if (item.hp <= 10)
		SendSysMessage(character, "The brittle material breaks when you handle it.");
		DestroyItem(item);
		return;
	endif

	//setup some variables
	var item_damaged_amount := item.maxhp - item.hp;

	//now determine how many ingots and how much skill it will take to repair this item
	var ingots_needed := CInt(item_damaged_amount/15);
	if (!ingots_needed)
		ingots_needed := 1;
	endif

	//allow the use to pick which ingots to use
	SendSysMessage(character, "You need " + ingots_needed + " ingot(s) to repair this item.");
        SendSysMessage(character, "Target the same type of ingots to repair it");
	var found_ingots := Target(character);
	if (!found_ingots)
		SendSysMessage(character, "Canceled.");
		return;
	endif
	if (!IsIngot(found_ingots.objtype) )
		SendSysMessage(character, "That's not an ingot!");
		return;
	endif

        var hidetype := GetObjProperty( item, "IngotType");
        if (hidetype != found_ingots.objtype)
           SendSysMessage(character, "That is not the same type of ingots!");
           return;
        endif

	if (!ReserveItem(found_ingots) )
		SendSysMessage(character, "You cannot use that right now.");
		return;
	endif
	if (!Accessible(character, found_ingots) )
		SendSysMessage(character, "You can't reach that.");
		return;
	endif
	if (found_ingots.amount < ingots_needed)
		SendSysMessage(character, "You need " + ingots_needed + " ingots.  That's only " + found_ingots.amount + "!");
		return;
	endif

	PlaySoundEffect(character, SFX_ANVIL);
           PerformAction(character, ANIM_ATTACK_1HAND_DOWN);
	sleep(2);
	PlaySoundEffect(character, SFX_ANVIL);
           PerformAction(character, ANIM_ATTACK_1HAND_DOWN);
	sleep(2);
	PlaySoundEffect(character, SFX_ANVIL);
           PerformAction(character, ANIM_ATTACK_1HAND_DOWN);
	sleep(2);

	SubtractAmount(found_ingots, ingots_needed);
	var total_damage := GetObjProperty(item, "total_damage");
	if (!total_damage)
		total_damage := 0;
	endif

	if (total_damage + item_damaged_amount > item.maxhp)
		DestroyItem(item);
		SendSysMessage(character, "The brittle material breaks when you handle it.");
		return;
	endif

	if (!CheckSkill(character, repair_skill, 80, 0) )
		total_damage := total_damage + RandomInt(10);
		SetObjProperty(item, "total_damage", total_damage);
		if (total_damage + item_damaged_amount > item.maxhp)
			DestroyItem(item);
			SendSysMessage(character, "The brittle material breaks when you handle it.");
			return;
		endif
		SendSysMessage(character, "You only manage to damage the item further...");
                item.hp := item.hp - (RandomInt(10));
		return;
	endif

	var skill_bonus := CInt(GetEffectiveSkill(character, SKILLID_BLACKSMITHY)/4);
	if (item.name["fine"])
		skill_bonus := skill_bonus + 5;
	elseif (item.name["durable"])
		skill_bonus := skill_bonus + 10;
	elseif (item.name["rugged"])
		skill_bonus := skill_bonus + 15;
	elseif (item.name["tempered"])
		skill_bonus := skill_bonus + 20;
	elseif (item.name["indestructable"])
		skill_bonus := skill_bonus + 25;
	elseif (item.name["exceptional"])
		skill_bonus := skill_bonus + 25;
	endif

	item_damaged_amount := CInt(item_damaged_amount * (100-skill_bonus)/100);
	if (item_damaged_amount < 5)
		item_damaged_amount := 5;
	endif

	total_damage := total_damage + item_damaged_amount;
	SetObjProperty(item, "total_damage", total_damage);
	item.hp := item.maxhp;
	SendSysMessage(character, "You repair the item completely");
	return;
endfunction




///////////////////
//  checks what special options are available for upgrading a blacksmithy item
///////////////////

function DoSpecialBlacksmithingStuff(byref character, byref item, repair_skill)

		if (getobjproperty(item, "elite"))
			makelegendary(character,item);
			return;
		endif

	//nothing we can do with player made items at the highest upgrade level
	if (item.desc["exceptional"] || item.desc["Exceptional"])

		SendSysMessage(character, "That item is in full repair.");
		return;
	endif

	//if its a magic item and they're using blacksmithy, they can change the color of the item, or
	//if its a breastplate, they can change its gender
	if (IsMagicalItem(item))
//		if (repair_skill != SKILLID_BLACKSMITHY)
			SendSysMessage(character, "Magical items can not be repaired.");
			return;
//		endif

		if (item.graphic == UOBJ_PLATE_BREASTPLATE || item.graphic == UOBJ_PLATE_BREASTPLATE2 ||
				item.graphic == UOBJ_PLATE_FEMALE || item.graphic == UOBJ_PLATE_FEMALE2)
			var menu := CreateMenu("Options:");
			AddMenuItem(menu, 0, "Laminate");
			AddMenuItem(menu, 0, "Change gender");

			var selection := SelectMenuItem2(character, menu);
			if (!selection)
				SendSysMessage(character, "Canceled.");
				return;
			elseif (selection.index == 1)
				DoColorCoating(character, item, repair_skill);
				return;
			elseif (selection.index == 2)
				ChangeGenderOfMetalArmor(character, item, repair_skill);
				return;
			else
				SendSysMessage(character, "You're not supposed to get this message.  Whoops.");
				return;
			endif
			return;
		else
			//DoColorCoating (character, item, repair_skill);
                        SendSysMessage(character, "That item is in full repair.");
			return;
		endif

	//otherwise try to upgrade it
	else
		//DoBlacksmithyItemUpgrade (character, item, repair_skill);
		SendSysMessage(character, "That item is in full repair.");
		return;
	endif
endfunction




///////////////////
//  Tries to upgrade the item that was selected.  This section only confirms the upgrade, then
//  calls a seperate section of code
///////////////////

function DoBlacksmithyItemUpgrade(byref character, byref item, repair_skill)
	var smith_cfg_file := ReadConfigFile( ":blacksmithy:blacksmithy" );
	var elem := FindConfigElem(smith_cfg_file, item.objtype);
	if (!elem)
		SendSysMessage(character, "That item is in full repair.");
		return;
	endif

	var material_needed := CInt(elem.material/2);
	var time_delay := elem.time;
	if (time_delay > 1)
		time_delay := time_delay - 1;
	endif;

	var item_name := elem.name;
	var item_skill := elem.skill + 15;
	if (item.desc["quality"])
		item_skill := item_skill + 10;
	endif
	if (item_skill > 110)
		item_skill := 110;
	endif

	SendSysMessage(character, "That item is in full repair.");
	SendSysMessage(character, "Upgrading that item will take " + material_needed + " ingots and " + item_skill + " skill.");
	if (item_skill > GetEffectiveSkill(character, repair_skill) + 20)
		SendSysMessage(character, "Your skill is too low to upgrade that item.");
		return;
	endif

	//allow the use to pick which ingots to use
	SendSysMessage(character, "Target the ingots to use:");
	var found_ingots := Target(character);
	if (!found_ingots)
		SendSysMessage(character, "Canceled.");
		return;
	endif

	if (!IsIngot(found_ingots.objtype) )
		SendSysMessage(character, "That's not an ingot!");
		return;
	endif
	if (!ReserveItem(found_ingots) )
		SendSysMessage(character, "You cannot use that right now.");
		return;
	endif
	if (!Accessible(character, found_ingots) )
		SendSysMessage(character, "You can't reach that.");
		return;
	endif
	if (found_ingots.amount < material_needed)
		SendSysMessage(character, "You need " + material_needed + " ingots.  That's only " + found_ingots.amount + "!");
		return;
	endif

	PerformBlacksmithyItemUpgrade(character, item, found_ingots, material_needed, repair_skill, item_skill, time_delay, item_name);
endfunction




///////////////////
//  this function does the actual item upgrade
///////////////////

function PerformBlacksmithyItemUpgrade(character, item, found_ingots, material_needed, repair_skill, item_skill, time_delay, prefix, item_name := 0, total_points := 0)

	var sx := character.x;
	var sy := character.y;
        var blacksmithyskill := GetEffectiveSkill( character, SKILLID_BLACKSMITHY);
        var armsloreskill := GetEffectiveSkill( character, SKILLID_ARMSLORE);
	var eliteprobability := 0;


                if(( blacksmithyskill > 95) && (armsloreskill > 95))
                      eliteprobability := CINT(((blacksmithyskill - 95)/2) + ((armsloreskill - 95)/2));
                      if(eliteprobability > 15)
                         eliteprobability := 15;
                      endif
		endif


		if (character.cmdlevel > 2)
			SendSysMessage(character,"Chance for elite: " + eliteprobability,color := 0x89);
		endif



	repeat
		for i := 1 to time_delay
                	PerformAction(character, ANIM_ATTACK_1HAND_DOWN);
                	PlaySoundEffect(character, SFX_ANVIL);
                	sleepms(2100);
		endfor

		if (!found_ingots || found_ingots.amount < material_needed)
			SendSysMessage(character, "You don't have enough material to continue.");
                        SubtractAmount(found_ingots, RandomInt(material_needed));
			return;
		endif


		if (CheckSkill(character, repair_skill, item_skill, modify_points(character, repair_skill, total_points)) )
			SubtractAmount(found_ingots, material_needed);
			SendSysMessage(character, "You succeed in upgrading the item!");

			if (item.desc ["quality"])
                           if ((RandomInt(100)+ 1) <= eliteprobability)

                                if(prefix)
			            item.name := "an elite " + prefix + " " + item_name;
                                else
			  	    item.name := "an elite " + item_name;
                                endif

				item.quality := 1.5;
				item.hp := item.maxhp;
                                var newname := SendTextEntryGump( character, "Choose a name for the elite:", 50);
                                if(newname)
                                    SetName(item, "-" + newname + "-" );
                                endif

                                SendSysMessage( character, "You craft an elite " + item_name + " and place it in your pack." );
                                SetObjProperty(item, "craftedby", "crafted by " + character.name);
				SetObjProperty(item, "elite", 1);
				return;
                           endif
                          
                           if(prefix)
                              item.name := "an exceptional " + prefix + " " + item_name;
                           else
		              item.name := "an exceptional " + item_name;
                           endif

			   item.quality := 1.3;
		           item.hp := item.maxhp;
			   return;
			else
      
                                if(prefix)
				   item.name := "a quality " + prefix + " " + item_name;
                                else
				   item.name := "a quality " + item_name;
                                endif
  
				item.quality := 1.1;
				item.hp := item.maxhp;

				if (item_skill > 120)
					item_skill := 120;
				endif

				if (item_skill > GetEffectiveSkill(character, repair_skill) + 20)
					SendSysMessage(character, "Your skill is too low to upgrade the item any further.");
					return;
				endif
                                item_skill := item_skill + 10;

		if (character.cmdlevel > 2)
			SendSysMessage(character,"Skill for exceptional: " + item_skill,color := 0x89);
		endif

			endif
		else
			SubtractAmount(found_ingots, RandomInt(material_needed) );

                        if ((blacksmithyskill < 100) || (armsloreskill < 100))
			   if ((RandomInt(CINT((armsloreskill+blacksmithyskill)/4))+1)==1)
				SendSysMessage(character, "You ruin the item trying to upgrade it.");
				DestroyItem(item);
				return 0;
			   else
				SendSysMessage(character, "You destroy some material.");
			   endif
			else
			   SendSysMessage(character, "You destroy some material.");
			endif
		endif


	until (character.x != sx || character.y != sy);
endfunction





///////////////////
//  allows the user to coat the given piece of equipment with another color
///////////////////

function DoColorCoating(byref character, byref item, repair_skill)
	var smith_cfg_file := ReadConfigFile( ":blacksmithy:blacksmithy" );
	var elem := FindConfigElem(smith_cfg_file, item.objtype);
	if (!elem)
		SendSysMessage(character, "That item is in full repair.");
		return;
	endif

	var material_needed := CInt(elem.material/2);
	var time_delay := elem.time;
	if (time_delay > 1)
		time_delay := time_delay - 1;
	endif;

	SendSysMessage(character, "That item is in full repair.");
	SendSysMessage(character, "Laminating that item will take " + material_needed);
	if (GetEffectiveSkill(character, repair_skill) < 90)
		SendSysMessage(character, "Your skill is too low to laminate that item.");
		return;
	endif

	SendSysMessage(character, "Target some ingots to laminate the item with.");
	var found_ingots := Target(character);
	if (!found_ingots)
		SendSysMessage(character, "Canceled.");
		return;
	endif
	if (!ReserveItem(found_ingots) )
		SendSysMessage(character, "You cannot use that right now.");
		return;
	endif
	if (!IsIngot(found_ingots.objtype) )
		SendSysMessage(character, "That's not an ingot!");
		return;
	endif
	if (!Accessible(character, found_ingots) )
		SendSysMessage(character, "You can't reach that.");
		return;
	endif
	if (found_ingots.amount < material_needed)
		SendSysMessage(character, "You need " + material_needed + " ingots.  That's only " + found_ingots.amount + "!");
		return;
	endif

	var confirm_upgrade := YesNo(character, "Laminate?");
	if (!confirm_upgrade)
		SendSysMessage(character, "Canceled.");
		return;
	endif

	for i := 1 to time_delay
		PlaySoundEffect(character, SFX_ANVIL);
		sleep(2);
	endfor
	PlaySoundEffect(character, SFX_ANVIL);

	if (RandomInt(1000) == 0)
		SendSysMessage(character, "You fail, destroying the item.");
		DestroyItem(item);
		return;
	elseif ( RandomInt(100) < 10 )
		SendSysMessage(character, "You fail, destroying some ingots.");
		SubtractAmount(found_ingots, RandomInt(material_needed) );
		return;
	else
		SendSysMessage(character, "You succeed in laminating the item.");
		item.color := found_ingots.color;
		SubtractAmount(found_ingots, material_needed);
		return;
	endif

endfunction




///////////////////
//  changes the gender of plate armor from male to female and back again
///////////////////

function ChangeGenderOfMetalArmor(byref character, byref item, repair_skill)
	var smith_cfg_file := ReadConfigFile( ":blacksmithy:blacksmithy" );
	var elem := FindConfigElem(smith_cfg_file, item.objtype);
	if (!elem)
		SendSysMessage(character, "That item is in full repair.");
		return;
	endif

	var material_needed := CInt(elem.material/2);
	var time_delay := elem.time;
	if (time_delay > 1)
		time_delay := time_delay - 1;
	endif;

	SendSysMessage(character, "That item is in full repair.");
	SendSysMessage(character, "Changing the gender of that item will take " + material_needed);
	if (GetEffectiveSkill(character, repair_skill) < 90)
		SendSysMessage(character, "Your skill is too low to do this.");
		return;
	endif

	SendSysMessage(character, "Target the ingots to use:");
	var found_ingots := Target(character);
	if (!found_ingots)
		SendSysMessage(character, "Canceled.");
		return;
	endif
	if (!IsIngot(found_ingots.objtype) )
		SendSysMessage(character, "That's not an ingot!");
		return;
	endif
	if (!ReserveItem(found_ingots) )
		SendSysMessage(character, "You cannot use that right now.");
		return;
	endif
	if (!Accessible(character, found_ingots) )
		SendSysMessage(character, "You can't reach that.");
		return;
	endif
	if (found_ingots.amount < material_needed)
		SendSysMessage(character, "You need " + material_needed + " ingots.  That's only " + found_ingots.amount + "!");
		return;
	endif

	var confirm_upgrade := YesNo(character, "Change gender?");
	if (!confirm_upgrade)
		SendSysMessage(character, "Canceled.");
		return;
	endif

	for i := 1 to time_delay
		PlaySoundEffect(character, SFX_ANVIL);
		sleep(2);
	endfor
	PlaySoundEffect(character, SFX_ANVIL);

	if (RandomInt(1000) == 0)
		SendSysMessage(character, "You fail, destroying the item.");
		DestroyItem(item);
		return;
	elseif ( RandomInt(100) < 10 )
		SendSysMessage(character, "You fail, destroying some ingots.");
		SubtractAmount(found_ingots, RandomInt(material_needed) );
		return;
	else
		SendSysMessage(character, "You succeed in modifying the item.");
		case (item.graphic)
			UOBJ_PLATE_BREASTPLATE:
				item.graphic := UOBJ_PLATE_FEMALE;
			UOBJ_PLATE_BREASTPLATE2:
				item.graphic := UOBJ_PLATE_FEMALE2;
			UOBJ_PLATE_FEMALE:
				item.graphic := UOBJ_PLATE_BREASTPLATE;
			UOBJ_PLATE_FEMALE2:
				item.graphic := UOBJ_PLATE_BREASTPLATE2;
			default:
				SendSysMessage(character, "Um, never mind.  I was thinking of a different type of item, I guess.");
				return;
		endcase
		SubtractAmount(found_ingots, material_needed);
		return;
	endif

endfunction

function makelegendary(byref character, weapon)

const SOUND_EFFECT_SPARKLE	:= 0x1e8;
const EFFECT_SPARKLE		:= 0x373a;
	var diff,element,chargename;
	if (!weapon.movable)
		return;
	endif

	if (!ismetalweapon(weapon))
		return;
	endif
	
	diff:=getobjproperty(weapon, "elite");
	if (!diff)
		Sendsysmessage (character, "This is not an elite weapon");
		return;
	endif

	if (!Accessible(character,weapon))
		return;
	endif


	SendSysMessage(character, "Select the gem to use.");
	var thegem := Target(character);
	if (!thegem)
		return;
	endif

	if (!Accessible(character,thegem))
		return;
	endif
	if (!thegem.movable)
		return;
	endif

	case (thegem.objtype)
	0x0f13://name  Summon Daemon
		element:= "dismount";
		chargename := "ruby";
	0x0f11://name  Lightening
		element:= "elec";
		chargename := "sapphire";
	0x0f30://name Flame Strike
		element:= "fire";
		chargename := "diamond";
	0x0f0f://name  Meteor Swarm
		element:= "cold";
		chargename := "star sapphire";
	0x0f25://name  Nightsight
		element:= "sil";
		chargename := "amber";
	0x0f15://name  Protection
		element:= "dragonslaying";
		chargename := "citrine";
	0x0f16://name  Venom
		element:= "poison";
		chargename := "amethyst";
	0x0f10://name  Resurrection
		chargename := "emerald";
		element:= "disarm";
	0x0f18://name  Magic Missile
		chargename := "tourmaline";
		element:= "vampire";
	default:
		SendSysMessage(character, "You can't charge that!");
		return;
	endcase
	var fail_damage:=randomint(100)+20;
	SubtractAmount(thegem,1);

	
		for i := 1 to 10
                	PerformAction(character, ANIM_ATTACK_1HAND_DOWN);
                	PlaySoundEffect(character, SFX_ANVIL);
                	sleepms(2100);
		endfor

               	PlaySoundEffect(character, SFX_ANVIL);
		sleep(1);


	if (!CheckSkill(character, SKILLID_ARMSLORE, 110, modify_points(character, SKILLID_ARMSLORE, 50)))
		PlaySoundEffect(character, SFX_SPELL_EXPLOSION);
		PlayObjectCenteredEffect(character, FX_EXPLODE_3, 7, 0x10);
		PrintTextAbovePrivate(character,"*You destroy the weapon*",character);
		applyrawdamage(character, fail_damage);
		DestroyItem(weapon);
	elseif (!CheckSkill(character, SKILLID_BLACKSMITHY, 110, modify_points(character, SKILLID_BLACKSMITHY, 50)))
		PlaySoundEffect(character, SFX_SPELL_EXPLOSION);
		PlayObjectCenteredEffect(character, FX_EXPLODE_3, 7, 0x10);
		PrintTextAbovePrivate(character,"*You destroy the weapon*",character);
		applyrawdamage(character, fail_damage);
		DestroyItem(weapon);
	else
		if (randomint(5)<diff)
			PlaySoundEffect(character, SFX_SPELL_EXPLOSION);
			PlayObjectCenteredEffect(character, FX_EXPLODE_3, 7, 0x10);
			PrintTextAbovePrivate(character,"*You destroy the weapon*",character);
			applyrawdamage(character, fail_damage);
			DestroyItem(weapon);
			return;
		endif			
		PlayObjectCenteredEffect(character, EFFECT_SPARKLE, 7,0x10);
        	PlaySoundEffect(character, SOUND_EFFECT_SPARKLE);
		SetObjProperty(weapon,element,5);
		if (diff==1)
		PrintTextAbovePrivate(character,"*You created a legendary weapon!*",character);
		else
		PrintTextAbovePrivate(character,"*You enchanted the legendary weapon!*",character);
		endif
          
	var newname := SendTextEntryGump( character, "Choose name for the legendary item", 50);
	var itemname:=Getobjproperty(weapon,"name");
	if(newname)
		SetName(weapon, "-" + newname + "-" );
		else
		SetName(weapon, "a legendary " + itemname);
	endif

		diff:=CINT(diff)+1;
		SetObjProperty(weapon,"elite",diff);
	endif

endfunction
Breg
New User
Posts: 27
Joined: Sat Dec 09, 2006 11:58 am

Re: Getting my Items to work now..

Post by Breg »

Smelting.src

Code: Select all

////////////////
// smelting.src
//
// Turns normal or colored ore into its respective ingot.
// Some ores are harder to work with than others.
//
// Author: Racalac, 5/8/99
//
// Modifications: 
//     19990525 Syz moved UOBJ_XX definitions to include/objtype.inc
//
////////////////

use uo;
use os;
use util;

include "include/client";
include "include/objtype";
include "include/yesno";
include "include/class";
include "include/trainingskill";


program smelt_that_ore ( character, ore )
    if (GetObjProperty (character, "NoHit") > readgameclock() )
        PrintTextAbovePrivate (character, "I feel disheartened and I am not in the mood to do so.", character);
        return;
    endif
        

        var data := {};
        data[1] := "mining";
        data[2] := ReadGameClock();
        data[3] := 45;
        SetObjProperty(character, "LastUsedSkill", data );
        TrainingSkill(character, data[3]);

	var mount := GetEquipmentByLayer( character, 25 );
	if ( mount )
		PrintTextAbovePrivate( character, "You cannot smelt while mounted.", character );
		return;
	endif


    case( ore.objtype )
UOBJ_DULLCOPPER_ORE:       SmeltOre( character, ore, UOBJ_DULLCOPPER_INGOT, 0, 5 );
UOBJ_COPPER_ORE:           SmeltOre( character, ore, UOBJ_COPPER_INGOT, 10, 10 );
UOBJ_BRONZE_ORE:           SmeltOre( character, ore, UOBJ_BRONZE_INGOT, 20, 15 );
UOBJ_IRON_ORE:             SmeltOre( character, ore, UOBJ_IRON_INGOT, 30, 20 );
UOBJ_VERITE_ORE:       	   SmeltOre( character, ore, UOBJ_VERITE_INGOT, 35, 25 );		//weapon
UOBJ_SYNTIAN_ORE:          SmeltOre( character, ore, UOBJ_SYNTIAN_INGOT, 40, 30 );		//Armour
UOBJ_AZURITE_ORE:          SmeltOre( character, ore, UOBJ_AZURITE_INGOT, 45, 35 );		//both
UOBJ_EXECUTOR_ORE:         SmeltOre( character, ore, UOBJ_EXECUTOR_INGOT, 45, 40 );		//weapon
UOBJ_RADLIUS_ORE:      	   SmeltOre( character, ore, UOBJ_RADLIUS_INGOT, 45, 40 );		//Armour
UOBJ_AUGHLITE_ORE:         SmeltOre( character, ore, 0x6559, 50, 45 );		//both
UOBJ_SPIRITSTONE_ORE:      SmeltOre( character, ore, UOBJ_SPIRITSTONE_INGOT, 55, 45 );	//Armour
UOBJ_DEVILSCLAW_ORE:       SmeltOre( character, ore, UOBJ_DEVILSCLAW_INGOT, 60, 45 );	//Weapon
UOBJ_SHADOW_ORE:      	   SmeltOre( character, ore, UOBJ_SHADOW_INGOT, 65, 50 );		//Armour
UOBJ_GLOOM_ORE:      	   SmeltOre( character, ore, UOBJ_GLOOM_INGOT, 70, 50 );		//both
UOBJ_DEVILSTOOTH_ORE:      SmeltOre( character, ore, UOBJ_DEVILSTOOTH_INGOT, 74, 50 );	//Weapon
UOBJ_PYRITE_ORE:           SmeltOre( character, ore, UOBJ_PYRITE_INGOT, 78, 50 );		//weapon
UOBJ_AGAPITE_ORE:     	   SmeltOre( character, ore, UOBJ_AGAPITE_INGOT, 82, 55 );		//Armour
UOBJ_MALACHITE_ORE:        SmeltOre( character, ore, UOBJ_MALACHITE_INGOT, 85, 55 );	//Armour
UOBJ_KRYZTAL_ORE:          SmeltOre( character, ore, UOBJ_KRYZTAL_INGOT, 85, 55 );		//Weapon
UOBJ_GOLD_ORE:      	   SmeltOre( character, ore, UOBJ_GOLD_INGOT, 87, 55 );		//Armour
UOBJ_VELVITE_ORE:      SmeltOre( character, ore, UOBJ_VELVITE_INGOT, 90, 60 );	//Armour
UOBJ_NOXIOUS_ORE:     	   SmeltOre( character, ore, UOBJ_NOXIOUS_INGOT, 92, 60 );		//Weapon
UOBJ_VALORITE_ORE:     	   SmeltOre( character, ore, UOBJ_VALORITE_INGOT, 94, 60 );		//ARMOUR
UOBJ_FATIGUE_ORE:      	   SmeltOre( character, ore, UOBJ_FATIGUE_INGOT, 96, 60 );		//both
UOBJ_WRAITHSBONE_ORE:      SmeltOre( character, ore, UOBJ_WRAITHSBONE_INGOT, 98, 65 );	//Weapon
UOBJ_SCARLETITE_ORE:       SmeltOre( character, ore, UOBJ_SCARLETITE_INGOT, 100, 65 );	//Armour
UOBJ_ONYX_ORE:             SmeltOre( character, ore, UOBJ_ONYX_INGOT, 105, 65 );		//Weapon
UOBJ_CORAL_ORE:            SmeltOre( character, ore, UOBJ_CORAL_INGOT, 65, 70 );	//Armour
UOBJ_SOLAR_ORE:            SmeltOre( character, ore, UOBJ_SOLAR_INGOT, 80, 70 );	        //Weapon
UOBJ_STARTEAR_ORE:         SmeltOre( character, ore, UOBJ_STARTEAR_INGOT, 90, 60 );	        //Weapon
UOBJ_SILVER_ORE:           SmeltOre( character, ore, UOBJ_SILVER_INGOT, 63, 55 );	        //both
UOBJ_LUNAR_ORE:            SmeltOre( character, ore, UOBJ_LUNAR_INGOT, 70, 60 );	        //WEAPON
UOBJ_ROYAL_ORE:            SmeltOre( character, ore, UOBJ_ROYAL_INGOT, 88, 60 );	        //ARMOUR

// SPECIAL ORES
UOBJ_DAEMONSFEAR_ORE:      SmeltOre( character, ore, UOBJ_DAEMONSFEAR_INGOT, 95, 95 );	//weapon
UOBJ_DAEMONROCK_ORE:       SmeltOre( character, ore, UOBJ_DAEMONROCK_INGOT, 100, 90 );	//Armour
UOBJ_VOLCANIC_ORE:      SmeltOre( character, ore, UOBJ_VOLCANIC_INGOT, 65, 115 );	//Armour

// Specialist Ores [DWARVEN]
UOBJ_LHIOLITE_ORE:         SmeltOre( character, ore, UOBJ_LHIOLITE_INGOT, 80, 150 );	//Armour
UOBJ_GREDSTINUEL_ORE:      SmeltOre( character, ore, UOBJ_GREDSTINUEL_INGOT, 80, 150 );	//Armour
UOBJ_GLACIAL_ORE:   SmeltOre( character, ore, UOBJ_GLACIAL_INGOT, 85, 150 );	//Armour
UOBJ_TEKRHAN_ORE:      	   SmeltOre( character, ore, UOBJ_TEKRHAN_INGOT, 88, 150 );		//Weapon
UOBJ_HEKHRANISH_ORE:       SmeltOre( character, ore, UOBJ_HEKHRANISH_INGOT, 92, 150 );	//Armour
UOBJ_DWARFISHORKANIAN_ORE: SmeltOre( character, ore, UOBJ_DWARFISHORKANIAN_INGOT, 77, 150 );//Weapon
UOBJ_AORKRHAN_ORE:         SmeltOre( character, ore, UOBJ_AORKRHAN_INGOT, 100, 150 );	//Weapon
UOBJ_AUROPIAN_ORE:         SmeltOre( character, ore, UOBJ_AUROPIAN_INGOT, 102, 150 );	//Armour

// Radlius Series [RADLIUS]
UOBJ_SHALRIUS_ORE:         SmeltOre( character, ore, UOBJ_SHALRIUS_INGOT, 63, 55 );		//both
UOBJ_GHURONIUS_ORE:        SmeltOre( character, ore, UOBJ_GHURONIUS_INGOT, 94, 90 );	//both
UOBJ_KELTRUNIUS_ORE:       SmeltOre( character, ore, UOBJ_KELTRUNIUS_INGOT, 97, 90 );	//both

// Gargoyles
UOBJ_ATRINTIUM_ORE:        SmeltOre( character, ore, UOBJ_ATRINTIUM_INGOT, 57, 60 );		//both

// New ores 
UOBJ_MITHRIL_ORE:	   SmeltOre( character, ore, UOBJ_MITHRIL_INGOT, 98, 90);
UOBJ_ADMANTIUM_ORE:	   SmeltOre( character, ore, UOBJ_ADMANTIUM_INGOT, 98, 90);
UOBJ_EMPYREAN_ORE:	   SmeltOre( character, ore, UOBJ_EMPYREAN_INGOT, 95, 90);
UOBJ_ELECTRICAL_ORE:	   SmeltOre( character, ore, UOBJ_ELECTRICAL_INGOT, 65, 55);
UOBJ_MAGNETIC_ORE:	   SmeltOre( character, ore, UOBJ_MAGNETIC_INGOT, 85, 150);
UOBJ_WINTERITE_ORE:	   SmeltOre( character, ore, UOBJ_WINTERITE_INGOT, 80, 150);
UOBJ_MOLTEN_ORE:	   SmeltOre( character, ore, UOBJ_MOLTEN_INGOT, 85, 150);
UOBJ_ROSESTEEL_ORE:	   SmeltOre( character, ore, UOBJ_ROSESTEEL_INGOT, 80, 150);
UOBJ_CRIMSONITE_ORE:	   SmeltOre( character, ore, UOBJ_CRIMSONITE_INGOT, 90, 90);
UOBJ_PHOENIX_ORE:	   SmeltOre( character, ore, UOBJ_PHOENIX_INGOT, 90, 1450;
UOBJ_SAND:		   SmeltOre( character, ore, UOBJ_GLASS, 40, 30 );
UOBJ_GOLD_COIN:		   MakeGoldBars( character, ore );
        default: SendSysMessage( character, "You can't smelt that." );
    endcase
endprogram


function SmeltOre( character, ore, ingot, difficulty, points )

    if (!ReserveItem(ore))
	SendSysMessage(character, "You cannot use that right now.");
	return;
    endif

    if ( !Accessible( character, ore ) )
        SendSysMessage( character, "You can't reach that." );
        return;
    endif
   
    if (ore.movable == 0 )
        SendSysMessage(character, "Its locked down.");
        return;
    endif

    var near_items := ListItemsNearLocation(character.x, character.y, character.z,2);
    foreach forge in near_items
    	if ( ((forge.objtype >= UOBJ_FORGE_START) && (forge.objtype <= UOBJ_FORGE_END)) || (forge.objtype == UOBJ_SMALL_FORGE) )

        	if ( CheckSkill( character, SKILLID_MINING, difficulty,  modify_points( character, SKILLID_MINING, points) ) )

			var created_ingot:=SafeCreateInContainer(character.backpack, ingot, GetAmount( ore ) );

                        if(created_ingot)
				if( character.cmdlevel < 3  )
					SetObjProperty(created_ingot,"hidden_fresh",1);
				endif

            		      DestroyItem( ore );
                              PlaySoundEffect(character, 34);
                              sleepms(5000);
            		      SendSysMessage( character, "You create some ingots and place them in your pack." );

			if (character.cmdlevel>2)
                        
                        SetObjProperty( created_ingot, "Createdby", character.acctname );
			endif

			      return;
		        else
                              SendSysMessage(character, "Your backpack is full!");
                              return;
                        endif
		else
                        var subore := RandomInt(5)+1;
                        if(subore > ore.amount)
                             subore := ore.amount;
                        endif
        		SubtractAmount( ore, subore );
                        PlaySoundEffect(character, 34);
                        sleepms(5000);
        		SendSysMessage( character, "You destroy some ore." );
			return;
		endif
    	endif
    endforeach
    SendSysMessage( character, "You must be near a forge to smelt ore!" );
   
endfunction


///////////////////
//  Searches the area around the character for a forge
///////////////////

function FindForgeInArea(character)
	foreach item in ListItemsNearLocation(character.x, character.y, character.z,2)
		if ( item.objtype >= UOBJ_FORGE_START && item.objtype <= UOBJ_FORGE_END )
			return 1;
		elseif (item.objtype == UOBJ_SMALL_FORGE)
			return 1;
		endif
	endforeach
	return 0;
endfunction


///////////////////
//  Creates gold bars out of gold coins
///////////////////

function MakeGoldBars(character, gold)
	if (!ReserveItem(gold))
		SendSysMessage(character, "You cannot use that right now.");
		return;
	endif

	if ( !Accessible( character, gold ) )
		SendSysMessage( character, "You can't reach that." );
		return;
	endif

	if (!FindForgeInArea(character))
		SendSysMessage(character, "You must be near a forge to smelt gold.");
		return;
	endif

	if (!YesNo(character,"Melt coins?"))
		SendSysMessage(character, "Canceled.");
		return;
	endif

	if (CheckSkill( character, SKILLID_BLACKSMITHY, 40,  modify_points(character, SKILLID_BLACKSMITHY, 0) ))
		var theamount;
		if (gold.amount < 100)
			SendSysMessage(character, "It doesn't look like you have enough gold");
			return;
		else
			theamount := CInt(gold.amount /100);
		endif

		var ingots := SafeCreateInContainer( character.backpack, UOBJ_GOLD_INGOT, theamount );

			if( character.cmdlevel < 3  )
				SetObjProperty(ingots,"hidden_fresh",1);
			endif
			if (character.cmdlevel>2)
                        SetObjProperty( ingots, "GMcrafted", character.acctname );
                        SetObjProperty( ingots, "Createdby", character.acctname );
			endif

		if (!ingots)
			PrintTextAbovePrivate(character, "*Your backpack is full!*", character);
			return;
		endif
		SubtractAmount( gold, CInt(theamount*100) );
		SendSysMessage( character, "You create some gold ingots and place them in your pack." );
	else
		SubtractAmount( gold, RandomInt(30) + 3 );
		SendSysMessage( character, "You destroy some material." );
	endif

endfunction

function SafeCreateInContainer(cont,objtype,amt)
        var theitem := CreateItemAtLocation( 1, 1,-50,objtype, amt );
        var succ := MoveItemToContainer(theitem,cont);
        if( !succ || !theitem )
            DestroyItem(theitem);
            return 0;
        endif
        return theitem;
endfunction

function CheckStack(item,cont)
        var proparray1,proparray2, array1, array2,same;
        foreach object in EnumerateItemsInContainer(cont)
            if(object.objtype == item.objtype && object.serial != item.serial)
                same := 1;
                proparray1 := GetObjPropertyNames(item);
                foreach prop in proparray1
                    array1.append(prop,GetObjProperty(item,prop));
                endforeach
                proparray2 := GetObjPropertyNames(object);
                foreach prop in proparray2
                    array2.append(prop,GetObjProperty(object,prop));
                endforeach
                if( len(proparray1) != len(proparray2) )
                    same := 0;
                endif
                foreach prop in proparray1
                    if(array1[prop] != array2[prop])
                        same := 0;
                    endif
                endforeach
                foreach prop in proparray2
                    if(array1[prop] != array2[prop])
                        same := 0;
                    endif
                endforeach
                if(same)
                    var amt := item.amount;
                    if( !DestroyItem(item) )
                        return 0;
                    endif
                    AddAmount(object,amt);
                    return 1;
                endif
            endif
        endforeach
        return 1;  
endfunction
Ingots.cfg

Code: Select all

#Special Defs:
#newColour $420$ - Makes item same colour as ingots.
#reqProp testProp - Makes ingot require usage of a smithy tool with CProp "testProp" set to true.
#reqEnch testEnch - Makes ingot require usage of a smithy tool with enchantment "testEnch".
#noSkillSub 1 - If the easier smithing for higher smiths is enabled, this disables it for the specific ingot (Radlius, Scarletite).
#
#Notes:
#MinSkill	-Minimum skill to use this ingot
#bonusSkill	-Extra skill requirement added to items default (Decimals!)
#newColour	-Colour of new item
#bonusPoints	-Added to the points the char gets for crafting the item
#bonusHp	-Amount of extra HP for an item with this ore
#prefix		-Prefix to name
#suffix		-suffix to name
#enchantments	-Sea sReadme.txt

//Dull Copper
ingot 0x6550
{
	MinSkill	0
	bonusSkill	75
	newColour	0x03EA
	bonusPoints	50
	bonusHp		0
	prefix		dull copper
	suffix		
	enchantments	DullCopperIngot
	damageMod	0
	armourMod	0
}

//Copper
ingot 0x6551
{
	MinSkill	10
	bonusSkill	80
	newColour	0x0602
	bonusPoints	60
	bonusHp		0
	prefix		copper
	suffix		
	enchantments	CopperIngot
	damageMod	0
	armourMod	0
}

//Bronze
ingot 0x6552
{
	MinSkill	20
	bonusSkill	82
	newColour	0x045E
	bonusPoints	70
	bonusHp		0
	prefix		bronze
	suffix		
	enchantments	BronzeIngot
	damageMod	0
	armourMod	0
}

//Iron
ingot 0x6553
{
	MinSkill	30
	bonusSkill	84
	newColour	0x0
	bonusPoints	80
	bonusHp		0
	prefix		iron
	suffix		
	enchantments	IronIngot
	damageMod	0
	armourMod	0
}

//Verite
ingot 0x6554
{
	MinSkill	35
	bonusSkill	81
	newColour	0x07D1
	bonusPoints	90
	bonusHp		0
	prefix		verite
	suffix		
	enchantments	VeriteIngot
	damageMod	1
	armourMod	0
}

//Syntian
ingot 0x6555
{
	MinSkill	40
	bonusSkill	85
	newColour	0x031C
	bonusPoints	100
	bonusHp		0
	prefix		syntian
	suffix		
	enchantments	SyntianIngot
	damageMod	0
	armourMod	1
}

//Azurite
ingot 0x6556
{
	MinSkill	45
	bonusSkill	90
	newColour	0x4DF
	bonusPoints	105
	bonusHp		0
	prefix		azurite
	suffix		
	enchantments	AzuriteIngot
	damageMod	1
	armourMod	1
}

//Executor
ingot 0x6557
{
	MinSkill	45
	bonusSkill	90
	newColour	0x0345
	bonusPoints	105
	bonusHp		0
	prefix		executor
	suffix		
	enchantments	ExecutorIngot
	damageMod	2
	armourMod	0
}

//Radlius
ingot 0x6558
{
	MinSkill	45
	bonusSkill	90
	newColour	0x0173
	bonusPoints	105
	bonusHp		0
	prefix		radlius
	suffix		
	enchantments	RadliusIngot
	damageMod	0
	armourMod	2
}

//Aughlite
ingot 0x6559
{
	MinSkill	50
	bonusSkill	90
	newColour	0x0281
	bonusPoints	108
	bonusHp		0
	prefix		aughlite
	suffix		
	enchantments	AughliteIngot
	damageMod	1
	armourMod	2
}

//Spirit Stone
ingot 0x655A
{
	MinSkill	55
	bonusSkill	91
	newColour	0x07A1
	bonusPoints	110
	bonusHp		0
	prefix		spirit stone
	suffix		
	enchantments	SpiritStoneIngot
	damageMod	1
	armourMod	3
}

//Devils Claw
ingot 0x655B
{
	MinSkill	60
	bonusSkill	92
	newColour	0x01B8
	bonusPoints	113
	bonusHp		0
	prefix		devils claw
	suffix		
	enchantments	DevilsClawIngot
	damageMod	3
	armourMod	1
}

//Shadow
ingot 0x655C
{
	MinSkill	65
	bonusSkill	93
	newColour	0x0770
	bonusPoints	114
	bonusHp		0
	prefix		shadow
	suffix		
	enchantments	ShadowIngot
	damageMod	2
	armourMod	4
}

//Gloom
ingot 0x655D
{
	MinSkill	70
	bonusSkill	94
	newColour	0x02F0
	bonusPoints	115
	bonusHp		0
	prefix		gloom
	suffix		
	enchantments	GloomIngot
	damageMod	2
	armourMod	4
}

//Devils Tooth
ingot 0x655E
{
	MinSkill	74
	bonusSkill	95
	newColour	0x0029
	bonusPoints	116
	bonusHp		0
	prefix		devils tooth
	suffix		
	enchantments	DevilsToothIngot
	damageMod	3
	armourMod	2
}

//Pyrite
ingot 0x655F
{
	MinSkill	78
	bonusSkill	96
	newColour	0x6B8
	bonusPoints	117
	bonusHp		0
	prefix		pyrite
	suffix		
	enchantments	PyriteIngot
	damageMod	3
	armourMod	2
}

//Agapite
ingot 0x6560
{
	MinSkill	82
	bonusSkill	97
	newColour	0x03EC
	bonusPoints	118
	bonusHp		0
	prefix		agapite
	suffix		
	enchantments	AgapiteIngot
	damageMod	3
	armourMod	6
}

//Malachite
ingot 0x6561
{
	MinSkill	85
	bonusSkill	98
	newColour	0x852
	bonusPoints	119
	bonusHp		0
	prefix		malachite
	suffix		
	enchantments	MalachiteIngot
	damageMod	3
	armourMod	6
}

//Kryztal
ingot 0x6562
{
	MinSkill	85
	bonusSkill	99
	newColour	0x07FE
	bonusPoints	120
	bonusHp		0
	prefix		kryztal
	suffix		
	enchantments	KryztalIngot
	damageMod	6
	armourMod	0
}

//Gold
ingot 0x6563
{
	MinSkill	87
	bonusSkill	99
	newColour	0x07CC
	bonusPoints	110
	bonusHp		0
	prefix		golden
	suffix		
	enchantments	GoldIngot
	damageMod	3
	armourMod	6
}

//Velvite
ingot 0x6564
{
	MinSkill	90
	bonusSkill	100
	newColour	0x078C
	bonusPoints	122
	bonusHp		0
	prefix		velvite
	suffix		
	enchantments	DaemonspineIngot
	damageMod	4
	armourMod	8
}

//Snograz
ingot 0x6565
{
	MinSkill	90
	bonusSkill	100
	newColour	2444
	bonusPoints	122
	bonusHp		0
	prefix		noxious
	suffix		
	enchantments	SnograzIngot
	damageMod	7
	armourMod	0
}

//Valorite
ingot 0x6566
{
	MinSkill	92
	bonusSkill	100
	newColour	0x0539
	bonusPoints	124
	bonusHp		0
	prefix		valorite
	suffix		
	enchantments	ValoriteIngot
	damageMod	3
	armourMod	9
}

//Fatigue
ingot 0x6567
{
	MinSkill	94
	bonusSkill	101
	newColour	0x026D
	bonusPoints	126
	bonusHp		0
	prefix		fatigue
	suffix		
	enchantments	FatigueIngot
	damageMod	4
	armourMod	9
}

//Wraiths Bone
ingot 0x6568
{
	MinSkill	96
	bonusSkill	102
	newColour	0x0810
	bonusPoints	128
	bonusHp		0
	prefix		wraiths bone
	suffix		
	enchantments	WraithsBoneIngot
	damageMod	6
	armourMod	8
}

//Scarletite
ingot 0x6569
{
	MinSkill	98
	bonusSkill	103
	newColour	2097
	bonusPoints	128
	bonusHp		0
	prefix		scarletite
	suffix		
	enchantments	ScarletiteIngot
	damageMod	3
	armourMod	10
}

//Onyx
ingot 0x656A
{
	MinSkill	99
	bonusSkill	105
	newColour	0x0455
	bonusPoints	130
	bonusHp		0
	prefix		onyx
	suffix		
	enchantments	OnyxIngot
	damageMod	10
	armourMod	5
}

//Solar
ingot 0x657B
{
	MinSkill	80
	bonusSkill	97
	newColour	0x0038
	bonusPoints	117
	bonusHp		0
	prefix		solar
	suffix		
	enchantments	SolarIngot
	damageMod	5
	armourMod	0
}

//Startear
ingot 0x657C
{
	MinSkill	90
	bonusSkill	100
	newColour	0x0800
	bonusPoints	119
	bonusHp		0
	prefix		startear
	suffix		
	enchantments	StartearIngot
	damageMod	6
	armourMod	0
}

//Silver
ingot 0x657D
{
	MinSkill	63
	bonusSkill	92
	newColour	0x0482
	bonusPoints	113
	bonusHp		0
	prefix		silver
	suffix		
	enchantments	SilverIngot
	damageMod	1
	armourMod	4
}

//Lunar
ingot 0x657E
{
	MinSkill	70
	bonusSkill	94
	newColour	2045
	bonusPoints	115
	bonusHp		0
	prefix		lunar
	suffix		
	enchantments	LunarIngot
	damageMod	5
	armourMod	0
}

//Royal
ingot 0x657F
{
	MinSkill	88
	bonusSkill	99
	newColour	2457
	bonusPoints	118
	bonusHp		0
	prefix		royal
	suffix		
	enchantments	RoyalIngot
	damageMod	5
	armourMod	7
}

///////////////////////
/////SPECIAL ORES//////
///////////////////////

//Daemon's Fear [SPECIAL]
ingot 0x656C
{
	MinSkill	90
	bonusSkill	110
	newColour	0x07E5
	bonusPoints	130
	bonusHp		0
	prefix		daemon's fear
	suffix		
	enchantments	DaemonsFearIngot
	damageMod	10
	armourMod	8
}

//Daemon Rock [SPECIAL]
ingot 0x656D
{
	MinSkill	95
	bonusSkill	110
	newColour	0x0799
	bonusPoints	130
	bonusHp		0
	prefix		daemon rock
	suffix		
	enchantments	DaemonRockIngot
	damageMod	9
	armourMod	15
}


///////////////////////
///////////////////////
////Specialist Ores////
///////////////////////
///////////////////////

//Lhiolite [Dwarven]
ingot 0x656F
{
	MinSkill	80
	bonusSkill	100
	newColour	0x07AB
	bonusPoints	150
	bonusHp		0
	prefix		lhiolite
	suffix		
	enchantments	LhioliteIngot
	damageMod	3
	armourMod	7
}

//Gredstinuel [Dwarven]
ingot 0x6570
{
	MinSkill	80
	bonusSkill	100
	newColour	0x0780
	bonusPoints	150
	bonusHp		0
	prefix		gredstinuel
	suffix		
	enchantments	GredstinuelIngot
	damageMod	4
	armourMod	7
}

//Dwarven Olupius [Dwarven]
ingot 0x6571
{
	MinSkill	85
	bonusSkill	100
	newColour	0x07C9
	bonusPoints	150
	bonusHp		0
	prefix		glacial
	suffix		
	enchantments	DwarvenOlupiusIngot
	damageMod	5
	armourMod	9
}

//Tekrhan [Dwarven]
ingot 0x6572
{
	MinSkill	88
	bonusSkill	100
	newColour	2969
	bonusPoints	150
	bonusHp		0
	prefix		tekrhan
	suffix		
	enchantments	TekrhanIngot
	damageMod	8
	armourMod	5
}

//Hekhranish [Dwarven]
ingot 0x6573
{
	MinSkill	90
	bonusSkill	100
	newColour	1939
	bonusPoints	150
	bonusHp		0
	prefix		hekhranish
	suffix		
	enchantments	HekhranishIngot
	damageMod	4
	armourMod	7
}

//Dwarfish Orkanian [Dwarven]
ingot 0x6574
{
	MinSkill	77
	bonusSkill	100
	newColour	0x080D
	bonusPoints	150
	bonusHp		0
	prefix		dwarfish orkanian
	suffix		
	enchantments	DwarfishOrkanianIngot
	damageMod	5
	armourMod	2
}

//Aorkrhan [Dwarven]
ingot 0x6575
{
	MinSkill	98
	bonusSkill	100
	newColour	0x0794
	bonusPoints	150
	bonusHp		0
	prefix		aorkrhan
	suffix		
	enchantments	AorkrhanIngot
	damageMod	8
	armourMod	6
}

//Auropian [Dwarven]
ingot 0x6576
{
	MinSkill	99
	bonusSkill	100
	newColour	2796
	bonusPoints	150
	bonusHp		0
	prefix		auropian
	suffix		
	enchantments	AuropianIngot
	damageMod	5
	armourMod	13
}

//////////////////
//Radlius Series//
//////////////////

//Shalrius [Radlius]
ingot 0x6577
{
	MinSkill	63
	bonusSkill	50
	newColour	2962
	bonusPoints	108
	bonusHp		0
	prefix		shalrius
	suffix		
	enchantments	ShalriusIngot
	damageMod	4
	armourMod	5
}

//Ghuronius [Radlius]
ingot 0x6578
{
	MinSkill	94
	bonusSkill	50
	newColour	2963
	bonusPoints	130
	bonusHp		0
	prefix		ghuronius
	suffix		
	enchantments	GhuroniusIngot
	damageMod	8
	armourMod	10
}

//Keltrunius [Radlius]
ingot 0x6579
{
	MinSkill	97
	bonusSkill	50
	newColour	2959
	bonusPoints	120
	bonusHp		0
	prefix		keltrunius
	suffix		
	enchantments	KeltruniusIngot
	damageMod	9
	armourMod	13
}

/////////////
//Gargoyles//
/////////////

//Atrintium [Gargoyles]
ingot 0x657A
{
	MinSkill	57
	bonusSkill	100
	newColour	2961
	bonusPoints	100
	bonusHp		0
	prefix		atrintium
	suffix		
	enchantments	AtrintiumIngot
	damageMod	3
	armourMod	5
}

ingot 0xf57
{
	MinSkill	98
	bonusSkill	100
	newColour	2592
	bonusPoints	100
	bonusHp		250
	prefix		empyrean
	suffix		
	enchantments	EmpyreanIngot
	damageMod	8
	armourMod	15
}

ingot 0xf58
{
	MinSkill	70
	bonusSkill	110
	newColour	2794
	bonusPoints	100
	bonusHp		0
	prefix		electrical
	suffix		
	enchantments	ElectricalIngot
	damageMod	3
	armourMod	0
}

ingot 0xf59
{
	MinSkill	90
	bonusSkill	110
	newColour	2797
	bonusPoints	100
	bonusHp		0
	prefix		magnetic
	suffix		
	enchantments	MagneticIngot
	damageMod	8
	armourMod	0
}

ingot 0xf5a
{
	MinSkill	90
	bonusSkill	110
	newColour	2083
	bonusPoints	100
	bonusHp		0
	prefix		molten
	suffix		
	enchantments	MoltenIngot
	damageMod	8
	armourMod	0
}

ingot 0x656b
{
	MinSkill	70
	bonusSkill	100
	newColour	0x7EC
	bonusPoints	100
	bonusHp		0
	prefix		coral
	suffix		
	enchantments	StartearIngot
	damageMod	3
	armourMod	0
}

ingot 0x656E
{
	MinSkill	70
	bonusSkill	100
	newColour	0x079C
	bonusPoints	100
	bonusHp		0
	prefix		volcanic
	suffix		
	enchantments	VolcanicIngot
	damageMod	3
	armourMod	0
}

ingot 0xF5B
{
	MinSkill	85
	bonusSkill	100
	newColour	2730
	bonusPoints	150
	bonusHp		0
	prefix		winterite
	suffix		
	enchantments	WinteriteIngot
	damageMod	3
	armourMod	8
}

ingot 0x6580
{
	MinSkill	80
	bonusSkill	105
	newColour	2065
	bonusPoints	128
	bonusHp		0
	prefix		rosesteel
	suffix		
	enchantments	RosesteelIngot
	damageMod	4
	armourMod	7
}

ingot 0x658A
{
	MinSkill	90
	bonusSkill	110
	newColour	1645
	bonusPoints	128
	bonusHp		0
	prefix		crimsonite
	suffix		
	enchantments	CrimsoniteIngot
	damageMod	5
	armourMod	8
}

ingot 0x64F7
{
	MinSkill	98
	bonusSkill	110
	newColour	2053
	bonusPoints	128
	bonusHp		0
	prefix		mythril
	suffix		
	enchantments	MythrilIngot
	damageMod	5
	armourMod	15
}

ingot 0x64F9
{
	MinSkill	100
	bonusSkill	110
	newColour	2975
	bonusPoints	128
	bonusHp		0
	prefix		adamantium
	suffix		
	enchantments	DaemonSpineIngot
	damageMod	7
	armourMod	18
}

ingot 0xfffd
{
	MinSkill	98
	bonusSkill	110
	newColour	2445
	bonusPoints	128
	bonusHp		10
	prefix		phoenix
	suffix		
	enchantments	PhoenixIngot
	damageMod	10
	armourMod	20
}
User avatar
CWO
POL Expert
Posts: 1158
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: Getting my Items to work now..

Post by CWO »

UOBJ_PHOENIX_ORE: SmeltOre( character, ore, UOBJ_PHOENIX_INGOT, 90, 1450; <--- Just before the ; close the parentheses...
Breg
New User
Posts: 27
Joined: Sat Dec 09, 2006 11:58 am

Re: Getting my Items to work now..

Post by Breg »

Yep figures it'd be a tiny error like that... I need to get my eyes checked.. Thanks script compiled 100% and It works perfectly, next project it clerical rites and religions.. yippe...
Post Reply