Skip to content
Browse files

1/31/2010 - Xuri (0.98-4.0e)

	Added DEF values to standard clothing, footwear and headwear
	Minor fix to JS/COMMANDS/TARGETING/add.js which ensures that the script won't break under some very specific circumstances
	System-message rapporting how many ingots player gets when smelting player-made items should now rapport correct amount
	Made GetScriptItemSettings look for "x" instead of "0x" in harditems.dfn, fixes some stacking issues with ingots
	Corrected IDs for gold coins and kindling in harditems.dfn by removing leading 0s in the IDs
	Crafting system can now handle MAXRANK values up to 255
  • Loading branch information...
1 parent c97de43 commit f7ee62e6bc4212c971b6d9a0de19b08f5b10c007 xuridabur committed Jan 31, 2010
View
4 dfns/harditems/harditems.dfn
@@ -35,7 +35,7 @@ type=232
}
//Kindling
-[0x0de1]
+[0xde1]
{
pileable=1
decay=1
@@ -44,7 +44,7 @@ value=0,1
}
//Gold
-[x0eed]
+[xeed]
{
pileable=1
decay=1
View
12 js/commands/targeting/add.js
@@ -106,12 +106,14 @@ function onCallback1( socket, ourObj )
newItem.SetLocation( x, y, z );
}
if( newItem )
+ {
newItem.decayable = false;
- if( newItem.id != itemID )
- { //If itemid of newly created item differs from specified id, delete item - it's a default one only
- mChar.SysMessage( "Specified item-ID does not exist." );
- mChar.SysMessage( "Hex: 0x"+itemID.toString(16)+ " Dec: " + itemID );
- newItem.Delete();
+ if( newItem.id != itemID )
+ { //If itemid of newly created item differs from specified id, delete item - it's a default one only
+ mChar.SysMessage( "Specified item-ID does not exist." );
+ mChar.SysMessage( "Hex: 0x"+itemID.toString(16)+ " Dec: " + itemID );
+ newItem.Delete();
+ }
}
}
}
View
8 source/Changelog.txt
@@ -1,3 +1,11 @@
+1/31/2010 - Xuri (0.98-4.0e)
+ Added DEF values to standard clothing, footwear and headwear
+ Minor fix to JS/COMMANDS/TARGETING/add.js which ensures that the script won't break under some very specific circumstances
+ System-message rapporting how many ingots player gets when smelting player-made items should now rapport correct amount
+ Made GetScriptItemSettings look for "x" instead of "0x" in harditems.dfn, fixes some stacking issues with ingots
+ Corrected IDs for gold coins and kindling in harditems.dfn by removing leading 0s in the IDs
+ Crafting system can now handle MAXRANK values up to 255
+
1/30/2010 - Xuri
Fixed an issue with sword.js which stopped you from carving shafts/kindling from a single wooden log
Re-ordered IDs listed under METAL in DFNDATA/CREATE/resources.dfn to make UOX3 give same ingot-types when smelting
View
7 source/UOXJSMethods.cpp
@@ -3776,15 +3776,16 @@ JSBool CItem_Refresh( JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
//o--------------------------------------------------------------------------o
JSBool CItem_ApplyRank( JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval )
{
- if( argc != 1 )
+ if( argc != 2 )
{
- MethodError( "ApplyRank: Invalid number of arguments (takes 1)" );
+ MethodError( "ApplyRank: Invalid number of arguments (takes 2)" );
return JS_FALSE;
}
CItem *myItem = (CItem *)JS_GetPrivate( cx, obj );
int rank = JSVAL_TO_INT( argv[0] );
+ int maxrank = JSVAL_TO_INT( argv[1] );
- Skills->ApplyRank( NULL, myItem, rank );
+ Skills->ApplyRank( NULL, myItem, rank, maxrank );
return JS_TRUE;
}
View
2 source/UOXJSMethods.h
@@ -394,7 +394,7 @@ static JSFunctionSpec CItem_Methods[] =
{ "SetCont", CItem_SetCont, 1, 0, 0 },
{ "ApplySection", CBase_ApplySection, 1, 0, 0 },
{ "Refresh", CItem_Refresh, 0, 0, 0 },
- { "ApplyRank", CItem_ApplyRank, 1, 0, 0 },
+ { "ApplyRank", CItem_ApplyRank, 2, 0, 0 },
{ "FirstItem", CBase_FirstItem, 0, 0, 0 },
{ "NextItem", CBase_NextItem, 0, 0, 0 },
{ "FinishedItems", CBase_FinishedItems, 0, 0, 0 },
View
2 source/cVersionClass.cpp
@@ -21,7 +21,7 @@ namespace UOX
// product info
//o---------------------------------------------------------------------------o
const std::string VER = "0.98-4";
-const std::string BUILD = "0d";
+const std::string BUILD = "0e";
const std::string REALBUILD = "0";
const std::string SVER = "2.0";
const std::string CVER = "2.0";
View
3 source/effect.cpp
@@ -293,7 +293,8 @@ void cEffects::HandleMakeItemEffect( CTEffect *tMake )
{
targItem->SetName2( targItem->GetName().c_str() );
SI32 rank = Skills->CalcRankAvg( src, (*toMake) );
- Skills->ApplyRank( sock, targItem, static_cast<UI08>(rank) );
+ SI32 maxrank = toMake->maxRank;
+ Skills->ApplyRank( sock, targItem, static_cast<UI08>(rank), static_cast<UI08>(maxrank) );
// if we're not a GM, see if we should store our creator
if( !src->IsGM() && toMake->skillReqs.size() > 0 )
View
2 source/items.cpp
@@ -475,7 +475,7 @@ CItem * cItem::CreateBaseScriptItem( UString ourItem, const UI08 worldNum, const
//o--------------------------------------------------------------------------o
void cItem::GetScriptItemSettings( CItem *iCreated )
{
- const UString item = "0x" + UString::number( iCreated->GetID(), 16 );
+ const UString item = "x" + UString::number( iCreated->GetID(), 16 );
ScriptSection *toFind = FileLookup->FindEntrySubStr( item, hard_items_def );
if( toFind != NULL )
ApplyItemSection( iCreated, toFind );
View
20 source/skills.cpp
@@ -71,21 +71,22 @@ SI32 cSkills::CalcRankAvg( CChar *player, createEntry& skillMake )
}
//o---------------------------------------------------------------------------o
-//| Function : void cSkills::ApplyRank( CSocket *s, CItem *c, UI08 rank )
+//| Function : void cSkills::ApplyRank( CSocket *s, CItem *c, UI08 rank, UI08 maxrank )
//| Date : 24 August 1999
//| Programmer : Magius(CHE)
//o---------------------------------------------------------------------------o
//| Purpose : Modify variables based on item's rank.
//o---------------------------------------------------------------------------o
-void cSkills::ApplyRank( CSocket *s, CItem *c, UI08 rank )
+void cSkills::ApplyRank( CSocket *s, CItem *c, UI08 rank, UI08 maxrank )
{
char tmpmsg[512];
*tmpmsg='\0';
-
+
if( cwmWorldState->ServerData()->RankSystemStatus() )
{
c->SetRank( rank );
+
if( c->GetLoDamage() > 0 )
c->SetLoDamage( (SI16)( ( rank * c->GetLoDamage() ) / 10 ) );
if( c->GetHiDamage() > 0 )
@@ -98,13 +99,18 @@ void cSkills::ApplyRank( CSocket *s, CItem *c, UI08 rank )
c->SetMaxHP( (SI16)( ( rank * c->GetMaxHP() ) / 10 ) );
if( c->GetBuyValue() > 0 )
c->SetBuyValue( (UI32)( ( rank * c->GetBuyValue() ) / 10 ) );
-
- if( rank <= 10 )
- s->sysmessage( 783 + rank );
+
+ // Convert item's rank to a value between 1 and 10, to fit rank system messages
+ UI08 tempRank = floor((( rank * 100 ) / maxrank ) / 10 );
+
+ if( tempRank >= 1 && tempRank <= 10 )
+ s->sysmessage( 783 + tempRank );
+ else if( tempRank < 1 )
+ s->sysmessage( 784 );
+
}
else
c->SetRank( rank );
-
}
//o---------------------------------------------------------------------------o
View
2 source/skills.h
@@ -159,7 +159,7 @@ class cSkills
void NewMakeMenu( CSocket *s, int menu, UI08 skill );
createEntry *FindItem( UI16 itemNum );
void MakeItem( createEntry &toMake, CChar *player, CSocket *sock, UI16 itemEntry );
- void ApplyRank( CSocket *s, CItem *c, UI08 rank );
+ void ApplyRank( CSocket *s, CItem *c, UI08 rank, UI08 maxrank );
void HandleMakeMenu( CSocket *s, int button, int menu );
void CreateTrackingMenu( CSocket *s, UI16 m );
View
4 source/targeting.cpp
@@ -1466,7 +1466,7 @@ void SmeltTarget( CSocket *s )
Skills->CheckSkill( mChar, MINING, (SI16)avgMin, (SI16)avgMax );
- R32 sumAmountRestored = 0.0f;
+ UI08 sumAmountRestored = 0;
for( UI32 skCtr = 0; skCtr < ourCreateEntry->resourceNeeded.size(); ++skCtr )
{
@@ -1476,7 +1476,7 @@ void SmeltTarget( CSocket *s )
sumAmountRestored += amtToRestore;
Items->CreateItem( s, mChar, itemID, amtToRestore, itemColour, OT_ITEM, true );
}
-
+
s->sysmessage( 1116, sumAmountRestored );
i->Delete();
}

0 comments on commit f7ee62e

Please sign in to comment.
Something went wrong with that request. Please try again.