From 3f5efab632343097a845c503d2ebadd2edaaf375 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Tue, 30 Apr 2024 23:29:39 -0500 Subject: [PATCH 001/147] Lower Requirements Propertie Added AOS Lower Requirement propertie. --- data/js/commands/targeting/get.js | 3 +++ data/js/commands/targeting/set.js | 4 ++++ source/CPacketSend.cpp | 11 ++++++++++- source/Changelog.txt | 3 +++ source/UOXJSPropertyEnums.h | 1 + source/UOXJSPropertyFuncs.cpp | 2 ++ source/UOXJSPropertySpecs.h | 1 + source/cBaseObject.cpp | 21 +++++++++++++++++++++ source/cBaseObject.h | 4 ++++ source/cItem.cpp | 7 +++++++ source/cPlayerAction.cpp | 3 ++- source/items.cpp | 4 +++- source/ssection.cpp | 2 ++ source/ssection.h | 1 + 14 files changed, 64 insertions(+), 3 deletions(-) diff --git a/data/js/commands/targeting/get.js b/data/js/commands/targeting/get.js index 365d3a2b3..2804da034 100644 --- a/data/js/commands/targeting/get.js +++ b/data/js/commands/targeting/get.js @@ -319,6 +319,9 @@ function HandleGetItem( socket, ourItem, uKey ) case "RESISTPOISON": socket.SysMessage( ourObj.Resist( 7 )); break; + case "LOWERSTATREQ": + socket.SysMessage( ourObj.lowerStatReq ); + break; case "ARMORCLASS": case "ARMOURCLASS": case "AC": diff --git a/data/js/commands/targeting/set.js b/data/js/commands/targeting/set.js index e9b4f3226..9abe4d36c 100644 --- a/data/js/commands/targeting/set.js +++ b/data/js/commands/targeting/set.js @@ -98,6 +98,10 @@ function onCallback0( socket, ourObj ) ourObj.Resist( 7, nVal ); okMsg( socket ); break; + case "LOWERSTATREQ": + ourItem.lowerStatReq = nVal; + okMsg( socket ); + break; case "HP": case "HEALTH": ourObj.health = nVal; diff --git a/source/CPacketSend.cpp b/source/CPacketSend.cpp index e1d8ee4ca..5684336e0 100644 --- a/source/CPacketSend.cpp +++ b/source/CPacketSend.cpp @@ -7657,12 +7657,21 @@ void CPToolTip::CopyItemData( CItem& cItem, size_t &totalStringLen, bool addAmou FinalizeData( tempEntry, totalStringLen ); } - if( cItem.GetStrength() > 1 ) + const SI16 strReq = (cItem.GetStrength() * (100 - cItem.GetLowerStatReq())) / 100; + + if( strReq > 0 ) { tempEntry.stringNum = 1061170; // strength requirement ~1_val~ tempEntry.ourText = oldstrutil::number( cItem.GetStrength() ); FinalizeData( tempEntry, totalStringLen ); } + + if( cItem.GetLowerStatReq() > 0 ) + { + tempEntry.stringNum = 1060435; // lower requirements ~1_val~% + tempEntry.ourText = oldstrutil::number( cItem.GetLowerStatReq() ); + FinalizeData( tempEntry, totalStringLen ); + } } } diff --git a/source/Changelog.txt b/source/Changelog.txt index 1d779c15f..35333948e 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,6 @@ +30/04/2024 - Dragon Slayer/Xuri/Maarc + Added AOS Lower Requirement propertie. + 27/04/2024 - Dragon Slayer/Xuri Fixed an issue where non-corpse containers - including treasure chests in dungeons - would decay and leave all their contents on the ground. Converted LOOTDECAYSWITHCORPSE ini setting to two new settings, one for player corpses, one for NPC corpses: diff --git a/source/UOXJSPropertyEnums.h b/source/UOXJSPropertyEnums.h index af309d496..e4019b194 100644 --- a/source/UOXJSPropertyEnums.h +++ b/source/UOXJSPropertyEnums.h @@ -445,6 +445,7 @@ enum CI_Properties CIP_DECAYTIME, CIP_LODAMAGE, CIP_HIDAMAGE, + CIP_LOWERSTATREQ, CIP_AC, CIP_DEF, CIP_RESISTCOLD, diff --git a/source/UOXJSPropertyFuncs.cpp b/source/UOXJSPropertyFuncs.cpp index 3823356f9..734a6e32f 100644 --- a/source/UOXJSPropertyFuncs.cpp +++ b/source/UOXJSPropertyFuncs.cpp @@ -676,6 +676,7 @@ JSBool CItemProps_getProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGERAIN: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( RAIN )); break; case CIP_DAMAGESNOW: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( SNOW )); break; case CIP_SPEED: *vp = INT_TO_JSVAL( gPriv->GetSpeed() ); break; + case CIP_LOWERSTATREQ: *vp = INT_TO_JSVAL( gPriv->GetLowerStatReq() ); break; case CIP_NAME2: tString = JS_NewStringCopyZ( cx, gPriv->GetName2().c_str() ); *vp = STRING_TO_JSVAL( tString ); @@ -1321,6 +1322,7 @@ JSBool CItemProps_setProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGERAIN: gPriv->SetWeatherDamage( RAIN, encaps.toBool() ); break; case CIP_DAMAGESNOW: gPriv->SetWeatherDamage( SNOW, encaps.toBool() ); break; case CIP_SPEED: gPriv->SetSpeed( static_cast( encaps.toInt() )); break; + case CIP_LOWERSTATREQ: gPriv->SetLowerStatReq( static_cast( encaps.toInt() )); break; case CIP_NAME2: gPriv->SetName2( encaps.toString() ); break; case CIP_RACE: gPriv->SetRace( static_cast( encaps.toInt() )); break; case CIP_MAXHP: gPriv->SetMaxHP( static_cast( encaps.toInt() )); break; diff --git a/source/UOXJSPropertySpecs.h b/source/UOXJSPropertySpecs.h index 3149dc0ec..123111cdb 100644 --- a/source/UOXJSPropertySpecs.h +++ b/source/UOXJSPropertySpecs.h @@ -477,6 +477,7 @@ inline JSPropertySpec CItemProps[] = { "damagePoison", CIP_DAMAGEPOISON, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "damageRain", CIP_DAMAGERAIN, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "damageSnow", CIP_DAMAGESNOW, JSPROP_ENUMANDPERM, nullptr, nullptr }, + { "lowerStateReq", CIP_LOWERSTATREQ, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "name2", CIP_NAME2, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "isChar", CIP_ISCHAR, JSPROP_ENUMPERMRO, nullptr, nullptr }, { "isItem", CIP_ISITEM, JSPROP_ENUMPERMRO, nullptr, nullptr }, diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp index 506c247ac..82435c442 100644 --- a/source/cBaseObject.cpp +++ b/source/cBaseObject.cpp @@ -1036,6 +1036,27 @@ void CBaseObject::IncHP( SI16 amtToChange ) SetHP( hitpoints + amtToChange ); } +//o------------------------------------------------------------------------------------------------o +//| Function - CBaseObject::GetLowerStatReq() +//| CBaseObject::GetLowerStatReq() +//| Date - 30 April, 2024 +//o------------------------------------------------------------------------------------------------o +//| Purpose - Gets/Sets the Stat Requirements of the object +//o------------------------------------------------------------------------------------------------o +SI16 CBaseObject::GetLowerStatReq( void ) const +{ + return lowerStatReq; +} +void CBaseObject::SetLowerStatReq( SI16 newValue ) +{ + lowerStatReq = newValue; + + if( CanBeObjType( OT_ITEM )) + { + ( static_cast( this ))->UpdateRegion(); + } +} + //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject::GetDir() //| CBaseObject::SetDir() diff --git a/source/cBaseObject.h b/source/cBaseObject.h index 638e826f7..84c38ee70 100644 --- a/source/cBaseObject.h +++ b/source/cBaseObject.h @@ -69,6 +69,7 @@ class CBaseObject SI16 dexterity; SI16 intelligence; SI16 hitpoints; + SI16 lowerStatReq; VisibleTypes visible; SI16 hiDamage; SI16 loDamage; @@ -256,6 +257,9 @@ class CBaseObject void IncDexterity( SI16 toInc = 1 ); void IncIntelligence( SI16 toInc = 1 ); + virtual SI16 GetLowerStatReq( void ) const; + virtual void SetLowerStatReq( SI16 newValue ); + virtual void PostLoadProcessing( void ); virtual bool LoadRemnants( void ) = 0; diff --git a/source/cItem.cpp b/source/cItem.cpp index 3c6523d5d..4987e294e 100644 --- a/source/cItem.cpp +++ b/source/cItem.cpp @@ -1660,6 +1660,7 @@ auto CItem::CopyData( CItem *target ) -> void target->SetMaxRange( GetMaxRange() ); target->SetMaxUses( GetMaxUses() ); target->SetUsesLeft( GetUsesLeft() ); + target->SetLowerStatReq( GetLowerStatReq() ); target->SetStealable( GetStealable() ); // Set damage types on new item @@ -1739,6 +1740,7 @@ bool CItem::DumpBody( std::ostream &outStream ) const outStream << "Speed=" + std::to_string( GetSpeed() ) + newLine; outStream << "Movable=" + std::to_string( GetMovable() ) + newLine; outStream << "Priv=" + std::to_string( GetPriv() ) + newLine; + outStream << "LowerStatReq=" + std::to_string( GetLowerStatReq() ) + newLine; outStream << "Value=" + std::to_string( GetBuyValue() ) + "," + std::to_string( GetSellValue() ) + "," + std::to_string( GetVendorPrice() ) + newLine; outStream << "Restock=" + std::to_string( GetRestock() ) + newLine; outStream << "AC=" + std::to_string( GetArmourClass() ) + newLine; @@ -1922,6 +1924,11 @@ bool CItem::HandleLine( std::string &UTag, std::string &data ) SetWeatherDamage( LIGHTNING, static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )) == 1 ); rValue = true; } + if( UTag == "LOWERSTATREQ" ) + { + SetLowerStatReq( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 ))); + rValue = true; + } break; case 'M': if( UTag == "MAXITEMS" ) diff --git a/source/cPlayerAction.cpp b/source/cPlayerAction.cpp index d667a6598..63357d2aa 100644 --- a/source/cPlayerAction.cpp +++ b/source/cPlayerAction.cpp @@ -698,7 +698,8 @@ bool CPIEquipItem::Handle( void ) if( k == ourChar ) { bool canWear = false; - if( i->GetStrength() > k->GetStrength() ) + const SI16 scaledStrength = ( i->GetStrength() * ( 100 - i->GetLowerStatReq() )) / 100; + if( scaledStrength > k->GetStrength() ) { tSock->SysMessage( 1188 ); // You are not strong enough to use that. (NOTE: Should these messages use color 0x096a to stand out and replicate hard coded client message?) } diff --git a/source/items.cpp b/source/items.cpp index 1cd4a2aaf..c2be6ca94 100644 --- a/source/items.cpp +++ b/source/items.cpp @@ -356,6 +356,7 @@ auto ApplyItemSection( CItem *applyTo, CScriptSection *toApply, std::string sect case DFNTAG_LAYER: applyTo->SetLayer( static_cast( ndata )); break; case DFNTAG_LIGHT: applyTo->SetWeatherDamage( LIGHT, ndata != 0 ); break; case DFNTAG_LIGHTNING: applyTo->SetWeatherDamage( LIGHTNING, ndata != 0 ); break; + case DFNTAG_LOWERSTATREQ: applyTo->SetLowerStatReq( static_cast( ndata )); break; case DFNTAG_MAXHP: applyTo->SetMaxHP( static_cast( ndata )); break; case DFNTAG_MAXITEMS: applyTo->SetMaxItems( static_cast( ndata )); break; case DFNTAG_MAXRANGE: applyTo->SetMaxRange( static_cast( ndata )); break; @@ -1820,7 +1821,8 @@ void cItem::CheckEquipment( CChar *p ) { if( ValidateObject( i )) { - if( i->GetStrength() > StrengthToCompare )//if strength required > character's strength + const SI16 scaledStrength = ( i->GetStrength() * ( 100 - i->GetLowerStatReq() )) / 100; + if( scaledStrength > StrengthToCompare )//if strength required > character's strength { itemsToUnequip.push_back( i ); } diff --git a/source/ssection.cpp b/source/ssection.cpp index c2a563b47..21fe0b936 100644 --- a/source/ssection.cpp +++ b/source/ssection.cpp @@ -130,6 +130,7 @@ const UI08 dfnDataTypes[DFNTAG_COUNTOFTAGS] = DFN_NUMERIC, // DFNTAG_LAYER, DFN_NUMERIC, // DFNTAG_LIGHT, DFN_NUMERIC, // DFNTAG_LIGHTNING, + DFN_NUMERIC, // DFNTAG_LOWERSTATREQ, DFN_NUMERIC, // DFNTAG_LOCKPICKING, DFN_NUMERIC, // DFNTAG_LODAMAGE, DFN_UPPERSTRING, // DFNTAG_LOOT, @@ -389,6 +390,7 @@ const std::map strToDFNTag {"LAYER"s, DFNTAG_LAYER}, {"LIGHT"s, DFNTAG_LIGHT}, {"LIGHTNING"s, DFNTAG_LIGHTNING}, + {"LOWERSTATREQ"s, DFNTAG_LOWERSTATREQ}, {"LOCKPICKING"s, DFNTAG_LOCKPICKING}, {"LODAMAGE"s, DFNTAG_LODAMAGE}, {"LOOT"s, DFNTAG_LOOT}, diff --git a/source/ssection.h b/source/ssection.h index a2a660aec..f97d60cc0 100644 --- a/source/ssection.h +++ b/source/ssection.h @@ -137,6 +137,7 @@ enum DFNTAGS DFNTAG_LAYER, DFNTAG_LIGHT, DFNTAG_LIGHTNING, + DFNTAG_LOWERSTATREQ, DFNTAG_LOCKPICKING, DFNTAG_LODAMAGE, DFNTAG_LOOT, From fc5556d4d1e8be85651357f261f37bb85aed1480 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Tue, 30 Apr 2024 23:56:24 -0500 Subject: [PATCH 002/147] Update Changelog.txt --- source/Changelog.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/Changelog.txt b/source/Changelog.txt index 35333948e..09cb71bb8 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,5 +1,6 @@ 30/04/2024 - Dragon Slayer/Xuri/Maarc - Added AOS Lower Requirement propertie. + Added AOS Lower Requirement property. + -Lower Requirements - Lowers the strength requirements to wear an object. 27/04/2024 - Dragon Slayer/Xuri Fixed an issue where non-corpse containers - including treasure chests in dungeons - would decay and leave all their contents on the ground. From d3c58c9b1f7adf693978a636f6d5342ebc814b0f Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Tue, 30 Apr 2024 23:58:43 -0500 Subject: [PATCH 003/147] Update Changelog.txt --- source/Changelog.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Changelog.txt b/source/Changelog.txt index 09cb71bb8..0e31e1a75 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,6 +1,6 @@ 30/04/2024 - Dragon Slayer/Xuri/Maarc - Added AOS Lower Requirement property. - -Lower Requirements - Lowers the strength requirements to wear an object. + Added Support for new AOS property tag. + -LOWERSTATREQ - Lowers the strength requirements to wear an object. 27/04/2024 - Dragon Slayer/Xuri Fixed an issue where non-corpse containers - including treasure chests in dungeons - would decay and leave all their contents on the ground. From cf0e117bbd32c52f9f8c04ea423da9d345af9368 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 5 May 2024 13:37:36 -0500 Subject: [PATCH 004/147] Spawner Gump This gives spawners a gump to edit them, You do not have to use it but very nice if your not wanting to mess with a lot of set commands. --- data/dfndata/items/gmmenu/spawners.dfn | 1 + data/js/jse_fileassociations.scp | 1 + data/js/server/misc/spawnergump.js | 248 +++++++++++++++++++++++++ 3 files changed, 250 insertions(+) create mode 100644 data/js/server/misc/spawnergump.js diff --git a/data/dfndata/items/gmmenu/spawners.dfn b/data/dfndata/items/gmmenu/spawners.dfn index 342ebcb4f..46b622016 100644 --- a/data/dfndata/items/gmmenu/spawners.dfn +++ b/data/dfndata/items/gmmenu/spawners.dfn @@ -7,6 +7,7 @@ interval=1 5 visible=1 decay=0 movable=2 +script=2204 } [orcspawn] diff --git a/data/js/jse_fileassociations.scp b/data/js/jse_fileassociations.scp index 2cbb8e3d5..a2fd7630c 100644 --- a/data/js/jse_fileassociations.scp +++ b/data/js/jse_fileassociations.scp @@ -98,6 +98,7 @@ 2201=server/misc/hint_tooltip.js 2202=server/misc/warning_trigger.js 2203=server/misc/charges_left_tooltip.js +2204=server/misc/spawnergump.js // Server Data [2500-2749] 2500=server/data/weapontypes.js diff --git a/data/js/server/misc/spawnergump.js b/data/js/server/misc/spawnergump.js new file mode 100644 index 000000000..83f22e612 --- /dev/null +++ b/data/js/server/misc/spawnergump.js @@ -0,0 +1,248 @@ +function onUseChecked( pUser, iUsed ) +{ + var socket = pUser.socket; + socket.tempObj = iUsed; + var gumpID = 5037 + 0xffff; + + if( socket && iUsed && iUsed.isItem ) + { + socket.CloseGump( gumpID, 0 ); + spawnerGump( socket, pUser, iUsed ); + } + + return false; +} + +function spawnerGump( socket, pUser, iUsed ) +{ + var spawner = new Gump; + var powerState = ""; + var spawnName = ""; + if( iUsed.sectionalist == true ) + { + powerState = "Enabled"; + if( iUsed.type == 61 ) + { + spawnName = "Item List" + } + else + spawnName = "Npc List" + } + else + { + powerState = "Disabled"; + if( iUsed.type == 61 ) + { + spawnName = "Item" + } + else + spawnName = "Npc" + } + + var typeName = ""; + switch( iUsed.type ) + { + case 61: typeName = "Item"; break + case 62: typeName = "Npc"; break + case 125: typeName = "Escort"; break + } + + var amountLabel = ( iUsed.type != 61 ) ? "Amount" : "Spawn Item DFN"; + var applyLabel = "Apply"; + var minLabel = "Min:"; + var maxLabel = "Max:"; + + spawner.AddPage( 0 ); + + spawner.AddBackground( 40, 80, 413, 134, 5054 ); + spawner.AddCheckerTrans( 40, 80, 413, 134 ); + spawner.AddPicture( 50, 100, 7956 ); + + if( iUsed.type != 61 ) + { + spawner.AddHTMLGump( 310, 100, 178, 22, false, false, amountLabel ); + spawner.AddHTMLGump( 90, 100, 203, 22, false, false, "Spawn " + spawnName + " DFN" ); + + spawner.AddHTMLGump( 255, 155, 140, 22, false, false, "Rename" ); + + spawner.AddButton( 50, 180, 4005, 4007, 1, 0, 1 ); + spawner.AddHTMLGump( 90, 180, 140, 22, false, false, applyLabel ); + + spawner.AddHTMLGump( 80, 152, 140, 22, false, false, minLabel ); + spawner.AddHTMLGump( 160, 152, 140, 22, false, false, maxLabel ); + + spawner.AddCheckbox( 130, 180, 2152, 0, 1 ); + spawner.AddHTMLGump( 160, 185, 140, 22, false, false, "Spawnlist: " + powerState + "" ); + spawner.AddCheckbox( 300, 180, 2152, 0, 2 ); + spawner.AddHTMLGump( 330, 185, 140, 22, false, false, "Spawn Type: " + typeName + "" ); + spawner.AddBackground( 80, 120, 201, 28, 5120 ); + spawner.AddBackground( 305, 120, 134, 28, 5120 ); + spawner.AddBackground( 105, 150, 50, 25, 5120 ); + spawner.AddBackground( 190, 150, 50, 25, 5120 ); + spawner.AddBackground(305, 152, 134, 28, 5120); + + spawner.AddText( 90, 125, 0, iUsed.spawnsection ); + spawner.AddText( 315, 125, 0, iUsed.amount ); + spawner.AddText( 110, 155, 0, iUsed.mininterval ); + spawner.AddText( 195, 155, 0, iUsed.maxinterval ); + spawner.AddText(310, 152, 0, iUsed.name); + + spawner.AddTextEntry( 90, 125, 178, 20, 1153, 0, 8, iUsed.spawnsection ); + spawner.AddTextEntry( 315, 125, 115, 20, 1153, 0, 9, iUsed.amount ); + spawner.AddTextEntry( 110, 155, 40, 20, 1153, 0, 10, iUsed.mininterval ); + spawner.AddTextEntry( 195, 155, 40, 20, 1153, 0, 11, iUsed.maxinterval ); + spawner.AddTextEntry(310, 152, 140, 25, 1153, 0, 12, iUsed.name); + } + else + { + spawner.AddHTMLGump( 90, 100, 203, 22, false, false, "Spawn " + spawnName + " DFN" ); + spawner.AddHTMLGump( 255, 155, 140, 22, false, false, "Rename" ); + spawner.AddButton( 50, 180, 4005, 4007, 1, 0, 1 ); + spawner.AddHTMLGump( 90, 180, 140, 22, false, false, applyLabel ); + + spawner.AddHTMLGump( 80, 152, 140, 22, false, false, minLabel ); + spawner.AddHTMLGump( 160, 152, 140, 22, false, false, maxLabel ); + + spawner.AddCheckbox( 130, 180, 2152, 0, 1 ); + spawner.AddHTMLGump( 160, 185, 140, 22, false, false, "Spawnlist: " + powerState + "" ); + spawner.AddCheckbox( 300, 180, 2152, 0, 2 ); + spawner.AddHTMLGump( 330, 185, 140, 22, false, false, "Spawn Type: " + typeName + "" ); + + spawner.AddBackground( 80, 120, 201, 28, 5120 ); + spawner.AddBackground( 105, 150, 50, 25, 5120 ); + spawner.AddBackground( 190, 150, 50, 25, 5120 ); + spawner.AddBackground(305, 152, 134, 28, 5120); + + spawner.AddText( 90, 125, 0, iUsed.spawnsection ); + spawner.AddText( 110, 155, 0, iUsed.mininterval ); + spawner.AddText( 195, 155, 0, iUsed.maxinterval ); + spawner.AddText( 310, 152, 0, iUsed.name ); + + spawner.AddTextEntry( 90, 125, 178, 20, 1153, 0, 11, iUsed.spawnsection ); + spawner.AddTextEntry( 110, 155, 40, 20, 1153, 0, 13, iUsed.maxinterval ); + spawner.AddTextEntry( 195, 155, 40, 20, 1153, 0, 12, iUsed.mininterval ); + spawner.AddTextEntry( 310, 152, 140, 25, 1153, 0, 10, iUsed.name ); + + } + spawner.Send( socket ); + spawner.Free(); +} + +function onGumpPress( socket, pButton, gumpData ) +{ + var pUser = socket.currentChar; + var iUsed = socket.tempObj; + + var spawn = gumpData.getEdit( 0 ); + if( iUsed.type != 61 ) + { + var num = gumpData.getEdit( 1 ); + var min = gumpData.getEdit( 2 ); + var max = gumpData.getEdit( 3 ); + var name = gumpData.getEdit( 4 ); + } + else + { + var min = gumpData.getEdit( 1 ); + var max = gumpData.getEdit( 2 ); + var name = gumpData.getEdit( 3 ); + } + var OtherButton = gumpData.getButton( 0 ); + switch( pButton ) + { + case 0: + break; + case 1: + if( iUsed.type != 61 ) + { + iUsed.spawnsection = spawn; + iUsed.amount = num; + iUsed.mininterval = min; + iUsed.maxinterval = max; + } + else + { + iUsed.spawnsection = spawn; + iUsed.mininterval = min; + iUsed.maxinterval = max; + } + + if( name == null || name == " " ) + { + socket.SysMessage(GetDictionaryEntry(9270, socket.language)); // That name is too short, or no name was entered. + } + else if( name.length > 50 ) + { + pSocket.SysMessage(GetDictionaryEntry(9271, pSocket.language)); // That name is too long. Maximum 50 chars. + } + else + { + iUsed.name = name; + } + + switch( OtherButton ) + { + case 1: + if( iUsed.sectionalist == true ) + { + pUser.SysMessage( "You have disabled the spawn list. You can now add single NPCs." ); + iUsed.sectionalist = false; + } + else + { + pUser.SysMessage( "You have enabled the spawn list. It will now only accept NPC lists." ); + iUsed.sectionalist = true; + } + break; + case 2: + var typeTransitions = { + 61: { nextType: 62, message: "Changed Type to Npc", resetAmount: false }, + 62: { nextType: 125, message: "Changed Type to Escort", resetAmount: false }, + 125: { nextType: 61, message: "Changed Type to Item", resetAmount: true } + }; + + var currentTransition = typeTransitions[iUsed.type]; + if( currentTransition ) + { + iUsed.type = currentTransition.nextType; + if( currentTransition.resetAmount ) + { + iUsed.amount = 0; + } + pUser.SysMessage( currentTransition.message ); + } + break; + } + spawnerGump( socket, pUser, iUsed ); + break; + } +} + +function onTooltip( spawner ) +{ + var typeName = ""; + switch( spawner.type ) + { + case 61: typeName = "Item"; break + case 62: typeName = "Npc"; break + case 125: typeName = "Escort"; break + } + var powerState = ""; + if( spawner.sectionalist == true ) + { + powerState = "Enabled"; + } + else + { + powerState = "Disabled"; + } + + var tooltipText = ""; + tooltipText = "Spawn DFN: " + spawner.spawnsection; + tooltipText += "\n" + "Spawn Type: " + typeName; + tooltipText += "\n" + "Spawn List: " + powerState; + tooltipText += "\n" + "Amount: " + "" + spawner.amount + ""; + tooltipText += "\n" + "Min Interval: " + "" + spawner.mininterval + "" + " Max Interval: " + "" + spawner.maxinterval + ""; + tooltipText += "\n" + "Region: " + "" + spawner.region.name + ""; + return tooltipText; +} \ No newline at end of file From ade31480e36f251d22811705929565fbd5f24356 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 5 May 2024 13:39:58 -0500 Subject: [PATCH 005/147] Update Changelog.txt --- source/Changelog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/Changelog.txt b/source/Changelog.txt index 1d779c15f..662e7ac84 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,6 @@ +5/05/2024 - Dragon Slayer + Added Spawner Gump and attached to the base_spawner, just another option for making editing spawners without using commands. (js spawnergump) + 27/04/2024 - Dragon Slayer/Xuri Fixed an issue where non-corpse containers - including treasure chests in dungeons - would decay and leave all their contents on the ground. Converted LOOTDECAYSWITHCORPSE ini setting to two new settings, one for player corpses, one for NPC corpses: From 63a0eeca9ea675d801745a624acd16699479efd8 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 5 May 2024 15:50:36 -0500 Subject: [PATCH 006/147] Update Changelog.txt --- source/Changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/source/Changelog.txt b/source/Changelog.txt index 662e7ac84..adb63ea9e 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,5 +1,6 @@ 5/05/2024 - Dragon Slayer Added Spawner Gump and attached to the base_spawner, just another option for making editing spawners without using commands. (js spawnergump) + -Just double click any spawner you create from the addmenu or add from spawners.dfn file, gump will appear if you create a spawner with commands you would have to attach the script directly to it. 27/04/2024 - Dragon Slayer/Xuri Fixed an issue where non-corpse containers - including treasure chests in dungeons - would decay and leave all their contents on the ground. From 199ca5ae42e4ac6874e71d1f5c03294a9159440c Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 5 May 2024 17:01:18 -0500 Subject: [PATCH 007/147] Update spawnergump.js --- data/js/server/misc/spawnergump.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/js/server/misc/spawnergump.js b/data/js/server/misc/spawnergump.js index 83f22e612..9174ff9e7 100644 --- a/data/js/server/misc/spawnergump.js +++ b/data/js/server/misc/spawnergump.js @@ -185,12 +185,12 @@ function onGumpPress( socket, pButton, gumpData ) case 1: if( iUsed.sectionalist == true ) { - pUser.SysMessage( "You have disabled the spawn list. You can now add single NPCs." ); + pUser.SysMessage( "You have disabled the spawn list. You can now add single DFN." ); iUsed.sectionalist = false; } else { - pUser.SysMessage( "You have enabled the spawn list. It will now only accept NPC lists." ); + pUser.SysMessage( "You have enabled the spawn list. It will now only accept DFN lists." ); iUsed.sectionalist = true; } break; From 94156fe62d589b08d51cc8b890b6d8dd3e696913 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Thu, 9 May 2024 20:04:33 -0500 Subject: [PATCH 008/147] fixed small detail --- source/cItem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/cItem.cpp b/source/cItem.cpp index 4987e294e..816b95a44 100644 --- a/source/cItem.cpp +++ b/source/cItem.cpp @@ -1924,7 +1924,7 @@ bool CItem::HandleLine( std::string &UTag, std::string &data ) SetWeatherDamage( LIGHTNING, static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )) == 1 ); rValue = true; } - if( UTag == "LOWERSTATREQ" ) + else if( UTag == "LOWERSTATREQ" ) { SetLowerStatReq( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 ))); rValue = true; From 18b338bb795644b915db3278197b1fe6eeef6667 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 11 May 2024 20:17:11 -0500 Subject: [PATCH 009/147] Fixed cast --- source/UOXJSPropertyFuncs.cpp | 2 +- source/cItem.cpp | 2 +- source/items.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/UOXJSPropertyFuncs.cpp b/source/UOXJSPropertyFuncs.cpp index 734a6e32f..71b9860ef 100644 --- a/source/UOXJSPropertyFuncs.cpp +++ b/source/UOXJSPropertyFuncs.cpp @@ -1322,7 +1322,7 @@ JSBool CItemProps_setProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGERAIN: gPriv->SetWeatherDamage( RAIN, encaps.toBool() ); break; case CIP_DAMAGESNOW: gPriv->SetWeatherDamage( SNOW, encaps.toBool() ); break; case CIP_SPEED: gPriv->SetSpeed( static_cast( encaps.toInt() )); break; - case CIP_LOWERSTATREQ: gPriv->SetLowerStatReq( static_cast( encaps.toInt() )); break; + case CIP_LOWERSTATREQ: gPriv->SetLowerStatReq( static_cast( encaps.toInt() )); break; case CIP_NAME2: gPriv->SetName2( encaps.toString() ); break; case CIP_RACE: gPriv->SetRace( static_cast( encaps.toInt() )); break; case CIP_MAXHP: gPriv->SetMaxHP( static_cast( encaps.toInt() )); break; diff --git a/source/cItem.cpp b/source/cItem.cpp index 816b95a44..6f8eb1ca4 100644 --- a/source/cItem.cpp +++ b/source/cItem.cpp @@ -1926,7 +1926,7 @@ bool CItem::HandleLine( std::string &UTag, std::string &data ) } else if( UTag == "LOWERSTATREQ" ) { - SetLowerStatReq( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 ))); + SetLowerStatReq( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 ))); rValue = true; } break; diff --git a/source/items.cpp b/source/items.cpp index c2be6ca94..6cc3d7664 100644 --- a/source/items.cpp +++ b/source/items.cpp @@ -356,7 +356,7 @@ auto ApplyItemSection( CItem *applyTo, CScriptSection *toApply, std::string sect case DFNTAG_LAYER: applyTo->SetLayer( static_cast( ndata )); break; case DFNTAG_LIGHT: applyTo->SetWeatherDamage( LIGHT, ndata != 0 ); break; case DFNTAG_LIGHTNING: applyTo->SetWeatherDamage( LIGHTNING, ndata != 0 ); break; - case DFNTAG_LOWERSTATREQ: applyTo->SetLowerStatReq( static_cast( ndata )); break; + case DFNTAG_LOWERSTATREQ: applyTo->SetLowerStatReq( static_cast( ndata )); break; case DFNTAG_MAXHP: applyTo->SetMaxHP( static_cast( ndata )); break; case DFNTAG_MAXITEMS: applyTo->SetMaxItems( static_cast( ndata )); break; case DFNTAG_MAXRANGE: applyTo->SetMaxRange( static_cast( ndata )); break; From 2cec24c9891ec802e8259fefd4faab4074df993f Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 13 May 2024 19:01:20 -0500 Subject: [PATCH 010/147] Three New AOS properties --- source/CPacketSend.cpp | 21 ++++++++++++ source/Changelog.txt | 7 ++++ source/UOXJSPropertyEnums.h | 3 ++ source/UOXJSPropertyFuncs.cpp | 6 ++++ source/UOXJSPropertySpecs.h | 3 ++ source/cBaseObject.cpp | 63 +++++++++++++++++++++++++++++++++++ source/cBaseObject.h | 12 +++++++ source/cChar.cpp | 9 +++++ source/cItem.cpp | 21 ++++++++++++ source/items.cpp | 3 ++ source/ssection.cpp | 6 ++++ source/ssection.h | 3 ++ 12 files changed, 157 insertions(+) diff --git a/source/CPacketSend.cpp b/source/CPacketSend.cpp index e1d8ee4ca..dfcf7cd62 100644 --- a/source/CPacketSend.cpp +++ b/source/CPacketSend.cpp @@ -7657,6 +7657,27 @@ void CPToolTip::CopyItemData( CItem& cItem, size_t &totalStringLen, bool addAmou FinalizeData( tempEntry, totalStringLen ); } + if( cItem.GetBonusHits() > 0 ) + { + tempEntry.stringNum = 1060431; // hit point increase ~1_val~ + tempEntry.ourText = oldstrutil::number( cItem.GetBonusHits() ); + FinalizeData( tempEntry, totalStringLen ); + } + + if( cItem.GetBonusStam() > 0 ) + { + tempEntry.stringNum = 1060484; // stamina increase ~1_val~ + tempEntry.ourText = oldstrutil::number( cItem.GetBonusStam() ); + FinalizeData( tempEntry, totalStringLen ); + } + + if( cItem.GetBonusMana() > 0 ) + { + tempEntry.stringNum = 1060439; // mana increase ~1_val~ + tempEntry.ourText = oldstrutil::number( cItem.GetBonusMana() ); + FinalizeData( tempEntry, totalStringLen ); + } + if( cItem.GetStrength() > 1 ) { tempEntry.stringNum = 1061170; // strength requirement ~1_val~ diff --git a/source/Changelog.txt b/source/Changelog.txt index 1d779c15f..c695610cd 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,10 @@ +13/05/2024 - Dragon Slayer + Added three More AOS Props + -BONUSHITS=# + -BONUSMANA=# + -BONUSSTAM=# + Add this properties to any weapon/armor/jewlery will give the player more hp/mana/stam why its equiped. depending on number you add with it + 27/04/2024 - Dragon Slayer/Xuri Fixed an issue where non-corpse containers - including treasure chests in dungeons - would decay and leave all their contents on the ground. Converted LOOTDECAYSWITHCORPSE ini setting to two new settings, one for player corpses, one for NPC corpses: diff --git a/source/UOXJSPropertyEnums.h b/source/UOXJSPropertyEnums.h index af309d496..f7f187903 100644 --- a/source/UOXJSPropertyEnums.h +++ b/source/UOXJSPropertyEnums.h @@ -516,6 +516,9 @@ enum CI_Properties CIP_ISCONTTYPE, CIP_CARVESECTION, CIP_SPEED, + CIP_BONUSHITS, + CIP_BONUSSTAM, + CIP_BONUSMANA, CIP_MULTI, CIP_AMMOID, CIP_AMMOHUE, diff --git a/source/UOXJSPropertyFuncs.cpp b/source/UOXJSPropertyFuncs.cpp index 3823356f9..a492f112a 100644 --- a/source/UOXJSPropertyFuncs.cpp +++ b/source/UOXJSPropertyFuncs.cpp @@ -676,6 +676,9 @@ JSBool CItemProps_getProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGERAIN: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( RAIN )); break; case CIP_DAMAGESNOW: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( SNOW )); break; case CIP_SPEED: *vp = INT_TO_JSVAL( gPriv->GetSpeed() ); break; + case CIP_BONUSHITS: *vp = INT_TO_JSVAL( gPriv->GetBonusHits() ); break; + case CIP_BONUSSTAM: *vp = INT_TO_JSVAL( gPriv->GetBonusStam() ); break; + case CIP_BONUSMANA: *vp = INT_TO_JSVAL( gPriv->GetBonusMana() ); break; case CIP_NAME2: tString = JS_NewStringCopyZ( cx, gPriv->GetName2().c_str() ); *vp = STRING_TO_JSVAL( tString ); @@ -1321,6 +1324,9 @@ JSBool CItemProps_setProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGERAIN: gPriv->SetWeatherDamage( RAIN, encaps.toBool() ); break; case CIP_DAMAGESNOW: gPriv->SetWeatherDamage( SNOW, encaps.toBool() ); break; case CIP_SPEED: gPriv->SetSpeed( static_cast( encaps.toInt() )); break; + case CIP_BONUSHITS: gPriv->SetBonusHits( static_cast( encaps.toInt() )); break; + case CIP_BONUSSTAM: gPriv->SetBonusStam( static_cast( encaps.toInt() )); break; + case CIP_BONUSMANA: gPriv->SetBonusMana( static_cast( encaps.toInt() )); break; case CIP_NAME2: gPriv->SetName2( encaps.toString() ); break; case CIP_RACE: gPriv->SetRace( static_cast( encaps.toInt() )); break; case CIP_MAXHP: gPriv->SetMaxHP( static_cast( encaps.toInt() )); break; diff --git a/source/UOXJSPropertySpecs.h b/source/UOXJSPropertySpecs.h index 3149dc0ec..c5a8c8039 100644 --- a/source/UOXJSPropertySpecs.h +++ b/source/UOXJSPropertySpecs.h @@ -535,6 +535,9 @@ inline JSPropertySpec CItemProps[] = { "ammoFXHue", CIP_AMMOFXHUE, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "ammoFXRender", CIP_AMMOFXRENDER, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "speed", CIP_SPEED, JSPROP_ENUMANDPERM, nullptr, nullptr }, + { "bonusHits", CIP_BONUSHITS, JSPROP_ENUMANDPERM, nullptr, nullptr }, + { "bonusStam", CIP_BONUSSTAM, JSPROP_ENUMANDPERM, nullptr, nullptr }, + { "bonusMana", CIP_BONUSMANA, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "multi", CIP_MULTI, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "maxRange", CIP_MAXRANGE, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "baseRange", CIP_BASERANGE, JSPROP_ENUMANDPERM, nullptr, nullptr }, diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp index 506c247ac..51cbb80ae 100644 --- a/source/cBaseObject.cpp +++ b/source/cBaseObject.cpp @@ -1631,6 +1631,69 @@ void CBaseObject::SetIntelligence2( SI16 nVal ) } } +//o------------------------------------------------------------------------------------------------o +//| Function - CBaseObject::GetBonusHits() +//| CBaseObject::SetBonusHits() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Gets/Sets the health max var associated with the object. For chars, it's the +//| bonuses (via armour and such) +//o------------------------------------------------------------------------------------------------o +SI16 CBaseObject::GetBonusHits( void ) const +{ + return bonusHits; +} +void CBaseObject::SetBonusHits( SI16 nVal ) +{ + bonusHits = nVal; + + if( CanBeObjType( OT_ITEM )) + { + ( static_cast( this ))->UpdateRegion(); + } +} + +//o------------------------------------------------------------------------------------------------o +//| Function - CBaseObject::GetBonusStam() +//| CBaseObject::SetBonusStam() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Gets/Sets the stamina max var associated with the object. For chars, it's the +//| bonuses (via armour and such) +//o------------------------------------------------------------------------------------------------o +SI16 CBaseObject::GetBonusStam( void ) const +{ + return bonusStam; +} +void CBaseObject::SetBonusStam( SI16 nVal ) +{ + bonusStam = nVal; + + if( CanBeObjType( OT_ITEM )) + { + ( static_cast( this ))->UpdateRegion(); + } +} + +//o------------------------------------------------------------------------------------------------o +//| Function - CBaseObject::GetBonusMana() +//| CBaseObject::SetBonusMana() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Gets/Sets the Mana max var associated with the object. For chars, it's the +//| bonuses (via armour and such) +//o------------------------------------------------------------------------------------------------o +SI16 CBaseObject::GetBonusMana( void ) const +{ + return bonusMana; +} +void CBaseObject::SetBonusMana( SI16 nVal ) +{ + bonusMana = nVal; + + if( CanBeObjType( OT_ITEM )) + { + ( static_cast( this ))->UpdateRegion(); + } +} + //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject::IncStrength() //o------------------------------------------------------------------------------------------------o diff --git a/source/cBaseObject.h b/source/cBaseObject.h index 638e826f7..15563feca 100644 --- a/source/cBaseObject.h +++ b/source/cBaseObject.h @@ -79,6 +79,9 @@ class CBaseObject SI16 st2; SI16 dx2; SI16 in2; + SI16 bonusHits; + SI16 bonusStam; + SI16 bonusMana; mutable SI32 FilePosition; SERIAL tempMulti; std::string name; @@ -256,6 +259,15 @@ class CBaseObject void IncDexterity( SI16 toInc = 1 ); void IncIntelligence( SI16 toInc = 1 ); + SI16 GetBonusHits( void ) const; + virtual void SetBonusHits( SI16 nVal ); + + SI16 GetBonusStam( void ) const; + virtual void SetBonusStam( SI16 nVal ); + + SI16 GetBonusMana( void ) const; + virtual void SetBonusMana( SI16 nVal ); + virtual void PostLoadProcessing( void ); virtual bool LoadRemnants( void ) = 0; diff --git a/source/cChar.cpp b/source/cChar.cpp index 7aa03f6fa..6e4d4f6d2 100644 --- a/source/cChar.cpp +++ b/source/cChar.cpp @@ -2920,6 +2920,10 @@ bool CChar::WearItem( CItem *toWear ) IncDexterity2( itemLayers[tLayer]->GetDexterity2() ); IncIntelligence2( itemLayers[tLayer]->GetIntelligence2() ); + SetFixedMaxHP( GetMaxHP() + itemLayers[tLayer]->GetBonusHits()); + SetFixedMaxStam( GetMaxStam() + itemLayers[tLayer]->GetBonusStam()); + SetFixedMaxMana( GetMaxMana() + itemLayers[tLayer]->GetBonusMana()); + if( toWear->IsPostLoaded() ) { if( itemLayers[tLayer]->GetPoisoned() ) @@ -2979,6 +2983,11 @@ bool CChar::TakeOffItem( ItemLayers Layer ) IncStrength2( -itemLayers[Layer]->GetStrength2() ); IncDexterity2( -itemLayers[Layer]->GetDexterity2() ); IncIntelligence2( -itemLayers[Layer]->GetIntelligence2() ); + + SetFixedMaxHP( GetMaxHP() -itemLayers[Layer]->GetBonusHits()); + SetFixedMaxStam( GetMaxStam() -itemLayers[Layer]->GetBonusStam()); + SetFixedMaxMana( GetMaxMana() -itemLayers[Layer]->GetBonusMana()); + if( itemLayers[Layer]->GetPoisoned() ) { if( itemLayers[Layer]->GetPoisoned() > GetPoisoned() ) diff --git a/source/cItem.cpp b/source/cItem.cpp index 3c6523d5d..45850e6f7 100644 --- a/source/cItem.cpp +++ b/source/cItem.cpp @@ -1654,6 +1654,9 @@ auto CItem::CopyData( CItem *target ) -> void target->SetWeightMax( GetWeightMax() ); target->SetBaseWeight( GetBaseWeight() ); target->SetMaxItems( GetMaxItems() ); + target->SetBonusHits( GetBonusHits() ); + target->SetBonusStam( GetBonusStam() ); + target->SetBonusMana( GetBonusMana() ); //target->SetWipeable( IsWipeable() ); target->SetPriv( GetPriv() ); target->SetBaseRange( GetBaseRange() ); @@ -1737,6 +1740,9 @@ bool CItem::DumpBody( std::ostream &outStream ) const outStream << "MaxItems=" + std::to_string( GetMaxItems() ) + newLine; outStream << "MaxHP=" + std::to_string( GetMaxHP() ) + newLine; outStream << "Speed=" + std::to_string( GetSpeed() ) + newLine; + outStream << "BonusHits=" + std::to_string( GetBonusHits() ) + newLine; + outStream << "BonusStam=" + std::to_string( GetBonusStam() ) + newLine; + outStream << "BonusMana=" + std::to_string( GetBonusMana() ) + newLine; outStream << "Movable=" + std::to_string( GetMovable() ) + newLine; outStream << "Priv=" + std::to_string( GetPriv() ) + newLine; outStream << "Value=" + std::to_string( GetBuyValue() ) + "," + std::to_string( GetSellValue() ) + "," + std::to_string( GetVendorPrice() ) + newLine; @@ -1820,6 +1826,21 @@ bool CItem::HandleLine( std::string &UTag, std::string &data ) bools = static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )); rValue = true; } + else if( UTag == "BONUSHITS" ) + { + SetBonusHits( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 ))); + rValue = true; + } + else if( UTag == "BONUSSTAM" ) + { + SetBonusStam( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 ))); + rValue = true; + } + else if( UTag == "BONUSMANA" ) + { + SetBonusMana( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 ))); + rValue = true; + } break; case 'C': if( UTag == "CONT" ) diff --git a/source/items.cpp b/source/items.cpp index 1cd4a2aaf..3bb17bb66 100644 --- a/source/items.cpp +++ b/source/items.cpp @@ -139,6 +139,9 @@ auto ApplyItemSection( CItem *applyTo, CScriptSection *toApply, std::string sect break; case DFNTAG_AC: applyTo->SetArmourClass( static_cast( ndata )); break; case DFNTAG_BASERANGE: applyTo->SetBaseRange( static_cast( ndata )); break; + case DFNTAG_BONUSHITS: applyTo->SetBonusHits( static_cast( ndata )); break; + case DFNTAG_BONUSSTAM: applyTo->SetBonusStam( static_cast( ndata )); break; + case DFNTAG_BONUSMANA: applyTo->SetBonusMana( static_cast( ndata )); break; case DFNTAG_CREATOR: applyTo->SetCreator( ndata ); break; case DFNTAG_COLOUR: applyTo->SetColour( static_cast( ndata )); break; case DFNTAG_COLOURLIST: applyTo->SetColour( AddRandomColor( cdata )); break; diff --git a/source/ssection.cpp b/source/ssection.cpp index c2a563b47..dbfc8a475 100644 --- a/source/ssection.cpp +++ b/source/ssection.cpp @@ -215,6 +215,9 @@ const UI08 dfnDataTypes[DFNTAG_COUNTOFTAGS] = DFN_STRING, // DFNTAG_SPAWNOBJ, DFN_STRING, // DFNTAG_SPAWNOBJLIST, DFN_NUMERIC, // DFNTAG_SPD, + DFN_NUMERIC, // DFNTAG_BONUSHITS, + DFN_NUMERIC, // DFNTAG_BONUSSTAM, + DFN_NUMERIC, // DFNTAG_BONUSMANA, DFN_STRING, // DFNTAG_SPELLS, DFN_DOUBLENUMERIC, // DFNTAG_SPELLWEAVING, DFN_DOUBLENUMERIC, // DFNTAG_SPIRITSPEAK, @@ -283,6 +286,9 @@ const std::map strToDFNTag {"BLACKSMITHING"s, DFNTAG_BLACKSMITHING}, {"BOWCRAFT"s, DFNTAG_BOWCRAFT}, {"BUSHIDO"s, DFNTAG_BUSHIDO}, + {"BONUSHITS"s, DFNTAG_BONUSHITS}, + {"BONUSSTAM"s, DFNTAG_BONUSSTAM}, + {"BONUSMANA"s, DFNTAG_BONUSMANA}, {"CAMPING"s, DFNTAG_CAMPING}, {"CARPENTRY"s, DFNTAG_CARPENTRY}, {"CARTOGRAPHY"s, DFNTAG_CARTOGRAPHY}, diff --git a/source/ssection.h b/source/ssection.h index a2a660aec..8ffc1edc9 100644 --- a/source/ssection.h +++ b/source/ssection.h @@ -222,6 +222,9 @@ enum DFNTAGS DFNTAG_SPAWNOBJ, DFNTAG_SPAWNOBJLIST, DFNTAG_SPD, + DFNTAG_BONUSHITS, + DFNTAG_BONUSSTAM, + DFNTAG_BONUSMANA, DFNTAG_SPELLS, DFNTAG_SPELLWEAVING, DFNTAG_SPIRITSPEAK, From 5d7eef00fd5763ca05bfbc787ba68927bd463789 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 25 May 2024 19:05:38 -0500 Subject: [PATCH 011/147] Special Moves This is the 12 AOS abilites that are in the book on the paperdoll. --- data/js/combat/blockequip.js | 20 + data/js/combat/special_moves.js | 644 +++++++++++++++++++++++++++++++ data/js/jse_fileassociations.scp | 2 + data/js/server/global.js | 12 + source/Changelog.txt | 5 + source/cChar.cpp | 38 ++ 6 files changed, 721 insertions(+) create mode 100644 data/js/combat/blockequip.js create mode 100644 data/js/combat/special_moves.js diff --git a/data/js/combat/blockequip.js b/data/js/combat/blockequip.js new file mode 100644 index 000000000..6241b6ea5 --- /dev/null +++ b/data/js/combat/blockequip.js @@ -0,0 +1,20 @@ +function onEquipAttempt( pEquipper, iEquipped ) +{ + var blockEquip = pEquipper.GetTempTag( "BlockEquip" ); + if( blockEquip == true ) + { + iEquipped.SetTempTag( "charSer", pEquipper.serial.toString() ); + iEquipped.StartTimer( 10 ,1, true ); + return false; + } + + return true; +} + +function onTimer( timerObj, timerID ) +{ + var mChar = CalcCharFromSer(parseInt( timerObj.GetTempTag( "charSer" ))) + timerObj.container = mChar.pack; + timerObj.Refresh(); + timerObj.SetTempTag( "charSer", null ); +} \ No newline at end of file diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js new file mode 100644 index 000000000..a14499824 --- /dev/null +++ b/data/js/combat/special_moves.js @@ -0,0 +1,644 @@ +function onSpecialMove(pUser, abilityID) +{ + /*switch (abilityID) + { + case 0x01: // Armor Ignore + HandleArmorIgnore(pUser, abilityID); + break; + case 0x05:// Disarm + HandleDisarm(pUser, abilityID); + break; + case 0x06:// Dismount + HandleDismount(pUser, abilityID); + break; + case 0x0C:// ShadowStrike + HandleShadowStrike(pUser, abilityID); + break; + case 0x0B:// Paralyzing Blow + HandleParalyzingBlow(pUser, abilityID); + break; + default: + break; + }*/ + + pUser.TextMessage("I'm activating ability #" + abilityID); + pUser.SetTempTag("abilityID", abilityID); + //pUser.StartTimer(5000, abilityID, true); + return true; + + //The rest of the AOS Abilites before any other expansions + //Mortal Strike + //Infectious Strike + //Double Strike + //Bleed Attack + //Whirlwind Attack +} + +// Define the checkSkillRequirement function outside RequiredSkill +function checkSkillRequirement(pUser, requiredSkillLevel, requiredSkill, skillMessage) +{ + if (pUser.skills[requiredSkill] < requiredSkillLevel) + { + pUser.SysMessage("You need " + skillMessage + " weapon skill to perform that attack"); + return false; + } + return true; +} + +// Define the RequiredSkill function +function RequiredSkill(pUser, abilityID) +{ + // Define weapon types and their skill requirements and if primary or secondary ability + var weaponTypes = { + "0x0DF0": { primary: 0, secondary: 11, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0DF1": { primary: 0, secondary: 11, reqSkill: 41, skillMsg: "mace fighting" }, // Black Staves // WhirlwindAttack, ParalyzingBlow + + "0x0DF2": { primary: 6, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0DF3": { primary: 6, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0DF4": { primary: 6, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0DF5": { primary: 6, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, // wands // Dismount, Disarm + + "0x0E81": { primary: 0, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0E82": { primary: 0, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, // Shepherd's Crooks // CrushingBlow, Disarm + + "0x0e85": { primary: 0, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0e86": { primary: 0, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, // pickaxe // DoubleStrike, Disarm + + "0x0E87": { primary: 0, secondary: 6, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0E88": { primary: 0, secondary: 6, reqSkill: 41, skillMsg: "mace fighting" }, // Pitchforks // BleedAttack, Dismount + + "0x0E89": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0E8A": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, // Quarter Staves // DoubleStrike, ConcussionBlow + + "0x0EC2": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0EC3": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, // Cleavers // BleedAttack, InfectiousStrike + + "0x0EC4": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0EC5": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, // Skinning Knives // ShadowStrike, BleedAttack + + "0x0F43": { primary: 1, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F44": { primary: 1, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, // hatchets // ArmorIgnore, Disarm + + "0x0F45": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F46": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Executioner Axes // BleedAttack, MortalStrike + + "0x0F47": { primary: 1, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F48": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Battle Axes // BleedAttack, ConcussionBlow + + "0x0F49": { primary: 0, secondary: 6, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F4A": { primary: 0, secondary: 6, reqSkill: 40, skillMsg: "Swordsmanship" }, // Axes // CrushingBlow, Dismount + + "0x0F4B": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F4C": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Double Axe // DoubleStrike, WhirlwindAttack + + "0x0F4D": { primary: 11, secondary: 6, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F4E": { primary: 11, secondary: 6, reqSkill: 40, skillMsg: "Swordsmanship" }, // Bardiches // ParalyzingBlow, Dismount + + "0x0F4F": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F50": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Crossbows // ConcussionBlow, MortalStrike + + "0x0F51": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F52": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Daggers // InfectiousStrike, ShadowStrike + + "0x0F5C": { primary: 0, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0F5D": { primary: 0, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, // Maces // ConcussionBlow, Disarm + + "0x0F5E": { primary: 0, secondary: 1, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F5F": { primary: 0, secondary: 1, reqSkill: 40, skillMsg: "Swordsmanship" }, // Broadswords // CrushingBlow, ArmorIgnore + + "0x13B7": { primary: 1, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13B8": { primary: 1, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F60": { primary: 1, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F61": { primary: 1, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Longswords // ArmorIgnore, ConcussionBlow + + "0x0F62": { primary: 1, secondary: 11, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F63": { primary: 1, secondary: 11, reqSkill: 40, skillMsg: "Swordsmanship" }, // Spears // ArmorIgnore, ParalyzingBlow + + "0x0FB4": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0FB5": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Sledge hammers // CrushingBlow, ShadowStrike + + "0x13AF": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13B0": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // War Axes // ArmorIgnore, BleedAttack + + "0x13B1": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13B2": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Bows // ParalyzingBlow, MortalStrike + + "0x13B3": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13B4": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Clubs // ShadowStrike, Dismount + + "0x13B5": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13B6": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Scimitars // DoubleStrike, ParalyzingBlow + + "0x13B9": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13BA": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Viking Swords // ParalyzingBlow, CrushingBlow + + "0x13FC": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13FD": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Heavy Crossbows // MovingShot, Dismount + + "0x13E3": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13E4": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Smith's Hammers // CrushingBlow, ShadowStrike + + "0x13F6": { primary: 0, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13F7": { primary: 0, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, // Butcher Knives // InfectiousStrike,Disarm + + "0x13F8": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13F9": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Gnarled Staves // ConcussionBlow,ForceOfNature + + "0x13FA": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13FB": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Large Battle Axes // WhirlwindAttack,BleedAttack + + "0x13FE": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13FF": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Katana // DoubleStrike,ArmorIgnore + + "0x1400": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x1401": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Kryss // ArmorIgnore,InfectiousStrike + + "0x1402": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x1403": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Short Spears // ShadowStrike,MortalStrike + + "0x1404": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x1405": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // War Forks // BleedAttack,Disarm + + "0x1406": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x1407": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // War Maces // CrushingBlow,MortalStrike + + "0x1438": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x1439": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // War Hammers // WhirlwindAttack,CrushingBlow + + "0x143A": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x143B": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Mauls // DoubleStrike,ConcussionBlow + + "0x143C": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x143D": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Hammer Picks // ArmorIgnore,MortalStrike + + "0x143E": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x143F": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Halberds // WhirlwindAttack,ConcussionBlow + + "0x1440": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x1441": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Cutlasses // BleedAttack,ShadowStrike + + "0x1442": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x1443": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" } // Two Handed Axes // DoubleStrike,ShadowStrike + }; + + // Get items in user's hands + var itemRHand = pUser.FindItemLayer(0x01); + var itemLHand = pUser.FindItemLayer(0x02); + + // Check if either hand has an item + if (itemRHand != null) { + // Check item in the right hand + if (weaponTypes[itemRHand.sectionID]) + { + var weapon = weaponTypes[itemRHand.sectionID]; + + if (abilityID == weapon.primary) + { + return checkSkillRequirement(pUser, 700, weapon.reqSkill, weapon.skillMsg); + } + else if (abilityID == weapon.secondary) + { + return checkSkillRequirement(pUser, 900, weapon.reqSkill, weapon.skillMsg); + } + } + } + else if (itemLHand != null) + { + // Check item in the left hand + if (weaponTypes[itemLHand.sectionID]) + { + var weapon = weaponTypes[itemLHand.sectionID]; + if (abilityID == weapon.primary) + { + return checkSkillRequirement(pUser, 700, weapon.reqSkill, weapon.skillMsg); + } + else if (abilityID == weapon.secondary) + { + return checkSkillRequirement(pUser, 900, weapon.reqSkill, weapon.skillMsg); + } + } + } + else //checking if both hands null if so, it is a wrestling skill + { + if (abilityID == 5) + { + return checkSkillRequirement(pUser, 700, 43, "Wrestling"); + } + else if (abilityID == 11) + { + return checkSkillRequirement(pUser, 900, 43, "Wrestling"); + } + } + + return true; +} + +function CheckMana(pUser, abilityID, requiredMana) +{ + var NextUse = pUser.GetTempTag("doubleMana"); + var iTime = GetCurrentClock(); + if (pUser.mana <= requiredMana) + { + pUser.TextMessage("You need " + requiredMana + " mana to perform that attack"); + DeactivateSpecialMove(pUser.socket, abilityID); + return false; + } + else + { + pUser.SetTempTag("doubleMana", iTime.toString()); + var Delay = 3000; + if ((iTime - NextUse) < Delay) + { + pUser.mana -= requiredMana * 2; + return true; + } + else + { + pUser.mana -= requiredMana; + return true; + } + } +} + +function HandleArmorIgnore(pUser, abilityID) +{ + pUser.SetTempTag("ArmorIgnore", true); + pUser.SetTempTag("abilityID", abilityID); +} + +function HandleDismount(pUser, abilityID) +{ + pUser.SetTempTag("Dismount", true); + pUser.SetTempTag("abilityID", abilityID); +} + +function HandleShadowStrike(pUser, abilityID) +{ + pUser.SetTempTag("ShadowStrike", true); + pUser.SetTempTag("abilityID", abilityID); +} + +function HandleParalyzingBlow(pUser, abilityID) +{ + pUser.SetTempTag("ParalyzingBlow", true); + pUser.SetTempTag("abilityID", abilityID); +} + +function HandleDisarm(pUser, abilityID) +{ + pUser.SetTempTag("Disarm", true); +} + +function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) +{ + var abilityID = pAttacker.GetTempTag("abilityID"); + var baseDamage = pAttacker.attack; + + if( baseDamage == -1 ) // No damage if weapon breaks + return 0; + + var damage = ApplyDamageBonuses( 1, pAttacker, pDefender, fightSkill, hitLoc, baseDamage ); + + if( damage < 1 ) + return 0; + + // Check if attacker has armor ignore enabled + if (abilityID == 1) // armorignore + { + // Armor Ignore ignores defense modifiers, but deals only 90% of potential damage + damage *= 0.9; + + if(fightSkill == 31) // Archery + { + // Cap damage from Armor Strike attack at 30 for archery weapons + if(damage > 30) + damage = 30; + } + else + { + // For all othe rfighting skills, cap damage from Armor Strike at 35 + if(damage > 35) + damage = 35; + } + } + else if (abilityID == 12)// shadowstrike + { + damage *= 1.25; + } + else if (abilityID == 4)// crushingblow + { + damage *= 1.5; + } + else if (abilityID == 3)// ConcussionBlow + { + if (pDefender.maxhp > 0) + { + var hitsPercent = (pDefender.hp / pDefender.maxhp) * 100.0; + + var manaPercent = 0; + + if (pDefender.maxmana > 0) + manaPercent = (pDefender.mana / pDefender.maxmana) * 100.0; + + damage += Math.min(Math.floor(Math.abs(hitsPercent - manaPercent) / 4), 20); + } + } + else + { + // Otherwise, apply normal defense modifiers + damage = ApplyDefenseModifiers( 1, pAttacker, pDefender, fightSkill, hitLoc, damage, true ); + } + + // If damage after defense modifiers is below 0, do a small random amount of damage still + if( damage <= 0 ) + damage = RandomNumber( 0, 4 ); + + // If defender is a player, damage is divided by this modifier from uox.ini + if( !pDefender.npc ) + damage /= GetServerSetting( "NPCDAMAGERATE" ); + + return damage; +} + +function onAttack( pAttacker, pDefender ) +{ + var abilityID = pAttacker.GetTempTag("abilityID"); + + if (abilityID == 1) // armnor ignore + { + var requiredMana = 14; + + // Clear out any current ability the player is doing + if (abilityID != 1) + DeactivateSpecialMove(pAttacker.socket, abilityID); + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + pAttacker.TextMessage("Your attack penetrates their armor!"); + pDefender.TextMessage("The blow penetrated your armor!"); + + pDefender.SoundEffect(0x0056, true); + pDefender.StaticEffect(0x3728, 0x09, 0x06); + } + else if (abilityID == 12) // shadowstrike + { + var requiredMana = 20; + + if (pAttacker.skills[47] < 800) // Stealth + { + pAttacker.TextMessage("You lack the required stealth to perform that attack"); + return true; + } + + // Clear out any current ability the player is doing + if (abilityID != 12) + DeactivateSpecialMove(pAttacker.socket, abilityID); + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + pAttacker.TextMessage("You strike and hide in the shadows!"); + pDefender.TextMessage("You are dazed by the attack and your attacker vanishes!"); + + pAttacker.StaticEffect(0x376A, 0x09, 0x06); + + pDefender.SoundEffect(0x482, true); + pDefender.StaticEffect(0x37BE, 0x09, 0x06); + + pAttacker.atWar = false; + pDefender.atWar = false; + pAttacker.visible = 1; + } + else if (abilityID == 6) // Dismount + { + var requiredMana = 16; + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + // Check to see if player is mount or flying. + if (pAttacker.isonhorse) { + pAttacker.TextMessage("You cannot perform that attack while mounted or flying!"); + DeactivateSpecialMove(pAttacker.socket, abilityID); + return true; + } + + // Clear out any current ability the player is doing + if (abilityID != 6) + DeactivateSpecialMove(pAttacker.socket, abilityID); + + // Only Can work on players or npcs that is mounted + if (!pDefender.isonhorse) { + pAttacker.TextMessage("This attack only works on mounted or flying targets"); + return true; + } + + //Lesser Hiryu have an 80% chance of missing this attack needs added + + //This is the Dismount Information sent to Attacker and Defender + pDefender.SoundEffect(0x140, true); + pDefender.StaticEffect(0x3728, 0x09, 0x06); + pAttacker.TextMessage("The force of your attack has dislodged them from their mount!"); + pDefender.Dismount(); + pDefender.TextMessage("You have been knocked off of your mount by " + pAttacker.name + "!"); + pAttacker.SetTempTag("Dismount", false); + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + } + else if (abilityID == 11) // ParalyzingBlow + { + var requiredMana = 30; + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + // Clear out any current ability the player is doing + if (abilityID != 11) + DeactivateSpecialMove(pAttacker.socket, abilityID); + + pAttacker.SoundEffect(0x204, true); + pDefender.StaticEffect(0x376A, 0x09, 0x32); + var IsImmune = pDefender.GetTempTag("IsImmune") + + if (IsImmune != null && IsImmune == true) { + pAttacker.TextMessage("Your target resists paralysis."); + pDefender.TextMessage("You resist paralysis."); + return true; + } + + var seconds = 3000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) + if (pDefender.npc) { + seconds = 6000; + } + else if (pDefender.socket) { + pDefender.TextMessage("The attack has temporarily paralyzed you!", false, 0x3b2, 0, pDefender.serial);// The attack has temporarily paralyzed you! + } + + pDefender.SetTempTag("IsImmune", true); + pDefender.StartTimer(seconds + 8000, 9000, true); + pDefender.StartTimer(seconds, 8000, true); + pDefender.frozen = true; + + if (pAttacker.socket) { + pAttacker.TextMessage(GetDictionaryEntry(17702, pAttacker.socket.language), false, 0x3b2, 0, pAttacker.serial);// You deliver a paralyzing blow! + } + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + } + else if (abilityID == 5) // Disarm + { + //check skills + if (!RequiredSkill(pAttacker, abilityID)) + return true; + + var itemRHand = pDefender.FindItemLayer(0x01); + var itemLHand = pDefender.FindItemLayer(0x02); + var requiredMana = 20; + + if (pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2) { + pAttacker.SysMessage("You cannot disarm your opponent."); + return false; + } + + if (itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9) { + pAttacker.SysMessage("Your target is already unarmed!"); + return false; + } + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + // Clear out any current ability the player is doing + if (abilityID != 5) + DeactivateSpecialMove(pAttacker, abilityID); + + pAttacker.SoundEffect(0x3B9, true); + pDefender.StaticEffect(0x37BE, 0x09, 0x32); + + pAttacker.SysMessage("You disarm their weapon!"); + pDefender.SysMessage("Your weapon has been disarmed!"); + + if (itemLHand != null) + { + itemLHand.container = pDefender.pack; + } + + if (itemRHand != null) + { + itemRHand.container = pDefender.pack; + } + + pDefender.AddScriptTrigger(7002);//block equip for 5 seconds script added + pDefender.SetTempTag("BlockEquip", true); + pDefender.StartTimer(5000, 9100, true); + + TriggerEvent(50104, "AddBuff", pDefender, 0x3ea, 1075637, 0, 5, " "); + + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + } + else if (abilityID == 4) // crushingblow + { + var requiredMana = 20; + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + // Clear out any current ability the player is doing + if (abilityID != 4) + DeactivateSpecialMove(pAttacker, abilityID); + + pAttacker.SysMessage("You have delivered a crushing blow!"); + pDefender.SysMessage("You take extra damage from the crushing attack!"); + + pAttacker.SoundEffect(0x1E1, true); + } + else if (abilityID == 3) // ConcussionBlow + { + var requiredMana = 20; + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + // Clear out any current ability the player is doing + if (abilityID != 3) + DeactivateSpecialMove(pAttacker, abilityID); + + pAttacker.SysMessage("You have delivered a concussion!"); + pDefender.SysMessage("You feel disoriented!"); + + pAttacker.SoundEffect(0x213, true); + pDefender.StaticEffect(0x377A, 0x09, 0x32); + } +} + +function ClearSpecialMove(pUser, abilityID) +{ + var socket = pUser.socket; + pUser.SetTempTag("abilityID", null); + pUser.SetTempTag("doubleMana", null); + + var toSend = new Packet; + toSend.ReserveSize(7) + toSend.WriteByte(0, 0xbf); // Packet + toSend.WriteShort(1, 0x07); // Length + toSend.WriteShort(3, 0x21); // SubCmd + toSend.WriteByte(5, abilityID); // Ability ID + toSend.WriteByte(6, 0); // On/off + socket.Send(toSend); + toSend.Free(); +} + +function DeactivateSpecialMove(pUser, abilityID ) +{ + var socket = pUser.socket; + var toSend = new Packet; + + toSend.ReserveSize( 7 ) + toSend.WriteByte( 0, 0xbf ); // Packet + toSend.WriteShort( 1, 0x07 ); // Length + toSend.WriteShort( 3, 0x21 ); // SubCmd + toSend.WriteByte( 5, abilityID ); // Ability ID + toSend.WriteByte( 6, 0 ); // On/off + socket.Send( toSend ); + toSend.Free(); +} + +function onTimer( timerObj, timerID ) +{ + var socket = timerObj.socket; + var abilityID = timerObj.GetTempTag("abilityID"); + if (timerObj == null || timerObj.dead) + { + timerObj.frozen = false; + timerObj.SetTempTag("IsImmune", false); + timerObj.RemoveScriptTrigger(7002); + timerObj.SetTempTag("BlockEquip", false); + ClearSpecialMove(timerObj, abilityID); + return; + } + else if (timerID == 8000) + { + timerObj.frozen = false; + } + else if (timerID == 9000) + { + timerObj.SetTempTag("IsImmune", false); + } + else if (timerID == 9100) + { + timerObj.RemoveScriptTrigger(7002); + timerObj.SetTempTag("BlockEquip", false); + socket.SysMessage("Your confusion has passed, you may now arm a weapon!"); + } + else if (timerObj.socket) + { + //Toggle ability off after 5 second timer has elapsed + DeactivateSpecialMove(timerObj, timerID); + } +} \ No newline at end of file diff --git a/data/js/jse_fileassociations.scp b/data/js/jse_fileassociations.scp index 2cbb8e3d5..802cd528c 100644 --- a/data/js/jse_fileassociations.scp +++ b/data/js/jse_fileassociations.scp @@ -329,6 +329,8 @@ // Combat Scripts [7000-7499] //------------------------------------------- 7000=combat/peacemake_effect.js +7001=combat/special_moves.js +7002=combat/blockequip.js //------------------------------------------- // Misc Player Scripts [8000-8499] diff --git a/data/js/server/global.js b/data/js/server/global.js index aada1f443..582a9d268 100644 --- a/data/js/server/global.js +++ b/data/js/server/global.js @@ -36,6 +36,12 @@ function onLogin( socket, pChar ) // Check if "Young" player still meets requirement for being considered young TriggerEvent( 8001, "CheckYoungStatus", socket, pChar, true ); } + + //Attach the special moves Book + if( !pChar.npc && !pChar.HasScriptTrigger( 7001 )) + { + pChar.AddScriptTrigger( 7001 ); + } } function onLogout( pSock, pChar ) @@ -71,6 +77,12 @@ function onCreatePlayer( pChar ) TriggerEvent( 8001, "GiveYoungPlayerItems", pChar.socket, pChar ); } + + //Attach the special moves Book + if( !pChar.npc && !pChar.HasScriptTrigger( 7001 )) + { + pChar.AddScriptTrigger( 7001 ); + } } // Generic global-script function to look up data in /shared/jsWorldData/ folder diff --git a/source/Changelog.txt b/source/Changelog.txt index 1d779c15f..addbacc9c 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,8 @@ +25/05/2024 - Dragon Slayer + Added special_moves.js There is 12 special aos moves you can find on uoguide.com + Added blockequip.js This script is used to block reqeuiping weapons. + Thanks to Xuri for making unequipattemp work for chars and not just items + 27/04/2024 - Dragon Slayer/Xuri Fixed an issue where non-corpse containers - including treasure chests in dungeons - would decay and leave all their contents on the ground. Converted LOOTDECAYSWITHCORPSE ini setting to two new settings, one for player corpses, one for NPC corpses: diff --git a/source/cChar.cpp b/source/cChar.cpp index 7aa03f6fa..f8dc40bc1 100644 --- a/source/cChar.cpp +++ b/source/cChar.cpp @@ -2883,6 +2883,7 @@ CItem *CChar::GetItemAtLayer( ItemLayers Layer ) //| Purpose - Wears the item toWear and adjusts the stats if any are //| required to change. Returns true if successfully equipped //o------------------------------------------------------------------------------------------------o +void Bounce( CSocket *bouncer, CItem *bouncing, UI08 mode = 5 ); bool CChar::WearItem( CItem *toWear ) { // Run event prior to equipping item, allowing script to prevent equip @@ -2900,6 +2901,27 @@ bool CChar::WearItem( CItem *toWear ) } } + scriptTriggers.clear(); + scriptTriggers.shrink_to_fit(); + scriptTriggers = this->GetScriptTriggers(); + for( auto i : scriptTriggers ) + { + cScript *tScript = JSMapping->GetScript( i ); + if( tScript != nullptr ) + { + // If script returns false, prevent item from being equipped + if( tScript->OnEquipAttempt( this, toWear ) == 0 ) + { + CSocket *mSock = this->GetSocket(); + if( mSock != nullptr ) + { + Bounce( mSock, toWear ); + } + return false; + } + } + } + bool rValue = true; ItemLayers tLayer = toWear->GetLayer(); if( tLayer != IL_NONE ) // Layer == 0 is a special case, for things like trade windows and such @@ -2972,6 +2994,22 @@ bool CChar::TakeOffItem( ItemLayers Layer ) } } + scriptTriggers.clear(); + scriptTriggers.shrink_to_fit(); + scriptTriggers = this->GetScriptTriggers(); + for( auto i : scriptTriggers ) + { + cScript *tScript = JSMapping->GetScript( i ); + if( tScript != nullptr ) + { + // If script returns false, prevent item from being equipped + if( tScript->OnUnequipAttempt( this, itemLayers[Layer] ) == 0 ) + { + return false; + } + } + } + if( Layer == IL_PACKITEM ) // It's our pack! { SetPackItem( nullptr ); From 230fa75b4131624ddaac382d1550abcf61dbb2d4 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 26 May 2024 00:16:03 -0500 Subject: [PATCH 012/147] Update cItem.cpp --- source/cItem.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/source/cItem.cpp b/source/cItem.cpp index 45850e6f7..c345ecdc2 100644 --- a/source/cItem.cpp +++ b/source/cItem.cpp @@ -1740,9 +1740,7 @@ bool CItem::DumpBody( std::ostream &outStream ) const outStream << "MaxItems=" + std::to_string( GetMaxItems() ) + newLine; outStream << "MaxHP=" + std::to_string( GetMaxHP() ) + newLine; outStream << "Speed=" + std::to_string( GetSpeed() ) + newLine; - outStream << "BonusHits=" + std::to_string( GetBonusHits() ) + newLine; - outStream << "BonusStam=" + std::to_string( GetBonusStam() ) + newLine; - outStream << "BonusMana=" + std::to_string( GetBonusMana() ) + newLine; + outStream << "BonusStats=" + std::to_string( GetBonusHits() ) + "," + std::to_string( GetBonusStam() ) + "," + std::to_string( GetBonusMana() ) + newLine; outStream << "Movable=" + std::to_string( GetMovable() ) + newLine; outStream << "Priv=" + std::to_string( GetPriv() ) + newLine; outStream << "Value=" + std::to_string( GetBuyValue() ) + "," + std::to_string( GetSellValue() ) + "," + std::to_string( GetVendorPrice() ) + newLine; @@ -1826,20 +1824,12 @@ bool CItem::HandleLine( std::string &UTag, std::string &data ) bools = static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )); rValue = true; } - else if( UTag == "BONUSHITS" ) + else if( UTag == "BONUSSTATS" ) { - SetBonusHits( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 ))); - rValue = true; - } - else if( UTag == "BONUSSTAM" ) - { - SetBonusStam( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 ))); - rValue = true; - } - else if( UTag == "BONUSMANA" ) - { - SetBonusMana( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 ))); - rValue = true; + SetBonusHits( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( csecs[0], "//" )), nullptr, 0 ))); + SetBonusStam( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( csecs[1], "//" )), nullptr, 0 ))); + SetBonusMana( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( csecs[2], "//" )), nullptr, 0 ))); + rValue = true; } break; case 'C': From a32f192b1f6d9b3b674b58fff3f2e5ac0fec6f4b Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 27 May 2024 15:08:23 -0500 Subject: [PATCH 013/147] Fixed the Bonus add ons Now they will not save on world save --- source/cChar.cpp | 91 ++++++++++++++++++++++++++++++++++++++++++------ source/cChar.h | 9 +++++ 2 files changed, 89 insertions(+), 11 deletions(-) diff --git a/source/cChar.cpp b/source/cChar.cpp index 6e4d4f6d2..530053021 100644 --- a/source/cChar.cpp +++ b/source/cChar.cpp @@ -2920,9 +2920,9 @@ bool CChar::WearItem( CItem *toWear ) IncDexterity2( itemLayers[tLayer]->GetDexterity2() ); IncIntelligence2( itemLayers[tLayer]->GetIntelligence2() ); - SetFixedMaxHP( GetMaxHP() + itemLayers[tLayer]->GetBonusHits()); - SetFixedMaxStam( GetMaxStam() + itemLayers[tLayer]->GetBonusStam()); - SetFixedMaxMana( GetMaxMana() + itemLayers[tLayer]->GetBonusMana()); + IncBonusHits( itemLayers[tLayer]->GetBonusHits() ); + IncBonusStam( itemLayers[tLayer]->GetBonusStam() ); + IncBonusMana( itemLayers[tLayer]->GetBonusMana() ); if( toWear->IsPostLoaded() ) { @@ -2984,9 +2984,9 @@ bool CChar::TakeOffItem( ItemLayers Layer ) IncDexterity2( -itemLayers[Layer]->GetDexterity2() ); IncIntelligence2( -itemLayers[Layer]->GetIntelligence2() ); - SetFixedMaxHP( GetMaxHP() -itemLayers[Layer]->GetBonusHits()); - SetFixedMaxStam( GetMaxStam() -itemLayers[Layer]->GetBonusStam()); - SetFixedMaxMana( GetMaxMana() -itemLayers[Layer]->GetBonusMana()); + IncBonusHits( -itemLayers[Layer]->GetBonusHits() ); + IncBonusStam( -itemLayers[Layer]->GetBonusStam() ); + IncBonusMana( -itemLayers[Layer]->GetBonusMana() ); if( itemLayers[Layer]->GetPoisoned() ) { @@ -3796,7 +3796,7 @@ UI16 CChar::GetMaxHP( void ) oldRace = GetRace(); } - return maxHP; + return maxHP + GetBonusHits(); } void CChar::SetMaxHP( UI16 newmaxhp, UI16 newoldstr, RACEID newoldrace ) { @@ -3839,7 +3839,7 @@ void CChar::SetFixedMaxHP( SI16 newmaxhp ) SI16 CChar::GetMaxMana( void ) { if(( maxMana_oldint != GetIntelligence() || oldRace != GetRace() ) && !GetMaxManaFixed() ) - //if int/race changed since last calculation, recalculate maxHp + //if int/race changed since last calculation, recalculate maxMana { CRace *pRace = Races->Race( GetRace() ); @@ -3856,7 +3856,7 @@ SI16 CChar::GetMaxMana( void ) oldRace = GetRace(); } - return maxMana; + return maxMana + GetBonusMana(); } void CChar::SetMaxMana( SI16 newmaxmana, UI16 newoldint, RACEID newoldrace ) { @@ -3898,7 +3898,7 @@ void CChar::SetFixedMaxMana( SI16 newmaxmana ) //o------------------------------------------------------------------------------------------------o SI16 CChar::GetMaxStam( void ) { - // If dex/race changed since last calculation, recalculate maxHp + // If dex/race changed since last calculation, recalculate maxStam if(( maxStam_olddex != GetDexterity() || oldRace != GetRace() ) && !GetMaxStamFixed() ) { CRace *pRace = Races->Race( GetRace() ); @@ -3916,7 +3916,7 @@ SI16 CChar::GetMaxStam( void ) oldRace = GetRace(); } - return maxStam; + return maxStam + GetBonusStam(); } void CChar::SetMaxStam( SI16 newmaxstam, UI16 newolddex, RACEID newoldrace ) { @@ -5602,6 +5602,75 @@ void CChar::SetIntelligence2( SI16 nVal ) UpdateRegion(); } +//o------------------------------------------------------------------------------------------------o +//| Function - CChar::SetBonusHits() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Sets bonus Hits stat for character +//o------------------------------------------------------------------------------------------------o +void CChar::SetBonusHits( SI16 nVal ) +{ + CBaseObject::SetBonusHits( nVal ); + Dirty( UT_HITPOINTS ); + UpdateRegion(); +} + +//o------------------------------------------------------------------------------------------------o +//| Function - CChar::SetBonusStam() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Sets bonus Stam stat for character +//o------------------------------------------------------------------------------------------------o +void CChar::SetBonusStam( SI16 nVal ) +{ + CBaseObject::SetBonusStam( nVal ); + Dirty( UT_STAMINA ); + UpdateRegion(); +} + +//o------------------------------------------------------------------------------------------------o +//| Function - CChar::SetBonusMana() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Sets bonus Mana stat for character +//o------------------------------------------------------------------------------------------------o +void CChar::SetBonusMana( SI16 nVal ) +{ + CBaseObject::SetBonusMana( nVal ); + Dirty( UT_MANA ); + UpdateRegion(); +} + +//o------------------------------------------------------------------------------------------------o +//| Function - CChar::IncBonusHits() +//| Date - 26 May 2024 +//o------------------------------------------------------------------------------------------------o +//| Purpose - Increments GetBonusHits (modifications) by toAdd +//o------------------------------------------------------------------------------------------------o +void CChar::IncBonusHits( SI16 toAdd ) +{ + SetBonusHits( static_cast( GetBonusHits() + toAdd )); +} + +//o------------------------------------------------------------------------------------------------o +//| Function - CChar::IncBonusStam() +//| Date - 26 May 2024 +//o------------------------------------------------------------------------------------------------o +//| Purpose - Increments GetBonusStam (modifications) by toAdd +//o------------------------------------------------------------------------------------------------o +void CChar::IncBonusStam( SI16 toAdd ) +{ + SetBonusStam( static_cast( GetBonusStam() + toAdd )); +} + +//o------------------------------------------------------------------------------------------------o +//| Function - CChar::IncBonusMana() +//| Date - 26 May 2024 +//o------------------------------------------------------------------------------------------------o +//| Purpose - Increments GetBonusMana (modifications) by toAdd +//o------------------------------------------------------------------------------------------------o +void CChar::IncBonusMana( SI16 toAdd ) +{ + SetBonusMana( static_cast( GetBonusMana() + toAdd )); +} + //o------------------------------------------------------------------------------------------------o //| Function - CChar::IncStamina() //o------------------------------------------------------------------------------------------------o diff --git a/source/cChar.h b/source/cChar.h index ed4cc90ba..3156340ff 100644 --- a/source/cChar.h +++ b/source/cChar.h @@ -628,6 +628,15 @@ class CChar : public CBaseObject virtual void SetStrength2( SI16 newValue ) override; virtual void SetDexterity2( SI16 newValue ) override; virtual void SetIntelligence2( SI16 newValue ) override; + + virtual void SetBonusHits( SI16 newValue ) override; + virtual void SetBonusStam( SI16 newValue ) override; + virtual void SetBonusMana( SI16 newValue ) override; + + void IncBonusHits( SI16 toAdd = 1 ); + void IncBonusStam( SI16 toAdd = 1 ); + void IncBonusMana( SI16 toAdd = 1 ); + void IncStamina( SI16 toInc ); void IncMana( SI16 toInc ); void SetMaxLoyalty( UI16 newMaxLoyalty ); From 46b237cfa9b907fa8d6b1aa92b64b5252ccd03cc Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 27 May 2024 15:42:10 -0500 Subject: [PATCH 014/147] update Special Moves --- data/js/combat/special_moves.js | 277 +++++++++++++------------------- 1 file changed, 114 insertions(+), 163 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index a14499824..6383a0d07 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -1,29 +1,10 @@ function onSpecialMove(pUser, abilityID) { - /*switch (abilityID) - { - case 0x01: // Armor Ignore - HandleArmorIgnore(pUser, abilityID); - break; - case 0x05:// Disarm - HandleDisarm(pUser, abilityID); - break; - case 0x06:// Dismount - HandleDismount(pUser, abilityID); - break; - case 0x0C:// ShadowStrike - HandleShadowStrike(pUser, abilityID); - break; - case 0x0B:// Paralyzing Blow - HandleParalyzingBlow(pUser, abilityID); - break; - default: - break; - }*/ - - pUser.TextMessage("I'm activating ability #" + abilityID); + // Check Skills + if (!RequiredSkill(pUser, abilityID)) + return true; + pUser.SetTempTag("abilityID", abilityID); - //pUser.StartTimer(5000, abilityID, true); return true; //The rest of the AOS Abilites before any other expansions @@ -35,11 +16,12 @@ function onSpecialMove(pUser, abilityID) } // Define the checkSkillRequirement function outside RequiredSkill -function checkSkillRequirement(pUser, requiredSkillLevel, requiredSkill, skillMessage) +function checkSkillRequirement(pUser, requiredSkillLevel, requiredSkill, skillMessage, abilityID) { if (pUser.skills[requiredSkill] < requiredSkillLevel) { pUser.SysMessage("You need " + skillMessage + " weapon skill to perform that attack"); + DeactivateSpecialMove(pUser, abilityID) return false; } return true; @@ -50,135 +32,135 @@ function RequiredSkill(pUser, abilityID) { // Define weapon types and their skill requirements and if primary or secondary ability var weaponTypes = { - "0x0DF0": { primary: 0, secondary: 11, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0DF1": { primary: 0, secondary: 11, reqSkill: 41, skillMsg: "mace fighting" }, // Black Staves // WhirlwindAttack, ParalyzingBlow + "0x0DF0": { primary: 0, secondary: 11, reqSkill: 41 }, + "0x0DF1": { primary: 0, secondary: 11, reqSkill: 41 }, // Black Staves // WhirlwindAttack, ParalyzingBlow - "0x0DF2": { primary: 6, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0DF3": { primary: 6, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0DF4": { primary: 6, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0DF5": { primary: 6, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, // wands // Dismount, Disarm + "0x0DF2": { primary: 6, secondary: 5, reqSkill: 41 }, + "0x0DF3": { primary: 6, secondary: 5, reqSkill: 41 }, + "0x0DF4": { primary: 6, secondary: 5, reqSkill: 41 }, + "0x0DF5": { primary: 6, secondary: 5, reqSkill: 41 }, // wands // Dismount, Disarm - "0x0E81": { primary: 0, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0E82": { primary: 0, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, // Shepherd's Crooks // CrushingBlow, Disarm + "0x0E81": { primary: 0, secondary: 5, reqSkill: 41 }, + "0x0E82": { primary: 0, secondary: 5, reqSkill: 41 }, // Shepherd's Crooks // CrushingBlow, Disarm - "0x0e85": { primary: 0, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0e86": { primary: 0, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, // pickaxe // DoubleStrike, Disarm + "0x0e85": { primary: 0, secondary: 5, reqSkill: 40 }, + "0x0e86": { primary: 0, secondary: 5, reqSkill: 40 }, // pickaxe // DoubleStrike, Disarm - "0x0E87": { primary: 0, secondary: 6, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0E88": { primary: 0, secondary: 6, reqSkill: 41, skillMsg: "mace fighting" }, // Pitchforks // BleedAttack, Dismount + "0x0E87": { primary: 0, secondary: 6, reqSkill: 41 }, + "0x0E88": { primary: 0, secondary: 6, reqSkill: 41 }, // Pitchforks // BleedAttack, Dismount - "0x0E89": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0E8A": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, // Quarter Staves // DoubleStrike, ConcussionBlow + "0x0E89": { primary: 0, secondary: 0, reqSkill: 41 }, + "0x0E8A": { primary: 0, secondary: 0, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow - "0x0EC2": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0EC3": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, // Cleavers // BleedAttack, InfectiousStrike + "0x0EC2": { primary: 0, secondary: 0, reqSkill: 41 }, + "0x0EC3": { primary: 0, secondary: 0, reqSkill: 41 }, // Cleavers // BleedAttack, InfectiousStrike - "0x0EC4": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0EC5": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, // Skinning Knives // ShadowStrike, BleedAttack + "0x0EC4": { primary: 0, secondary: 0, reqSkill: 41 }, + "0x0EC5": { primary: 0, secondary: 0, reqSkill: 41 }, // Skinning Knives // ShadowStrike, BleedAttack - "0x0F43": { primary: 1, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F44": { primary: 1, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, // hatchets // ArmorIgnore, Disarm + "0x0F43": { primary: 1, secondary: 5, reqSkill: 40 }, + "0x0F44": { primary: 1, secondary: 5, reqSkill: 40 }, // hatchets // ArmorIgnore, Disarm - "0x0F45": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F46": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Executioner Axes // BleedAttack, MortalStrike + "0x0F45": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x0F46": { primary: 0, secondary: 0, reqSkill: 40 }, // Executioner Axes // BleedAttack, MortalStrike - "0x0F47": { primary: 1, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F48": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Battle Axes // BleedAttack, ConcussionBlow + "0x0F47": { primary: 1, secondary: 5, reqSkill: 40 }, + "0x0F48": { primary: 0, secondary: 0, reqSkill: 40 }, // Battle Axes // BleedAttack, ConcussionBlow - "0x0F49": { primary: 0, secondary: 6, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F4A": { primary: 0, secondary: 6, reqSkill: 40, skillMsg: "Swordsmanship" }, // Axes // CrushingBlow, Dismount + "0x0F49": { primary: 0, secondary: 6, reqSkill: 40 }, + "0x0F4A": { primary: 0, secondary: 6, reqSkill: 40 }, // Axes // CrushingBlow, Dismount - "0x0F4B": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F4C": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Double Axe // DoubleStrike, WhirlwindAttack + "0x0F4B": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x0F4C": { primary: 0, secondary: 0, reqSkill: 40 }, // Double Axe // DoubleStrike, WhirlwindAttack - "0x0F4D": { primary: 11, secondary: 6, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F4E": { primary: 11, secondary: 6, reqSkill: 40, skillMsg: "Swordsmanship" }, // Bardiches // ParalyzingBlow, Dismount + "0x0F4D": { primary: 11, secondary: 6, reqSkill: 40 }, + "0x0F4E": { primary: 11, secondary: 6, reqSkill: 40 }, // Bardiches // ParalyzingBlow, Dismount - "0x0F4F": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F50": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Crossbows // ConcussionBlow, MortalStrike + "0x0F4F": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x0F50": { primary: 0, secondary: 0, reqSkill: 40 }, // Crossbows // ConcussionBlow, MortalStrike - "0x0F51": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F52": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Daggers // InfectiousStrike, ShadowStrike + "0x0F51": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x0F52": { primary: 0, secondary: 0, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike - "0x0F5C": { primary: 0, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0F5D": { primary: 0, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, // Maces // ConcussionBlow, Disarm + "0x0F5C": { primary: 0, secondary: 5, reqSkill: 41 }, + "0x0F5D": { primary: 0, secondary: 5, reqSkill: 41 }, // Maces // ConcussionBlow, Disarm - "0x0F5E": { primary: 0, secondary: 1, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F5F": { primary: 0, secondary: 1, reqSkill: 40, skillMsg: "Swordsmanship" }, // Broadswords // CrushingBlow, ArmorIgnore + "0x0F5E": { primary: 0, secondary: 1, reqSkill: 40 }, + "0x0F5F": { primary: 0, secondary: 1, reqSkill: 40 }, // Broadswords // CrushingBlow, ArmorIgnore - "0x13B7": { primary: 1, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13B8": { primary: 1, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F60": { primary: 1, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F61": { primary: 1, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Longswords // ArmorIgnore, ConcussionBlow + "0x13B7": { primary: 1, secondary: 0, reqSkill: 40 }, + "0x13B8": { primary: 1, secondary: 0, reqSkill: 40 }, + "0x0F60": { primary: 1, secondary: 0, reqSkill: 40 }, + "0x0F61": { primary: 1, secondary: 0, reqSkill: 40 }, // Longswords // ArmorIgnore, ConcussionBlow - "0x0F62": { primary: 1, secondary: 11, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F63": { primary: 1, secondary: 11, reqSkill: 40, skillMsg: "Swordsmanship" }, // Spears // ArmorIgnore, ParalyzingBlow + "0x0F62": { primary: 1, secondary: 11, reqSkill: 40 }, + "0x0F63": { primary: 1, secondary: 11, reqSkill: 40 }, // Spears // ArmorIgnore, ParalyzingBlow - "0x0FB4": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0FB5": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Sledge hammers // CrushingBlow, ShadowStrike + "0x0FB4": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x0FB5": { primary: 0, secondary: 0, reqSkill: 40 }, // Sledge hammers // CrushingBlow, ShadowStrike - "0x13AF": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13B0": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // War Axes // ArmorIgnore, BleedAttack + "0x13AF": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13B0": { primary: 0, secondary: 0, reqSkill: 40 }, // War Axes // ArmorIgnore, BleedAttack - "0x13B1": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13B2": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Bows // ParalyzingBlow, MortalStrike + "0x13B1": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13B2": { primary: 0, secondary: 0, reqSkill: 40 }, // Bows // ParalyzingBlow, MortalStrike - "0x13B3": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13B4": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Clubs // ShadowStrike, Dismount + "0x13B3": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13B4": { primary: 0, secondary: 0, reqSkill: 40 }, // Clubs // ShadowStrike, Dismount - "0x13B5": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13B6": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Scimitars // DoubleStrike, ParalyzingBlow + "0x13B5": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13B6": { primary: 0, secondary: 0, reqSkill: 40 }, // Scimitars // DoubleStrike, ParalyzingBlow - "0x13B9": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13BA": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Viking Swords // ParalyzingBlow, CrushingBlow + "0x13B9": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13BA": { primary: 0, secondary: 0, reqSkill: 40 }, // Viking Swords // ParalyzingBlow, CrushingBlow - "0x13FC": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13FD": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Heavy Crossbows // MovingShot, Dismount + "0x13FC": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13FD": { primary: 0, secondary: 0, reqSkill: 40 }, // Heavy Crossbows // MovingShot, Dismount - "0x13E3": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13E4": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Smith's Hammers // CrushingBlow, ShadowStrike + "0x13E3": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13E4": { primary: 0, secondary: 0, reqSkill: 40 }, // Smith's Hammers // CrushingBlow, ShadowStrike - "0x13F6": { primary: 0, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13F7": { primary: 0, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, // Butcher Knives // InfectiousStrike,Disarm + "0x13F6": { primary: 0, secondary: 5, reqSkill: 40 }, + "0x13F7": { primary: 0, secondary: 5, reqSkill: 40 }, // Butcher Knives // InfectiousStrike,Disarm - "0x13F8": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13F9": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Gnarled Staves // ConcussionBlow,ForceOfNature + "0x13F8": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13F9": { primary: 0, secondary: 0, reqSkill: 40 }, // Gnarled Staves // ConcussionBlow,ForceOfNature - "0x13FA": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13FB": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Large Battle Axes // WhirlwindAttack,BleedAttack + "0x13FA": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13FB": { primary: 0, secondary: 0, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack - "0x13FE": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13FF": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Katana // DoubleStrike,ArmorIgnore + "0x13FE": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13FF": { primary: 0, secondary: 0, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore - "0x1400": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x1401": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Kryss // ArmorIgnore,InfectiousStrike + "0x1400": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x1401": { primary: 0, secondary: 0, reqSkill: 40 }, // Kryss // ArmorIgnore,InfectiousStrike - "0x1402": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x1403": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Short Spears // ShadowStrike,MortalStrike + "0x1402": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x1403": { primary: 0, secondary: 0, reqSkill: 40 }, // Short Spears // ShadowStrike,MortalStrike - "0x1404": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x1405": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // War Forks // BleedAttack,Disarm + "0x1404": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x1405": { primary: 0, secondary: 0, reqSkill: 40 }, // War Forks // BleedAttack,Disarm - "0x1406": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x1407": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // War Maces // CrushingBlow,MortalStrike + "0x1406": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x1407": { primary: 0, secondary: 0, reqSkill: 40 }, // War Maces // CrushingBlow,MortalStrike - "0x1438": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x1439": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // War Hammers // WhirlwindAttack,CrushingBlow + "0x1438": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x1439": { primary: 0, secondary: 0, reqSkill: 40 }, // War Hammers // WhirlwindAttack,CrushingBlow - "0x143A": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x143B": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Mauls // DoubleStrike,ConcussionBlow + "0x143A": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x143B": { primary: 0, secondary: 0, reqSkill: 40 }, // Mauls // DoubleStrike,ConcussionBlow - "0x143C": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x143D": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Hammer Picks // ArmorIgnore,MortalStrike + "0x143C": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x143D": { primary: 0, secondary: 0, reqSkill: 40 }, // Hammer Picks // ArmorIgnore,MortalStrike - "0x143E": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x143F": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Halberds // WhirlwindAttack,ConcussionBlow + "0x143E": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x143F": { primary: 0, secondary: 0, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow - "0x1440": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x1441": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Cutlasses // BleedAttack,ShadowStrike + "0x1440": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x1441": { primary: 0, secondary: 0, reqSkill: 40 }, // Cutlasses // BleedAttack,ShadowStrike - "0x1442": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x1443": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" } // Two Handed Axes // DoubleStrike,ShadowStrike + "0x1442": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x1443": { primary: 0, secondary: 0, reqSkill: 40 } // Two Handed Axes // DoubleStrike,ShadowStrike }; // Get items in user's hands @@ -186,7 +168,8 @@ function RequiredSkill(pUser, abilityID) var itemLHand = pUser.FindItemLayer(0x02); // Check if either hand has an item - if (itemRHand != null) { + if (itemRHand != null) + { // Check item in the right hand if (weaponTypes[itemRHand.sectionID]) { @@ -194,11 +177,11 @@ function RequiredSkill(pUser, abilityID) if (abilityID == weapon.primary) { - return checkSkillRequirement(pUser, 700, weapon.reqSkill, weapon.skillMsg); + return checkSkillRequirement(pUser, 700, weapon.reqSkill, "70", abilityID); } else if (abilityID == weapon.secondary) { - return checkSkillRequirement(pUser, 900, weapon.reqSkill, weapon.skillMsg); + return checkSkillRequirement(pUser, 900, weapon.reqSkill, "90", abilityID); } } } @@ -210,11 +193,11 @@ function RequiredSkill(pUser, abilityID) var weapon = weaponTypes[itemLHand.sectionID]; if (abilityID == weapon.primary) { - return checkSkillRequirement(pUser, 700, weapon.reqSkill, weapon.skillMsg); + return checkSkillRequirement(pUser, 700, weapon.reqSkill, "70", abilityID); } else if (abilityID == weapon.secondary) { - return checkSkillRequirement(pUser, 900, weapon.reqSkill, weapon.skillMsg); + return checkSkillRequirement(pUser, 900, weapon.reqSkill, "90", abilityID); } } } @@ -222,11 +205,11 @@ function RequiredSkill(pUser, abilityID) { if (abilityID == 5) { - return checkSkillRequirement(pUser, 700, 43, "Wrestling"); + return checkSkillRequirement(pUser, 700, 43, "70"); } else if (abilityID == 11) { - return checkSkillRequirement(pUser, 900, 43, "Wrestling"); + return checkSkillRequirement(pUser, 900, 43, "90"); } } @@ -260,35 +243,6 @@ function CheckMana(pUser, abilityID, requiredMana) } } -function HandleArmorIgnore(pUser, abilityID) -{ - pUser.SetTempTag("ArmorIgnore", true); - pUser.SetTempTag("abilityID", abilityID); -} - -function HandleDismount(pUser, abilityID) -{ - pUser.SetTempTag("Dismount", true); - pUser.SetTempTag("abilityID", abilityID); -} - -function HandleShadowStrike(pUser, abilityID) -{ - pUser.SetTempTag("ShadowStrike", true); - pUser.SetTempTag("abilityID", abilityID); -} - -function HandleParalyzingBlow(pUser, abilityID) -{ - pUser.SetTempTag("ParalyzingBlow", true); - pUser.SetTempTag("abilityID", abilityID); -} - -function HandleDisarm(pUser, abilityID) -{ - pUser.SetTempTag("Disarm", true); -} - function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) { var abilityID = pAttacker.GetTempTag("abilityID"); @@ -464,17 +418,20 @@ function onAttack( pAttacker, pDefender ) pDefender.StaticEffect(0x376A, 0x09, 0x32); var IsImmune = pDefender.GetTempTag("IsImmune") - if (IsImmune != null && IsImmune == true) { + if (IsImmune != null && IsImmune == true) + { pAttacker.TextMessage("Your target resists paralysis."); pDefender.TextMessage("You resist paralysis."); return true; } var seconds = 3000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) - if (pDefender.npc) { + if (pDefender.npc) + { seconds = 6000; } - else if (pDefender.socket) { + else if (pDefender.socket) + { pDefender.TextMessage("The attack has temporarily paralyzed you!", false, 0x3b2, 0, pDefender.serial);// The attack has temporarily paralyzed you! } @@ -483,27 +440,26 @@ function onAttack( pAttacker, pDefender ) pDefender.StartTimer(seconds, 8000, true); pDefender.frozen = true; - if (pAttacker.socket) { + if (pAttacker.socket) + { pAttacker.TextMessage(GetDictionaryEntry(17702, pAttacker.socket.language), false, 0x3b2, 0, pAttacker.serial);// You deliver a paralyzing blow! } ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 5) // Disarm { - //check skills - if (!RequiredSkill(pAttacker, abilityID)) - return true; - var itemRHand = pDefender.FindItemLayer(0x01); var itemLHand = pDefender.FindItemLayer(0x02); var requiredMana = 20; - if (pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2) { + if (pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2) + { pAttacker.SysMessage("You cannot disarm your opponent."); return false; } - if (itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9) { + if (itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9) + { pAttacker.SysMessage("Your target is already unarmed!"); return false; } @@ -636,9 +592,4 @@ function onTimer( timerObj, timerID ) timerObj.SetTempTag("BlockEquip", false); socket.SysMessage("Your confusion has passed, you may now arm a weapon!"); } - else if (timerObj.socket) - { - //Toggle ability off after 5 second timer has elapsed - DeactivateSpecialMove(timerObj, timerID); - } } \ No newline at end of file From a6437b935d7e1b0d05a061fcb8f1f0a96df8b7fe Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 27 May 2024 16:07:16 -0500 Subject: [PATCH 015/147] Updates --- data/js/combat/special_moves.js | 156 ++++++++++++++++---------------- 1 file changed, 79 insertions(+), 77 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 6383a0d07..9629e198a 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -12,7 +12,7 @@ function onSpecialMove(pUser, abilityID) //Infectious Strike //Double Strike //Bleed Attack - //Whirlwind Attack + //Whirlwind Attack } // Define the checkSkillRequirement function outside RequiredSkill @@ -28,7 +28,7 @@ function checkSkillRequirement(pUser, requiredSkillLevel, requiredSkill, skillMe } // Define the RequiredSkill function -function RequiredSkill(pUser, abilityID) +function RequiredSkill( pUser, abilityID ) { // Define weapon types and their skill requirements and if primary or secondary ability var weaponTypes = { @@ -40,8 +40,8 @@ function RequiredSkill(pUser, abilityID) "0x0DF4": { primary: 6, secondary: 5, reqSkill: 41 }, "0x0DF5": { primary: 6, secondary: 5, reqSkill: 41 }, // wands // Dismount, Disarm - "0x0E81": { primary: 0, secondary: 5, reqSkill: 41 }, - "0x0E82": { primary: 0, secondary: 5, reqSkill: 41 }, // Shepherd's Crooks // CrushingBlow, Disarm + "0x0E81": { primary: 4, secondary: 5, reqSkill: 41 }, + "0x0E82": { primary: 4, secondary: 5, reqSkill: 41 }, // Shepherd's Crooks // CrushingBlow, Disarm "0x0e85": { primary: 0, secondary: 5, reqSkill: 40 }, "0x0e86": { primary: 0, secondary: 5, reqSkill: 40 }, // pickaxe // DoubleStrike, Disarm @@ -49,14 +49,14 @@ function RequiredSkill(pUser, abilityID) "0x0E87": { primary: 0, secondary: 6, reqSkill: 41 }, "0x0E88": { primary: 0, secondary: 6, reqSkill: 41 }, // Pitchforks // BleedAttack, Dismount - "0x0E89": { primary: 0, secondary: 0, reqSkill: 41 }, - "0x0E8A": { primary: 0, secondary: 0, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow + "0x0E89": { primary: 0, secondary: 3, reqSkill: 41 }, + "0x0E8A": { primary: 0, secondary: 3, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow "0x0EC2": { primary: 0, secondary: 0, reqSkill: 41 }, "0x0EC3": { primary: 0, secondary: 0, reqSkill: 41 }, // Cleavers // BleedAttack, InfectiousStrike - "0x0EC4": { primary: 0, secondary: 0, reqSkill: 41 }, - "0x0EC5": { primary: 0, secondary: 0, reqSkill: 41 }, // Skinning Knives // ShadowStrike, BleedAttack + "0x0EC4": { primary: 12, secondary: 0, reqSkill: 41 }, + "0x0EC5": { primary: 12, secondary: 0, reqSkill: 41 }, // Skinning Knives // ShadowStrike, BleedAttack "0x0F43": { primary: 1, secondary: 5, reqSkill: 40 }, "0x0F44": { primary: 1, secondary: 5, reqSkill: 40 }, // hatchets // ArmorIgnore, Disarm @@ -64,11 +64,11 @@ function RequiredSkill(pUser, abilityID) "0x0F45": { primary: 0, secondary: 0, reqSkill: 40 }, "0x0F46": { primary: 0, secondary: 0, reqSkill: 40 }, // Executioner Axes // BleedAttack, MortalStrike - "0x0F47": { primary: 1, secondary: 5, reqSkill: 40 }, - "0x0F48": { primary: 0, secondary: 0, reqSkill: 40 }, // Battle Axes // BleedAttack, ConcussionBlow + "0x0F47": { primary: 0, secondary: 3, reqSkill: 40 }, + "0x0F48": { primary: 0, secondary: 3, reqSkill: 40 }, // Battle Axes // BleedAttack, ConcussionBlow - "0x0F49": { primary: 0, secondary: 6, reqSkill: 40 }, - "0x0F4A": { primary: 0, secondary: 6, reqSkill: 40 }, // Axes // CrushingBlow, Dismount + "0x0F49": { primary: 4, secondary: 6, reqSkill: 40 }, + "0x0F4A": { primary: 4, secondary: 6, reqSkill: 40 }, // Axes // CrushingBlow, Dismount "0x0F4B": { primary: 0, secondary: 0, reqSkill: 40 }, "0x0F4C": { primary: 0, secondary: 0, reqSkill: 40 }, // Double Axe // DoubleStrike, WhirlwindAttack @@ -76,91 +76,91 @@ function RequiredSkill(pUser, abilityID) "0x0F4D": { primary: 11, secondary: 6, reqSkill: 40 }, "0x0F4E": { primary: 11, secondary: 6, reqSkill: 40 }, // Bardiches // ParalyzingBlow, Dismount - "0x0F4F": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x0F50": { primary: 0, secondary: 0, reqSkill: 40 }, // Crossbows // ConcussionBlow, MortalStrike + "0x0F4F": { primary: 3, secondary: 0, reqSkill: 40 }, + "0x0F50": { primary: 3, secondary: 0, reqSkill: 40 }, // Crossbows // ConcussionBlow, MortalStrike - "0x0F51": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x0F52": { primary: 0, secondary: 0, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike + "0x0F51": { primary: 0, secondary: 12, reqSkill: 40 }, + "0x0F52": { primary: 0, secondary: 12, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike - "0x0F5C": { primary: 0, secondary: 5, reqSkill: 41 }, - "0x0F5D": { primary: 0, secondary: 5, reqSkill: 41 }, // Maces // ConcussionBlow, Disarm + "0x0F5C": { primary: 3, secondary: 5, reqSkill: 41 }, + "0x0F5D": { primary: 3, secondary: 5, reqSkill: 41 }, // Maces // ConcussionBlow, Disarm - "0x0F5E": { primary: 0, secondary: 1, reqSkill: 40 }, - "0x0F5F": { primary: 0, secondary: 1, reqSkill: 40 }, // Broadswords // CrushingBlow, ArmorIgnore + "0x0F5E": { primary: 4, secondary: 1, reqSkill: 40 }, + "0x0F5F": { primary: 4, secondary: 1, reqSkill: 40 }, // Broadswords // CrushingBlow, ArmorIgnore - "0x13B7": { primary: 1, secondary: 0, reqSkill: 40 }, - "0x13B8": { primary: 1, secondary: 0, reqSkill: 40 }, - "0x0F60": { primary: 1, secondary: 0, reqSkill: 40 }, - "0x0F61": { primary: 1, secondary: 0, reqSkill: 40 }, // Longswords // ArmorIgnore, ConcussionBlow + "0x13B7": { primary: 1, secondary: 3, reqSkill: 40 }, + "0x13B8": { primary: 1, secondary: 3, reqSkill: 40 }, + "0x0F60": { primary: 1, secondary: 3, reqSkill: 40 }, + "0x0F61": { primary: 1, secondary: 3, reqSkill: 40 }, // Longswords // ArmorIgnore, ConcussionBlow "0x0F62": { primary: 1, secondary: 11, reqSkill: 40 }, "0x0F63": { primary: 1, secondary: 11, reqSkill: 40 }, // Spears // ArmorIgnore, ParalyzingBlow - "0x0FB4": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x0FB5": { primary: 0, secondary: 0, reqSkill: 40 }, // Sledge hammers // CrushingBlow, ShadowStrike + "0x0FB4": { primary: 4, secondary: 12, reqSkill: 40 }, + "0x0FB5": { primary: 4, secondary: 12, reqSkill: 40 }, // Sledge hammers // CrushingBlow, ShadowStrike - "0x13AF": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13B0": { primary: 0, secondary: 0, reqSkill: 40 }, // War Axes // ArmorIgnore, BleedAttack + "0x13AF": { primary: 1, secondary: 0, reqSkill: 40 }, + "0x13B0": { primary: 1, secondary: 0, reqSkill: 40 }, // War Axes // ArmorIgnore, BleedAttack - "0x13B1": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13B2": { primary: 0, secondary: 0, reqSkill: 40 }, // Bows // ParalyzingBlow, MortalStrike + "0x13B1": { primary: 11, secondary: 0, reqSkill: 40 }, + "0x13B2": { primary: 11, secondary: 0, reqSkill: 40 }, // Bows // ParalyzingBlow, MortalStrike - "0x13B3": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13B4": { primary: 0, secondary: 0, reqSkill: 40 }, // Clubs // ShadowStrike, Dismount + "0x13B3": { primary: 12, secondary: 6, reqSkill: 40 }, + "0x13B4": { primary: 12, secondary: 6, reqSkill: 40 }, // Clubs // ShadowStrike, Dismount - "0x13B5": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13B6": { primary: 0, secondary: 0, reqSkill: 40 }, // Scimitars // DoubleStrike, ParalyzingBlow + "0x13B5": { primary: 0, secondary: 11, reqSkill: 40 }, + "0x13B6": { primary: 0, secondary: 1, reqSkill: 40 }, // Scimitars // DoubleStrike, ParalyzingBlow - "0x13B9": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13BA": { primary: 0, secondary: 0, reqSkill: 40 }, // Viking Swords // ParalyzingBlow, CrushingBlow + "0x13B9": { primary: 11, secondary: 4, reqSkill: 40 }, + "0x13BA": { primary: 11, secondary: 4, reqSkill: 40 }, // Viking Swords // ParalyzingBlow, CrushingBlow - "0x13FC": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13FD": { primary: 0, secondary: 0, reqSkill: 40 }, // Heavy Crossbows // MovingShot, Dismount + "0x13FC": { primary: 0, secondary: 6, reqSkill: 40 }, + "0x13FD": { primary: 0, secondary: 6, reqSkill: 40 }, // Heavy Crossbows // MovingShot, Dismount - "0x13E3": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13E4": { primary: 0, secondary: 0, reqSkill: 40 }, // Smith's Hammers // CrushingBlow, ShadowStrike + "0x13E3": { primary: 4, secondary: 12, reqSkill: 40 }, + "0x13E4": { primary: 4, secondary: 12, reqSkill: 40 }, // Smith's Hammers // CrushingBlow, ShadowStrike "0x13F6": { primary: 0, secondary: 5, reqSkill: 40 }, "0x13F7": { primary: 0, secondary: 5, reqSkill: 40 }, // Butcher Knives // InfectiousStrike,Disarm - "0x13F8": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13F9": { primary: 0, secondary: 0, reqSkill: 40 }, // Gnarled Staves // ConcussionBlow,ForceOfNature + "0x13F8": { primary: 3, secondary: 0, reqSkill: 40 }, + "0x13F9": { primary: 3, secondary: 0, reqSkill: 40 }, // Gnarled Staves // ConcussionBlow,ForceOfNature "0x13FA": { primary: 0, secondary: 0, reqSkill: 40 }, "0x13FB": { primary: 0, secondary: 0, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack - "0x13FE": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13FF": { primary: 0, secondary: 0, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore + "0x13FE": { primary: 0, secondary: 1, reqSkill: 40 }, + "0x13FF": { primary: 0, secondary: 1, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore - "0x1400": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x1401": { primary: 0, secondary: 0, reqSkill: 40 }, // Kryss // ArmorIgnore,InfectiousStrike + "0x1400": { primary: 1, secondary: 0, reqSkill: 40 }, + "0x1401": { primary: 1, secondary: 0, reqSkill: 40 }, // Kryss // ArmorIgnore,InfectiousStrike - "0x1402": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x1403": { primary: 0, secondary: 0, reqSkill: 40 }, // Short Spears // ShadowStrike,MortalStrike + "0x1402": { primary: 12, secondary: 0, reqSkill: 40 }, + "0x1403": { primary: 12, secondary: 0, reqSkill: 40 }, // Short Spears // ShadowStrike,MortalStrike - "0x1404": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x1405": { primary: 0, secondary: 0, reqSkill: 40 }, // War Forks // BleedAttack,Disarm + "0x1404": { primary: 0, secondary: 5, reqSkill: 40 }, + "0x1405": { primary: 0, secondary: 5, reqSkill: 40 }, // War Forks // BleedAttack,Disarm - "0x1406": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x1407": { primary: 0, secondary: 0, reqSkill: 40 }, // War Maces // CrushingBlow,MortalStrike + "0x1406": { primary: 4, secondary: 0, reqSkill: 40 }, + "0x1407": { primary: 4, secondary: 0, reqSkill: 40 }, // War Maces // CrushingBlow,MortalStrike - "0x1438": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x1439": { primary: 0, secondary: 0, reqSkill: 40 }, // War Hammers // WhirlwindAttack,CrushingBlow + "0x1438": { primary: 0, secondary: 4, reqSkill: 40 }, + "0x1439": { primary: 0, secondary: 4, reqSkill: 40 }, // War Hammers // WhirlwindAttack,CrushingBlow - "0x143A": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x143B": { primary: 0, secondary: 0, reqSkill: 40 }, // Mauls // DoubleStrike,ConcussionBlow + "0x143A": { primary: 0, secondary: 3, reqSkill: 40 }, + "0x143B": { primary: 0, secondary: 3, reqSkill: 40 }, // Mauls // DoubleStrike,ConcussionBlow - "0x143C": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x143D": { primary: 0, secondary: 0, reqSkill: 40 }, // Hammer Picks // ArmorIgnore,MortalStrike + "0x143C": { primary: 1, secondary: 0, reqSkill: 40 }, + "0x143D": { primary: 1, secondary: 0, reqSkill: 40 }, // Hammer Picks // ArmorIgnore,MortalStrike - "0x143E": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x143F": { primary: 0, secondary: 0, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow + "0x143E": { primary: 0, secondary: 3, reqSkill: 40 }, + "0x143F": { primary: 0, secondary: 3, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow - "0x1440": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x1441": { primary: 0, secondary: 0, reqSkill: 40 }, // Cutlasses // BleedAttack,ShadowStrike + "0x1440": { primary: 0, secondary: 12, reqSkill: 40 }, + "0x1441": { primary: 0, secondary: 12, reqSkill: 40 }, // Cutlasses // BleedAttack,ShadowStrike - "0x1442": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x1443": { primary: 0, secondary: 0, reqSkill: 40 } // Two Handed Axes // DoubleStrike,ShadowStrike + "0x1442": { primary: 0, secondary: 12, reqSkill: 40 }, + "0x1443": { primary: 0, secondary: 12, reqSkill: 40 } // Two Handed Axes // DoubleStrike,ShadowStrike }; // Get items in user's hands @@ -322,7 +322,7 @@ function onAttack( pAttacker, pDefender ) { var requiredMana = 14; - // Clear out any current ability the player is doing + // Clear out any current ability the player is doing when he switches abilities if (abilityID != 1) DeactivateSpecialMove(pAttacker.socket, abilityID); @@ -346,7 +346,7 @@ function onAttack( pAttacker, pDefender ) return true; } - // Clear out any current ability the player is doing + // Clear out any current ability the player is doing when he switches abilities if (abilityID != 12) DeactivateSpecialMove(pAttacker.socket, abilityID); @@ -375,18 +375,20 @@ function onAttack( pAttacker, pDefender ) return true; // Check to see if player is mount or flying. - if (pAttacker.isonhorse) { + if (pAttacker.isonhorse) + { pAttacker.TextMessage("You cannot perform that attack while mounted or flying!"); DeactivateSpecialMove(pAttacker.socket, abilityID); return true; } - // Clear out any current ability the player is doing + // Clear out any current ability the player is doing when he switches abilities if (abilityID != 6) DeactivateSpecialMove(pAttacker.socket, abilityID); // Only Can work on players or npcs that is mounted - if (!pDefender.isonhorse) { + if (!pDefender.isonhorse) + { pAttacker.TextMessage("This attack only works on mounted or flying targets"); return true; } @@ -410,7 +412,7 @@ function onAttack( pAttacker, pDefender ) if (!CheckMana(pAttacker, abilityID, requiredMana)) return true; - // Clear out any current ability the player is doing + // Clear out any current ability the player is doing when he switches abilities if (abilityID != 11) DeactivateSpecialMove(pAttacker.socket, abilityID); @@ -468,7 +470,7 @@ function onAttack( pAttacker, pDefender ) if (!CheckMana(pAttacker, abilityID, requiredMana)) return true; - // Clear out any current ability the player is doing + // Clear out any current ability the player is doing when he switches abilities if (abilityID != 5) DeactivateSpecialMove(pAttacker, abilityID); @@ -504,7 +506,7 @@ function onAttack( pAttacker, pDefender ) if (!CheckMana(pAttacker, abilityID, requiredMana)) return true; - // Clear out any current ability the player is doing + // Clear out any current ability the player is doing when he switches abilities if (abilityID != 4) DeactivateSpecialMove(pAttacker, abilityID); @@ -521,7 +523,7 @@ function onAttack( pAttacker, pDefender ) if (!CheckMana(pAttacker, abilityID, requiredMana)) return true; - // Clear out any current ability the player is doing + // Clear out any current ability the player is doing when he switches abilities if (abilityID != 3) DeactivateSpecialMove(pAttacker, abilityID); @@ -572,9 +574,9 @@ function onTimer( timerObj, timerID ) if (timerObj == null || timerObj.dead) { timerObj.frozen = false; - timerObj.SetTempTag("IsImmune", false); + timerObj.SetTempTag("IsImmune", null); timerObj.RemoveScriptTrigger(7002); - timerObj.SetTempTag("BlockEquip", false); + timerObj.SetTempTag("BlockEquip", null); ClearSpecialMove(timerObj, abilityID); return; } @@ -584,12 +586,12 @@ function onTimer( timerObj, timerID ) } else if (timerID == 9000) { - timerObj.SetTempTag("IsImmune", false); + timerObj.SetTempTag("IsImmune", null); } else if (timerID == 9100) { timerObj.RemoveScriptTrigger(7002); - timerObj.SetTempTag("BlockEquip", false); + timerObj.SetTempTag("BlockEquip", null); socket.SysMessage("Your confusion has passed, you may now arm a weapon!"); } } \ No newline at end of file From 12d3e6686ae8e4f9dae14143b4b0365ff927db10 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 27 May 2024 16:58:40 -0500 Subject: [PATCH 016/147] Missing Wand ID's --- data/js/server/data/weapontypes.js | 4 ++++ source/Changelog.txt | 3 +++ source/combat.cpp | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/data/js/server/data/weapontypes.js b/data/js/server/data/weapontypes.js index 42fe15a2b..0a6940e56 100644 --- a/data/js/server/data/weapontypes.js +++ b/data/js/server/data/weapontypes.js @@ -208,6 +208,10 @@ function GetWeaponType( mChar, itemID ) case 0x48B3: //gargish axe - SA weaponType = "TWOHND_AXES"; break; // Default Maces + case 0x0DF2: // Wand + case 0x0DF3: // Wand + case 0x0DF4: // Wand + case 0x0DF5: // Wand case 0x0FB4: //sledge hammer case 0x0FB5: //sledge hammer case 0x0F5C: //mace diff --git a/source/Changelog.txt b/source/Changelog.txt index f64afbc32..424b6f5f6 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,6 @@ +27/05/2024 - Dragon Slayer + Added Missing Wand ID's to combat weapon type in core and in js. + 1/05/2024 - Dragon Slayer/Xuri Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode. Fixed createfood to check for reagents on cast. diff --git a/source/combat.cpp b/source/combat.cpp index 8817d7b3d..b38953b35 100644 --- a/source/combat.cpp +++ b/source/combat.cpp @@ -801,6 +801,10 @@ UI08 CHandleCombat::GetWeaponType( CItem *i ) case 0x48B3: //gargish axe - SA return TWOHND_AXES; // Default Maces + case 0x0DF2: // Wand + case 0x0DF3: // Wand + case 0x0DF4: // Wand + case 0x0DF5: // Wand case 0x13E3: //smith's hammer case 0x13E4: //smith's hammer case 0x13B3: //club From 863c0dc3fc397a0a075a6953dd2af209cf99977a Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 27 May 2024 17:20:19 -0500 Subject: [PATCH 017/147] Update Skills Cleanup functions --- data/js/combat/special_moves.js | 159 ++++++++++++++++---------------- 1 file changed, 80 insertions(+), 79 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 9629e198a..a94a93067 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -15,18 +15,18 @@ function onSpecialMove(pUser, abilityID) //Whirlwind Attack } -// Define the checkSkillRequirement function outside RequiredSkill -function checkSkillRequirement(pUser, requiredSkillLevel, requiredSkill, skillMessage, abilityID) +function checkSkillRequirement( pUser, requiredSkillLevel, requiredSkill, skillMessage, abilityID ) { - if (pUser.skills[requiredSkill] < requiredSkillLevel) + if( pUser.skills[requiredSkill] < requiredSkillLevel ) { - pUser.SysMessage("You need " + skillMessage + " weapon skill to perform that attack"); - DeactivateSpecialMove(pUser, abilityID) + pUser.SysMessage( "You need " + skillMessage + " weapon skill to perform that attack" ); + DeactivateSpecialMove( pUser, abilityID ); return false; } return true; } +// archery 31 swordsmansip 40 macefighting 41 fencing 42 wrestling 43 // Define the RequiredSkill function function RequiredSkill( pUser, abilityID ) { @@ -46,17 +46,17 @@ function RequiredSkill( pUser, abilityID ) "0x0e85": { primary: 0, secondary: 5, reqSkill: 40 }, "0x0e86": { primary: 0, secondary: 5, reqSkill: 40 }, // pickaxe // DoubleStrike, Disarm - "0x0E87": { primary: 0, secondary: 6, reqSkill: 41 }, - "0x0E88": { primary: 0, secondary: 6, reqSkill: 41 }, // Pitchforks // BleedAttack, Dismount + "0x0E87": { primary: 0, secondary: 6, reqSkill: 42 }, + "0x0E88": { primary: 0, secondary: 6, reqSkill: 42 }, // Pitchforks // BleedAttack, Dismount "0x0E89": { primary: 0, secondary: 3, reqSkill: 41 }, "0x0E8A": { primary: 0, secondary: 3, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow - "0x0EC2": { primary: 0, secondary: 0, reqSkill: 41 }, - "0x0EC3": { primary: 0, secondary: 0, reqSkill: 41 }, // Cleavers // BleedAttack, InfectiousStrike + "0x0EC2": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x0EC3": { primary: 0, secondary: 0, reqSkill: 40 }, // Cleavers // BleedAttack, InfectiousStrike - "0x0EC4": { primary: 12, secondary: 0, reqSkill: 41 }, - "0x0EC5": { primary: 12, secondary: 0, reqSkill: 41 }, // Skinning Knives // ShadowStrike, BleedAttack + "0x0EC4": { primary: 12, secondary: 0, reqSkill: 40 }, + "0x0EC5": { primary: 12, secondary: 0, reqSkill: 40 }, // Skinning Knives // ShadowStrike, BleedAttack "0x0F43": { primary: 1, secondary: 5, reqSkill: 40 }, "0x0F44": { primary: 1, secondary: 5, reqSkill: 40 }, // hatchets // ArmorIgnore, Disarm @@ -76,8 +76,8 @@ function RequiredSkill( pUser, abilityID ) "0x0F4D": { primary: 11, secondary: 6, reqSkill: 40 }, "0x0F4E": { primary: 11, secondary: 6, reqSkill: 40 }, // Bardiches // ParalyzingBlow, Dismount - "0x0F4F": { primary: 3, secondary: 0, reqSkill: 40 }, - "0x0F50": { primary: 3, secondary: 0, reqSkill: 40 }, // Crossbows // ConcussionBlow, MortalStrike + "0x0F4F": { primary: 3, secondary: 0, reqSkill: 31 }, + "0x0F50": { primary: 3, secondary: 0, reqSkill: 31 }, // Crossbows // ConcussionBlow, MortalStrike "0x0F51": { primary: 0, secondary: 12, reqSkill: 40 }, "0x0F52": { primary: 0, secondary: 12, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike @@ -93,20 +93,20 @@ function RequiredSkill( pUser, abilityID ) "0x0F60": { primary: 1, secondary: 3, reqSkill: 40 }, "0x0F61": { primary: 1, secondary: 3, reqSkill: 40 }, // Longswords // ArmorIgnore, ConcussionBlow - "0x0F62": { primary: 1, secondary: 11, reqSkill: 40 }, - "0x0F63": { primary: 1, secondary: 11, reqSkill: 40 }, // Spears // ArmorIgnore, ParalyzingBlow + "0x0F62": { primary: 1, secondary: 11, reqSkill: 42 }, + "0x0F63": { primary: 1, secondary: 11, reqSkill: 42 }, // Spears // ArmorIgnore, ParalyzingBlow - "0x0FB4": { primary: 4, secondary: 12, reqSkill: 40 }, - "0x0FB5": { primary: 4, secondary: 12, reqSkill: 40 }, // Sledge hammers // CrushingBlow, ShadowStrike + "0x0FB4": { primary: 4, secondary: 12, reqSkill: 41 }, + "0x0FB5": { primary: 4, secondary: 12, reqSkill: 41 }, // Sledge hammers // CrushingBlow, ShadowStrike "0x13AF": { primary: 1, secondary: 0, reqSkill: 40 }, "0x13B0": { primary: 1, secondary: 0, reqSkill: 40 }, // War Axes // ArmorIgnore, BleedAttack - "0x13B1": { primary: 11, secondary: 0, reqSkill: 40 }, - "0x13B2": { primary: 11, secondary: 0, reqSkill: 40 }, // Bows // ParalyzingBlow, MortalStrike + "0x13B1": { primary: 11, secondary: 0, reqSkill: 31 }, + "0x13B2": { primary: 11, secondary: 0, reqSkill: 31 }, // Bows // ParalyzingBlow, MortalStrike - "0x13B3": { primary: 12, secondary: 6, reqSkill: 40 }, - "0x13B4": { primary: 12, secondary: 6, reqSkill: 40 }, // Clubs // ShadowStrike, Dismount + "0x13B3": { primary: 12, secondary: 6, reqSkill: 41 }, + "0x13B4": { primary: 12, secondary: 6, reqSkill: 41 }, // Clubs // ShadowStrike, Dismount "0x13B5": { primary: 0, secondary: 11, reqSkill: 40 }, "0x13B6": { primary: 0, secondary: 1, reqSkill: 40 }, // Scimitars // DoubleStrike, ParalyzingBlow @@ -114,17 +114,17 @@ function RequiredSkill( pUser, abilityID ) "0x13B9": { primary: 11, secondary: 4, reqSkill: 40 }, "0x13BA": { primary: 11, secondary: 4, reqSkill: 40 }, // Viking Swords // ParalyzingBlow, CrushingBlow - "0x13FC": { primary: 0, secondary: 6, reqSkill: 40 }, - "0x13FD": { primary: 0, secondary: 6, reqSkill: 40 }, // Heavy Crossbows // MovingShot, Dismount + "0x13FC": { primary: 0, secondary: 6, reqSkill: 31 }, + "0x13FD": { primary: 0, secondary: 6, reqSkill: 31 }, // Heavy Crossbows // MovingShot, Dismount - "0x13E3": { primary: 4, secondary: 12, reqSkill: 40 }, - "0x13E4": { primary: 4, secondary: 12, reqSkill: 40 }, // Smith's Hammers // CrushingBlow, ShadowStrike + "0x13E3": { primary: 4, secondary: 12, reqSkill: 41 }, + "0x13E4": { primary: 4, secondary: 12, reqSkill: 41 }, // Smith's Hammers // CrushingBlow, ShadowStrike "0x13F6": { primary: 0, secondary: 5, reqSkill: 40 }, "0x13F7": { primary: 0, secondary: 5, reqSkill: 40 }, // Butcher Knives // InfectiousStrike,Disarm - "0x13F8": { primary: 3, secondary: 0, reqSkill: 40 }, - "0x13F9": { primary: 3, secondary: 0, reqSkill: 40 }, // Gnarled Staves // ConcussionBlow,ForceOfNature + "0x13F8": { primary: 3, secondary: 0, reqSkill: 41 }, + "0x13F9": { primary: 3, secondary: 0, reqSkill: 41 }, // Gnarled Staves // ConcussionBlow,ForceOfNature "0x13FA": { primary: 0, secondary: 0, reqSkill: 40 }, "0x13FB": { primary: 0, secondary: 0, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack @@ -132,26 +132,26 @@ function RequiredSkill( pUser, abilityID ) "0x13FE": { primary: 0, secondary: 1, reqSkill: 40 }, "0x13FF": { primary: 0, secondary: 1, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore - "0x1400": { primary: 1, secondary: 0, reqSkill: 40 }, - "0x1401": { primary: 1, secondary: 0, reqSkill: 40 }, // Kryss // ArmorIgnore,InfectiousStrike + "0x1400": { primary: 1, secondary: 0, reqSkill: 42 }, + "0x1401": { primary: 1, secondary: 0, reqSkill: 42 }, // Kryss // ArmorIgnore,InfectiousStrike - "0x1402": { primary: 12, secondary: 0, reqSkill: 40 }, - "0x1403": { primary: 12, secondary: 0, reqSkill: 40 }, // Short Spears // ShadowStrike,MortalStrike + "0x1402": { primary: 12, secondary: 0, reqSkill: 42 }, + "0x1403": { primary: 12, secondary: 0, reqSkill: 42 }, // Short Spears // ShadowStrike,MortalStrike - "0x1404": { primary: 0, secondary: 5, reqSkill: 40 }, - "0x1405": { primary: 0, secondary: 5, reqSkill: 40 }, // War Forks // BleedAttack,Disarm + "0x1404": { primary: 0, secondary: 5, reqSkill: 42 }, + "0x1405": { primary: 0, secondary: 5, reqSkill: 42 }, // War Forks // BleedAttack,Disarm - "0x1406": { primary: 4, secondary: 0, reqSkill: 40 }, - "0x1407": { primary: 4, secondary: 0, reqSkill: 40 }, // War Maces // CrushingBlow,MortalStrike + "0x1406": { primary: 4, secondary: 0, reqSkill: 41 }, + "0x1407": { primary: 4, secondary: 0, reqSkill: 41 }, // War Maces // CrushingBlow,MortalStrike - "0x1438": { primary: 0, secondary: 4, reqSkill: 40 }, - "0x1439": { primary: 0, secondary: 4, reqSkill: 40 }, // War Hammers // WhirlwindAttack,CrushingBlow + "0x1438": { primary: 0, secondary: 4, reqSkill: 41 }, + "0x1439": { primary: 0, secondary: 4, reqSkill: 41 }, // War Hammers // WhirlwindAttack,CrushingBlow - "0x143A": { primary: 0, secondary: 3, reqSkill: 40 }, - "0x143B": { primary: 0, secondary: 3, reqSkill: 40 }, // Mauls // DoubleStrike,ConcussionBlow + "0x143A": { primary: 0, secondary: 3, reqSkill: 41 }, + "0x143B": { primary: 0, secondary: 3, reqSkill: 41 }, // Mauls // DoubleStrike,ConcussionBlow - "0x143C": { primary: 1, secondary: 0, reqSkill: 40 }, - "0x143D": { primary: 1, secondary: 0, reqSkill: 40 }, // Hammer Picks // ArmorIgnore,MortalStrike + "0x143C": { primary: 1, secondary: 0, reqSkill: 41 }, + "0x143D": { primary: 1, secondary: 0, reqSkill: 41 }, // Hammer Picks // ArmorIgnore,MortalStrike "0x143E": { primary: 0, secondary: 3, reqSkill: 40 }, "0x143F": { primary: 0, secondary: 3, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow @@ -164,73 +164,74 @@ function RequiredSkill( pUser, abilityID ) }; // Get items in user's hands - var itemRHand = pUser.FindItemLayer(0x01); - var itemLHand = pUser.FindItemLayer(0x02); + var itemRHand = pUser.FindItemLayer( 0x01 ); + var itemLHand = pUser.FindItemLayer( 0x02 ); // Check if either hand has an item - if (itemRHand != null) + if( itemRHand != null ) { // Check item in the right hand - if (weaponTypes[itemRHand.sectionID]) + if( weaponTypes[itemRHand.sectionID] ) { var weapon = weaponTypes[itemRHand.sectionID]; - if (abilityID == weapon.primary) + if( abilityID == weapon.primary ) { - return checkSkillRequirement(pUser, 700, weapon.reqSkill, "70", abilityID); + return checkSkillRequirement( pUser, 700, weapon.reqSkill, "70", abilityID ); } - else if (abilityID == weapon.secondary) + else if( abilityID == weapon.secondary ) { - return checkSkillRequirement(pUser, 900, weapon.reqSkill, "90", abilityID); + return checkSkillRequirement( pUser, 900, weapon.reqSkill, "90", abilityID ); } } } - else if (itemLHand != null) + else if( itemLHand != null ) { // Check item in the left hand - if (weaponTypes[itemLHand.sectionID]) + if( weaponTypes[itemLHand.sectionID] ) { var weapon = weaponTypes[itemLHand.sectionID]; - if (abilityID == weapon.primary) + + if ( abilityID == weapon.primary ) { - return checkSkillRequirement(pUser, 700, weapon.reqSkill, "70", abilityID); + return checkSkillRequirement( pUser, 700, weapon.reqSkill, "70", abilityID ); } - else if (abilityID == weapon.secondary) + else if( abilityID == weapon.secondary ) { - return checkSkillRequirement(pUser, 900, weapon.reqSkill, "90", abilityID); + return checkSkillRequirement( pUser, 900, weapon.reqSkill, "90", abilityID ); } } } - else //checking if both hands null if so, it is a wrestling skill + else// checking if both hands null if so, it is a wrestling skill { - if (abilityID == 5) + if( abilityID == 5 ) { - return checkSkillRequirement(pUser, 700, 43, "70"); + return checkSkillRequirement( pUser, 700, 43, "70" ); } - else if (abilityID == 11) + else if( abilityID == 11 ) { - return checkSkillRequirement(pUser, 900, 43, "90"); + return checkSkillRequirement( pUser, 900, 43, "90" ); } } return true; } -function CheckMana(pUser, abilityID, requiredMana) +function CheckMana( pUser, abilityID, requiredMana ) { - var NextUse = pUser.GetTempTag("doubleMana"); + var NextUse = pUser.GetTempTag( "doubleMana" ); var iTime = GetCurrentClock(); - if (pUser.mana <= requiredMana) + if( pUser.mana <= requiredMana ) { - pUser.TextMessage("You need " + requiredMana + " mana to perform that attack"); - DeactivateSpecialMove(pUser.socket, abilityID); + pUser.TextMessage( "You need " + requiredMana + " mana to perform that attack" ); + DeactivateSpecialMove( pUser.socket, abilityID ); return false; } else { - pUser.SetTempTag("doubleMana", iTime.toString()); - var Delay = 3000; - if ((iTime - NextUse) < Delay) + pUser.SetTempTag( "doubleMana", iTime.toString() ); + var Delay = 3000;// If abilitie is performed with 3 seconds of last abilitie it will then cost double mana + if(( iTime - NextUse ) < Delay ) { pUser.mana -= requiredMana * 2; return true; @@ -257,42 +258,42 @@ function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) return 0; // Check if attacker has armor ignore enabled - if (abilityID == 1) // armorignore + if( abilityID == 1 ) // armorignore { // Armor Ignore ignores defense modifiers, but deals only 90% of potential damage damage *= 0.9; - if(fightSkill == 31) // Archery + if( fightSkill == 31 ) // Archery { // Cap damage from Armor Strike attack at 30 for archery weapons - if(damage > 30) + if( damage > 30 ) damage = 30; } else { // For all othe rfighting skills, cap damage from Armor Strike at 35 - if(damage > 35) + if( damage > 35 ) damage = 35; } } - else if (abilityID == 12)// shadowstrike + else if( abilityID == 12 )// shadowstrike { damage *= 1.25; } - else if (abilityID == 4)// crushingblow + else if( abilityID == 4 )// crushingblow { damage *= 1.5; } - else if (abilityID == 3)// ConcussionBlow + else if( abilityID == 3 )// ConcussionBlow { if (pDefender.maxhp > 0) { - var hitsPercent = (pDefender.hp / pDefender.maxhp) * 100.0; + var hitsPercent = ( pDefender.hp / pDefender.maxhp ) * 100.0; var manaPercent = 0; - if (pDefender.maxmana > 0) - manaPercent = (pDefender.mana / pDefender.maxmana) * 100.0; + if( pDefender.maxmana > 0 ) + manaPercent = ( pDefender.mana / pDefender.maxmana ) * 100.0; damage += Math.min(Math.floor(Math.abs(hitsPercent - manaPercent) / 4), 20); } @@ -316,7 +317,7 @@ function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) function onAttack( pAttacker, pDefender ) { - var abilityID = pAttacker.GetTempTag("abilityID"); + var abilityID = pAttacker.GetTempTag( "abilityID" ); if (abilityID == 1) // armnor ignore { From 6d5228097154d7cc1338239d9b88d733bd7560c3 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 27 May 2024 20:13:51 -0500 Subject: [PATCH 018/147] added couple more moves Bleed Attack and Mortal Strike, --- data/js/combat/special_moves.js | 134 +++++++++++++++++++++++++------- data/js/item/potion.js | 2 +- data/js/skill/healing.js | 26 +++++++ 3 files changed, 131 insertions(+), 31 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index a94a93067..8b90c7133 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -8,10 +8,8 @@ function onSpecialMove(pUser, abilityID) return true; //The rest of the AOS Abilites before any other expansions - //Mortal Strike //Infectious Strike //Double Strike - //Bleed Attack //Whirlwind Attack } @@ -46,26 +44,26 @@ function RequiredSkill( pUser, abilityID ) "0x0e85": { primary: 0, secondary: 5, reqSkill: 40 }, "0x0e86": { primary: 0, secondary: 5, reqSkill: 40 }, // pickaxe // DoubleStrike, Disarm - "0x0E87": { primary: 0, secondary: 6, reqSkill: 42 }, - "0x0E88": { primary: 0, secondary: 6, reqSkill: 42 }, // Pitchforks // BleedAttack, Dismount + "0x0E87": { primary: 2, secondary: 6, reqSkill: 42 }, + "0x0E88": { primary: 2, secondary: 6, reqSkill: 42 }, // Pitchforks // BleedAttack, Dismount "0x0E89": { primary: 0, secondary: 3, reqSkill: 41 }, "0x0E8A": { primary: 0, secondary: 3, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow - "0x0EC2": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x0EC3": { primary: 0, secondary: 0, reqSkill: 40 }, // Cleavers // BleedAttack, InfectiousStrike + "0x0EC2": { primary: 2, secondary: 0, reqSkill: 40 }, + "0x0EC3": { primary: 2, secondary: 0, reqSkill: 40 }, // Cleavers // BleedAttack, InfectiousStrike - "0x0EC4": { primary: 12, secondary: 0, reqSkill: 40 }, - "0x0EC5": { primary: 12, secondary: 0, reqSkill: 40 }, // Skinning Knives // ShadowStrike, BleedAttack + "0x0EC4": { primary: 12, secondary: 2, reqSkill: 40 }, + "0x0EC5": { primary: 12, secondary: 2, reqSkill: 40 }, // Skinning Knives // ShadowStrike, BleedAttack "0x0F43": { primary: 1, secondary: 5, reqSkill: 40 }, "0x0F44": { primary: 1, secondary: 5, reqSkill: 40 }, // hatchets // ArmorIgnore, Disarm - "0x0F45": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x0F46": { primary: 0, secondary: 0, reqSkill: 40 }, // Executioner Axes // BleedAttack, MortalStrike + "0x0F45": { primary: 2, secondary: 9, reqSkill: 40 }, + "0x0F46": { primary: 2, secondary: 9, reqSkill: 40 }, // Executioner Axes // BleedAttack, MortalStrike - "0x0F47": { primary: 0, secondary: 3, reqSkill: 40 }, - "0x0F48": { primary: 0, secondary: 3, reqSkill: 40 }, // Battle Axes // BleedAttack, ConcussionBlow + "0x0F47": { primary: 2, secondary: 3, reqSkill: 40 }, + "0x0F48": { primary: 2, secondary: 3, reqSkill: 40 }, // Battle Axes // BleedAttack, ConcussionBlow "0x0F49": { primary: 4, secondary: 6, reqSkill: 40 }, "0x0F4A": { primary: 4, secondary: 6, reqSkill: 40 }, // Axes // CrushingBlow, Dismount @@ -76,8 +74,8 @@ function RequiredSkill( pUser, abilityID ) "0x0F4D": { primary: 11, secondary: 6, reqSkill: 40 }, "0x0F4E": { primary: 11, secondary: 6, reqSkill: 40 }, // Bardiches // ParalyzingBlow, Dismount - "0x0F4F": { primary: 3, secondary: 0, reqSkill: 31 }, - "0x0F50": { primary: 3, secondary: 0, reqSkill: 31 }, // Crossbows // ConcussionBlow, MortalStrike + "0x0F4F": { primary: 3, secondary: 9, reqSkill: 31 }, + "0x0F50": { primary: 3, secondary: 9, reqSkill: 31 }, // Crossbows // ConcussionBlow, MortalStrike "0x0F51": { primary: 0, secondary: 12, reqSkill: 40 }, "0x0F52": { primary: 0, secondary: 12, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike @@ -99,11 +97,11 @@ function RequiredSkill( pUser, abilityID ) "0x0FB4": { primary: 4, secondary: 12, reqSkill: 41 }, "0x0FB5": { primary: 4, secondary: 12, reqSkill: 41 }, // Sledge hammers // CrushingBlow, ShadowStrike - "0x13AF": { primary: 1, secondary: 0, reqSkill: 40 }, - "0x13B0": { primary: 1, secondary: 0, reqSkill: 40 }, // War Axes // ArmorIgnore, BleedAttack + "0x13AF": { primary: 1, secondary: 2, reqSkill: 40 }, + "0x13B0": { primary: 1, secondary: 2, reqSkill: 40 }, // War Axes // ArmorIgnore, BleedAttack - "0x13B1": { primary: 11, secondary: 0, reqSkill: 31 }, - "0x13B2": { primary: 11, secondary: 0, reqSkill: 31 }, // Bows // ParalyzingBlow, MortalStrike + "0x13B1": { primary: 11, secondary: 9, reqSkill: 31 }, + "0x13B2": { primary: 11, secondary: 9, reqSkill: 31 }, // Bows // ParalyzingBlow, MortalStrike "0x13B3": { primary: 12, secondary: 6, reqSkill: 41 }, "0x13B4": { primary: 12, secondary: 6, reqSkill: 41 }, // Clubs // ShadowStrike, Dismount @@ -126,8 +124,8 @@ function RequiredSkill( pUser, abilityID ) "0x13F8": { primary: 3, secondary: 0, reqSkill: 41 }, "0x13F9": { primary: 3, secondary: 0, reqSkill: 41 }, // Gnarled Staves // ConcussionBlow,ForceOfNature - "0x13FA": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13FB": { primary: 0, secondary: 0, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack + "0x13FA": { primary: 0, secondary: 2, reqSkill: 40 }, + "0x13FB": { primary: 0, secondary: 2, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack "0x13FE": { primary: 0, secondary: 1, reqSkill: 40 }, "0x13FF": { primary: 0, secondary: 1, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore @@ -135,14 +133,14 @@ function RequiredSkill( pUser, abilityID ) "0x1400": { primary: 1, secondary: 0, reqSkill: 42 }, "0x1401": { primary: 1, secondary: 0, reqSkill: 42 }, // Kryss // ArmorIgnore,InfectiousStrike - "0x1402": { primary: 12, secondary: 0, reqSkill: 42 }, - "0x1403": { primary: 12, secondary: 0, reqSkill: 42 }, // Short Spears // ShadowStrike,MortalStrike + "0x1402": { primary: 12, secondary: 9, reqSkill: 42 }, + "0x1403": { primary: 12, secondary: 9, reqSkill: 42 }, // Short Spears // ShadowStrike,MortalStrike - "0x1404": { primary: 0, secondary: 5, reqSkill: 42 }, - "0x1405": { primary: 0, secondary: 5, reqSkill: 42 }, // War Forks // BleedAttack,Disarm + "0x1404": { primary: 2, secondary: 5, reqSkill: 42 }, + "0x1405": { primary: 2, secondary: 5, reqSkill: 42 }, // War Forks // BleedAttack,Disarm - "0x1406": { primary: 4, secondary: 0, reqSkill: 41 }, - "0x1407": { primary: 4, secondary: 0, reqSkill: 41 }, // War Maces // CrushingBlow,MortalStrike + "0x1406": { primary: 4, secondary: 9, reqSkill: 41 }, + "0x1407": { primary: 4, secondary: 9, reqSkill: 41 }, // War Maces // CrushingBlow,MortalStrike "0x1438": { primary: 0, secondary: 4, reqSkill: 41 }, "0x1439": { primary: 0, secondary: 4, reqSkill: 41 }, // War Hammers // WhirlwindAttack,CrushingBlow @@ -150,14 +148,14 @@ function RequiredSkill( pUser, abilityID ) "0x143A": { primary: 0, secondary: 3, reqSkill: 41 }, "0x143B": { primary: 0, secondary: 3, reqSkill: 41 }, // Mauls // DoubleStrike,ConcussionBlow - "0x143C": { primary: 1, secondary: 0, reqSkill: 41 }, - "0x143D": { primary: 1, secondary: 0, reqSkill: 41 }, // Hammer Picks // ArmorIgnore,MortalStrike + "0x143C": { primary: 1, secondary: 9, reqSkill: 41 }, + "0x143D": { primary: 1, secondary: 9, reqSkill: 41 }, // Hammer Picks // ArmorIgnore,MortalStrike "0x143E": { primary: 0, secondary: 3, reqSkill: 40 }, "0x143F": { primary: 0, secondary: 3, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow - "0x1440": { primary: 0, secondary: 12, reqSkill: 40 }, - "0x1441": { primary: 0, secondary: 12, reqSkill: 40 }, // Cutlasses // BleedAttack,ShadowStrike + "0x1440": { primary: 2, secondary: 12, reqSkill: 40 }, + "0x1441": { primary: 2, secondary: 12, reqSkill: 40 }, // Cutlasses // BleedAttack,ShadowStrike "0x1442": { primary: 0, secondary: 12, reqSkill: 40 }, "0x1443": { primary: 0, secondary: 12, reqSkill: 40 } // Two Handed Axes // DoubleStrike,ShadowStrike @@ -534,6 +532,63 @@ function onAttack( pAttacker, pDefender ) pAttacker.SoundEffect(0x213, true); pDefender.StaticEffect(0x377A, 0x09, 0x32); } + else if (abilityID == 9) // Mortal Strike + {// turn healthbar yellow on defender need spacket sent for this. + var requiredMana = 30; + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + // Clear out any current ability the player is doing when he switches abilities + if (abilityID != 9) + DeactivateSpecialMove(pAttacker, abilityID); + + pAttacker.SysMessage("You deliver a mortal wound!"); + pDefender.SysMessage("You have been mortally wounded!"); + + pAttacker.SoundEffect(0x1E1, true); + pDefender.StaticEffect(0x37B9, 0x09, 0x32); + + pDefender.SetTempTag("blockHeal", true); + + var seconds = 6000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) + if (pDefender.npc) + { + seconds = 12000; + } + pDefender.StartTimer(seconds, 9200, true); + + if( pDefender.socket ) + TriggerEvent( 50104, "AddBuff", pDefender, 1027, 1075810, 1075811, 6, " " ); + + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + } + + else if (abilityID == 2) // bleedattack + { + var requiredMana = 30; + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + // Clear out any current ability the player is doing when he switches abilities + if (abilityID != 2) + DeactivateSpecialMove(pAttacker, abilityID); + + pAttacker.SysMessage("Your target is bleeding!"); + pDefender.SysMessage("You are bleeding!"); + + pDefender.TextMessage("You are bleeding profusely", false, 0x21); + pDefender.TextMessage(pDefender.name + " is bleeding profusely", true, 0x21, 1); + + pDefender.StartTimer(10, 9300, true); + pDefender.SetTempTag("doBleed", true); + + pAttacker.SoundEffect(0x133, true); + pDefender.StaticEffect(0x377A, 0x09, 0x32); + } } function ClearSpecialMove(pUser, abilityID) @@ -572,12 +627,16 @@ function onTimer( timerObj, timerID ) { var socket = timerObj.socket; var abilityID = timerObj.GetTempTag("abilityID"); + var damage = 31; + if (timerObj == null || timerObj.dead) { timerObj.frozen = false; timerObj.SetTempTag("IsImmune", null); timerObj.RemoveScriptTrigger(7002); timerObj.SetTempTag("BlockEquip", null); + timerObj.SetTempTag("blockHeal", null); + timerObj.SetTempTag("doBleed", null); ClearSpecialMove(timerObj, abilityID); return; } @@ -595,4 +654,19 @@ function onTimer( timerObj, timerID ) timerObj.SetTempTag("BlockEquip", null); socket.SysMessage("Your confusion has passed, you may now arm a weapon!"); } + else if (timerID == 9200) + { + timerObj.SetTempTag("blockHeal", null); + socket.SysMessage("You are no longer mortally wounded."); + } + else if (timerID == 9300) + { + timerObj.SetTempTag("doBleed", null); + socket.SysMessage("The bleeding wounds have healed, you are no longer bleeding!"); + } + if (timerObj.GetTempTag("doBleed") == true) + { + damage -= 3; + timerObj.hp -= damage; + } } \ No newline at end of file diff --git a/data/js/item/potion.js b/data/js/item/potion.js index d92697cfb..c84c16900 100644 --- a/data/js/item/potion.js +++ b/data/js/item/potion.js @@ -161,7 +161,7 @@ function onUseChecked( pUser, iUsed ) case 4: // Heal Potion if( pUser.health < pUser.maxhp ) { - if( pUser.poison > 0 ) + if( pUser.poison > 0 || pUser.GetTempTag( "blockHeal" ) == true ) { pUser.SysMessage( GetDictionaryEntry( 9058, socket.language )); // You can not heal yourself in your current state. return; diff --git a/data/js/skill/healing.js b/data/js/skill/healing.js index 6523eb4a7..eb7cf9703 100644 --- a/data/js/skill/healing.js +++ b/data/js/skill/healing.js @@ -232,6 +232,32 @@ function onCallback1( socket, ourObj ) } else // Heal { + + if( ourObj.GetTempTag( "blockHeal" ) == true ) + { + if( ourObj != mChar && ourObj.socket ) + { + socket.SysMessage( "You cannot heal that target in their current state." ); + } + else + { + socket.SysMessage( GetDictionaryEntry( 9058, socket.language ));// You can not heal yourself in your current state. + } + } + else if( ourObj.GetTempTag( "doBleed" ) == true ) + { + if( ourObj != mChar && ourObj.socket ) + { + socket.SysMessage( "You bind the wound and stop the bleeding" ); + } + else + { + socket.SysMessage( "The bleeding wounds have healed, you are no longer bleeding!" ); + } + ourObj.KillJSTimer( 9300, 7001 ); + ourObj.SetTempTag( "doBleed", null ); + } + // Consume some bandages if( bItem.amount > 1 ) { From 0b8edf8a6316640dc61554d0961bb293698a61ec Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Tue, 28 May 2024 20:16:15 -0500 Subject: [PATCH 019/147] Added Infectious Strike --- data/js/combat/special_moves.js | 135 +++++++++++++++++++++++--------- 1 file changed, 99 insertions(+), 36 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 8b90c7133..81e413026 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -8,7 +8,6 @@ function onSpecialMove(pUser, abilityID) return true; //The rest of the AOS Abilites before any other expansions - //Infectious Strike //Double Strike //Whirlwind Attack } @@ -50,8 +49,8 @@ function RequiredSkill( pUser, abilityID ) "0x0E89": { primary: 0, secondary: 3, reqSkill: 41 }, "0x0E8A": { primary: 0, secondary: 3, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow - "0x0EC2": { primary: 2, secondary: 0, reqSkill: 40 }, - "0x0EC3": { primary: 2, secondary: 0, reqSkill: 40 }, // Cleavers // BleedAttack, InfectiousStrike + "0x0EC2": { primary: 2, secondary: 8, reqSkill: 40 }, + "0x0EC3": { primary: 2, secondary: 8, reqSkill: 40 }, // Cleavers // BleedAttack, InfectiousStrike "0x0EC4": { primary: 12, secondary: 2, reqSkill: 40 }, "0x0EC5": { primary: 12, secondary: 2, reqSkill: 40 }, // Skinning Knives // ShadowStrike, BleedAttack @@ -77,8 +76,8 @@ function RequiredSkill( pUser, abilityID ) "0x0F4F": { primary: 3, secondary: 9, reqSkill: 31 }, "0x0F50": { primary: 3, secondary: 9, reqSkill: 31 }, // Crossbows // ConcussionBlow, MortalStrike - "0x0F51": { primary: 0, secondary: 12, reqSkill: 40 }, - "0x0F52": { primary: 0, secondary: 12, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike + "0x0F51": { primary: 8, secondary: 12, reqSkill: 40 }, + "0x0F52": { primary: 8, secondary: 12, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike "0x0F5C": { primary: 3, secondary: 5, reqSkill: 41 }, "0x0F5D": { primary: 3, secondary: 5, reqSkill: 41 }, // Maces // ConcussionBlow, Disarm @@ -118,8 +117,8 @@ function RequiredSkill( pUser, abilityID ) "0x13E3": { primary: 4, secondary: 12, reqSkill: 41 }, "0x13E4": { primary: 4, secondary: 12, reqSkill: 41 }, // Smith's Hammers // CrushingBlow, ShadowStrike - "0x13F6": { primary: 0, secondary: 5, reqSkill: 40 }, - "0x13F7": { primary: 0, secondary: 5, reqSkill: 40 }, // Butcher Knives // InfectiousStrike,Disarm + "0x13F6": { primary: 8, secondary: 5, reqSkill: 40 }, + "0x13F7": { primary: 8, secondary: 5, reqSkill: 40 }, // Butcher Knives // InfectiousStrike,Disarm "0x13F8": { primary: 3, secondary: 0, reqSkill: 41 }, "0x13F9": { primary: 3, secondary: 0, reqSkill: 41 }, // Gnarled Staves // ConcussionBlow,ForceOfNature @@ -130,8 +129,8 @@ function RequiredSkill( pUser, abilityID ) "0x13FE": { primary: 0, secondary: 1, reqSkill: 40 }, "0x13FF": { primary: 0, secondary: 1, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore - "0x1400": { primary: 1, secondary: 0, reqSkill: 42 }, - "0x1401": { primary: 1, secondary: 0, reqSkill: 42 }, // Kryss // ArmorIgnore,InfectiousStrike + "0x1400": { primary: 1, secondary: 8, reqSkill: 42 }, + "0x1401": { primary: 1, secondary: 8, reqSkill: 42 }, // Kryss // ArmorIgnore,InfectiousStrike "0x1402": { primary: 12, secondary: 9, reqSkill: 42 }, "0x1403": { primary: 12, secondary: 9, reqSkill: 42 }, // Short Spears // ShadowStrike,MortalStrike @@ -369,6 +368,10 @@ function onAttack( pAttacker, pDefender ) { var requiredMana = 16; + // Clear out any current ability the player is doing when he switches abilities + if (abilityID != 6) + DeactivateSpecialMove(pAttacker.socket, abilityID); + //checking mana if (!CheckMana(pAttacker, abilityID, requiredMana)) return true; @@ -381,10 +384,6 @@ function onAttack( pAttacker, pDefender ) return true; } - // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 6) - DeactivateSpecialMove(pAttacker.socket, abilityID); - // Only Can work on players or npcs that is mounted if (!pDefender.isonhorse) { @@ -407,14 +406,15 @@ function onAttack( pAttacker, pDefender ) { var requiredMana = 30; - //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) - return true; // Clear out any current ability the player is doing when he switches abilities if (abilityID != 11) DeactivateSpecialMove(pAttacker.socket, abilityID); + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + pAttacker.SoundEffect(0x204, true); pDefender.StaticEffect(0x376A, 0x09, 0x32); var IsImmune = pDefender.GetTempTag("IsImmune") @@ -465,14 +465,14 @@ function onAttack( pAttacker, pDefender ) return false; } - //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) - return true; - // Clear out any current ability the player is doing when he switches abilities if (abilityID != 5) DeactivateSpecialMove(pAttacker, abilityID); + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + pAttacker.SoundEffect(0x3B9, true); pDefender.StaticEffect(0x37BE, 0x09, 0x32); @@ -501,14 +501,14 @@ function onAttack( pAttacker, pDefender ) { var requiredMana = 20; - //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) - return true; - // Clear out any current ability the player is doing when he switches abilities if (abilityID != 4) DeactivateSpecialMove(pAttacker, abilityID); + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + pAttacker.SysMessage("You have delivered a crushing blow!"); pDefender.SysMessage("You take extra damage from the crushing attack!"); @@ -518,14 +518,14 @@ function onAttack( pAttacker, pDefender ) { var requiredMana = 20; - //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) - return true; - // Clear out any current ability the player is doing when he switches abilities if (abilityID != 3) DeactivateSpecialMove(pAttacker, abilityID); + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + pAttacker.SysMessage("You have delivered a concussion!"); pDefender.SysMessage("You feel disoriented!"); @@ -536,14 +536,14 @@ function onAttack( pAttacker, pDefender ) {// turn healthbar yellow on defender need spacket sent for this. var requiredMana = 30; - //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) - return true; - // Clear out any current ability the player is doing when he switches abilities if (abilityID != 9) DeactivateSpecialMove(pAttacker, abilityID); + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + pAttacker.SysMessage("You deliver a mortal wound!"); pDefender.SysMessage("You have been mortally wounded!"); @@ -569,14 +569,14 @@ function onAttack( pAttacker, pDefender ) { var requiredMana = 30; - //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) - return true; - // Clear out any current ability the player is doing when he switches abilities if (abilityID != 2) DeactivateSpecialMove(pAttacker, abilityID); + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + pAttacker.SysMessage("Your target is bleeding!"); pDefender.SysMessage("You are bleeding!"); @@ -589,6 +589,68 @@ function onAttack( pAttacker, pDefender ) pAttacker.SoundEffect(0x133, true); pDefender.StaticEffect(0x377A, 0x09, 0x32); } + else if (abilityID == 8) // Infectious Strike + { + var requiredMana = 20; + var itemRHand = pAttacker.FindItemLayer(0x01); + var itemLHand = pAttacker.FindItemLayer(0x02); + + // Clear out any current ability the player is doing when he switches abilities + if (abilityID != 8) + DeactivateSpecialMove(pAttacker, abilityID); + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + if (itemLHand != null && itemLHand.poison <= 0 || itemRHand != null && itemRHand.poison <= 0) + { + pDefender.SysMessage("Your weapon must have a dose of poison to perform an infectious strike!"); + return; + } + + var level = 0; + var chance = Math.random(); + if (pAttacker.skills[30] >= 0 && pAttacker.skills[30] <= 199) + { + level = 1; + } + else if (pAttacker.skills[30] >= 200 && pAttacker.skills[30] <= 399) + { + level = 2; + } + else if (pAttacker.skills[30] >= 400 && pAttacker.skills[30] <= 599) + { + level = 3; + } + else if (pAttacker.skills[30] >= 600 && pAttacker.skills[30] <= 1000) + { + level = 4; + } + + // Adjust the poison level based on chance + if (chance < 0.2) + { + level--; // Decrease the level by 1 + if (level < 0) + { + level = 1; // Ensure the level doesn't go below 0 and is always set to least 1 + } + } + else if (chance > 0.8) + { + level++; // Increase the level by 1 + pAttacker.SysMessage("Your precise strike has increased the level of the poison by 1"); + pDefender.SysMessage("The poison seems extra effective!"); + } + + pAttacker.TextMessage("You have poisoned your target : " + pDefender.name); + pDefender.TextMessage(pAttacker.name +" : poisoned you!"); + pDefender.poison = level; + + pAttacker.SoundEffect(0xDD, true); + pDefender.StaticEffect(0x3728, 0x09, 0x32); + } } function ClearSpecialMove(pUser, abilityID) @@ -668,5 +730,6 @@ function onTimer( timerObj, timerID ) { damage -= 3; timerObj.hp -= damage; + timerObj.StaticEffect(0x122A, 0, 15); // blood effect } } \ No newline at end of file From e7c87950800fad4fdd5ec02e67a5a5ac3c845f13 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Wed, 29 May 2024 14:07:29 -0500 Subject: [PATCH 020/147] Fixed House Addons in Homes House add-on deeds are now returned when an add-on is present in the house. --- data/js/server/house/houseCommands.js | 11 ++++++++++- source/Changelog.txt | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/data/js/server/house/houseCommands.js b/data/js/server/house/houseCommands.js index e27bef044..2c7afd3f3 100644 --- a/data/js/server/house/houseCommands.js +++ b/data/js/server/house/houseCommands.js @@ -1522,8 +1522,17 @@ function DemolishHouse( pSocket, iMulti ) iMulti.RemoveTrashCont( itemInHouse ); itemInHouse.Delete(); } - else if( itemInHouse.movable == 2 ) // items placed as part of the house itself like forge/anvil in smithy + else if( itemInHouse.movable == 2 || itemInHouse.GetTag( "deed" )) // items placed as part of the house itself like forge/anvil in smithy or the addon deed { + var addonDeed = itemInHouse.GetTag( "deed" ); + if( addonDeed ) + { + var newDeed = CreateDFNItem( pSocket, pSocket.currentChar, addonDeed, 1, "ITEM", true ); + if( newDeed ) + { + pSocket.SysMessage( GetDictionaryEntry( 1970, pSocket.language )); // A deed for the house add-on has been placed in your backpack. + } + } itemInHouse.Delete(); } else if( itemInHouse.isLockedDown ) diff --git a/source/Changelog.txt b/source/Changelog.txt index f64afbc32..43a0869d2 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,6 @@ +29/05/2024 - Dragon Slayer + House add-on deeds are now returned when an add-on is present in the house. + 1/05/2024 - Dragon Slayer/Xuri Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode. Fixed createfood to check for reagents on cast. From 7735b0ce567b05812a5484657ca64613c02aa994 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Wed, 29 May 2024 14:08:34 -0500 Subject: [PATCH 021/147] Update Changelog.txt --- source/Changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Changelog.txt b/source/Changelog.txt index 43a0869d2..016465bc7 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,5 +1,5 @@ 29/05/2024 - Dragon Slayer - House add-on deeds are now returned when an add-on is present in the house. + House add-on deeds are now returned when an add-on is present in the house on demolish. 1/05/2024 - Dragon Slayer/Xuri Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode. From 680ecc1d30c7147e0e6d6d21b1819ec5d1839a99 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Wed, 29 May 2024 17:46:05 -0500 Subject: [PATCH 022/147] fixes Fixed timers to use scriptid Fixed Bleed timer added buff to bleed. --- data/js/combat/special_moves.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 81e413026..6b0b2e6b3 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -406,7 +406,6 @@ function onAttack( pAttacker, pDefender ) { var requiredMana = 30; - // Clear out any current ability the player is doing when he switches abilities if (abilityID != 11) DeactivateSpecialMove(pAttacker.socket, abilityID); @@ -437,8 +436,8 @@ function onAttack( pAttacker, pDefender ) } pDefender.SetTempTag("IsImmune", true); - pDefender.StartTimer(seconds + 8000, 9000, true); - pDefender.StartTimer(seconds, 8000, true); + pDefender.StartTimer(seconds + 8000, 9000, 7001); + pDefender.StartTimer(seconds, 8000, 7001); pDefender.frozen = true; if (pAttacker.socket) @@ -491,7 +490,7 @@ function onAttack( pAttacker, pDefender ) pDefender.AddScriptTrigger(7002);//block equip for 5 seconds script added pDefender.SetTempTag("BlockEquip", true); - pDefender.StartTimer(5000, 9100, true); + pDefender.StartTimer(5000, 9100, 7001); TriggerEvent(50104, "AddBuff", pDefender, 0x3ea, 1075637, 0, 5, " "); @@ -583,11 +582,17 @@ function onAttack( pAttacker, pDefender ) pDefender.TextMessage("You are bleeding profusely", false, 0x21); pDefender.TextMessage(pDefender.name + " is bleeding profusely", true, 0x21, 1); - pDefender.StartTimer(10, 9300, true); + pDefender.StartTimer(10000, 9300, 7001); + pDefender.StartTimer(2000, 9400, 7001); pDefender.SetTempTag("doBleed", true); + if (pDefender.socket) + TriggerEvent(50104, "AddBuff", pDefender, 1039, 1075829, 1075830, 10, " 1, 10 ,2"); + pAttacker.SoundEffect(0x133, true); pDefender.StaticEffect(0x377A, 0x09, 0x32); + + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 8) // Infectious Strike { @@ -698,6 +703,7 @@ function onTimer( timerObj, timerID ) timerObj.RemoveScriptTrigger(7002); timerObj.SetTempTag("BlockEquip", null); timerObj.SetTempTag("blockHeal", null); + timerObj.KillJSTimer(9400, 7001); timerObj.SetTempTag("doBleed", null); ClearSpecialMove(timerObj, abilityID); return; @@ -724,12 +730,14 @@ function onTimer( timerObj, timerID ) else if (timerID == 9300) { timerObj.SetTempTag("doBleed", null); + timerObj.KillJSTimer(9400, 7001); socket.SysMessage("The bleeding wounds have healed, you are no longer bleeding!"); } - if (timerObj.GetTempTag("doBleed") == true) + else if (timerID == 9400) { - damage -= 3; - timerObj.hp -= damage; - timerObj.StaticEffect(0x122A, 0, 15); // blood effect + var damage = RandomNumber(1, 10); + timerObj.health -= damage; + //timerObj.StaticEffect(0x122A, 0, 15); // blood effect got to figure how to add it to ground. + timerObj.StartTimer(2000, 9400, 7001);//restart timer every 2 seconds until it shuts off } } \ No newline at end of file From 707558681ceaf97f0ec4e8ce04491313a0f2dea5 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Wed, 29 May 2024 22:47:50 -0500 Subject: [PATCH 023/147] Update special_moves.js --- data/js/combat/special_moves.js | 390 ++++++++++++++++---------------- 1 file changed, 196 insertions(+), 194 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 6b0b2e6b3..4a8f5c865 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -1,10 +1,14 @@ -function onSpecialMove(pUser, abilityID) +function onSpecialMove( pUser, abilityID ) { // Check Skills - if (!RequiredSkill(pUser, abilityID)) + if( !RequiredSkill( pUser, abilityID )) return true; - pUser.SetTempTag("abilityID", abilityID); + // Check Mana + if( !CheckMana( pUser, abilityID )) + return true; + + pUser.SetTempTag( "abilityID", abilityID ); return true; //The rest of the AOS Abilites before any other expansions @@ -214,14 +218,31 @@ function RequiredSkill( pUser, abilityID ) return true; } -function CheckMana( pUser, abilityID, requiredMana ) +function CheckMana( pUser, abilityID ) { + var abilitieMana = { + 1: { manaAmount: 14 }, + 2: { manaAmount: 30 }, + 3: { manaAmount: 20 }, + 4: { manaAmount: 20 }, + 5: { manaAmount: 20 }, + 6: { manaAmount: 16 }, + 7: { manaAmount: 20 }, + 8: { manaAmount: 20 }, + 9: { manaAmount: 30 }, + 10: { manaAmount: 30 }, + 11: { manaAmount: 30 }, + 12: { manaAmount: 20 } + }; + var NextUse = pUser.GetTempTag( "doubleMana" ); var iTime = GetCurrentClock(); + var requiredMana = abilitieMana[abilityID].manaAmount; + if( pUser.mana <= requiredMana ) { - pUser.TextMessage( "You need " + requiredMana + " mana to perform that attack" ); - DeactivateSpecialMove( pUser.socket, abilityID ); + pUser.SysMessage( "You need " + requiredMana + " mana to perform that attack" ); + DeactivateSpecialMove( pUser, abilityID ); return false; } else @@ -314,18 +335,21 @@ function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) function onAttack( pAttacker, pDefender ) { - var abilityID = pAttacker.GetTempTag( "abilityID" ); + var abilityID = pAttacker.GetTempTag("abilityID"); + + onAbility(pAttacker, pDefender, abilityID); +} +function onAbility(pAttacker, pDefender, abilityID) +{ if (abilityID == 1) // armnor ignore { - var requiredMana = 14; - // Clear out any current ability the player is doing when he switches abilities if (abilityID != 1) DeactivateSpecialMove(pAttacker.socket, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) + if (!CheckMana(pAttacker, abilityID)) return true; pAttacker.TextMessage("Your attack penetrates their armor!"); @@ -333,134 +357,86 @@ function onAttack( pAttacker, pDefender ) pDefender.SoundEffect(0x0056, true); pDefender.StaticEffect(0x3728, 0x09, 0x06); + + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } - else if (abilityID == 12) // shadowstrike + else if (abilityID == 2) // bleedattack { - var requiredMana = 20; - - if (pAttacker.skills[47] < 800) // Stealth - { - pAttacker.TextMessage("You lack the required stealth to perform that attack"); - return true; - } - // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 12) - DeactivateSpecialMove(pAttacker.socket, abilityID); + if (abilityID != 2) + DeactivateSpecialMove(pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) + if (!CheckMana(pAttacker, abilityID)) return true; - pAttacker.TextMessage("You strike and hide in the shadows!"); - pDefender.TextMessage("You are dazed by the attack and your attacker vanishes!"); + pAttacker.SysMessage("Your target is bleeding!"); + pDefender.SysMessage("You are bleeding!"); - pAttacker.StaticEffect(0x376A, 0x09, 0x06); + pDefender.TextMessage("You are bleeding profusely", false, 0x21); + pDefender.TextMessage(pDefender.name + " is bleeding profusely", true, 0x21, 1); - pDefender.SoundEffect(0x482, true); - pDefender.StaticEffect(0x37BE, 0x09, 0x06); + pDefender.StartTimer(10000, 9300, 7001); + pDefender.StartTimer(2000, 9400, 7001); + pDefender.SetTempTag("doBleed", true); - pAttacker.atWar = false; - pDefender.atWar = false; - pAttacker.visible = 1; + if (pDefender.socket) + TriggerEvent(50104, "AddBuff", pDefender, 1039, 1075829, 1075830, 10, " 1, 10 ,2"); + + pAttacker.SoundEffect(0x133, true); + pDefender.StaticEffect(0x377A, 0x09, 0x32); + + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } - else if (abilityID == 6) // Dismount + else if (abilityID == 3) // ConcussionBlow { - var requiredMana = 16; // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 6) - DeactivateSpecialMove(pAttacker.socket, abilityID); + if (abilityID != 3) + DeactivateSpecialMove(pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) - return true; - - // Check to see if player is mount or flying. - if (pAttacker.isonhorse) - { - pAttacker.TextMessage("You cannot perform that attack while mounted or flying!"); - DeactivateSpecialMove(pAttacker.socket, abilityID); + if (!CheckMana(pAttacker, abilityID)) return true; - } - // Only Can work on players or npcs that is mounted - if (!pDefender.isonhorse) - { - pAttacker.TextMessage("This attack only works on mounted or flying targets"); - return true; - } + pAttacker.SysMessage("You have delivered a concussion!"); + pDefender.SysMessage("You feel disoriented!"); - //Lesser Hiryu have an 80% chance of missing this attack needs added + pAttacker.SoundEffect(0x213, true); + pDefender.StaticEffect(0x377A, 0x09, 0x32); - //This is the Dismount Information sent to Attacker and Defender - pDefender.SoundEffect(0x140, true); - pDefender.StaticEffect(0x3728, 0x09, 0x06); - pAttacker.TextMessage("The force of your attack has dislodged them from their mount!"); - pDefender.Dismount(); - pDefender.TextMessage("You have been knocked off of your mount by " + pAttacker.name + "!"); - pAttacker.SetTempTag("Dismount", false); ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } - else if (abilityID == 11) // ParalyzingBlow + else if (abilityID == 4) // crushingblow { - var requiredMana = 30; // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 11) - DeactivateSpecialMove(pAttacker.socket, abilityID); + if (abilityID != 4) + DeactivateSpecialMove(pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) - return true; - - pAttacker.SoundEffect(0x204, true); - pDefender.StaticEffect(0x376A, 0x09, 0x32); - var IsImmune = pDefender.GetTempTag("IsImmune") - - if (IsImmune != null && IsImmune == true) - { - pAttacker.TextMessage("Your target resists paralysis."); - pDefender.TextMessage("You resist paralysis."); + if (!CheckMana(pAttacker, abilityID)) return true; - } - - var seconds = 3000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) - if (pDefender.npc) - { - seconds = 6000; - } - else if (pDefender.socket) - { - pDefender.TextMessage("The attack has temporarily paralyzed you!", false, 0x3b2, 0, pDefender.serial);// The attack has temporarily paralyzed you! - } - pDefender.SetTempTag("IsImmune", true); - pDefender.StartTimer(seconds + 8000, 9000, 7001); - pDefender.StartTimer(seconds, 8000, 7001); - pDefender.frozen = true; + pAttacker.SysMessage("You have delivered a crushing blow!"); + pDefender.SysMessage("You take extra damage from the crushing attack!"); - if (pAttacker.socket) - { - pAttacker.TextMessage(GetDictionaryEntry(17702, pAttacker.socket.language), false, 0x3b2, 0, pAttacker.serial);// You deliver a paralyzing blow! - } - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + pAttacker.SoundEffect(0x1E1, true); } else if (abilityID == 5) // Disarm { var itemRHand = pDefender.FindItemLayer(0x01); var itemLHand = pDefender.FindItemLayer(0x02); - var requiredMana = 20; - if (pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2) - { + if (pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2) { pAttacker.SysMessage("You cannot disarm your opponent."); + DeactivateSpecialMove(pAttacker.socket, abilityID); return false; } - if (itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9) - { + if (itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9) { pAttacker.SysMessage("Your target is already unarmed!"); + DeactivateSpecialMove(pAttacker.socket, abilityID); return false; } @@ -469,7 +445,7 @@ function onAttack( pAttacker, pDefender ) DeactivateSpecialMove(pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) + if (!CheckMana(pAttacker, abilityID)) return true; pAttacker.SoundEffect(0x3B9, true); @@ -478,13 +454,11 @@ function onAttack( pAttacker, pDefender ) pAttacker.SysMessage("You disarm their weapon!"); pDefender.SysMessage("Your weapon has been disarmed!"); - if (itemLHand != null) - { + if (itemLHand != null) { itemLHand.container = pDefender.pack; } - if (itemRHand != null) - { + if (itemRHand != null) { itemRHand.container = pDefender.pack; } @@ -496,51 +470,103 @@ function onAttack( pAttacker, pDefender ) ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } - else if (abilityID == 4) // crushingblow + else if (abilityID == 6) // Dismount { - var requiredMana = 20; - // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 4) - DeactivateSpecialMove(pAttacker, abilityID); + if (abilityID != 6) + DeactivateSpecialMove(pAttacker.socket, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) + if (!CheckMana(pAttacker, abilityID)) return true; - pAttacker.SysMessage("You have delivered a crushing blow!"); - pDefender.SysMessage("You take extra damage from the crushing attack!"); + // Check to see if player is mount or flying. + if (pAttacker.isonhorse) { + pAttacker.TextMessage("You cannot perform that attack while mounted or flying!"); + DeactivateSpecialMove(pAttacker.socket, abilityID); + return true; + } - pAttacker.SoundEffect(0x1E1, true); + // Only Can work on players or npcs that is mounted + if (!pDefender.isonhorse) { + pAttacker.TextMessage("This attack only works on mounted or flying targets"); + return true; + } + + //Lesser Hiryu have an 80% chance of missing this attack needs added + + //This is the Dismount Information sent to Attacker and Defender + pDefender.SoundEffect(0x140, true); + pDefender.StaticEffect(0x3728, 0x09, 0x06); + pAttacker.TextMessage("The force of your attack has dislodged them from their mount!"); + pDefender.Dismount(); + pDefender.TextMessage("You have been knocked off of your mount by " + pAttacker.name + "!"); + pAttacker.SetTempTag("Dismount", false); + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } - else if (abilityID == 3) // ConcussionBlow + else if (abilityID == 8) // Infectious Strike { - var requiredMana = 20; + var itemRHand = pAttacker.FindItemLayer(0x01); + var itemLHand = pAttacker.FindItemLayer(0x02); // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 3) + if (abilityID != 8) DeactivateSpecialMove(pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) + if (!CheckMana(pAttacker, abilityID)) return true; - pAttacker.SysMessage("You have delivered a concussion!"); - pDefender.SysMessage("You feel disoriented!"); + if (itemLHand != null && itemLHand.poison <= 0 || itemRHand != null && itemRHand.poison <= 0) { + pDefender.SysMessage("Your weapon must have a dose of poison to perform an infectious strike!"); + return; + } - pAttacker.SoundEffect(0x213, true); - pDefender.StaticEffect(0x377A, 0x09, 0x32); + var level = 0; + var chance = Math.random(); + if (pAttacker.skills[30] >= 0 && pAttacker.skills[30] <= 199) { + level = 1; + } + else if (pAttacker.skills[30] >= 200 && pAttacker.skills[30] <= 399) { + level = 2; + } + else if (pAttacker.skills[30] >= 400 && pAttacker.skills[30] <= 599) { + level = 3; + } + else if (pAttacker.skills[30] >= 600 && pAttacker.skills[30] <= 1000) { + level = 4; + } + + // Adjust the poison level based on chance + if (chance < 0.2) { + level--; // Decrease the level by 1 + if (level < 0) { + level = 1; // Ensure the level doesn't go below 0 and is always set to least 1 + } + } + else if (chance > 0.8) { + level++; // Increase the level by 1 + pAttacker.SysMessage("Your precise strike has increased the level of the poison by 1"); + pDefender.SysMessage("The poison seems extra effective!"); + } + + pAttacker.TextMessage("You have poisoned your target : " + pDefender.name); + pDefender.TextMessage(pAttacker.name + " : poisoned you!"); + pDefender.poison = level; + + pAttacker.SoundEffect(0xDD, true); + pDefender.StaticEffect(0x3728, 0x09, 0x32); + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 9) // Mortal Strike {// turn healthbar yellow on defender need spacket sent for this. - var requiredMana = 30; // Clear out any current ability the player is doing when he switches abilities if (abilityID != 9) DeactivateSpecialMove(pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) + if (!CheckMana(pAttacker, abilityID)) return true; pAttacker.SysMessage("You deliver a mortal wound!"); @@ -552,109 +578,84 @@ function onAttack( pAttacker, pDefender ) pDefender.SetTempTag("blockHeal", true); var seconds = 6000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) - if (pDefender.npc) - { + if (pDefender.npc) { seconds = 12000; } pDefender.StartTimer(seconds, 9200, true); - if( pDefender.socket ) - TriggerEvent( 50104, "AddBuff", pDefender, 1027, 1075810, 1075811, 6, " " ); + if (pDefender.socket) + TriggerEvent(50104, "AddBuff", pDefender, 1027, 1075810, 1075811, 6, " "); ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } - - else if (abilityID == 2) // bleedattack + else if (abilityID == 11) // ParalyzingBlow { - var requiredMana = 30; - // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 2) - DeactivateSpecialMove(pAttacker, abilityID); + if (abilityID != 11) + DeactivateSpecialMove(pAttacker.socket, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) + if (!CheckMana(pAttacker, abilityID)) return true; - pAttacker.SysMessage("Your target is bleeding!"); - pDefender.SysMessage("You are bleeding!"); - - pDefender.TextMessage("You are bleeding profusely", false, 0x21); - pDefender.TextMessage(pDefender.name + " is bleeding profusely", true, 0x21, 1); + pAttacker.SoundEffect(0x204, true); + pDefender.StaticEffect(0x376A, 0x09, 0x32); + var IsImmune = pDefender.GetTempTag("IsImmune") - pDefender.StartTimer(10000, 9300, 7001); - pDefender.StartTimer(2000, 9400, 7001); - pDefender.SetTempTag("doBleed", true); + if (IsImmune != null && IsImmune == true) { + pAttacker.TextMessage("Your target resists paralysis."); + pDefender.TextMessage("You resist paralysis."); + return true; + } - if (pDefender.socket) - TriggerEvent(50104, "AddBuff", pDefender, 1039, 1075829, 1075830, 10, " 1, 10 ,2"); + var seconds = 3000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) + if (pDefender.npc) { + seconds = 6000; + } + else if (pDefender.socket) { + pDefender.TextMessage("The attack has temporarily paralyzed you!", false, 0x3b2, 0, pDefender.serial);// The attack has temporarily paralyzed you! + } - pAttacker.SoundEffect(0x133, true); - pDefender.StaticEffect(0x377A, 0x09, 0x32); + pDefender.SetTempTag("IsImmune", true); + pDefender.StartTimer(seconds + 8000, 9000, 7001); + pDefender.StartTimer(seconds, 8000, 7001); + pDefender.frozen = true; + if (pAttacker.socket) { + pAttacker.TextMessage(GetDictionaryEntry(17702, pAttacker.socket.language), false, 0x3b2, 0, pAttacker.serial);// You deliver a paralyzing blow! + } ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } - else if (abilityID == 8) // Infectious Strike + else if (abilityID == 12) // shadowstrike { - var requiredMana = 20; - var itemRHand = pAttacker.FindItemLayer(0x01); - var itemLHand = pAttacker.FindItemLayer(0x02); + if (pAttacker.skills[47] < 800) // Stealth + { + pAttacker.TextMessage("You lack the required stealth to perform that attack"); + DeactivateSpecialMove(pAttacker.socket, abilityID); + return true; + } // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 8) - DeactivateSpecialMove(pAttacker, abilityID); + if (abilityID != 12) + DeactivateSpecialMove(pAttacker.socket, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) + if (!CheckMana(pAttacker, abilityID)) return true; - if (itemLHand != null && itemLHand.poison <= 0 || itemRHand != null && itemRHand.poison <= 0) - { - pDefender.SysMessage("Your weapon must have a dose of poison to perform an infectious strike!"); - return; - } + pAttacker.TextMessage("You strike and hide in the shadows!"); + pDefender.TextMessage("You are dazed by the attack and your attacker vanishes!"); - var level = 0; - var chance = Math.random(); - if (pAttacker.skills[30] >= 0 && pAttacker.skills[30] <= 199) - { - level = 1; - } - else if (pAttacker.skills[30] >= 200 && pAttacker.skills[30] <= 399) - { - level = 2; - } - else if (pAttacker.skills[30] >= 400 && pAttacker.skills[30] <= 599) - { - level = 3; - } - else if (pAttacker.skills[30] >= 600 && pAttacker.skills[30] <= 1000) - { - level = 4; - } + pAttacker.StaticEffect(0x376A, 0x09, 0x06); - // Adjust the poison level based on chance - if (chance < 0.2) - { - level--; // Decrease the level by 1 - if (level < 0) - { - level = 1; // Ensure the level doesn't go below 0 and is always set to least 1 - } - } - else if (chance > 0.8) - { - level++; // Increase the level by 1 - pAttacker.SysMessage("Your precise strike has increased the level of the poison by 1"); - pDefender.SysMessage("The poison seems extra effective!"); - } + pDefender.SoundEffect(0x482, true); + pDefender.StaticEffect(0x37BE, 0x09, 0x06); - pAttacker.TextMessage("You have poisoned your target : " + pDefender.name); - pDefender.TextMessage(pAttacker.name +" : poisoned you!"); - pDefender.poison = level; + pAttacker.atWar = false; + pDefender.atWar = false; + pAttacker.visible = 1; - pAttacker.SoundEffect(0xDD, true); - pDefender.StaticEffect(0x3728, 0x09, 0x32); + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } } @@ -679,6 +680,7 @@ function DeactivateSpecialMove(pUser, abilityID ) { var socket = pUser.socket; var toSend = new Packet; + pUser.SetTempTag("abilityID", null); toSend.ReserveSize( 7 ) toSend.WriteByte( 0, 0xbf ); // Packet From bfb92c9ea0748f0fd54ceedb51bfffebdeab64d5 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Wed, 29 May 2024 23:00:18 -0500 Subject: [PATCH 024/147] Update special_moves.js --- data/js/combat/special_moves.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 4a8f5c865..a21519bbc 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -376,8 +376,7 @@ function onAbility(pAttacker, pDefender, abilityID) pDefender.TextMessage("You are bleeding profusely", false, 0x21); pDefender.TextMessage(pDefender.name + " is bleeding profusely", true, 0x21, 1); - pDefender.StartTimer(10000, 9300, 7001); - pDefender.StartTimer(2000, 9400, 7001); + pDefender.StartTimer(2000, 9300, 7001); // Start 2 second timer for blood and damage last total 10 seconds pDefender.SetTempTag("doBleed", true); if (pDefender.socket) @@ -729,17 +728,18 @@ function onTimer( timerObj, timerID ) timerObj.SetTempTag("blockHeal", null); socket.SysMessage("You are no longer mortally wounded."); } - else if (timerID == 9300) + + if (timerID >= 9300 && timerID < 9310) + { + var damage = RandomNumber(1, 10); + //timerObj.StaticEffect(0x122A, 0, 15); // blood effect got to figure how to add it to ground. + timerObj.health -= damage; + timerObj.StartTimer(2000, 9300 + 1, 7001);//restart timer every 2 seconds until it shuts off + } + else if (timerID == 9310) { timerObj.SetTempTag("doBleed", null); timerObj.KillJSTimer(9400, 7001); socket.SysMessage("The bleeding wounds have healed, you are no longer bleeding!"); } - else if (timerID == 9400) - { - var damage = RandomNumber(1, 10); - timerObj.health -= damage; - //timerObj.StaticEffect(0x122A, 0, 15); // blood effect got to figure how to add it to ground. - timerObj.StartTimer(2000, 9400, 7001);//restart timer every 2 seconds until it shuts off - } } \ No newline at end of file From e3ff890f4e148614425221805f2a08f717fefd13 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Thu, 30 May 2024 21:32:33 -0500 Subject: [PATCH 025/147] Cleanup and Changes Lots of changes --- data/js/combat/special_moves.js | 295 +++++++++++--------- data/js/jse_fileassociations.scp | 1 + data/js/server/network/0xbf_special_move.js | 34 +++ 3 files changed, 203 insertions(+), 127 deletions(-) create mode 100644 data/js/server/network/0xbf_special_move.js diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index a21519bbc..03cfc4496 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -8,7 +8,8 @@ function onSpecialMove( pUser, abilityID ) if( !CheckMana( pUser, abilityID )) return true; - pUser.SetTempTag( "abilityID", abilityID ); + if( abilityID >= 1 ) + pUser.SetTempTag( "abilityID", abilityID ); return true; //The rest of the AOS Abilites before any other expansions @@ -21,7 +22,7 @@ function checkSkillRequirement( pUser, requiredSkillLevel, requiredSkill, skillM if( pUser.skills[requiredSkill] < requiredSkillLevel ) { pUser.SysMessage( "You need " + skillMessage + " weapon skill to perform that attack" ); - DeactivateSpecialMove( pUser, abilityID ); + TriggerEvent(2205, "DeactivateSpecialMove", pUser, abilityID); return false; } return true; @@ -218,9 +219,10 @@ function RequiredSkill( pUser, abilityID ) return true; } -function CheckMana( pUser, abilityID ) +function getAbilityManaTable() { - var abilitieMana = { + return { + 0: { manaAmount: 0 }, 1: { manaAmount: 14 }, 2: { manaAmount: 30 }, 3: { manaAmount: 20 }, @@ -234,37 +236,65 @@ function CheckMana( pUser, abilityID ) 11: { manaAmount: 30 }, 12: { manaAmount: 20 } }; +} +function CheckMana( pUser, abilityID ) +{ + var abilitieMana = getAbilityManaTable(); var NextUse = pUser.GetTempTag( "doubleMana" ); var iTime = GetCurrentClock(); + var Delay = 3000; // If ability is performed within 3 seconds of the last ability, it will then cost double mana var requiredMana = abilitieMana[abilityID].manaAmount; - if( pUser.mana <= requiredMana ) - { + if( NextUse == null ) + { + NextUse = 0; + } + + var isDoubleMana = ( iTime - NextUse ) < Delay; + if( isDoubleMana ) + { + requiredMana *= 2; + } + + if( pUser.mana < requiredMana ) + { pUser.SysMessage( "You need " + requiredMana + " mana to perform that attack" ); - DeactivateSpecialMove( pUser, abilityID ); - return false; - } - else + TriggerEvent(2205, "DeactivateSpecialMove", pUser, abilityID); + return false; + } + else { - pUser.SetTempTag( "doubleMana", iTime.toString() ); - var Delay = 3000;// If abilitie is performed with 3 seconds of last abilitie it will then cost double mana - if(( iTime - NextUse ) < Delay ) - { - pUser.mana -= requiredMana * 2; - return true; - } - else - { - pUser.mana -= requiredMana; - return true; - } + return true; + } +} + +function DeductMana( pUser, abilityID ) +{ + var abilitieMana = getAbilityManaTable(); + var NextUse = pUser.GetTempTag( "doubleMana" ); + var iTime = GetCurrentClock(); + var Delay = 3000; // If ability is performed within 3 seconds of the last ability, it will then cost double mana + var requiredMana = abilitieMana[abilityID].manaAmount; + + if( NextUse == null ) + { + NextUse = 0; + } + + var isDoubleMana = ( iTime - NextUse ) < Delay; + if( isDoubleMana ) + { + requiredMana *= 2; } + + pUser.mana -= requiredMana; + pUser.SetTempTag( "doubleMana", iTime.toString() ); } function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) { - var abilityID = pAttacker.GetTempTag("abilityID"); + var abilityID = pAttacker.GetTempTag( "abilityID" ); var baseDamage = pAttacker.attack; if( baseDamage == -1 ) // No damage if weapon breaks @@ -333,24 +363,33 @@ function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) return damage; } +function onCombatHit( pAttacker, pDefender ) +{ + var abilityID = pAttacker.GetTempTag( "abilityID" ); + + onAbility( pAttacker, pDefender, abilityID ); +} + function onAttack( pAttacker, pDefender ) { - var abilityID = pAttacker.GetTempTag("abilityID"); + var abilityID = pAttacker.GetTempTag( "abilityID" ); - onAbility(pAttacker, pDefender, abilityID); + onAbility( pAttacker, pDefender, abilityID ); } -function onAbility(pAttacker, pDefender, abilityID) +function onAbility( pAttacker, pDefender, abilityID ) { if (abilityID == 1) // armnor ignore { // Clear out any current ability the player is doing when he switches abilities if (abilityID != 1) - DeactivateSpecialMove(pAttacker.socket, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } pAttacker.TextMessage("Your attack penetrates their armor!"); pDefender.TextMessage("The blow penetrated your armor!"); @@ -358,17 +397,19 @@ function onAbility(pAttacker, pDefender, abilityID) pDefender.SoundEffect(0x0056, true); pDefender.StaticEffect(0x3728, 0x09, 0x06); - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 2) // bleedattack { // Clear out any current ability the player is doing when he switches abilities if (abilityID != 2) - DeactivateSpecialMove(pAttacker, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } pAttacker.SysMessage("Your target is bleeding!"); pDefender.SysMessage("You are bleeding!"); @@ -376,8 +417,8 @@ function onAbility(pAttacker, pDefender, abilityID) pDefender.TextMessage("You are bleeding profusely", false, 0x21); pDefender.TextMessage(pDefender.name + " is bleeding profusely", true, 0x21, 1); - pDefender.StartTimer(2000, 9300, 7001); // Start 2 second timer for blood and damage last total 10 seconds - pDefender.SetTempTag("doBleed", true); + pDefender.StartTimer( 2000, 9300, 7001 ); // Start 2 second timer for blood and damage last total 10 seconds + pDefender.SetTempTag( "doBleed", true ); if (pDefender.socket) TriggerEvent(50104, "AddBuff", pDefender, 1039, 1075829, 1075830, 10, " 1, 10 ,2"); @@ -385,18 +426,20 @@ function onAbility(pAttacker, pDefender, abilityID) pAttacker.SoundEffect(0x133, true); pDefender.StaticEffect(0x377A, 0x09, 0x32); - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 3) // ConcussionBlow { // Clear out any current ability the player is doing when he switches abilities if (abilityID != 3) - DeactivateSpecialMove(pAttacker, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } pAttacker.SysMessage("You have delivered a concussion!"); pDefender.SysMessage("You feel disoriented!"); @@ -404,23 +447,26 @@ function onAbility(pAttacker, pDefender, abilityID) pAttacker.SoundEffect(0x213, true); pDefender.StaticEffect(0x377A, 0x09, 0x32); - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 4) // crushingblow { // Clear out any current ability the player is doing when he switches abilities if (abilityID != 4) - DeactivateSpecialMove(pAttacker, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } pAttacker.SysMessage("You have delivered a crushing blow!"); pDefender.SysMessage("You take extra damage from the crushing attack!"); pAttacker.SoundEffect(0x1E1, true); + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 5) // Disarm { @@ -429,23 +475,25 @@ function onAbility(pAttacker, pDefender, abilityID) if (pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2) { pAttacker.SysMessage("You cannot disarm your opponent."); - DeactivateSpecialMove(pAttacker.socket, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); return false; } if (itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9) { pAttacker.SysMessage("Your target is already unarmed!"); - DeactivateSpecialMove(pAttacker.socket, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); return false; } // Clear out any current ability the player is doing when he switches abilities if (abilityID != 5) - DeactivateSpecialMove(pAttacker, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } pAttacker.SoundEffect(0x3B9, true); pDefender.StaticEffect(0x37BE, 0x09, 0x32); @@ -467,31 +515,36 @@ function onAbility(pAttacker, pDefender, abilityID) TriggerEvent(50104, "AddBuff", pDefender, 0x3ea, 1075637, 0, 5, " "); - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 6) // Dismount { - // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 6) - DeactivateSpecialMove(pAttacker.socket, abilityID); - - //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; - // Check to see if player is mount or flying. - if (pAttacker.isonhorse) { + if (pAttacker.isonhorse) + { pAttacker.TextMessage("You cannot perform that attack while mounted or flying!"); - DeactivateSpecialMove(pAttacker.socket, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); return true; } // Only Can work on players or npcs that is mounted - if (!pDefender.isonhorse) { + if (!pDefender.isonhorse) + { pAttacker.TextMessage("This attack only works on mounted or flying targets"); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); return true; } + // Clear out any current ability the player is doing when he switches abilities + if (abilityID != 6) + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + + //checking mana + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } + //Lesser Hiryu have an 80% chance of missing this attack needs added //This is the Dismount Information sent to Attacker and Defender @@ -501,49 +554,60 @@ function onAbility(pAttacker, pDefender, abilityID) pDefender.Dismount(); pDefender.TextMessage("You have been knocked off of your mount by " + pAttacker.name + "!"); pAttacker.SetTempTag("Dismount", false); - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 8) // Infectious Strike { var itemRHand = pAttacker.FindItemLayer(0x01); var itemLHand = pAttacker.FindItemLayer(0x02); + if (itemLHand != null && itemLHand.poison <= 0 || itemRHand != null && itemRHand.poison <= 0) + { + pDefender.SysMessage("Your weapon must have a dose of poison to perform an infectious strike!"); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + return; + } + // Clear out any current ability the player is doing when he switches abilities if (abilityID != 8) - DeactivateSpecialMove(pAttacker, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; - - if (itemLHand != null && itemLHand.poison <= 0 || itemRHand != null && itemRHand.poison <= 0) { - pDefender.SysMessage("Your weapon must have a dose of poison to perform an infectious strike!"); - return; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); } var level = 0; var chance = Math.random(); - if (pAttacker.skills[30] >= 0 && pAttacker.skills[30] <= 199) { + if (pAttacker.skills[30] >= 0 && pAttacker.skills[30] <= 199) + { level = 1; } - else if (pAttacker.skills[30] >= 200 && pAttacker.skills[30] <= 399) { + else if (pAttacker.skills[30] >= 200 && pAttacker.skills[30] <= 399) + { level = 2; } - else if (pAttacker.skills[30] >= 400 && pAttacker.skills[30] <= 599) { + else if (pAttacker.skills[30] >= 400 && pAttacker.skills[30] <= 599) + { level = 3; } - else if (pAttacker.skills[30] >= 600 && pAttacker.skills[30] <= 1000) { + else if (pAttacker.skills[30] >= 600 && pAttacker.skills[30] <= 1000) + { level = 4; } // Adjust the poison level based on chance - if (chance < 0.2) { + if (chance < 0.2) + { level--; // Decrease the level by 1 - if (level < 0) { + if (level < 0) + { level = 1; // Ensure the level doesn't go below 0 and is always set to least 1 } } - else if (chance > 0.8) { + else if (chance > 0.8) + { level++; // Increase the level by 1 pAttacker.SysMessage("Your precise strike has increased the level of the poison by 1"); pDefender.SysMessage("The poison seems extra effective!"); @@ -555,18 +619,20 @@ function onAbility(pAttacker, pDefender, abilityID) pAttacker.SoundEffect(0xDD, true); pDefender.StaticEffect(0x3728, 0x09, 0x32); - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 9) // Mortal Strike {// turn healthbar yellow on defender need spacket sent for this. // Clear out any current ability the player is doing when he switches abilities if (abilityID != 9) - DeactivateSpecialMove(pAttacker, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } pAttacker.SysMessage("You deliver a mortal wound!"); pDefender.SysMessage("You have been mortally wounded!"); @@ -585,33 +651,38 @@ function onAbility(pAttacker, pDefender, abilityID) if (pDefender.socket) TriggerEvent(50104, "AddBuff", pDefender, 1027, 1075810, 1075811, 6, " "); - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 11) // ParalyzingBlow { // Clear out any current ability the player is doing when he switches abilities if (abilityID != 11) - DeactivateSpecialMove(pAttacker.socket, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } pAttacker.SoundEffect(0x204, true); pDefender.StaticEffect(0x376A, 0x09, 0x32); var IsImmune = pDefender.GetTempTag("IsImmune") - if (IsImmune != null && IsImmune == true) { + if (IsImmune != null && IsImmune == true) + { pAttacker.TextMessage("Your target resists paralysis."); pDefender.TextMessage("You resist paralysis."); return true; } var seconds = 3000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) - if (pDefender.npc) { + if (pDefender.npc) + { seconds = 6000; } - else if (pDefender.socket) { + else if (pDefender.socket) + { pDefender.TextMessage("The attack has temporarily paralyzed you!", false, 0x3b2, 0, pDefender.serial);// The attack has temporarily paralyzed you! } @@ -620,27 +691,30 @@ function onAbility(pAttacker, pDefender, abilityID) pDefender.StartTimer(seconds, 8000, 7001); pDefender.frozen = true; - if (pAttacker.socket) { + if (pAttacker.socket) + { pAttacker.TextMessage(GetDictionaryEntry(17702, pAttacker.socket.language), false, 0x3b2, 0, pAttacker.serial);// You deliver a paralyzing blow! } - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 12) // shadowstrike { if (pAttacker.skills[47] < 800) // Stealth { pAttacker.TextMessage("You lack the required stealth to perform that attack"); - DeactivateSpecialMove(pAttacker.socket, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); return true; } // Clear out any current ability the player is doing when he switches abilities if (abilityID != 12) - DeactivateSpecialMove(pAttacker.socket, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } pAttacker.TextMessage("You strike and hide in the shadows!"); pDefender.TextMessage("You are dazed by the attack and your attacker vanishes!"); @@ -654,43 +728,10 @@ function onAbility(pAttacker, pDefender, abilityID) pDefender.atWar = false; pAttacker.visible = 1; - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID); } } -function ClearSpecialMove(pUser, abilityID) -{ - var socket = pUser.socket; - pUser.SetTempTag("abilityID", null); - pUser.SetTempTag("doubleMana", null); - - var toSend = new Packet; - toSend.ReserveSize(7) - toSend.WriteByte(0, 0xbf); // Packet - toSend.WriteShort(1, 0x07); // Length - toSend.WriteShort(3, 0x21); // SubCmd - toSend.WriteByte(5, abilityID); // Ability ID - toSend.WriteByte(6, 0); // On/off - socket.Send(toSend); - toSend.Free(); -} - -function DeactivateSpecialMove(pUser, abilityID ) -{ - var socket = pUser.socket; - var toSend = new Packet; - pUser.SetTempTag("abilityID", null); - - toSend.ReserveSize( 7 ) - toSend.WriteByte( 0, 0xbf ); // Packet - toSend.WriteShort( 1, 0x07 ); // Length - toSend.WriteShort( 3, 0x21 ); // SubCmd - toSend.WriteByte( 5, abilityID ); // Ability ID - toSend.WriteByte( 6, 0 ); // On/off - socket.Send( toSend ); - toSend.Free(); -} - function onTimer( timerObj, timerID ) { var socket = timerObj.socket; @@ -706,7 +747,7 @@ function onTimer( timerObj, timerID ) timerObj.SetTempTag("blockHeal", null); timerObj.KillJSTimer(9400, 7001); timerObj.SetTempTag("doBleed", null); - ClearSpecialMove(timerObj, abilityID); + TriggerEvent(2205, "ClearSpecialMove", timerObj, abilityID); return; } else if (timerID == 8000) diff --git a/data/js/jse_fileassociations.scp b/data/js/jse_fileassociations.scp index 802cd528c..66e6cf568 100644 --- a/data/js/jse_fileassociations.scp +++ b/data/js/jse_fileassociations.scp @@ -98,6 +98,7 @@ 2201=server/misc/hint_tooltip.js 2202=server/misc/warning_trigger.js 2203=server/misc/charges_left_tooltip.js +2205=server/network/0xbf_special_move.js // Server Data [2500-2749] 2500=server/data/weapontypes.js diff --git a/data/js/server/network/0xbf_special_move.js b/data/js/server/network/0xbf_special_move.js new file mode 100644 index 000000000..1fc8dae05 --- /dev/null +++ b/data/js/server/network/0xbf_special_move.js @@ -0,0 +1,34 @@ +function ClearSpecialMove( pUser, abilityID ) +{ + var socket = pUser.socket; + var toSend = new Packet; + + toSend.ReserveSize( 7 ) + toSend.WriteByte( 0, 0xbf ); // Packet + toSend.WriteShort( 1, 0x07 ); // Length + toSend.WriteShort( 3, 0x21 ); // SubCmd + toSend.WriteByte( 5, abilityID ); // Ability ID + toSend.WriteByte( 6, 0 ); // On/off + socket.Send( toSend ); + toSend.Free(); + + pUser.SetTempTag( "abilityID", null ); + pUser.SetTempTag( "doubleMana", null ); +} + +function DeactivateSpecialMove( pUser, abilityID ) +{ + var socket = pUser.socket; + var toSend = new Packet; + + toSend.ReserveSize( 7 ) + toSend.WriteByte( 0, 0xbf ); // Packet + toSend.WriteShort( 1, 0x07 ); // Length + toSend.WriteShort( 3, 0x21 ); // SubCmd + toSend.WriteByte( 5, abilityID ); // Ability ID + toSend.WriteByte( 6, 0); // On/off + socket.Send( toSend ); + toSend.Free(); + + pUser.SetTempTag( "abilityID", null ); +} From affabd2442bcf594f2b083f2360c08512a82d5a0 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Thu, 30 May 2024 21:38:08 -0500 Subject: [PATCH 026/147] New Event Added OnCombatHit --- source/Changelog.txt | 2 ++ source/cScript.cpp | 29 +++++++++++++++++++++++++++++ source/cScript.h | 1 + source/combat.cpp | 9 +++++++++ 4 files changed, 41 insertions(+) diff --git a/source/Changelog.txt b/source/Changelog.txt index addbacc9c..64d3fd4a8 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -2,6 +2,8 @@ Added special_moves.js There is 12 special aos moves you can find on uoguide.com Added blockequip.js This script is used to block reqeuiping weapons. Thanks to Xuri for making unequipattemp work for chars and not just items + Added OnCombatHit + -Triggers for character with event attached when someone has taken damage 27/04/2024 - Dragon Slayer/Xuri Fixed an issue where non-corpse containers - including treasure chests in dungeons - would decay and leave all their contents on the ground. diff --git a/source/cScript.cpp b/source/cScript.cpp index 88ef1a0e6..fb0ae479f 100644 --- a/source/cScript.cpp +++ b/source/cScript.cpp @@ -3802,6 +3802,35 @@ SI08 cScript::OnAICombatTarget( CChar *attacker, CChar *target ) return TryParseJSVal( rval ); } +//o------------------------------------------------------------------------------------------------o +//| Function - cScript::onCombatHit() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Triggers for character with event attached when someone has taken damage +//| Will also trigger the onDefense event for the character being hit +//o------------------------------------------------------------------------------------------------o +bool cScript::onCombatHit( CChar *attacker, CChar *defender ) +{ + if( !ValidateObject( attacker ) || !ValidateObject( defender )) + return false; + + if( !ExistAndVerify( seOnCombatHit, "onCombatHit" )) + return false; + + jsval rval, params[2]; + JSObject *attObj = JSEngine->AcquireObject( IUE_CHAR, attacker, runTime ); + JSObject *defObj = JSEngine->AcquireObject( IUE_CHAR, defender, runTime ); + + params[0] = OBJECT_TO_JSVAL( attObj ); + params[1] = OBJECT_TO_JSVAL( defObj ); + JSBool retVal = JS_CallFunctionName( targContext, targObject, "onCombatHit", 2, params, &rval ); + if( retVal == JS_FALSE ) + { + SetEventExists( seOnCombatHit, false ); + } + + return ( retVal == JS_TRUE ); +} + //o------------------------------------------------------------------------------------------------o //| Function - cScript::OnCombatStart() //| Date - 23rd January, 2006 diff --git a/source/cScript.h b/source/cScript.h index f98e13c70..10330e719 100644 --- a/source/cScript.h +++ b/source/cScript.h @@ -279,6 +279,7 @@ class cScript SI08 OnSkillGump( CChar *mChar ); SI08 OnUseBandageMacro( CSocket *mSock, CChar *targChar, CItem *bandageItem ); SI08 OnAICombatTarget( CChar *attacker, CChar *target ); + bool onCombatHit( CChar *attacker, CChar *defender ); SI08 OnCombatStart( CChar *attacker, CChar *defender ); SI08 OnCombatEnd( CChar *attacker, CChar *defender ); diff --git a/source/combat.cpp b/source/combat.cpp index 8817d7b3d..f6bcebe15 100644 --- a/source/combat.cpp +++ b/source/combat.cpp @@ -2994,6 +2994,15 @@ bool CHandleCombat::HandleCombat( CSocket *mSock, CChar& mChar, CChar *ourTarg ) // Show hit messages, if enabled DoHitMessage( &mChar, ourTarg, hitLoc, ourDamage ); + for( auto scriptTrig : scriptTriggers ) + { + cScript *toExecute = JSMapping->GetScript( scriptTrig ); + if( toExecute != nullptr ) + { + toExecute->onCombatHit( &mChar, ourTarg ); + } + } + // Interrupt Spellcasting if( !ourTarg->IsNpc() && targSock != nullptr ) { From f0189f361dcbbc89fba5d2ed619c95ca0a275232 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 8 Jun 2024 20:38:02 -0500 Subject: [PATCH 027/147] Fixed Expansion Settings Fixed Accepting bods, When the expansion is to to lbr or later. --- data/js/npc/ai/vendor_bdo_dispenser.js | 2 +- source/Changelog.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/data/js/npc/ai/vendor_bdo_dispenser.js b/data/js/npc/ai/vendor_bdo_dispenser.js index 0b5739539..9d069ea22 100644 --- a/data/js/npc/ai/vendor_bdo_dispenser.js +++ b/data/js/npc/ai/vendor_bdo_dispenser.js @@ -302,7 +302,7 @@ function onSpeech( myString, pUser, myNPC ) { if( CheckBodTimers( pUser, myNPC.GetTag( "bodType" ) )) { - if( EraStringToNum( GetServerSetting( "CoreShardEra" )) <= EraStringToNum( "lbr" )) + if( EraStringToNum( GetServerSetting( "CoreShardEra" )) >= EraStringToNum( "lbr" )) { myNPC.SetTimer( Timer.MOVETIME, 1000 ); // Pause NPC in their tracks for a second myNPC.TurnToward( pUser ); diff --git a/source/Changelog.txt b/source/Changelog.txt index f64afbc32..c8413e9c6 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,6 @@ +6/06/2024 - Dragon Slayer + Fixed Accepting bods, When the expansion is to to lbr or later. + 1/05/2024 - Dragon Slayer/Xuri Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode. Fixed createfood to check for reagents on cast. From 0b5963437d48a3accb544247c550fe4903b860c7 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 9 Jun 2024 22:52:23 -0500 Subject: [PATCH 028/147] cleanup and dictionary files cleanup and dictionary files added --- data/dictionaries/dictionary.ENG | 37 +++ data/dictionaries/dictionary.ZRO | 37 +++ data/js/combat/blockequip.js | 2 +- data/js/combat/special_moves.js | 540 ++++++++++++++++--------------- 4 files changed, 350 insertions(+), 266 deletions(-) diff --git a/data/dictionaries/dictionary.ENG b/data/dictionaries/dictionary.ENG index c3dc18d54..28be828cd 100644 --- a/data/dictionaries/dictionary.ENG +++ b/data/dictionaries/dictionary.ENG @@ -5312,5 +5312,42 @@ 19100=You've successfully converted the metal. 19101=You can only convert five hundred ingots at a time. 19102=The item must be in your backpack to be exchanged. +// [19201-19300] Special Moves +19201=You need %i weapon skill to perform that attack +19202=You need %i mana to perform that attack +19203=Your attack penetrates their armor! +19204=The blow penetrated your armor! +19205=Your target is bleeding! +19206=You are bleeding! +19207=You are bleeding profusely +19208=%i is bleeding profusely +19209=You have delivered a concussion! +19210=You feel disoriented! +19211=You have delivered a crushing blow! +19212=You take extra damage from the crushing attack! +19213=You cannot disarm your opponent. +19214=Your target is already unarmed! +19215=You disarm their weapon! +19216=Your weapon has been disarmed! +19217=You cannot perform that attack while mounted or flying! +19218=This attack only works on mounted or flying targets +19219=The force of your attack has dislodged them from their mount! +19220=You have been knocked off of your mount by %i ! +19221=Your weapon must have a dose of poison to perform an infectious strike! +19222=Your precise strike has increased the level of the poison by 1 +19223=The poison seems extra effective! +19224=You have poisoned your target : %i +19225=%i : poisoned you! +19226=You deliver a mortal wound! +19227=You have been mortally wounded! +19228=Your target resists paralysis. +19229=You resist paralysis. +19230=The attack has temporarily paralyzed you! +19231=You lack the required stealth to perform that attack +19232=You strike and hide in the shadows! +19233=You are dazed by the attack and your attacker vanishes! +19234=Your confusion has passed, you may now arm a weapon! +19235=You are no longer mortally wounded. +19236=The bleeding wounds have healed, you are no longer bleeding! } EOF diff --git a/data/dictionaries/dictionary.ZRO b/data/dictionaries/dictionary.ZRO index 5792f2860..a8ea12a6f 100644 --- a/data/dictionaries/dictionary.ZRO +++ b/data/dictionaries/dictionary.ZRO @@ -5306,5 +5306,42 @@ 19100=You've successfully converted the metal. 19101=You can only convert five hundred ingots at a time. 19102=The item must be in your backpack to be exchanged. +// [19201-19300] Special Moves +19201=You need %i weapon skill to perform that attack +19202=You need %i mana to perform that attack +19203=Your attack penetrates their armor! +19204=The blow penetrated your armor! +19205=Your target is bleeding! +19206=You are bleeding! +19207=You are bleeding profusely +19208=%i is bleeding profusely +19209=You have delivered a concussion! +19210=You feel disoriented! +19211=You have delivered a crushing blow! +19212=You take extra damage from the crushing attack! +19213=You cannot disarm your opponent. +19214=Your target is already unarmed! +19215=You disarm their weapon! +19216=Your weapon has been disarmed! +19217=You cannot perform that attack while mounted or flying! +19218=This attack only works on mounted or flying targets +19219=The force of your attack has dislodged them from their mount! +19220=You have been knocked off of your mount by %i ! +19221=Your weapon must have a dose of poison to perform an infectious strike! +19222=Your precise strike has increased the level of the poison by 1 +19223=The poison seems extra effective! +19224=You have poisoned your target : %i +19225=%i : poisoned you! +19226=You deliver a mortal wound! +19227=You have been mortally wounded! +19228=Your target resists paralysis. +19229=You resist paralysis. +19230=The attack has temporarily paralyzed you! +19231=You lack the required stealth to perform that attack +19232=You strike and hide in the shadows! +19233=You are dazed by the attack and your attacker vanishes! +19234=Your confusion has passed, you may now arm a weapon! +19235=You are no longer mortally wounded. +19236=The bleeding wounds have healed, you are no longer bleeding! } EOF diff --git a/data/js/combat/blockequip.js b/data/js/combat/blockequip.js index 6241b6ea5..48c82f700 100644 --- a/data/js/combat/blockequip.js +++ b/data/js/combat/blockequip.js @@ -1,6 +1,6 @@ function onEquipAttempt( pEquipper, iEquipped ) { - var blockEquip = pEquipper.GetTempTag( "BlockEquip" ); + var blockEquip = pEquipper.GetTempTag( "blockEquip" ); if( blockEquip == true ) { iEquipped.SetTempTag( "charSer", pEquipper.serial.toString() ); diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 03cfc4496..4159916cf 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -1,11 +1,11 @@ function onSpecialMove( pUser, abilityID ) { // Check Skills - if( !RequiredSkill( pUser, abilityID )) + if( !checkRequiredSkill( pUser, abilityID )) return true; // Check Mana - if( !CheckMana( pUser, abilityID )) + if( !CheckMana( pUser, abilityID )) return true; if( abilityID >= 1 ) @@ -19,10 +19,12 @@ function onSpecialMove( pUser, abilityID ) function checkSkillRequirement( pUser, requiredSkillLevel, requiredSkill, skillMessage, abilityID ) { + var pSock = pUser.socket; if( pUser.skills[requiredSkill] < requiredSkillLevel ) { - pUser.SysMessage( "You need " + skillMessage + " weapon skill to perform that attack" ); - TriggerEvent(2205, "DeactivateSpecialMove", pUser, abilityID); + pSock.SysMessage( GetDictionaryEntry( 19201, pSock.language), skillMessage); // You need %i weapon skill to perform that attack + + TriggerEvent( 2205, "DeactivateSpecialMove", pUser, abilityID ); return false; } return true; @@ -30,109 +32,109 @@ function checkSkillRequirement( pUser, requiredSkillLevel, requiredSkill, skillM // archery 31 swordsmansip 40 macefighting 41 fencing 42 wrestling 43 // Define the RequiredSkill function -function RequiredSkill( pUser, abilityID ) +function checkRequiredSkill( pUser, abilityID ) { // Define weapon types and their skill requirements and if primary or secondary ability var weaponTypes = { - "0x0DF0": { primary: 0, secondary: 11, reqSkill: 41 }, - "0x0DF1": { primary: 0, secondary: 11, reqSkill: 41 }, // Black Staves // WhirlwindAttack, ParalyzingBlow + "0x0df0": { primary: 0, secondary: 11, reqSkill: 41 }, + "0x0df1": { primary: 0, secondary: 11, reqSkill: 41 }, // Black Staves // WhirlwindAttack, ParalyzingBlow - "0x0DF2": { primary: 6, secondary: 5, reqSkill: 41 }, - "0x0DF3": { primary: 6, secondary: 5, reqSkill: 41 }, - "0x0DF4": { primary: 6, secondary: 5, reqSkill: 41 }, - "0x0DF5": { primary: 6, secondary: 5, reqSkill: 41 }, // wands // Dismount, Disarm + "0x0df2": { primary: 6, secondary: 5, reqSkill: 41 }, + "0x0df3": { primary: 6, secondary: 5, reqSkill: 41 }, + "0x0df4": { primary: 6, secondary: 5, reqSkill: 41 }, + "0x0df5": { primary: 6, secondary: 5, reqSkill: 41 }, // wands // Dismount, Disarm - "0x0E81": { primary: 4, secondary: 5, reqSkill: 41 }, - "0x0E82": { primary: 4, secondary: 5, reqSkill: 41 }, // Shepherd's Crooks // CrushingBlow, Disarm + "0x0e81": { primary: 4, secondary: 5, reqSkill: 41 }, + "0x0e82": { primary: 4, secondary: 5, reqSkill: 41 }, // Shepherd's Crooks // CrushingBlow, Disarm "0x0e85": { primary: 0, secondary: 5, reqSkill: 40 }, "0x0e86": { primary: 0, secondary: 5, reqSkill: 40 }, // pickaxe // DoubleStrike, Disarm - "0x0E87": { primary: 2, secondary: 6, reqSkill: 42 }, - "0x0E88": { primary: 2, secondary: 6, reqSkill: 42 }, // Pitchforks // BleedAttack, Dismount + "0x0e87": { primary: 2, secondary: 6, reqSkill: 42 }, + "0x0e88": { primary: 2, secondary: 6, reqSkill: 42 }, // Pitchforks // BleedAttack, Dismount - "0x0E89": { primary: 0, secondary: 3, reqSkill: 41 }, - "0x0E8A": { primary: 0, secondary: 3, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow + "0x0e89": { primary: 0, secondary: 3, reqSkill: 41 }, + "0x0e8a": { primary: 0, secondary: 3, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow - "0x0EC2": { primary: 2, secondary: 8, reqSkill: 40 }, - "0x0EC3": { primary: 2, secondary: 8, reqSkill: 40 }, // Cleavers // BleedAttack, InfectiousStrike + "0x0ec2": { primary: 2, secondary: 8, reqSkill: 40 }, + "0x0ec3": { primary: 2, secondary: 8, reqSkill: 40 }, // Cleavers // BleedAttack, InfectiousStrike - "0x0EC4": { primary: 12, secondary: 2, reqSkill: 40 }, - "0x0EC5": { primary: 12, secondary: 2, reqSkill: 40 }, // Skinning Knives // ShadowStrike, BleedAttack + "0x0ec4": { primary: 12, secondary: 2, reqSkill: 40 }, + "0x0ec5": { primary: 12, secondary: 2, reqSkill: 40 }, // Skinning Knives // ShadowStrike, BleedAttack - "0x0F43": { primary: 1, secondary: 5, reqSkill: 40 }, - "0x0F44": { primary: 1, secondary: 5, reqSkill: 40 }, // hatchets // ArmorIgnore, Disarm + "0x0f43": { primary: 1, secondary: 5, reqSkill: 40 }, + "0x0f44": { primary: 1, secondary: 5, reqSkill: 40 }, // hatchets // ArmorIgnore, Disarm - "0x0F45": { primary: 2, secondary: 9, reqSkill: 40 }, - "0x0F46": { primary: 2, secondary: 9, reqSkill: 40 }, // Executioner Axes // BleedAttack, MortalStrike + "0x0f45": { primary: 2, secondary: 9, reqSkill: 40 }, + "0x0f46": { primary: 2, secondary: 9, reqSkill: 40 }, // Executioner Axes // BleedAttack, MortalStrike - "0x0F47": { primary: 2, secondary: 3, reqSkill: 40 }, - "0x0F48": { primary: 2, secondary: 3, reqSkill: 40 }, // Battle Axes // BleedAttack, ConcussionBlow + "0x0f47": { primary: 2, secondary: 3, reqSkill: 40 }, + "0x0f48": { primary: 2, secondary: 3, reqSkill: 40 }, // Battle Axes // BleedAttack, ConcussionBlow - "0x0F49": { primary: 4, secondary: 6, reqSkill: 40 }, - "0x0F4A": { primary: 4, secondary: 6, reqSkill: 40 }, // Axes // CrushingBlow, Dismount + "0x0f49": { primary: 4, secondary: 6, reqSkill: 40 }, + "0x0f4a": { primary: 4, secondary: 6, reqSkill: 40 }, // Axes // CrushingBlow, Dismount - "0x0F4B": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x0F4C": { primary: 0, secondary: 0, reqSkill: 40 }, // Double Axe // DoubleStrike, WhirlwindAttack + "0x0f4b": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x0f4c": { primary: 0, secondary: 0, reqSkill: 40 }, // Double Axe // DoubleStrike, WhirlwindAttack - "0x0F4D": { primary: 11, secondary: 6, reqSkill: 40 }, - "0x0F4E": { primary: 11, secondary: 6, reqSkill: 40 }, // Bardiches // ParalyzingBlow, Dismount + "0x0f4e": { primary: 11, secondary: 6, reqSkill: 40 }, + "0x0f4e": { primary: 11, secondary: 6, reqSkill: 40 }, // Bardiches // ParalyzingBlow, Dismount - "0x0F4F": { primary: 3, secondary: 9, reqSkill: 31 }, - "0x0F50": { primary: 3, secondary: 9, reqSkill: 31 }, // Crossbows // ConcussionBlow, MortalStrike + "0x0f4f": { primary: 3, secondary: 9, reqSkill: 31 }, + "0x0f50": { primary: 3, secondary: 9, reqSkill: 31 }, // Crossbows // ConcussionBlow, MortalStrike - "0x0F51": { primary: 8, secondary: 12, reqSkill: 40 }, - "0x0F52": { primary: 8, secondary: 12, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike + "0x0f51": { primary: 8, secondary: 12, reqSkill: 40 }, + "0x0f52": { primary: 8, secondary: 12, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike - "0x0F5C": { primary: 3, secondary: 5, reqSkill: 41 }, - "0x0F5D": { primary: 3, secondary: 5, reqSkill: 41 }, // Maces // ConcussionBlow, Disarm + "0x0f5c": { primary: 3, secondary: 5, reqSkill: 41 }, + "0x0f5d": { primary: 3, secondary: 5, reqSkill: 41 }, // Maces // ConcussionBlow, Disarm - "0x0F5E": { primary: 4, secondary: 1, reqSkill: 40 }, - "0x0F5F": { primary: 4, secondary: 1, reqSkill: 40 }, // Broadswords // CrushingBlow, ArmorIgnore + "0x0f5e": { primary: 4, secondary: 1, reqSkill: 40 }, + "0x0f5f": { primary: 4, secondary: 1, reqSkill: 40 }, // Broadswords // CrushingBlow, ArmorIgnore - "0x13B7": { primary: 1, secondary: 3, reqSkill: 40 }, - "0x13B8": { primary: 1, secondary: 3, reqSkill: 40 }, - "0x0F60": { primary: 1, secondary: 3, reqSkill: 40 }, - "0x0F61": { primary: 1, secondary: 3, reqSkill: 40 }, // Longswords // ArmorIgnore, ConcussionBlow + "0x13b7": { primary: 1, secondary: 3, reqSkill: 40 }, + "0x13b8": { primary: 1, secondary: 3, reqSkill: 40 }, + "0x0f60": { primary: 1, secondary: 3, reqSkill: 40 }, + "0x0f61": { primary: 1, secondary: 3, reqSkill: 40 }, // Longswords // ArmorIgnore, ConcussionBlow - "0x0F62": { primary: 1, secondary: 11, reqSkill: 42 }, - "0x0F63": { primary: 1, secondary: 11, reqSkill: 42 }, // Spears // ArmorIgnore, ParalyzingBlow + "0x0f62": { primary: 1, secondary: 11, reqSkill: 42 }, + "0x0f63": { primary: 1, secondary: 11, reqSkill: 42 }, // Spears // ArmorIgnore, ParalyzingBlow - "0x0FB4": { primary: 4, secondary: 12, reqSkill: 41 }, - "0x0FB5": { primary: 4, secondary: 12, reqSkill: 41 }, // Sledge hammers // CrushingBlow, ShadowStrike + "0x0fb4": { primary: 4, secondary: 12, reqSkill: 41 }, + "0x0fb5": { primary: 4, secondary: 12, reqSkill: 41 }, // Sledge hammers // CrushingBlow, ShadowStrike - "0x13AF": { primary: 1, secondary: 2, reqSkill: 40 }, - "0x13B0": { primary: 1, secondary: 2, reqSkill: 40 }, // War Axes // ArmorIgnore, BleedAttack + "0x13af": { primary: 1, secondary: 2, reqSkill: 40 }, + "0x13b0": { primary: 1, secondary: 2, reqSkill: 40 }, // War Axes // ArmorIgnore, BleedAttack - "0x13B1": { primary: 11, secondary: 9, reqSkill: 31 }, - "0x13B2": { primary: 11, secondary: 9, reqSkill: 31 }, // Bows // ParalyzingBlow, MortalStrike + "0x13b1": { primary: 11, secondary: 9, reqSkill: 31 }, + "0x13b2": { primary: 11, secondary: 9, reqSkill: 31 }, // Bows // ParalyzingBlow, MortalStrike - "0x13B3": { primary: 12, secondary: 6, reqSkill: 41 }, - "0x13B4": { primary: 12, secondary: 6, reqSkill: 41 }, // Clubs // ShadowStrike, Dismount + "0x13b3": { primary: 12, secondary: 6, reqSkill: 41 }, + "0x13b4": { primary: 12, secondary: 6, reqSkill: 41 }, // Clubs // ShadowStrike, Dismount - "0x13B5": { primary: 0, secondary: 11, reqSkill: 40 }, - "0x13B6": { primary: 0, secondary: 1, reqSkill: 40 }, // Scimitars // DoubleStrike, ParalyzingBlow + "0x13b5": { primary: 0, secondary: 11, reqSkill: 40 }, + "0x13b6": { primary: 0, secondary: 1, reqSkill: 40 }, // Scimitars // DoubleStrike, ParalyzingBlow - "0x13B9": { primary: 11, secondary: 4, reqSkill: 40 }, - "0x13BA": { primary: 11, secondary: 4, reqSkill: 40 }, // Viking Swords // ParalyzingBlow, CrushingBlow + "0x13b9": { primary: 11, secondary: 4, reqSkill: 40 }, + "0x13ba": { primary: 11, secondary: 4, reqSkill: 40 }, // Viking Swords // ParalyzingBlow, CrushingBlow - "0x13FC": { primary: 0, secondary: 6, reqSkill: 31 }, - "0x13FD": { primary: 0, secondary: 6, reqSkill: 31 }, // Heavy Crossbows // MovingShot, Dismount + "0x13fc": { primary: 0, secondary: 6, reqSkill: 31 }, + "0x13fd": { primary: 0, secondary: 6, reqSkill: 31 }, // Heavy Crossbows // MovingShot, Dismount - "0x13E3": { primary: 4, secondary: 12, reqSkill: 41 }, - "0x13E4": { primary: 4, secondary: 12, reqSkill: 41 }, // Smith's Hammers // CrushingBlow, ShadowStrike + "0x13e3": { primary: 4, secondary: 12, reqSkill: 41 }, + "0x13e4": { primary: 4, secondary: 12, reqSkill: 41 }, // Smith's Hammers // CrushingBlow, ShadowStrike - "0x13F6": { primary: 8, secondary: 5, reqSkill: 40 }, - "0x13F7": { primary: 8, secondary: 5, reqSkill: 40 }, // Butcher Knives // InfectiousStrike,Disarm + "0x13f6": { primary: 8, secondary: 5, reqSkill: 40 }, + "0x13f7": { primary: 8, secondary: 5, reqSkill: 40 }, // Butcher Knives // InfectiousStrike,Disarm - "0x13F8": { primary: 3, secondary: 0, reqSkill: 41 }, - "0x13F9": { primary: 3, secondary: 0, reqSkill: 41 }, // Gnarled Staves // ConcussionBlow,ForceOfNature + "0x13f8": { primary: 3, secondary: 0, reqSkill: 41 }, + "0x13f9": { primary: 3, secondary: 0, reqSkill: 41 }, // Gnarled Staves // ConcussionBlow,ForceOfNature - "0x13FA": { primary: 0, secondary: 2, reqSkill: 40 }, - "0x13FB": { primary: 0, secondary: 2, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack + "0x13fa": { primary: 0, secondary: 2, reqSkill: 40 }, + "0x13fb": { primary: 0, secondary: 2, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack - "0x13FE": { primary: 0, secondary: 1, reqSkill: 40 }, - "0x13FF": { primary: 0, secondary: 1, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore + "0x13fe": { primary: 0, secondary: 1, reqSkill: 40 }, + "0x13ff": { primary: 0, secondary: 1, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore "0x1400": { primary: 1, secondary: 8, reqSkill: 42 }, "0x1401": { primary: 1, secondary: 8, reqSkill: 42 }, // Kryss // ArmorIgnore,InfectiousStrike @@ -149,14 +151,14 @@ function RequiredSkill( pUser, abilityID ) "0x1438": { primary: 0, secondary: 4, reqSkill: 41 }, "0x1439": { primary: 0, secondary: 4, reqSkill: 41 }, // War Hammers // WhirlwindAttack,CrushingBlow - "0x143A": { primary: 0, secondary: 3, reqSkill: 41 }, - "0x143B": { primary: 0, secondary: 3, reqSkill: 41 }, // Mauls // DoubleStrike,ConcussionBlow + "0x143a": { primary: 0, secondary: 3, reqSkill: 41 }, + "0x143b": { primary: 0, secondary: 3, reqSkill: 41 }, // Mauls // DoubleStrike,ConcussionBlow - "0x143C": { primary: 1, secondary: 9, reqSkill: 41 }, - "0x143D": { primary: 1, secondary: 9, reqSkill: 41 }, // Hammer Picks // ArmorIgnore,MortalStrike + "0x143c": { primary: 1, secondary: 9, reqSkill: 41 }, + "0x143d": { primary: 1, secondary: 9, reqSkill: 41 }, // Hammer Picks // ArmorIgnore,MortalStrike - "0x143E": { primary: 0, secondary: 3, reqSkill: 40 }, - "0x143F": { primary: 0, secondary: 3, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow + "0x143e": { primary: 0, secondary: 3, reqSkill: 40 }, + "0x143f": { primary: 0, secondary: 3, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow "0x1440": { primary: 2, secondary: 12, reqSkill: 40 }, "0x1441": { primary: 2, secondary: 12, reqSkill: 40 }, // Cutlasses // BleedAttack,ShadowStrike @@ -194,7 +196,7 @@ function RequiredSkill( pUser, abilityID ) { var weapon = weaponTypes[itemLHand.sectionID]; - if ( abilityID == weapon.primary ) + if( abilityID == weapon.primary ) { return checkSkillRequirement( pUser, 700, weapon.reqSkill, "70", abilityID ); } @@ -240,6 +242,7 @@ function getAbilityManaTable() function CheckMana( pUser, abilityID ) { + var pSock = pUser.socket; var abilitieMana = getAbilityManaTable(); var NextUse = pUser.GetTempTag( "doubleMana" ); var iTime = GetCurrentClock(); @@ -259,8 +262,8 @@ function CheckMana( pUser, abilityID ) if( pUser.mana < requiredMana ) { - pUser.SysMessage( "You need " + requiredMana + " mana to perform that attack" ); - TriggerEvent(2205, "DeactivateSpecialMove", pUser, abilityID); + pSock.SysMessage( GetDictionaryEntry( 19202, pSock.language), requiredMana); // You need %i mana to perform that attack + TriggerEvent( 2205, "DeactivateSpecialMove", pUser, abilityID ); return false; } else @@ -269,7 +272,7 @@ function CheckMana( pUser, abilityID ) } } -function DeductMana( pUser, abilityID ) +function DeductMana( pUser, abilityID ) { var abilitieMana = getAbilityManaTable(); var NextUse = pUser.GetTempTag( "doubleMana" ); @@ -334,7 +337,7 @@ function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) } else if( abilityID == 3 )// ConcussionBlow { - if (pDefender.maxhp > 0) + if( pDefender.maxhp > 0) { var hitsPercent = ( pDefender.hp / pDefender.maxhp ) * 100.0; @@ -379,408 +382,415 @@ function onAttack( pAttacker, pDefender ) function onAbility( pAttacker, pDefender, abilityID ) { - if (abilityID == 1) // armnor ignore + var pSockAttacker = pAttacker.socket; + var pSockDefender = pDefender.socket; + + if( abilityID == 1 ) // armnor ignore { // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 1) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 1 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } - pAttacker.TextMessage("Your attack penetrates their armor!"); - pDefender.TextMessage("The blow penetrated your armor!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19203, pSockAttacker.language ));// Your attack penetrates their armor! + pSockDefender.SysMessage( GetDictionaryEntry( 19204, pSockDefender.language ));// The blow penetrated your armor! - pDefender.SoundEffect(0x0056, true); - pDefender.StaticEffect(0x3728, 0x09, 0x06); + pDefender.SoundEffect( 0x0056, true ); + pDefender.StaticEffect( 0x3728, 0x09, 0x06 ); - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 2) // bleedattack + else if( abilityID == 2 ) // bleedattack { // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 2) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 2 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } - pAttacker.SysMessage("Your target is bleeding!"); - pDefender.SysMessage("You are bleeding!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19205, pSockAttacker.language ));// Your target is bleeding! + pSockDefender.SysMessage( GetDictionaryEntry( 19206, pSockDefender.language ));// You are bleeding! - pDefender.TextMessage("You are bleeding profusely", false, 0x21); - pDefender.TextMessage(pDefender.name + " is bleeding profusely", true, 0x21, 1); + pSockDefender.TextMessage( GetDictionaryEntry( 19207, pSockDefender.language), false, 0x21 );// You are bleeding profusely + pSockDefender.TextMessage( pDefender.name, GetDictionaryEntry( 19208, pSockDefender.language), true, 0x21, 1 );// %i is bleeding profusely pDefender.StartTimer( 2000, 9300, 7001 ); // Start 2 second timer for blood and damage last total 10 seconds pDefender.SetTempTag( "doBleed", true ); - if (pDefender.socket) - TriggerEvent(50104, "AddBuff", pDefender, 1039, 1075829, 1075830, 10, " 1, 10 ,2"); + if( pDefender.socket) + TriggerEvent(50104, "AddBuff", pDefender, 1039, 1075829, 1075830, 10, " 1, 10 ,2" ); - pAttacker.SoundEffect(0x133, true); - pDefender.StaticEffect(0x377A, 0x09, 0x32); + pAttacker.SoundEffect( 0x133, true ); + pDefender.StaticEffect( 0x377A, 0x09, 0x32 ); - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 3) // ConcussionBlow + else if( abilityID == 3 ) // ConcussionBlow { - // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 3) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 3 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } - pAttacker.SysMessage("You have delivered a concussion!"); - pDefender.SysMessage("You feel disoriented!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19209, pSockAttacker.language ));// You have delivered a concussion! + pSockDefender.SysMessage( GetDictionaryEntry( 19210, pSockDefender.language ));// You feel disoriented! - pAttacker.SoundEffect(0x213, true); - pDefender.StaticEffect(0x377A, 0x09, 0x32); + pAttacker.SoundEffect( 0x213, true ); + pDefender.StaticEffect( 0x377A, 0x09, 0x32 ); - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 4) // crushingblow + else if( abilityID == 4 ) // crushingblow { // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 4) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 4 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } - pAttacker.SysMessage("You have delivered a crushing blow!"); - pDefender.SysMessage("You take extra damage from the crushing attack!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19211, pSockAttacker.language ));// You have delivered a crushing blow! + pSockDefender.SysMessage( GetDictionaryEntry( 19212, pSockDefender.language ));// You take extra damage from the crushing attack! - pAttacker.SoundEffect(0x1E1, true); - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + pAttacker.SoundEffect( 0x1E1, true ); + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 5) // Disarm + else if( abilityID == 5 ) // Disarm { - var itemRHand = pDefender.FindItemLayer(0x01); - var itemLHand = pDefender.FindItemLayer(0x02); + var itemRHand = pDefender.FindItemLayer( 0x01 ); + var itemLHand = pDefender.FindItemLayer( 0x02 ); - if (pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2) { - pAttacker.SysMessage("You cannot disarm your opponent."); - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2 ) + { + pSockAttacker.SysMessage( GetDictionaryEntry( 19213, pSockAttacker.language ));// You cannot disarm your opponent. + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); return false; } - if (itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9) { - pAttacker.SysMessage("Your target is already unarmed!"); - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9 ) + { + pSockAttacker.SysMessage( GetDictionaryEntry( 19214, pSockAttacker.language ));// Your target is already unarmed! + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); return false; } // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 5) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 5 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } - pAttacker.SoundEffect(0x3B9, true); - pDefender.StaticEffect(0x37BE, 0x09, 0x32); + pAttacker.SoundEffect( 0x3B9, true ); + pDefender.StaticEffect( 0x37BE, 0x09, 0x32 ); - pAttacker.SysMessage("You disarm their weapon!"); - pDefender.SysMessage("Your weapon has been disarmed!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19215, pSockAttacker.language ));// You disarm their weapon! + pSockDefender.SysMessage( GetDictionaryEntry( 19216, pSockDefender.language ));// Your weapon has been disarmed! - if (itemLHand != null) { + if( itemLHand != null ) + { itemLHand.container = pDefender.pack; } - if (itemRHand != null) { + if( itemRHand != null ) + { itemRHand.container = pDefender.pack; } pDefender.AddScriptTrigger(7002);//block equip for 5 seconds script added - pDefender.SetTempTag("BlockEquip", true); - pDefender.StartTimer(5000, 9100, 7001); + pDefender.SetTempTag( "blockEquip", true ); + pDefender.StartTimer( 5000, 9100, 7001 ); - TriggerEvent(50104, "AddBuff", pDefender, 0x3ea, 1075637, 0, 5, " "); + TriggerEvent(50104, "AddBuff", pDefender, 0x3ea, 1075637, 0, 5, " " ); - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 6) // Dismount + else if( abilityID == 6 ) // Dismount { // Check to see if player is mount or flying. - if (pAttacker.isonhorse) + if( pAttacker.isonhorse || pAttacker.isflying ) { - pAttacker.TextMessage("You cannot perform that attack while mounted or flying!"); - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + pSockAttacker.SysMessage( GetDictionaryEntry( 19217, pSockAttacker.language ));// You cannot perform that attack while mounted or flying! + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); return true; } // Only Can work on players or npcs that is mounted - if (!pDefender.isonhorse) + if( !pDefender.isonhorse || !pDefender.isflying ) { - pAttacker.TextMessage("This attack only works on mounted or flying targets"); - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + pSockAttacker.SysMessage( GetDictionaryEntry( 19218, pSockAttacker.language ));// This attack only works on mounted or flying targets + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); return true; } // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 6) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 6 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } //Lesser Hiryu have an 80% chance of missing this attack needs added //This is the Dismount Information sent to Attacker and Defender - pDefender.SoundEffect(0x140, true); - pDefender.StaticEffect(0x3728, 0x09, 0x06); - pAttacker.TextMessage("The force of your attack has dislodged them from their mount!"); + pDefender.SoundEffect( 0x140, true ); + pDefender.StaticEffect( 0x3728, 0x09, 0x06 ); + pSockAttacker.SysMessage( GetDictionaryEntry( 19219, pSockAttacker.language ));// The force of your attack has dislodged them from their mount! pDefender.Dismount(); - pDefender.TextMessage("You have been knocked off of your mount by " + pAttacker.name + "!"); - pAttacker.SetTempTag("Dismount", false); - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + pSockDefender.SysMessage( GetDictionaryEntry( 19220, pSockDefender.language ), pAttacker.name );// You have been knocked off of your mount by %i ! + + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 8) // Infectious Strike + else if( abilityID == 8 ) // Infectious Strike { var itemRHand = pAttacker.FindItemLayer(0x01); var itemLHand = pAttacker.FindItemLayer(0x02); - if (itemLHand != null && itemLHand.poison <= 0 || itemRHand != null && itemRHand.poison <= 0) + if( itemLHand != null && itemLHand.poison <= 0 || itemRHand != null && itemRHand.poison <= 0 ) { - pDefender.SysMessage("Your weapon must have a dose of poison to perform an infectious strike!"); - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + pSockAttacker.SysMessage( GetDictionaryEntry( 19221, pSockAttacker.language ));// Your weapon must have a dose of poison to perform an infectious strike! + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); return; } // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 8) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 8 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } var level = 0; var chance = Math.random(); - if (pAttacker.skills[30] >= 0 && pAttacker.skills[30] <= 199) + if( pAttacker.skills[30] >= 0 && pAttacker.skills[30] <= 199 ) { level = 1; } - else if (pAttacker.skills[30] >= 200 && pAttacker.skills[30] <= 399) + else if( pAttacker.skills[30] >= 200 && pAttacker.skills[30] <= 399 ) { level = 2; } - else if (pAttacker.skills[30] >= 400 && pAttacker.skills[30] <= 599) + else if( pAttacker.skills[30] >= 400 && pAttacker.skills[30] <= 599 ) { level = 3; } - else if (pAttacker.skills[30] >= 600 && pAttacker.skills[30] <= 1000) + else if( pAttacker.skills[30] >= 600 && pAttacker.skills[30] <= 1000 ) { level = 4; } // Adjust the poison level based on chance - if (chance < 0.2) + if( chance < 0.2 ) { level--; // Decrease the level by 1 - if (level < 0) + if( level < 0 ) { level = 1; // Ensure the level doesn't go below 0 and is always set to least 1 } } - else if (chance > 0.8) + else if( chance > 0.8 ) { level++; // Increase the level by 1 - pAttacker.SysMessage("Your precise strike has increased the level of the poison by 1"); - pDefender.SysMessage("The poison seems extra effective!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19222, pSockAttacker.language ));// Your precise strike has increased the level of the poison by 1 + pSockDefender.SysMessage( GetDictionaryEntry( 19223, pSockDefender.language ));// The poison seems extra effective! } - pAttacker.TextMessage("You have poisoned your target : " + pDefender.name); - pDefender.TextMessage(pAttacker.name + " : poisoned you!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19224, pSockAttacker.language), pDefender.name);// You have poisoned your target : + pSockDefender.SysMessage( pAttacker.name, GetDictionaryEntry( 19225, pSockDefender.language ));// %i : poisoned you! pDefender.poison = level; - pAttacker.SoundEffect(0xDD, true); - pDefender.StaticEffect(0x3728, 0x09, 0x32); - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + pAttacker.SoundEffect( 0xDD, true ); + pDefender.StaticEffect( 0x3728, 0x09, 0x32 ); + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 9) // Mortal Strike - {// turn healthbar yellow on defender need spacket sent for this. + else if( abilityID == 9 ) // Mortal Strike + { // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 9) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 9 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } - pAttacker.SysMessage("You deliver a mortal wound!"); - pDefender.SysMessage("You have been mortally wounded!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19226, pSockAttacker.language ));// You deliver a mortal wound! + pSockDefender.SysMessage( GetDictionaryEntry( 19227, pSockDefender.language ));// You have been mortally wounded! - pAttacker.SoundEffect(0x1E1, true); - pDefender.StaticEffect(0x37B9, 0x09, 0x32); + pAttacker.SoundEffect( 0x1E1, true ); + pDefender.StaticEffect( 0x37B9, 0x09, 0x32 ); - pDefender.SetTempTag("blockHeal", true); + pDefender.SetTempTag( "blockHeal", true ); var seconds = 6000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) - if (pDefender.npc) { + if( pDefender.npc ) + { seconds = 12000; } - pDefender.StartTimer(seconds, 9200, true); + pDefender.StartTimer(seconds, 9200, true ); - if (pDefender.socket) - TriggerEvent(50104, "AddBuff", pDefender, 1027, 1075810, 1075811, 6, " "); + if( pDefender.socket ) + TriggerEvent( 50104, "AddBuff", pDefender, 1027, 1075810, 1075811, 6, " " ); - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 11) // ParalyzingBlow + else if( abilityID == 11 ) // ParalyzingBlow { // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 11) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 11 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } - pAttacker.SoundEffect(0x204, true); - pDefender.StaticEffect(0x376A, 0x09, 0x32); - var IsImmune = pDefender.GetTempTag("IsImmune") + pAttacker.SoundEffect( 0x204, true ); + pDefender.StaticEffect( 0x376A, 0x09, 0x32 ); + var isImmune = pDefender.GetTempTag( "isImmune" ) - if (IsImmune != null && IsImmune == true) + if( isImmune != null && isImmune == true ) { - pAttacker.TextMessage("Your target resists paralysis."); - pDefender.TextMessage("You resist paralysis."); + pSockAttacker.SysMessage( GetDictionaryEntry( 19228, pSockAttacker.language ));// Your target resists paralysis. + pSockDefender.SysMessage( GetDictionaryEntry( 19229, pSockDefender.language ));// You resist paralysis. return true; } var seconds = 3000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) - if (pDefender.npc) + if( pDefender.npc ) { seconds = 6000; } - else if (pDefender.socket) + else if( pDefender.socket ) { - pDefender.TextMessage("The attack has temporarily paralyzed you!", false, 0x3b2, 0, pDefender.serial);// The attack has temporarily paralyzed you! + pSockDefender.TextMessage( GetDictionaryEntry( 19230, pSockDefender.language ), false, 0x3b2, 0, pDefender.serial );// The attack has temporarily paralyzed you! } - pDefender.SetTempTag("IsImmune", true); - pDefender.StartTimer(seconds + 8000, 9000, 7001); - pDefender.StartTimer(seconds, 8000, 7001); + pDefender.SetTempTag( "isImmune", true ); + pDefender.StartTimer( seconds + 8000, 9000, 7001 ); + pDefender.StartTimer( seconds, 8000, 7001 ); pDefender.frozen = true; - if (pAttacker.socket) + if( pAttacker.socket ) { - pAttacker.TextMessage(GetDictionaryEntry(17702, pAttacker.socket.language), false, 0x3b2, 0, pAttacker.serial);// You deliver a paralyzing blow! + pSockAttacker.SysMessage( GetDictionaryEntry( 17702, pAttacker.socket.language), false, 0x3b2, 0, pAttacker.serial );// You deliver a paralyzing blow! } - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 12) // shadowstrike + else if( abilityID == 12 ) // shadowstrike { - if (pAttacker.skills[47] < 800) // Stealth + if( pAttacker.skills[47] < 800 ) // Stealth { - pAttacker.TextMessage("You lack the required stealth to perform that attack"); - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + pSockAttacker.SysMessage( GetDictionaryEntry( 19231, pSockAttacker.language ));// "You lack the required stealth to perform that attack + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); return true; } // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 12) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 12 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } - pAttacker.TextMessage("You strike and hide in the shadows!"); - pDefender.TextMessage("You are dazed by the attack and your attacker vanishes!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19232, pSockAttacker.language ));// You strike and hide in the shadows! + pSockDefender.SysMessage( GetDictionaryEntry( 19233, pSockDefender.language ));// You are dazed by the attack and your attacker vanishes! - pAttacker.StaticEffect(0x376A, 0x09, 0x06); + pAttacker.StaticEffect( 0x376A, 0x09, 0x06 ); - pDefender.SoundEffect(0x482, true); - pDefender.StaticEffect(0x37BE, 0x09, 0x06); + pDefender.SoundEffect( 0x482, true ); + pDefender.StaticEffect( 0x37BE, 0x09, 0x06 ); pAttacker.atWar = false; pDefender.atWar = false; pAttacker.visible = 1; - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID); + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID ); } } function onTimer( timerObj, timerID ) { var socket = timerObj.socket; - var abilityID = timerObj.GetTempTag("abilityID"); + var abilityID = timerObj.GetTempTag( "abilityID" ); var damage = 31; - if (timerObj == null || timerObj.dead) + if( timerObj == null || timerObj.dead) { timerObj.frozen = false; - timerObj.SetTempTag("IsImmune", null); - timerObj.RemoveScriptTrigger(7002); - timerObj.SetTempTag("BlockEquip", null); - timerObj.SetTempTag("blockHeal", null); - timerObj.KillJSTimer(9400, 7001); - timerObj.SetTempTag("doBleed", null); - TriggerEvent(2205, "ClearSpecialMove", timerObj, abilityID); + timerObj.SetTempTag( "isImmune", null ); + timerObj.RemoveScriptTrigger( 7002 ); + timerObj.SetTempTag( "blockEquip", null ); + timerObj.SetTempTag( "blockHeal", null ); + timerObj.KillJSTimer( 9400, 7001 ); + timerObj.SetTempTag( "doBleed", null ); + TriggerEvent( 2205, "ClearSpecialMove", timerObj, abilityID ); return; } - else if (timerID == 8000) + else if( timerID == 8000 ) { timerObj.frozen = false; } - else if (timerID == 9000) + else if( timerID == 9000 ) { - timerObj.SetTempTag("IsImmune", null); + timerObj.SetTempTag( "isImmune", null ); } - else if (timerID == 9100) + else if( timerID == 9100 ) { - timerObj.RemoveScriptTrigger(7002); - timerObj.SetTempTag("BlockEquip", null); - socket.SysMessage("Your confusion has passed, you may now arm a weapon!"); + timerObj.RemoveScriptTrigger( 7002 ); + timerObj.SetTempTag( "blockEquip", null ); + socket.SysMessage( GetDictionaryEntry( 19234, socket.language ));// Your confusion has passed, you may now arm a weapon! } - else if (timerID == 9200) + else if( timerID == 9200 ) { - timerObj.SetTempTag("blockHeal", null); - socket.SysMessage("You are no longer mortally wounded."); + timerObj.SetTempTag("blockHeal", null ); + socket.SysMessage( GetDictionaryEntry( 19235, socket.language ));// You are no longer mortally wounded. } - if (timerID >= 9300 && timerID < 9310) + if( timerID >= 9300 && timerID < 9310 ) { - var damage = RandomNumber(1, 10); - //timerObj.StaticEffect(0x122A, 0, 15); // blood effect got to figure how to add it to ground. + var damage = RandomNumber( 1, 10 ); + //timerObj.StaticEffect( 0x122A, 0, 15); // blood effect got to figure how to add it to ground. timerObj.health -= damage; - timerObj.StartTimer(2000, 9300 + 1, 7001);//restart timer every 2 seconds until it shuts off + timerObj.StartTimer( 2000, 9300 + 1, 7001 );//restart timer every 2 seconds until it shuts off } - else if (timerID == 9310) + else if( timerID == 9310 ) { - timerObj.SetTempTag("doBleed", null); - timerObj.KillJSTimer(9400, 7001); - socket.SysMessage("The bleeding wounds have healed, you are no longer bleeding!"); + timerObj.SetTempTag( "doBleed", null ); + timerObj.KillJSTimer( 9400, 7001 ); + socket.SysMessage( GetDictionaryEntry( 19236, socket.language ));// The bleeding wounds have healed, you are no longer bleeding! } } \ No newline at end of file From 0baa814f14d283029853b2735470e9a130832eb1 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 10 Jun 2024 16:17:00 -0500 Subject: [PATCH 029/147] Updated rest of Dictionarys --- data/dictionaries/dictionary.CSY | 37 ++++++++++++++++++++++++++++++++ data/dictionaries/dictionary.FRE | 37 ++++++++++++++++++++++++++++++++ data/dictionaries/dictionary.GER | 37 ++++++++++++++++++++++++++++++++ data/dictionaries/dictionary.ITA | 37 ++++++++++++++++++++++++++++++++ data/dictionaries/dictionary.POL | 37 ++++++++++++++++++++++++++++++++ data/dictionaries/dictionary.PTG | 37 ++++++++++++++++++++++++++++++++ data/dictionaries/dictionary.SPA | 37 ++++++++++++++++++++++++++++++++ 7 files changed, 259 insertions(+) diff --git a/data/dictionaries/dictionary.CSY b/data/dictionaries/dictionary.CSY index d19756c34..9b6d32295 100644 --- a/data/dictionaries/dictionary.CSY +++ b/data/dictionaries/dictionary.CSY @@ -5311,5 +5311,42 @@ 19100=Úspěšně jste převedli kov. 19101=Najednou můžete převést pouze pět set ingotů. 19102=Pro výměnu musí být položka ve vašem batohu. +// [19201-19300] Speciální pohyby +19201=K provedení tohoto útoku potřebujete %i zbraň +19202=K provedení tohoto útoku potřebujete %i many +19203=Váš útok proniká jejich pancířem! +19204=Úder pronikl do vašeho brnění! +19205=Váš cíl krvácí! +19206=Ty krvácíš! +19207=Hodně krvácíte +19208=%i silně krvácí +19209=Máte otřes mozku! +19210=Cítíte se dezorientovaný! +19211=Zasadil jsi zdrcující ránu! +19212=Zdrcujícím útokem dostáváte další poškození! +19213=Nemůžete odzbrojit svého protivníka. +19214=Váš cíl již není ozbrojen! +19215=Odzbrojte svou zbraň! +19216=Vaše zbraň byla odzbrojena! +19217=Nemůžete provést tento útok během jízdy nebo letu! +19218=Tento útok funguje pouze na namontované nebo létající cíle +19219=Síla vašeho útoku je vytlačila z jejich koně! +19220=Byli jste sraženi z vašeho koně %i! +19221=Vaše zbraň musí mít dávku jedu, aby mohla provést infekční útok! +19222=Váš přesný zásah zvýšil úroveň jedu o 1 +19223=Jed se zdá být extra účinný! +19224=Otrávili jste svůj cíl: %i +19225=%i : otrávil tě! +19226=Zasadil jsi smrtelnou ránu! +19227=Byl jsi smrtelně zraněn! +19228=Váš cíl odolává paralýze. +19229=Odporujete paralýze. +19230=Útok vás dočasně paralyzoval! +19231=Chybí vám požadované utajení k provedení tohoto útoku +19232=Úder a schováš se ve stínu! +19233=Jste omráčeni útokem a váš útočník zmizí! +19234=Váš zmatek pominul, nyní můžete vyzbrojit zbraň! +19235=Už nejsi smrtelně zraněný. +19236=Krvácející rány se zahojily, už nekrvácíte! } EOF diff --git a/data/dictionaries/dictionary.FRE b/data/dictionaries/dictionary.FRE index 9465437b6..d61ada06d 100644 --- a/data/dictionaries/dictionary.FRE +++ b/data/dictionaries/dictionary.FRE @@ -5467,5 +5467,42 @@ 19100=Vous avez réussi à convertir le métal. 19101=Vous ne pouvez convertir que cinq cents lingots à la fois. 19102=L'article doit être dans votre sac à dos pour être échangé. +// [19201-19300] Coups spéciaux +19201=Vous avez besoin de %i compétence d'arme pour effectuer cette attaque +19202=Vous avez besoin de %i mana pour effectuer cette attaque +19203=Votre attaque pénètre leur armure ! +19204=Le coup a pénétré votre armure ! +19205=Votre cible saigne ! +19206=Vous saignez ! +19207=Vous saignez abondamment +19208=%i saigne abondamment +19209=Vous avez provoqué une commotion cérébrale ! +19210=Vous vous sentez désorienté ! +19211=Vous avez porté un coup fatal ! +19212=Vous subissez des dégâts supplémentaires grâce à l'attaque écrasante ! +19213=Vous ne pouvez pas désarmer votre adversaire. +19214=Votre cible n'est déjà pas armée ! +19215=Vous désarmez votre arme ! +19216=Votre arme a été désarmée ! +19217=Vous ne pouvez pas effectuer cette attaque en étant monté ou en vol ! +19218=Cette attaque ne fonctionne que sur des cibles montées ou volantes +19219=La force de votre attaque les a déloges de leur monture ! +19220=Vous avez été renversé de votre monture par %i ! +19221=Votre arme doit contenir une dose de poison pour effectuer une frappe contagieuse ! +19222=Votre frappe précise a augmenté le niveau du poison de 1 +19223=Le poison semble très efficace ! +19224=Vous avez empoisonné votre cible : %i +19225=%i : vous a empoisonné ! +19226=Vous infligez une blessure mortelle ! +19227=Vous avez été mortellement blessé ! +19228=Votre cible résiste à la paralysie. +19229=Vous résistez à la paralysie. +19230=L'attaque vous a temporairement paralysé ! +19231=Vous n'avez pas la furtivité requise pour effectuer cette attaque +19232=Vous frappez et vous cachez dans l'ombre ! +19233=Vous êtes étourdi par l'attaque et votre attaquant disparaît ! +19234=Votre confusion est passée, vous pouvez maintenant armer une arme ! +19235=Vous n'êtes plus mortellement blessé. +19236=Les plaies saignantes ont guéri, vous ne saignez plus ! } EOF diff --git a/data/dictionaries/dictionary.GER b/data/dictionaries/dictionary.GER index 2376f9a36..e0cc39df1 100644 --- a/data/dictionaries/dictionary.GER +++ b/data/dictionaries/dictionary.GER @@ -5311,5 +5311,42 @@ 19100=Sie haben das Metall erfolgreich umgewandelt. 19101=Sie können jeweils nur fünfhundert Barren umwandeln. 19102=Der Artikel muss sich zum Umtausch in Ihrem Rucksack befinden. +// [19201-19300] Spezialbewegungen +19201=Sie benötigen %i Waffenfähigkeit, um diesen Angriff auszuführen +19202=Du brauchst %i Mana, um diesen Angriff auszuführen +19203=Dein Angriff durchdringt ihre Rüstung! +19204=Der Schlag hat deine Rüstung durchdrungen! +19205=Dein Ziel blutet! +19206=Du blutest! +19207=Sie bluten stark +19208=%i blutet stark +19209=Sie haben sich eine Gehirnerschütterung zugezogen! +19210=Sie fühlen sich desorientiert! +19211=Du hast einen vernichtenden Schlag versetzt! +19212=Du erleidest zusätzlichen Schaden durch den vernichtenden Angriff! +19213=Sie können Ihren Gegner nicht entwaffnen. +19214=Ihr Ziel ist bereits unbewaffnet! +19215=Du entwaffnest ihre Waffe! +19216=Deine Waffe wurde entschärft! +19217=Sie können diesen Angriff nicht ausführen, während Sie reiten oder fliegen! +19218=Dieser Angriff funktioniert nur bei berittenen oder fliegenden Zielen +19219=Die Wucht deines Angriffs hat sie von ihrem Reittier gestoßen! +19220=Du wurdest von %i von deinem Reittier gestoßen! +19221=Ihre Waffe muss über eine Giftdosis verfügen, um einen ansteckenden Schlag auszuführen! +19222=Dein präziser Schlag hat die Giftstufe um 1 erhöht +19223=Das Gift scheint besonders wirksam zu sein! +19224=Sie haben Ihr Ziel vergiftet: %i +19225=%i: hat dich vergiftet! +19226=Du fügst eine tödliche Wunde zu! +19227=Du wurdest tödlich verwundet! +19228=Ihr Ziel widersteht einer Lähmung. +19229=Sie widerstehen einer Lähmung. +19230=Der Angriff hat Sie vorübergehend gelähmt! +19231=Ihnen fehlt die erforderliche Tarnung, um diesen Angriff auszuführen +19232=Du schlägst zu und versteckst dich im Schatten! +19233=Sie sind durch den Angriff benommen und Ihr Angreifer verschwindet! +19234=Ihre Verwirrung ist vorüber, Sie können jetzt eine Waffe bewaffnen! +19235=Sie sind nicht mehr tödlich verwundet. +19236=Die blutenden Wunden sind verheilt, Sie bluten nicht mehr! } EOF diff --git a/data/dictionaries/dictionary.ITA b/data/dictionaries/dictionary.ITA index 882528064..2a20d9062 100644 --- a/data/dictionaries/dictionary.ITA +++ b/data/dictionaries/dictionary.ITA @@ -5311,5 +5311,42 @@ 19100=Hai convertito con successo il metallo. 19101=Puoi convertire solo cinquecento lingotti alla volta. 19102=L'articolo deve essere nel tuo zaino per essere scambiato. +// [19201-19300] Mosse speciali +19201=Hai bisogno di %i abilità con l'arma per eseguire quell'attacco +19202=Hai bisogno di %i mana per eseguire quell'attacco +19203=Il tuo attacco penetra la loro armatura! +19204=Il colpo ha penetrato la tua armatura! +19205=Il tuo bersaglio sta sanguinando! +19206=Stai sanguinando! +19207=Stai sanguinando copiosamente +19208=%i sta sanguinando copiosamente +19209=Hai provocato una commozione cerebrale! +19210=Ti senti disorientato! +19211=Hai sferrato un colpo devastante! +19212=Subisci danni extra dall'attacco devastante! +19213=Non puoi disarmare il tuo avversario. +19214=Il tuo bersaglio è già disarmato! +19215=Disarma la loro arma! +19216=La tua arma è stata disarmata! +19217=Non puoi eseguire quell'attacco mentre sei a cavallo o mentre voli! +19218=Questo attacco funziona solo su bersagli montati o volanti +19219=La forza del tuo attacco li ha spostati dalla loro cavalcatura! +19220=Sei stato buttato giù dalla tua cavalcatura da %i! +19221=La tua arma deve avere una dose di veleno per eseguire un colpo infettivo! +19222=Il tuo colpo preciso ha aumentato il livello del veleno di 1 +19223=Il veleno sembra estremamente efficace! +19224=Hai avvelenato il tuo bersaglio: %i +19225=%i: ti ha avvelenato! +19226=Hai procurato una ferita mortale! +19227=Sei stato ferito a morte! +19228=Il tuo bersaglio resiste alla paralisi. +19229=Resisti alla paralisi. +19230=L'attacco ti ha temporaneamente paralizzato! +19231=Non hai la furtività necessaria per eseguire quell'attacco +19232=Colpisci e ti nascondi nell'ombra! +19233=Sei stordito dall'attacco e il tuo aggressore svanisce! +19234=La tua confusione è passata, ora puoi armare un'arma! +19235=Non sei più ferito a morte. +19236=Le ferite sanguinanti sono guarite, non stai più sanguinando! } EOF diff --git a/data/dictionaries/dictionary.POL b/data/dictionaries/dictionary.POL index 144ca3bbf..0ca11cd4a 100644 --- a/data/dictionaries/dictionary.POL +++ b/data/dictionaries/dictionary.POL @@ -5311,5 +5311,42 @@ 19100=Udało Ci się przekonwertować metal. 19101=Możesz wymieniać tylko pięćset sztabek na raz. 19102=Przedmiot musi znajdować się w Twoim plecaku, aby można go było wymienić. +// [19201-19300] Ruchy specjalne +19201=Potrzebujesz %i umiejętności posługiwania się bronią, aby wykonać ten atak +19202=Potrzebujesz %i many, aby wykonać ten atak +19203=Twój atak przebija ich zbroję! +19204=Cios przebił twoją zbroję! +19205=Twój cel krwawi! +19206=Krwawisz! +19207=Obficie krwawisz +19208=%i obficie krwawi +19209=Doznałeś wstrząsu mózgu! +19210=Czujesz się zdezorientowany! +19211=Zadałeś miażdżący cios! +19212=Otrzymujesz dodatkowe obrażenia od miażdżącego ataku! +19213=Nie możesz rozbroić przeciwnika. +19214=Twój cel jest już nieuzbrojony! +19215=Rozbrajasz ich broń! +19216=Twoja broń została rozbrojona! +19217=Nie możesz wykonać tego ataku na koniu lub w locie! +19218=Ten atak działa tylko na cele konne lub latające +19219=Siła twojego ataku zrzuciła ich z wierzchowca! +19220=Zostałeś strącony z wierzchowca przez %i! +19221=Twoja broń musi zawierać dawkę trucizny, aby wykonać zaraźliwy atak! +19222=Twoje precyzyjne uderzenie zwiększyło poziom trucizny o 1 +19223=Trucizna wydaje się wyjątkowo skuteczna! +19224=Otrułeś swój cel: %i +19225=%i: otrułem cię! +19226=Zadajesz śmiertelną ranę! +19227=Zostałeś śmiertelnie ranny! +19228=Twój cel jest odporny na paraliż. +19229=Jesteś odporny na paraliż. +19230=Atak chwilowo cię sparaliżował! +19231=Brakuje Ci wymaganej umiejętności ukrywania się, aby wykonać ten atak +19232=Uderzasz i chowasz się w cieniu! +19233=Jesteś oszołomiony atakiem i twój napastnik znika! +19234=Twoje zamieszanie minęło, możesz teraz uzbroić broń! +19235=Nie jesteś już śmiertelnie ranny. +19236=Krwawiące rany się zagoiły, już nie krwawisz! } EOF diff --git a/data/dictionaries/dictionary.PTG b/data/dictionaries/dictionary.PTG index 416dcad46..8ab1e9c06 100644 --- a/data/dictionaries/dictionary.PTG +++ b/data/dictionaries/dictionary.PTG @@ -5311,5 +5311,42 @@ 19100=Você converteu o metal com sucesso. 19101=Você só pode converter quinhentos lingotes por vez. 19102=O item deve estar em sua mochila para ser trocado. +// [19201-19300] Movimentos Especiais +19201=Você precisa de %i habilidade com arma para realizar esse ataque +19202=Você precisa de %i mana para realizar esse ataque +19203=Seu ataque penetra na armadura deles! +19204=O golpe penetrou em sua armadura! +19205=Seu alvo está sangrando! +19206=Você está sangrando! +19207=Você está sangrando muito +19208=%i está sangrando profusamente +19209=Você causou uma concussão! +19210=Você se sente desorientado! +19211=Você desferiu um golpe esmagador! +19212=Você sofre dano extra com o ataque esmagador! +19213=Você não pode desarmar seu oponente. +19214=Seu alvo já está desarmado! +19215=Você desarma a arma deles! +19216=Sua arma foi desarmada! +19217=Você não pode realizar esse ataque enquanto estiver montado ou voando! +19218=Este ataque só funciona em alvos montados ou voadores +19219=A força do seu ataque os desalojou da montaria! +19220=Você foi derrubado da montaria por %i! +19221=Sua arma deve ter uma dose de veneno para realizar um ataque infeccioso! +19222=Seu ataque preciso aumentou o nível do veneno em 1 +19223=O veneno parece extremamente eficaz! +19224=Você envenenou seu alvo: %i +19225=%i: envenenou você! +19226=Você causou um ferimento mortal! +19227=Você foi mortalmente ferido! +19228=Seu alvo resiste à paralisia. +19229=Você resiste à paralisia. +19230=O ataque paralisou você temporariamente! +19231=Você não tem a furtividade necessária para realizar esse ataque +19232=Você ataca e se esconde nas sombras! +19233=Você fica atordoado com o ataque e seu atacante desaparece! +19234=Sua confusão passou, agora você pode armar uma arma! +19235=Você não está mais mortalmente ferido. +19236=As feridas sangrentas sararam, você não está mais sangrando! } EOF diff --git a/data/dictionaries/dictionary.SPA b/data/dictionaries/dictionary.SPA index aa5807812..11346b8d4 100644 --- a/data/dictionaries/dictionary.SPA +++ b/data/dictionaries/dictionary.SPA @@ -5311,5 +5311,42 @@ 19100=Has convertido exitosamente el metal. 19101=Sólo puedes convertir quinientos lingotes a la vez. 19102=El artículo debe estar en tu mochila para ser intercambiado. +// [19201-19300] Movimientos especiales +19201=Necesitas %i habilidad con arma para realizar ese ataque +19202=Necesitas %i mana para realizar ese ataque +19203=¡Tu ataque penetra su armadura! +19204=¡El golpe atravesó tu armadura! +19205=¡Tu objetivo está sangrando! +19206=¡Estás sangrando! +19207=Estas sangrando profusamente +19208=%i está sangrando profusamente +19209=¡Has causado una conmoción cerebral! +19210=¡Te sientes desorientado! +19211=¡Has asestado un golpe aplastante! +19212=¡Recibes daño extra por el ataque aplastante! +19213=No puedes desarmar a tu oponente. +19214=¡Tu objetivo ya está desarmado! +19215=¡Desarmas su arma! +19216=¡Tu arma ha sido desarmada! +19217=¡No puedes realizar ese ataque mientras estás montado o volando! +19218=Este ataque sólo funciona en objetivos montados o voladores +19219=¡La fuerza de tu ataque los ha desalojado de su montura! +19220=¡%i te ha derribado de tu montura! +19221=¡Tu arma debe tener una dosis de veneno para realizar un ataque infeccioso! +19222=Tu golpe preciso ha aumentado el nivel del veneno en 1 +19223=¡El veneno parece extra efectivo! +19224=Has envenenado a tu objetivo: %i +19225=%i: ¡te envenenó! +19226=¡Has causado una herida mortal! +19227=¡Has sido herido de muerte! +19228=Tu objetivo resiste la parálisis. +19229=Resistes la parálisis. +19230=¡El ataque te ha paralizado temporalmente! +19231=Te falta el sigilo necesario para realizar ese ataque +19232=¡Atacas y te escondes en las sombras! +19233=¡Estás aturdido por el ataque y tu atacante desaparece! +19234=¡Tu confusión ha pasado, ahora puedes armar un arma! +19235=Ya no estás herido de muerte. +19236=Las heridas sangrantes han sanado, ¡ya no sangras! } EOF From 90c9a5f8354b98ac932d96b11bf7487125fbe49b Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Tue, 11 Jun 2024 23:31:55 -0500 Subject: [PATCH 030/147] Small Fixes to Get Fixed items handling correct target Added Getting the resist on chars --- data/js/commands/targeting/get.js | 36 ++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/data/js/commands/targeting/get.js b/data/js/commands/targeting/get.js index 365d3a2b3..b07305bd5 100644 --- a/data/js/commands/targeting/get.js +++ b/data/js/commands/targeting/get.js @@ -294,30 +294,27 @@ function HandleGetItem( socket, ourItem, uKey ) case "DESC": socket.SysMessage( ourItem.desc ); break; - case "DEF": - socket.SysMessage( ourItem.Resist( 1 )); - break; case "DEF": case "RESISTARMOR": - socket.SysMessage( ourObj.Resist( 1 )); + socket.SysMessage( ourItem.Resist( 1 )); break; case "RESISTLIGHT": - socket.SysMessage( ourObj.Resist( 2 )); + socket.SysMessage( ourItem.Resist( 2 )); break; case "RESISTWATER": - socket.SysMessage( ourObj.Resist( 3 )); + socket.SysMessage( ourItem.Resist( 3 )); break; case "RESISTCOLD": - socket.SysMessage( ourObj.Resist( 4 )); + socket.SysMessage( ourItem.Resist( 4 )); break; case "RESISTFIRE": - socket.SysMessage( ourObj.Resist( 5 )); + socket.SysMessage( ourItem.Resist( 5 )); break; case "RESISTENERGY": - socket.SysMessage( ourObj.Resist( 6 )); + socket.SysMessage( ourItem.Resist( 6 )); break; case "RESISTPOISON": - socket.SysMessage( ourObj.Resist( 7 )); + socket.SysMessage( ourItem.Resist( 7 )); break; case "ARMORCLASS": case "ARMOURCLASS": @@ -598,8 +595,27 @@ function HandleGetChar( socket, ourChar, uKey ) break; case "ARMOUR": case "ARMOR": + case "RESISTARMOR": socket.SysMessage( ourChar.Resist( 1 )); break; + case "RESISTLIGHT": + socket.SysMessage( ourChar.Resist( 2 )); + break; + case "RESISTWATER": + socket.SysMessage( ourChar.Resist( 3 )); + break; + case "RESISTCOLD": + socket.SysMessage( ourChar.Resist( 4 )); + break; + case "RESISTFIRE": + socket.SysMessage( ourChar.Resist( 5 )); + break; + case "RESISTENERGY": + socket.SysMessage( ourChar.Resist( 6 )); + break; + case "RESISTPOISON": + socket.SysMessage( ourChar.Resist( 7 )); + break; case "MAXHP": socket.SysMessage( ourChar.maxhp ); break; From 3283ed5e2c007d5c3bbfc16f584bb38fe9fe6d96 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Wed, 12 Jun 2024 00:46:05 -0500 Subject: [PATCH 031/147] Added restrictedAbilities Added restrictedAbilitiesfor adding unsupported abilities --- data/js/combat/special_moves.js | 110 +++++++++++++++++++++++--------- 1 file changed, 81 insertions(+), 29 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 4159916cf..fc888d4c0 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -1,5 +1,16 @@ function onSpecialMove( pUser, abilityID ) { + // Define the array of restricted ability IDs + var restrictedAbilities = [7, 10, 13, 14, 15, 16, 17,18,19,20,21,22,23,24,25,29]; + + // Check if the abilityID is in the array of restricted abilities + if( restrictedAbilities.indexOf( abilityID ) != -1 ) + { + pUser.SysMessage( "This ability is not yet available." ); + TriggerEvent( 2205, "DeactivateSpecialMove", pUser, abilityID ); + return false; + } + // Check Skills if( !checkRequiredSkill( pUser, abilityID )) return true; @@ -10,11 +21,8 @@ function onSpecialMove( pUser, abilityID ) if( abilityID >= 1 ) pUser.SetTempTag( "abilityID", abilityID ); - return true; - //The rest of the AOS Abilites before any other expansions - //Double Strike - //Whirlwind Attack + return true; } function checkSkillRequirement( pUser, requiredSkillLevel, requiredSkill, skillMessage, abilityID ) @@ -36,8 +44,8 @@ function checkRequiredSkill( pUser, abilityID ) { // Define weapon types and their skill requirements and if primary or secondary ability var weaponTypes = { - "0x0df0": { primary: 0, secondary: 11, reqSkill: 41 }, - "0x0df1": { primary: 0, secondary: 11, reqSkill: 41 }, // Black Staves // WhirlwindAttack, ParalyzingBlow + "0x0df0": { primary: 13, secondary: 11, reqSkill: 41 }, + "0x0df1": { primary: 13, secondary: 11, reqSkill: 41 }, // Black Staves // WhirlwindAttack, ParalyzingBlow "0x0df2": { primary: 6, secondary: 5, reqSkill: 41 }, "0x0df3": { primary: 6, secondary: 5, reqSkill: 41 }, @@ -47,14 +55,14 @@ function checkRequiredSkill( pUser, abilityID ) "0x0e81": { primary: 4, secondary: 5, reqSkill: 41 }, "0x0e82": { primary: 4, secondary: 5, reqSkill: 41 }, // Shepherd's Crooks // CrushingBlow, Disarm - "0x0e85": { primary: 0, secondary: 5, reqSkill: 40 }, - "0x0e86": { primary: 0, secondary: 5, reqSkill: 40 }, // pickaxe // DoubleStrike, Disarm + "0x0e85": { primary: 7, secondary: 5, reqSkill: 40 }, + "0x0e86": { primary: 7, secondary: 5, reqSkill: 40 }, // pickaxe // DoubleStrike, Disarm "0x0e87": { primary: 2, secondary: 6, reqSkill: 42 }, "0x0e88": { primary: 2, secondary: 6, reqSkill: 42 }, // Pitchforks // BleedAttack, Dismount - "0x0e89": { primary: 0, secondary: 3, reqSkill: 41 }, - "0x0e8a": { primary: 0, secondary: 3, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow + "0x0e89": { primary: 7, secondary: 3, reqSkill: 41 }, + "0x0e8a": { primary: 7, secondary: 3, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow "0x0ec2": { primary: 2, secondary: 8, reqSkill: 40 }, "0x0ec3": { primary: 2, secondary: 8, reqSkill: 40 }, // Cleavers // BleedAttack, InfectiousStrike @@ -74,8 +82,8 @@ function checkRequiredSkill( pUser, abilityID ) "0x0f49": { primary: 4, secondary: 6, reqSkill: 40 }, "0x0f4a": { primary: 4, secondary: 6, reqSkill: 40 }, // Axes // CrushingBlow, Dismount - "0x0f4b": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x0f4c": { primary: 0, secondary: 0, reqSkill: 40 }, // Double Axe // DoubleStrike, WhirlwindAttack + "0x0f4b": { primary: 7, secondary: 13, reqSkill: 40 }, + "0x0f4c": { primary: 7, secondary: 13, reqSkill: 40 }, // Double Axe // DoubleStrike, WhirlwindAttack "0x0f4e": { primary: 11, secondary: 6, reqSkill: 40 }, "0x0f4e": { primary: 11, secondary: 6, reqSkill: 40 }, // Bardiches // ParalyzingBlow, Dismount @@ -112,14 +120,14 @@ function checkRequiredSkill( pUser, abilityID ) "0x13b3": { primary: 12, secondary: 6, reqSkill: 41 }, "0x13b4": { primary: 12, secondary: 6, reqSkill: 41 }, // Clubs // ShadowStrike, Dismount - "0x13b5": { primary: 0, secondary: 11, reqSkill: 40 }, - "0x13b6": { primary: 0, secondary: 1, reqSkill: 40 }, // Scimitars // DoubleStrike, ParalyzingBlow + "0x13b5": { primary: 7, secondary: 11, reqSkill: 40 }, + "0x13b6": { primary: 7, secondary: 11, reqSkill: 40 }, // Scimitars // DoubleStrike, ParalyzingBlow "0x13b9": { primary: 11, secondary: 4, reqSkill: 40 }, "0x13ba": { primary: 11, secondary: 4, reqSkill: 40 }, // Viking Swords // ParalyzingBlow, CrushingBlow - "0x13fc": { primary: 0, secondary: 6, reqSkill: 31 }, - "0x13fd": { primary: 0, secondary: 6, reqSkill: 31 }, // Heavy Crossbows // MovingShot, Dismount + "0x13fc": { primary: 10, secondary: 6, reqSkill: 31 }, + "0x13fd": { primary: 10, secondary: 6, reqSkill: 31 }, // Heavy Crossbows // MovingShot, Dismount "0x13e3": { primary: 4, secondary: 12, reqSkill: 41 }, "0x13e4": { primary: 4, secondary: 12, reqSkill: 41 }, // Smith's Hammers // CrushingBlow, ShadowStrike @@ -130,11 +138,11 @@ function checkRequiredSkill( pUser, abilityID ) "0x13f8": { primary: 3, secondary: 0, reqSkill: 41 }, "0x13f9": { primary: 3, secondary: 0, reqSkill: 41 }, // Gnarled Staves // ConcussionBlow,ForceOfNature - "0x13fa": { primary: 0, secondary: 2, reqSkill: 40 }, - "0x13fb": { primary: 0, secondary: 2, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack + "0x13fa": { primary: 13, secondary: 2, reqSkill: 40 }, + "0x13fb": { primary: 13, secondary: 2, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack - "0x13fe": { primary: 0, secondary: 1, reqSkill: 40 }, - "0x13ff": { primary: 0, secondary: 1, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore + "0x13fe": { primary: 7, secondary: 1, reqSkill: 40 }, + "0x13ff": { primary: 7, secondary: 1, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore "0x1400": { primary: 1, secondary: 8, reqSkill: 42 }, "0x1401": { primary: 1, secondary: 8, reqSkill: 42 }, // Kryss // ArmorIgnore,InfectiousStrike @@ -148,23 +156,23 @@ function checkRequiredSkill( pUser, abilityID ) "0x1406": { primary: 4, secondary: 9, reqSkill: 41 }, "0x1407": { primary: 4, secondary: 9, reqSkill: 41 }, // War Maces // CrushingBlow,MortalStrike - "0x1438": { primary: 0, secondary: 4, reqSkill: 41 }, - "0x1439": { primary: 0, secondary: 4, reqSkill: 41 }, // War Hammers // WhirlwindAttack,CrushingBlow + "0x1438": { primary: 13, secondary: 4, reqSkill: 41 }, + "0x1439": { primary: 13, secondary: 4, reqSkill: 41 }, // War Hammers // WhirlwindAttack,CrushingBlow - "0x143a": { primary: 0, secondary: 3, reqSkill: 41 }, - "0x143b": { primary: 0, secondary: 3, reqSkill: 41 }, // Mauls // DoubleStrike,ConcussionBlow + "0x143a": { primary: 7, secondary: 3, reqSkill: 41 }, + "0x143b": { primary: 7, secondary: 3, reqSkill: 41 }, // Mauls // DoubleStrike,ConcussionBlow "0x143c": { primary: 1, secondary: 9, reqSkill: 41 }, "0x143d": { primary: 1, secondary: 9, reqSkill: 41 }, // Hammer Picks // ArmorIgnore,MortalStrike - "0x143e": { primary: 0, secondary: 3, reqSkill: 40 }, - "0x143f": { primary: 0, secondary: 3, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow + "0x143e": { primary: 13, secondary: 3, reqSkill: 40 }, + "0x143f": { primary: 13, secondary: 3, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow "0x1440": { primary: 2, secondary: 12, reqSkill: 40 }, "0x1441": { primary: 2, secondary: 12, reqSkill: 40 }, // Cutlasses // BleedAttack,ShadowStrike - "0x1442": { primary: 0, secondary: 12, reqSkill: 40 }, - "0x1443": { primary: 0, secondary: 12, reqSkill: 40 } // Two Handed Axes // DoubleStrike,ShadowStrike + "0x1442": { primary: 7, secondary: 12, reqSkill: 40 }, + "0x1443": { primary: 7, secondary: 12, reqSkill: 40 } // Two Handed Axes // DoubleStrike,ShadowStrike }; // Get items in user's hands @@ -236,7 +244,9 @@ function getAbilityManaTable() 9: { manaAmount: 30 }, 10: { manaAmount: 30 }, 11: { manaAmount: 30 }, - 12: { manaAmount: 20 } + 12: { manaAmount: 20 }, + 13: { manaAmount: 20 }, + 14: { manaAmount: 100 } }; } @@ -565,6 +575,20 @@ function onAbility( pAttacker, pDefender, abilityID ) TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } + else if( abilityID == 7 ) // Double Strike + { + // Clear out any current ability the player is doing when he switches abilities + if( abilityID != 7 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + + //checking mana + if( CheckMana( pAttacker, abilityID )) + { + DeductMana( pAttacker, abilityID ); + } + + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + } else if( abilityID == 8 ) // Infectious Strike { var itemRHand = pAttacker.FindItemLayer(0x01); @@ -663,6 +687,20 @@ function onAbility( pAttacker, pDefender, abilityID ) TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } + else if( abilityID == 10 ) // Moving Shot + { + // Clear out any current ability the player is doing when he switches abilities + if( abilityID != 10 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + + //checking mana + if( CheckMana( pAttacker, abilityID )) + { + DeductMana( pAttacker, abilityID ); + } + + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + } else if( abilityID == 11 ) // ParalyzingBlow { // Clear out any current ability the player is doing when he switches abilities @@ -740,6 +778,20 @@ function onAbility( pAttacker, pDefender, abilityID ) TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID ); } + else if( abilityID == 13 ) // Whirlwind Attack + { + // Clear out any current ability the player is doing when he switches abilities + if( abilityID != 13 ) + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + + //checking mana + if( CheckMana(pAttacker, abilityID )) + { + DeductMana( pAttacker, abilityID ); + } + + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + } } function onTimer( timerObj, timerID ) From 77d00be485578cbded5608b291615fa7c1957849 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Wed, 12 Jun 2024 20:05:38 -0500 Subject: [PATCH 032/147] Added socket checks Added Socket Checks so if its a npc it does not error out on sysmessage --- data/js/combat/special_moves.js | 49 +++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index fc888d4c0..bd87d3806 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -408,7 +408,8 @@ function onAbility( pAttacker, pDefender, abilityID ) } pSockAttacker.SysMessage( GetDictionaryEntry( 19203, pSockAttacker.language ));// Your attack penetrates their armor! - pSockDefender.SysMessage( GetDictionaryEntry( 19204, pSockDefender.language ));// The blow penetrated your armor! + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19204, pSockDefender.language ));// The blow penetrated your armor! pDefender.SoundEffect( 0x0056, true ); pDefender.StaticEffect( 0x3728, 0x09, 0x06 ); @@ -428,10 +429,13 @@ function onAbility( pAttacker, pDefender, abilityID ) } pSockAttacker.SysMessage( GetDictionaryEntry( 19205, pSockAttacker.language ));// Your target is bleeding! - pSockDefender.SysMessage( GetDictionaryEntry( 19206, pSockDefender.language ));// You are bleeding! + if( pSockDefender != null ) + { + pSockDefender.SysMessage(GetDictionaryEntry(19206, pSockDefender.language));// You are bleeding! - pSockDefender.TextMessage( GetDictionaryEntry( 19207, pSockDefender.language), false, 0x21 );// You are bleeding profusely - pSockDefender.TextMessage( pDefender.name, GetDictionaryEntry( 19208, pSockDefender.language), true, 0x21, 1 );// %i is bleeding profusely + pSockDefender.TextMessage(GetDictionaryEntry(19207, pSockDefender.language), false, 0x21);// You are bleeding profusely + pSockDefender.TextMessage(pDefender.name, GetDictionaryEntry(19208, pSockDefender.language), true, 0x21, 1);// %i is bleeding profusely + } pDefender.StartTimer( 2000, 9300, 7001 ); // Start 2 second timer for blood and damage last total 10 seconds pDefender.SetTempTag( "doBleed", true ); @@ -457,7 +461,9 @@ function onAbility( pAttacker, pDefender, abilityID ) } pSockAttacker.SysMessage( GetDictionaryEntry( 19209, pSockAttacker.language ));// You have delivered a concussion! - pSockDefender.SysMessage( GetDictionaryEntry( 19210, pSockDefender.language ));// You feel disoriented! + + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19210, pSockDefender.language ));// You feel disoriented! pAttacker.SoundEffect( 0x213, true ); pDefender.StaticEffect( 0x377A, 0x09, 0x32 ); @@ -478,7 +484,8 @@ function onAbility( pAttacker, pDefender, abilityID ) } pSockAttacker.SysMessage( GetDictionaryEntry( 19211, pSockAttacker.language ));// You have delivered a crushing blow! - pSockDefender.SysMessage( GetDictionaryEntry( 19212, pSockDefender.language ));// You take extra damage from the crushing attack! + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19212, pSockDefender.language ));// You take extra damage from the crushing attack! pAttacker.SoundEffect( 0x1E1, true ); TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success @@ -516,7 +523,8 @@ function onAbility( pAttacker, pDefender, abilityID ) pDefender.StaticEffect( 0x37BE, 0x09, 0x32 ); pSockAttacker.SysMessage( GetDictionaryEntry( 19215, pSockAttacker.language ));// You disarm their weapon! - pSockDefender.SysMessage( GetDictionaryEntry( 19216, pSockDefender.language ));// Your weapon has been disarmed! + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19216, pSockDefender.language ));// Your weapon has been disarmed! if( itemLHand != null ) { @@ -571,7 +579,9 @@ function onAbility( pAttacker, pDefender, abilityID ) pDefender.StaticEffect( 0x3728, 0x09, 0x06 ); pSockAttacker.SysMessage( GetDictionaryEntry( 19219, pSockAttacker.language ));// The force of your attack has dislodged them from their mount! pDefender.Dismount(); - pSockDefender.SysMessage( GetDictionaryEntry( 19220, pSockDefender.language ), pAttacker.name );// You have been knocked off of your mount by %i ! + + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19220, pSockDefender.language ), pAttacker.name );// You have been knocked off of your mount by %i ! TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } @@ -643,11 +653,14 @@ function onAbility( pAttacker, pDefender, abilityID ) { level++; // Increase the level by 1 pSockAttacker.SysMessage( GetDictionaryEntry( 19222, pSockAttacker.language ));// Your precise strike has increased the level of the poison by 1 - pSockDefender.SysMessage( GetDictionaryEntry( 19223, pSockDefender.language ));// The poison seems extra effective! + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19223, pSockDefender.language ));// The poison seems extra effective! } pSockAttacker.SysMessage( GetDictionaryEntry( 19224, pSockAttacker.language), pDefender.name);// You have poisoned your target : - pSockDefender.SysMessage( pAttacker.name, GetDictionaryEntry( 19225, pSockDefender.language ));// %i : poisoned you! + if( pSockDefender != null ) + pSockDefender.SysMessage( pAttacker.name, GetDictionaryEntry( 19225, pSockDefender.language ));// %i : poisoned you! + pDefender.poison = level; pAttacker.SoundEffect( 0xDD, true ); @@ -668,7 +681,9 @@ function onAbility( pAttacker, pDefender, abilityID ) } pSockAttacker.SysMessage( GetDictionaryEntry( 19226, pSockAttacker.language ));// You deliver a mortal wound! - pSockDefender.SysMessage( GetDictionaryEntry( 19227, pSockDefender.language ));// You have been mortally wounded! + + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19227, pSockDefender.language ));// You have been mortally wounded! pAttacker.SoundEffect( 0x1E1, true ); pDefender.StaticEffect( 0x37B9, 0x09, 0x32 ); @@ -720,7 +735,8 @@ function onAbility( pAttacker, pDefender, abilityID ) if( isImmune != null && isImmune == true ) { pSockAttacker.SysMessage( GetDictionaryEntry( 19228, pSockAttacker.language ));// Your target resists paralysis. - pSockDefender.SysMessage( GetDictionaryEntry( 19229, pSockDefender.language ));// You resist paralysis. + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19229, pSockDefender.language ));// You resist paralysis. return true; } @@ -765,7 +781,8 @@ function onAbility( pAttacker, pDefender, abilityID ) } pSockAttacker.SysMessage( GetDictionaryEntry( 19232, pSockAttacker.language ));// You strike and hide in the shadows! - pSockDefender.SysMessage( GetDictionaryEntry( 19233, pSockDefender.language ));// You are dazed by the attack and your attacker vanishes! + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19233, pSockDefender.language ));// You are dazed by the attack and your attacker vanishes! pAttacker.StaticEffect( 0x376A, 0x09, 0x06 ); @@ -824,7 +841,8 @@ function onTimer( timerObj, timerID ) { timerObj.RemoveScriptTrigger( 7002 ); timerObj.SetTempTag( "blockEquip", null ); - socket.SysMessage( GetDictionaryEntry( 19234, socket.language ));// Your confusion has passed, you may now arm a weapon! + if( socket != null ) + socket.SysMessage( GetDictionaryEntry( 19234, socket.language ));// Your confusion has passed, you may now arm a weapon! } else if( timerID == 9200 ) { @@ -843,6 +861,7 @@ function onTimer( timerObj, timerID ) { timerObj.SetTempTag( "doBleed", null ); timerObj.KillJSTimer( 9400, 7001 ); - socket.SysMessage( GetDictionaryEntry( 19236, socket.language ));// The bleeding wounds have healed, you are no longer bleeding! + if( socket != null ) + socket.SysMessage( GetDictionaryEntry( 19236, socket.language ));// The bleeding wounds have healed, you are no longer bleeding! } } \ No newline at end of file From d6a1d282919b0a3ac9d373d36db697b098479efb Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Wed, 12 Jun 2024 21:48:18 -0500 Subject: [PATCH 033/147] Cleanup Mana Table Added Description for all the mana and added SE and ML Mana --- data/js/combat/special_moves.js | 47 ++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index bd87d3806..5f2d006a8 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -230,23 +230,38 @@ function checkRequiredSkill( pUser, abilityID ) } function getAbilityManaTable() -{ +{// Mana is Based off 2003 AOS and 2005 ML return { - 0: { manaAmount: 0 }, - 1: { manaAmount: 14 }, - 2: { manaAmount: 30 }, - 3: { manaAmount: 20 }, - 4: { manaAmount: 20 }, - 5: { manaAmount: 20 }, - 6: { manaAmount: 16 }, - 7: { manaAmount: 20 }, - 8: { manaAmount: 20 }, - 9: { manaAmount: 30 }, - 10: { manaAmount: 30 }, - 11: { manaAmount: 30 }, - 12: { manaAmount: 20 }, - 13: { manaAmount: 20 }, - 14: { manaAmount: 100 } + 0: { manaAmount: 0 }, // Cancel Ability Attempt + 1: { manaAmount: 30 }, // Armor Ignore // Start AOS abiltiies + 2: { manaAmount: 30 }, // Bleed Attack + 3: { manaAmount: 30 }, // Concusion Blow + 4: { manaAmount: 30 }, // Crushing Blow + 5: { manaAmount: 20 }, // Disarm + 6: { manaAmount: 20 }, // Dismount + 7: { manaAmount: 30 }, // Double Strike + 8: { manaAmount: 20 }, // Infecting + 9: { manaAmount: 30 }, // Mortal Strike + 10: { manaAmount: 20 }, // Moving Shot + 11: { manaAmount: 35 }, // Paralyzing Blow + 12: { manaAmount: 25 }, // Shadow Strike + 13: { manaAmount: 25 }, // Whirlwind Attack // End AOS abilities + 14: { manaAmount: 30 }, // Riding Swipe // Start SE abiltiies + 15: { manaAmount: 30 }, // Frenzied Whirlwind + 16: { manaAmount: 30 }, // Block + 17: { manaAmount: 30 }, // Defense Mastery + 18: { manaAmount: 30 }, // Nerve Strike + 19: { manaAmount: 30 }, // Talon Strike + 20: { manaAmount: 30 }, // Feint + 21: { manaAmount: 30 }, // Dual Wield + 22: { manaAmount: 30 }, // Double shot + 23: { manaAmount: 30 }, // Armor Peirce // End SE abilities + 24: { manaAmount: 25 }, // Bladeweave // Start ML abilities + 25: { manaAmount: 15 }, // Force Arrow + 26: { manaAmount: 15 }, // Lightning Arrow + 27: { manaAmount: 25 }, // Psychic Attack + 28: { manaAmount: 35 }, // Serpent Arrow + 29: { manaAmount: 35 } // Force of Nature // End ML abilities }; } From 363ce296c459a21253c67b783fe85e2ef91c2786 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Fri, 14 Jun 2024 14:38:03 -0500 Subject: [PATCH 034/147] Hit/Defense Chance Properties --- source/CPacketSend.cpp | 14 ++++++++ source/UOXJSPropertyEnums.h | 2 ++ source/UOXJSPropertyFuncs.cpp | 4 +++ source/UOXJSPropertySpecs.h | 2 ++ source/cBaseObject.cpp | 62 +++++++++++++++++++++++++++++++++++ source/cBaseObject.h | 11 +++++++ source/cChar.cpp | 7 ++++ source/cItem.cpp | 14 ++++++++ source/combat.cpp | 6 ++-- source/items.cpp | 2 ++ source/ssection.cpp | 4 +++ source/ssection.h | 2 ++ 12 files changed, 127 insertions(+), 3 deletions(-) diff --git a/source/CPacketSend.cpp b/source/CPacketSend.cpp index e1d8ee4ca..04d145b29 100644 --- a/source/CPacketSend.cpp +++ b/source/CPacketSend.cpp @@ -7657,6 +7657,20 @@ void CPToolTip::CopyItemData( CItem& cItem, size_t &totalStringLen, bool addAmou FinalizeData( tempEntry, totalStringLen ); } + if( cItem.GetHitChance() > 0 ) + { + tempEntry.stringNum = 1060415; // hit chance increase ~1_val~% + tempEntry.ourText = oldstrutil::number( cItem.GetHitChance() ); + FinalizeData( tempEntry, totalStringLen ); + } + + if( cItem.GetDefenseChance() > 0 ) + { + tempEntry.stringNum = 1060408; // defense chance increase ~1_val~% + tempEntry.ourText = oldstrutil::number( cItem.GetDefenseChance() ); + FinalizeData( tempEntry, totalStringLen ); + } + if( cItem.GetStrength() > 1 ) { tempEntry.stringNum = 1061170; // strength requirement ~1_val~ diff --git a/source/UOXJSPropertyEnums.h b/source/UOXJSPropertyEnums.h index af309d496..f471df16e 100644 --- a/source/UOXJSPropertyEnums.h +++ b/source/UOXJSPropertyEnums.h @@ -461,6 +461,8 @@ enum CI_Properties CIP_DAMAGEPOISON, CIP_DAMAGERAIN, CIP_DAMAGESNOW, + CIP_HITCHANCE, + CIP_DEFENSECHANCE, CIP_NAME2, CIP_ISITEM, CIP_ISCHAR, diff --git a/source/UOXJSPropertyFuncs.cpp b/source/UOXJSPropertyFuncs.cpp index 3823356f9..02ff0cbb2 100644 --- a/source/UOXJSPropertyFuncs.cpp +++ b/source/UOXJSPropertyFuncs.cpp @@ -676,6 +676,8 @@ JSBool CItemProps_getProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGERAIN: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( RAIN )); break; case CIP_DAMAGESNOW: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( SNOW )); break; case CIP_SPEED: *vp = INT_TO_JSVAL( gPriv->GetSpeed() ); break; + case CIP_HITCHANCE: *vp = INT_TO_JSVAL( gPriv->GetHitChance() ); break; + case CIP_DEFENSECHANCE: *vp = INT_TO_JSVAL( gPriv->GetDefenseChance() ); break; case CIP_NAME2: tString = JS_NewStringCopyZ( cx, gPriv->GetName2().c_str() ); *vp = STRING_TO_JSVAL( tString ); @@ -1321,6 +1323,8 @@ JSBool CItemProps_setProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGERAIN: gPriv->SetWeatherDamage( RAIN, encaps.toBool() ); break; case CIP_DAMAGESNOW: gPriv->SetWeatherDamage( SNOW, encaps.toBool() ); break; case CIP_SPEED: gPriv->SetSpeed( static_cast( encaps.toInt() )); break; + case CIP_HITCHANCE: gPriv->SetHitChance( static_cast( encaps.toInt() )); break; + case CIP_DEFENSECHANCE: gPriv->SetDefenseChance( static_cast( encaps.toInt() )); break; case CIP_NAME2: gPriv->SetName2( encaps.toString() ); break; case CIP_RACE: gPriv->SetRace( static_cast( encaps.toInt() )); break; case CIP_MAXHP: gPriv->SetMaxHP( static_cast( encaps.toInt() )); break; diff --git a/source/UOXJSPropertySpecs.h b/source/UOXJSPropertySpecs.h index 3149dc0ec..b77c023aa 100644 --- a/source/UOXJSPropertySpecs.h +++ b/source/UOXJSPropertySpecs.h @@ -535,6 +535,8 @@ inline JSPropertySpec CItemProps[] = { "ammoFXHue", CIP_AMMOFXHUE, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "ammoFXRender", CIP_AMMOFXRENDER, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "speed", CIP_SPEED, JSPROP_ENUMANDPERM, nullptr, nullptr }, + { "hitChance", CIP_HITCHANCE, JSPROP_ENUMANDPERM, nullptr, nullptr }, + { "defenseChance", CIP_DEFENSECHANCE, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "multi", CIP_MULTI, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "maxRange", CIP_MAXRANGE, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "baseRange", CIP_BASERANGE, JSPROP_ENUMANDPERM, nullptr, nullptr }, diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp index 506c247ac..bfb143b5d 100644 --- a/source/cBaseObject.cpp +++ b/source/cBaseObject.cpp @@ -1036,6 +1036,48 @@ void CBaseObject::IncHP( SI16 amtToChange ) SetHP( hitpoints + amtToChange ); } +//o------------------------------------------------------------------------------------------------o +//| Function - CBaseObject::GetHitChance() +//| CBaseObject::SetHitChance() +//| Date - 14 June, 2024 +//o------------------------------------------------------------------------------------------------o +//| Purpose - Gets/Sets the Defense Chance of the Item Equiped +//o------------------------------------------------------------------------------------------------o +SI16 CBaseObject::GetHitChance( void ) const +{ + return hitChance; +} +void CBaseObject::SetHitChance( SI16 newValue ) +{ + hitChance = newValue; + + if( CanBeObjType( OT_ITEM )) + { + ( static_cast( this ))->UpdateRegion(); + } +} + +//o------------------------------------------------------------------------------------------------o +//| Function - CBaseObject::GetDefenseChance() +//| CBaseObject::SetDefenseChance() +//| Date - 14 June, 2024 +//o------------------------------------------------------------------------------------------------o +//| Purpose - Gets/Sets the Defense Chance of the Item Equiped +//o------------------------------------------------------------------------------------------------o +SI16 CBaseObject::GetDefenseChance( void ) const +{ + return defenseChance; +} +void CBaseObject::SetDefenseChance( SI16 newValue ) +{ + defenseChance = newValue; + + if( CanBeObjType( OT_ITEM )) + { + ( static_cast( this ))->UpdateRegion(); + } +} + //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject::GetDir() //| CBaseObject::SetDir() @@ -1661,6 +1703,26 @@ void CBaseObject::IncIntelligence( SI16 toInc ) SetIntelligence( intelligence + toInc ); } +//o------------------------------------------------------------------------------------------------o +//| Function - CBaseObject::IncHitChance() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Increments the object's Hit Chance value +//o------------------------------------------------------------------------------------------------o +void CBaseObject::IncHitChance( SI16 toInc ) +{ + SetHitChance( hitChance + toInc ); +} + +//o------------------------------------------------------------------------------------------------o +//| Function - CBaseObject::IncDefenseChance() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Increments the object's Hit Chance value +//o------------------------------------------------------------------------------------------------o +void CBaseObject::IncDefenseChance( SI16 toInc ) +{ + SetDefenseChance( defenseChance + toInc ); +} + //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject::DumpFooter() //o------------------------------------------------------------------------------------------------o diff --git a/source/cBaseObject.h b/source/cBaseObject.h index 638e826f7..4b5c66329 100644 --- a/source/cBaseObject.h +++ b/source/cBaseObject.h @@ -69,6 +69,8 @@ class CBaseObject SI16 dexterity; SI16 intelligence; SI16 hitpoints; + SI16 hitChance; + SI16 defenseChance; VisibleTypes visible; SI16 hiDamage; SI16 loDamage; @@ -223,6 +225,12 @@ class CBaseObject virtual void SetHP( SI16 newValue ); void IncHP( SI16 amtToChange ); + virtual SI16 GetHitChance( void ) const; + virtual void SetHitChance( SI16 newValue ); + + virtual SI16 GetDefenseChance( void ) const; + virtual void SetDefenseChance( SI16 newValue ); + void SetDir( UI08 newDir, bool sendUpdate = true ); UI08 GetDir( void ) const; @@ -256,6 +264,9 @@ class CBaseObject void IncDexterity( SI16 toInc = 1 ); void IncIntelligence( SI16 toInc = 1 ); + void IncHitChance( SI16 toInc = 1 ); + void IncDefenseChance( SI16 toInc = 1 ); + virtual void PostLoadProcessing( void ); virtual bool LoadRemnants( void ) = 0; diff --git a/source/cChar.cpp b/source/cChar.cpp index 7aa03f6fa..6bb36cb56 100644 --- a/source/cChar.cpp +++ b/source/cChar.cpp @@ -2920,6 +2920,9 @@ bool CChar::WearItem( CItem *toWear ) IncDexterity2( itemLayers[tLayer]->GetDexterity2() ); IncIntelligence2( itemLayers[tLayer]->GetIntelligence2() ); + IncHitChance( itemLayers[tLayer]->GetHitChance() ); + IncDefenseChance( itemLayers[tLayer]->GetDefenseChance() ); + if( toWear->IsPostLoaded() ) { if( itemLayers[tLayer]->GetPoisoned() ) @@ -2979,6 +2982,10 @@ bool CChar::TakeOffItem( ItemLayers Layer ) IncStrength2( -itemLayers[Layer]->GetStrength2() ); IncDexterity2( -itemLayers[Layer]->GetDexterity2() ); IncIntelligence2( -itemLayers[Layer]->GetIntelligence2() ); + + IncHitChance( -itemLayers[Layer]->GetHitChance() ); + IncDefenseChance( -itemLayers[Layer]->GetDefenseChance() ); + if( itemLayers[Layer]->GetPoisoned() ) { if( itemLayers[Layer]->GetPoisoned() > GetPoisoned() ) diff --git a/source/cItem.cpp b/source/cItem.cpp index 3c6523d5d..5843cfb86 100644 --- a/source/cItem.cpp +++ b/source/cItem.cpp @@ -1638,6 +1638,8 @@ auto CItem::CopyData( CItem *target ) -> void target->SetRndValueRate( GetRndValueRate() ); target->SetSpawn( GetSpawn() ); target->SetSpeed( GetSpeed() ); + target->SetHitChance( GetHitChance() ); + target->SetDefenseChance( GetDefenseChance() ); target->SetSpell( 0, GetSpell( 0 )); target->SetSpell( 1, GetSpell( 1 )); target->SetSpell( 2, GetSpell( 2 )); @@ -1736,6 +1738,8 @@ bool CItem::DumpBody( std::ostream &outStream ) const outStream << "BaseWeight=" + std::to_string( GetBaseWeight() ) + newLine; outStream << "MaxItems=" + std::to_string( GetMaxItems() ) + newLine; outStream << "MaxHP=" + std::to_string( GetMaxHP() ) + newLine; + outStream << "HitChance=" + std::to_string( GetHitChance() ) + newLine; + outStream << "DefenseChance=" + std::to_string( GetDefenseChance() ) + newLine; outStream << "Speed=" + std::to_string( GetSpeed() ) + newLine; outStream << "Movable=" + std::to_string( GetMovable() ) + newLine; outStream << "Priv=" + std::to_string( GetPriv() ) + newLine; @@ -1859,6 +1863,11 @@ bool CItem::HandleLine( std::string &UTag, std::string &data ) SetDye( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )) == 1 ); rValue = true; } + else if( UTag == "DEFENSECHANCE" ) + { + SetDefenseChance( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 ))); + rValue = true; + } break; case 'E': if( UTag == "ENTRYMADEFROM" ) @@ -1905,6 +1914,11 @@ bool CItem::HandleLine( std::string &UTag, std::string &data ) SetWeatherDamage( HEAT, static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )) == 1 ); rValue = true; } + else if( UTag == "HITCHANCE" ) + { + SetHitChance( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 ))); + rValue = true; + } break; case 'L': if( UTag == "LAYER" ) diff --git a/source/combat.cpp b/source/combat.cpp index 8817d7b3d..066e3e80e 100644 --- a/source/combat.cpp +++ b/source/combat.cpp @@ -2883,9 +2883,9 @@ bool CHandleCombat::HandleCombat( CSocket *mSock, CChar& mChar, CChar *ourTarg ) maxAttHitChanceBonus = 50; } - // Fetch bonuses to hitChance/defenseChance from AoS item properties, when implemented - //attHitChanceBonus = GetAttackerHitChanceBonus(); - //defDefenseChanceBonus = GetDefenderDefenseChanceBonus(); + // Fetch bonuses to hitChance/defenseChance from AoS item properties + attHitChanceBonus = mChar.GetHitChance(); + defDefenseChanceBonus = mChar.GetDefenseChance(); R32 attackerHitChance = ( static_cast( attackSkill / 10 ) + 20 ) * ( 100 + std::min( attHitChanceBonus, static_cast( maxAttHitChanceBonus ))); R32 defenderDefenseChance = ( static_cast( defendSkill / 10 ) + 20 ) * ( 100 + std::min( defDefenseChanceBonus, static_cast( 45 ))); diff --git a/source/items.cpp b/source/items.cpp index 1cd4a2aaf..5c4726c11 100644 --- a/source/items.cpp +++ b/source/items.cpp @@ -229,6 +229,7 @@ auto ApplyItemSection( CItem *applyTo, CScriptSection *toApply, std::string sect case DFNTAG_DISPELLABLE: applyTo->SetDispellable( true ); break; case DFNTAG_DISABLED: applyTo->SetDisabled( ndata != 0 ); break; case DFNTAG_DOORFLAG: break; + case DFNTAG_DEFENSECHANCE: applyTo->SetDefenseChance( static_cast( ndata )); break; case DFNTAG_GOOD: applyTo->SetGood( static_cast( ndata )); break; case DFNTAG_GLOW: applyTo->SetGlow( ndata ); break; case DFNTAG_GLOWBC: applyTo->SetGlowColour( static_cast( ndata )); break; @@ -338,6 +339,7 @@ auto ApplyItemSection( CItem *applyTo, CScriptSection *toApply, std::string sect } break; case DFNTAG_HIDAMAGE: applyTo->SetHiDamage( static_cast( ndata )); break; + case DFNTAG_HITCHANCE: applyTo->SetHitChance( static_cast( ndata )); break; case DFNTAG_HEAT: applyTo->SetWeatherDamage( HEAT, ndata != 0 ); break; case DFNTAG_ID: // applyTo->SetId( static_cast( ndata )); break; if( ssecs.size() == 1 ) diff --git a/source/ssection.cpp b/source/ssection.cpp index c2a563b47..73bb2e94b 100644 --- a/source/ssection.cpp +++ b/source/ssection.cpp @@ -66,6 +66,7 @@ const UI08 dfnDataTypes[DFNTAG_COUNTOFTAGS] = DFN_NUMERIC, // DFNTAG_DOORFLAG, DFN_NUMERIC, // DFNTAG_DYE, DFN_NUMERIC, // DFNTAG_DYEBEARD, + DFN_NUMERIC, // DFNTAG_DEFENSECHANCE, DFN_NUMERIC, // DFNTAG_DYEHAIR, DFN_STRING, // DFNTAG_ELEMENTRESIST, DFN_STRING, // DFNTAG_ERBONUS, @@ -111,6 +112,7 @@ const UI08 dfnDataTypes[DFNTAG_COUNTOFTAGS] = DFN_NUMERIC, // DFNTAG_HEAT, DFN_DOUBLENUMERIC, // DFNTAG_HERDING, DFN_NUMERIC, // DFNTAG_HIDAMAGE, + DFN_NUMERIC, // DFNTAG_HITCHANCE, DFN_DOUBLENUMERIC, // DFNTAG_HIDING, DFN_NODATA, // DFNTAG_HIRELING, DFN_DOUBLENUMERIC, // DFNTAG_HP, @@ -321,6 +323,7 @@ const std::map strToDFNTag {"DYEABLE"s, DFNTAG_DYE}, {"DYEHAIR"s, DFNTAG_DYEHAIR}, {"DYEBEARD"s, DFNTAG_DYEBEARD}, + {"DEFENSECHANCE"s, DFNTAG_DEFENSECHANCE}, {"ELEMENTRESIST"s, DFNTAG_ELEMENTRESIST}, {"ERBONUS"s, DFNTAG_ERBONUS}, {"EMOTECOLOR"s, DFNTAG_EMOTECOLOUR}, @@ -366,6 +369,7 @@ const std::map strToDFNTag {"HEAT"s, DFNTAG_HEAT}, {"HERDING"s, DFNTAG_HERDING}, {"HIDAMAGE"s, DFNTAG_HIDAMAGE}, + {"HITCHANCE"s, DFNTAG_HITCHANCE}, {"HIDING"s, DFNTAG_HIDING}, {"HIRELING"s, DFNTAG_HIRELING}, {"HP"s, DFNTAG_HP}, diff --git a/source/ssection.h b/source/ssection.h index a2a660aec..beaa359ab 100644 --- a/source/ssection.h +++ b/source/ssection.h @@ -71,6 +71,7 @@ enum DFNTAGS DFNTAG_DISPELLABLE, DFNTAG_DISABLED, DFNTAG_DOORFLAG, + DFNTAG_DEFENSECHANCE, DFNTAG_DYE, DFNTAG_DYEBEARD, DFNTAG_DYEHAIR, @@ -118,6 +119,7 @@ enum DFNTAGS DFNTAG_HEAT, DFNTAG_HERDING, DFNTAG_HIDAMAGE, + DFNTAG_HITCHANCE, DFNTAG_HIDING, DFNTAG_HIRELING, DFNTAG_HP, From 8863f5de2726fbc5e34a1e56f229063a0935c1d1 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Fri, 14 Jun 2024 14:42:36 -0500 Subject: [PATCH 035/147] Changelog --- source/Changelog.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/Changelog.txt b/source/Changelog.txt index f64afbc32..348b45e14 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,9 @@ +14/06/2024 - Dragon Slayer + Added two new DFN tags for Items: + HITCHANCE=# // Increases the player's chance to hit a target with wrestling, melee and ranged weapons. + DEFENSECHANCE=# // Increases the wearer's chance that his opponents' swings (or arrows/bolts) will miss. + These are also available as JS Engine object properties: .hitChance, .defenseChance + 1/05/2024 - Dragon Slayer/Xuri Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode. Fixed createfood to check for reagents on cast. From 3e7e8bccb3a378c4220bb9a46664a3aa1d78a5e0 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 16 Jun 2024 01:37:31 -0500 Subject: [PATCH 036/147] Swing Speed Increase --- source/CPacketSend.cpp | 17 ++++++++++++++++- source/SEFunctions.cpp | 3 +++ source/UOXJSPropertyEnums.h | 2 +- source/UOXJSPropertyFuncs.cpp | 2 ++ source/UOXJSPropertySpecs.h | 1 + source/cBaseObject.cpp | 31 +++++++++++++++++++++++++++++++ source/cBaseObject.h | 6 ++++++ source/cChar.cpp | 5 +++++ source/cItem.cpp | 6 ++++++ source/cServerData.cpp | 22 ++++++++++++++++++++-- source/cServerData.h | 4 ++++ source/combat.cpp | 31 ++++++++++++++++++++++++++++--- source/items.cpp | 1 + source/ssection.cpp | 2 ++ source/ssection.h | 1 + 15 files changed, 127 insertions(+), 7 deletions(-) diff --git a/source/CPacketSend.cpp b/source/CPacketSend.cpp index e1d8ee4ca..5dcb5536f 100644 --- a/source/CPacketSend.cpp +++ b/source/CPacketSend.cpp @@ -7544,7 +7544,15 @@ void CPToolTip::CopyItemData( CItem& cItem, size_t &totalStringLen, bool addAmou if( cItem.GetSpeed() > 0 ) { tempEntry.stringNum = 1061167; // weapon speed ~1_val~ - tempEntry.ourText = oldstrutil::number( cItem.GetSpeed() ); + if( cwmWorldState->ServerData()->ExpansionCoreShardEra() >= ER_ML ) + { + R64 wpnSpeedInSeconds = std::round(( 40000.0 / ( 200 * cItem.GetSpeed() ) * 0.5 ) * 10 ) / 10; + tempEntry.ourText = oldstrutil::format( "%.1fs", wpnSpeedInSeconds ); + } + else + { + tempEntry.ourText = oldstrutil::number( cItem.GetSpeed() ); + } FinalizeData( tempEntry, totalStringLen ); } @@ -7657,6 +7665,13 @@ void CPToolTip::CopyItemData( CItem& cItem, size_t &totalStringLen, bool addAmou FinalizeData( tempEntry, totalStringLen ); } + if( cItem.GetSwingSpeedIncrease() > 0 ) + { + tempEntry.stringNum = 1060486; // swing speed increase ~1_val~% + tempEntry.ourText = oldstrutil::number( cItem.GetSwingSpeedIncrease() ); + FinalizeData( tempEntry, totalStringLen ); + } + if( cItem.GetStrength() > 1 ) { tempEntry.stringNum = 1061170; // strength requirement ~1_val~ diff --git a/source/SEFunctions.cpp b/source/SEFunctions.cpp index 1700d8e55..6ec92ec01 100644 --- a/source/SEFunctions.cpp +++ b/source/SEFunctions.cpp @@ -5086,6 +5086,9 @@ JSBool SE_GetServerSetting( JSContext *cx, [[maybe_unused]] JSObject *obj, uintN case 349: // LOOTDECAYSWITHPLAYERCORPSE *rval = BOOLEAN_TO_JSVAL( cwmWorldState->ServerData()->NpcCorpseLootDecay() ); break; + case 353: // SWINGSPEEDINCREASECAP + *rval = INT_TO_JSVAL( static_cast( cwmWorldState->ServerData()->SwingSpeedIncreaseCap() )); + break; default: ScriptError( cx, "GetServerSetting: Invalid server setting name provided" ); return false; diff --git a/source/UOXJSPropertyEnums.h b/source/UOXJSPropertyEnums.h index af309d496..5e32536e1 100644 --- a/source/UOXJSPropertyEnums.h +++ b/source/UOXJSPropertyEnums.h @@ -533,7 +533,7 @@ enum CI_Properties CIP_ISITEMHELD, CIP_SECTIONID, CIP_STEALABLE, - + CIP_SWINGSPEEDINCREASE, CIP_LOCKDDOWNS, CIP_MAXLOCKDOWNS, CIP_TRASHCONTAINERS, diff --git a/source/UOXJSPropertyFuncs.cpp b/source/UOXJSPropertyFuncs.cpp index 3823356f9..3a57d8bba 100644 --- a/source/UOXJSPropertyFuncs.cpp +++ b/source/UOXJSPropertyFuncs.cpp @@ -675,6 +675,7 @@ JSBool CItemProps_getProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGEPOISON: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( POISON )); break; case CIP_DAMAGERAIN: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( RAIN )); break; case CIP_DAMAGESNOW: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( SNOW )); break; + case CIP_SWINGSPEEDINCREASE: *vp = INT_TO_JSVAL( gPriv->GetSwingSpeedIncrease() ); break; case CIP_SPEED: *vp = INT_TO_JSVAL( gPriv->GetSpeed() ); break; case CIP_NAME2: tString = JS_NewStringCopyZ( cx, gPriv->GetName2().c_str() ); @@ -1321,6 +1322,7 @@ JSBool CItemProps_setProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGERAIN: gPriv->SetWeatherDamage( RAIN, encaps.toBool() ); break; case CIP_DAMAGESNOW: gPriv->SetWeatherDamage( SNOW, encaps.toBool() ); break; case CIP_SPEED: gPriv->SetSpeed( static_cast( encaps.toInt() )); break; + case CIP_SWINGSPEEDINCREASE: gPriv->SetSwingSpeedIncrease( static_cast( encaps.toInt() )); break; case CIP_NAME2: gPriv->SetName2( encaps.toString() ); break; case CIP_RACE: gPriv->SetRace( static_cast( encaps.toInt() )); break; case CIP_MAXHP: gPriv->SetMaxHP( static_cast( encaps.toInt() )); break; diff --git a/source/UOXJSPropertySpecs.h b/source/UOXJSPropertySpecs.h index 3149dc0ec..e918979d4 100644 --- a/source/UOXJSPropertySpecs.h +++ b/source/UOXJSPropertySpecs.h @@ -535,6 +535,7 @@ inline JSPropertySpec CItemProps[] = { "ammoFXHue", CIP_AMMOFXHUE, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "ammoFXRender", CIP_AMMOFXRENDER, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "speed", CIP_SPEED, JSPROP_ENUMANDPERM, nullptr, nullptr }, + { "swingSpeedIncrease", CIP_SWINGSPEEDINCREASE, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "multi", CIP_MULTI, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "maxRange", CIP_MAXRANGE, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "baseRange", CIP_BASERANGE, JSPROP_ENUMANDPERM, nullptr, nullptr }, diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp index 506c247ac..19ee8c438 100644 --- a/source/cBaseObject.cpp +++ b/source/cBaseObject.cpp @@ -1568,6 +1568,27 @@ Point3_st CBaseObject::GetLocation( void ) const return Point3_st( x, y, z ); } +//o------------------------------------------------------------------------------------------------o +//| Function - CBaseObject::GetSwingSpeedIncrease() +//| CBaseObject::SetSwingSpeedIncrease() +//| Date - 14 June, 2024 +//o------------------------------------------------------------------------------------------------o +//| Purpose - Gets/Sets the swing speed increase of the Item Equiped +//o------------------------------------------------------------------------------------------------o +SI16 CBaseObject::GetSwingSpeedIncrease( void ) const +{ + return swingSpeedIncrease; +} +void CBaseObject::SetSwingSpeedIncrease( SI16 newValue ) +{ + swingSpeedIncrease = newValue; + + if( CanBeObjType( OT_ITEM )) + { + ( static_cast( this ))->UpdateRegion(); + } +} + //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject::GetStrength2() //| CBaseObject::SetStrength2() @@ -1661,6 +1682,16 @@ void CBaseObject::IncIntelligence( SI16 toInc ) SetIntelligence( intelligence + toInc ); } +//o------------------------------------------------------------------------------------------------o +//| Function - CBaseObject::IncSwingSpeedIncrease() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Increments the object's swing speed value +//o------------------------------------------------------------------------------------------------o +void CBaseObject::IncSwingSpeedIncrease( SI16 toInc ) +{ + SetSwingSpeedIncrease( swingSpeedIncrease + toInc ); +} + //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject::DumpFooter() //o------------------------------------------------------------------------------------------------o diff --git a/source/cBaseObject.h b/source/cBaseObject.h index 638e826f7..e2f8a5377 100644 --- a/source/cBaseObject.h +++ b/source/cBaseObject.h @@ -75,6 +75,7 @@ class CBaseObject SI32 weight; SI16 mana; SI16 stamina; + SI16 swingSpeedIncrease; UI16 scriptTrig; SI16 st2; SI16 dx2; @@ -223,6 +224,11 @@ class CBaseObject virtual void SetHP( SI16 newValue ); void IncHP( SI16 amtToChange ); + virtual SI16 GetSwingSpeedIncrease( void ) const; + virtual void SetSwingSpeedIncrease( SI16 newValue ); + + void IncSwingSpeedIncrease( SI16 toInc = 1 ); + void SetDir( UI08 newDir, bool sendUpdate = true ); UI08 GetDir( void ) const; diff --git a/source/cChar.cpp b/source/cChar.cpp index 7aa03f6fa..182409af1 100644 --- a/source/cChar.cpp +++ b/source/cChar.cpp @@ -2920,6 +2920,8 @@ bool CChar::WearItem( CItem *toWear ) IncDexterity2( itemLayers[tLayer]->GetDexterity2() ); IncIntelligence2( itemLayers[tLayer]->GetIntelligence2() ); + IncSwingSpeedIncrease( itemLayers[tLayer]->GetSwingSpeedIncrease() ); + if( toWear->IsPostLoaded() ) { if( itemLayers[tLayer]->GetPoisoned() ) @@ -2979,6 +2981,9 @@ bool CChar::TakeOffItem( ItemLayers Layer ) IncStrength2( -itemLayers[Layer]->GetStrength2() ); IncDexterity2( -itemLayers[Layer]->GetDexterity2() ); IncIntelligence2( -itemLayers[Layer]->GetIntelligence2() ); + + IncSwingSpeedIncrease( -itemLayers[Layer]->GetSwingSpeedIncrease() ); + if( itemLayers[Layer]->GetPoisoned() ) { if( itemLayers[Layer]->GetPoisoned() > GetPoisoned() ) diff --git a/source/cItem.cpp b/source/cItem.cpp index 3c6523d5d..2bc30a458 100644 --- a/source/cItem.cpp +++ b/source/cItem.cpp @@ -1743,6 +1743,7 @@ bool CItem::DumpBody( std::ostream &outStream ) const outStream << "Restock=" + std::to_string( GetRestock() ) + newLine; outStream << "AC=" + std::to_string( GetArmourClass() ) + newLine; outStream << "Rank=" + std::to_string( GetRank() ) + newLine; + outStream << "SwingSpeedIncrease=" + std::to_string( GetSwingSpeedIncrease() ) + newLine; outStream << "Sk_Made=" + std::to_string( GetMadeWith() ) + newLine; outStream << "Bools=" + std::to_string(( bools.to_ulong() )) + newLine; outStream << "Good=" + std::to_string( GetGood() ) + newLine; @@ -2127,6 +2128,11 @@ bool CItem::HandleLine( std::string &UTag, std::string &data ) SetStealable( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 ))); rValue = true; } + else if( UTag == "SWINGSPEEDINCREASE" ) + { + SetSwingSpeedIncrease( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 ))); + rValue = true; + } break; case 'T': if( UTag == "TYPE" ) diff --git a/source/cServerData.cpp b/source/cServerData.cpp index 3f57745a8..178453137 100644 --- a/source/cServerData.cpp +++ b/source/cServerData.cpp @@ -369,7 +369,8 @@ const std::map CServerData::uox3IniCaseValue {"SECRETSHARDKEY"s, 346}, {"MOONGATEFACETS"s, 347}, {"AUTOUNEQUIPPEDCASTING"s, 348}, - {"LOOTDECAYSWITHNPCCORPSE"s, 349} + {"LOOTDECAYSWITHNPCCORPSE"s, 349}, + {"SWINGSPEEDINCREASECAP"s, 353} }; constexpr auto MAX_TRACKINGTARGETS = 128; constexpr auto SKILLTOTALCAP = 7000; @@ -5196,7 +5197,7 @@ auto CServerData::SaveIni( const std::string &filename ) -> bool ofsOutput << "SHOWITEMRESISTSTATS=" << ( ShowItemResistStats() ? 1 : 0 ) << '\n'; ofsOutput << "SHOWWEAPONDAMAGETYPES=" << ( ShowWeaponDamageTypes() ? 1 : 0 ) << '\n'; ofsOutput << "WEAPONDAMAGEBONUSTYPE=" << static_cast( WeaponDamageBonusType() ) << '\n'; - + ofsOutput << "WEAPONSWINGSPEEDINCREASECAP=" << SwingSpeedIncreaseCap() << '\n'; ofsOutput << "}" << '\n'; ofsOutput << '\n' << "[magic]" << '\n' << "{" << '\n'; @@ -5395,6 +5396,20 @@ auto CServerData::TrackingRedisplayTime( UI16 value ) -> void trackingMsgRedisplayTimer = value; } +//o------------------------------------------------------------------------------------------------o +//| Function - CServerData::SwingSpeedIncreaseCap() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Gets/Sets the for swing speed cap propertie +//o------------------------------------------------------------------------------------------------o +auto CServerData::SwingSpeedIncreaseCap() const -> SI16 +{ + return swingSpeedIncreaseCap; +} +auto CServerData::SwingSpeedIncreaseCap( SI16 value ) -> void +{ + swingSpeedIncreaseCap = value; +} + //o------------------------------------------------------------------------------------------------o //| Function - CServerData::ParseIni() @@ -6565,6 +6580,9 @@ auto CServerData::HandleLine( const std::string& tag, const std::string& value ) case 349: // LOOTDECAYSWITHNPCCORPSE NpcCorpseLootDecay( static_cast( std::stoul( value, nullptr, 0 )) != 0 ); break; + case 353: // SWINGSPEEDINCREASE + SwingSpeedIncreaseCap( std::stof( value )); + break; default: rValue = false; break; diff --git a/source/cServerData.h b/source/cServerData.h index d770645c8..3abf534e0 100644 --- a/source/cServerData.h +++ b/source/cServerData.h @@ -400,6 +400,7 @@ class CServerData SI16 combatNpcBaseFleeAt; // % of HP where an NPC will flee, if it's not defined for them SI16 combatNpcBaseReattackAt; // % of HP where an NPC will resume attacking SI16 combatAttackStamina; // Amount of stamina lost when hitting an opponent + SI16 swingSpeedIncreaseCap; // The Cap for swing speed property // Start & Location Settings std::vector<__STARTLOCATIONDATA__> startlocations; @@ -953,6 +954,9 @@ class CServerData auto BODsFromCraftedItemsOnly( bool value ) -> void; auto BODsFromCraftedItemsOnly() const -> bool; + auto SwingSpeedIncreaseCap( SI16 value ) -> void; + SI16 SwingSpeedIncreaseCap() const; + auto MaxControlSlots( UI08 value ) -> void; UI08 MaxControlSlots() const; diff --git a/source/combat.cpp b/source/combat.cpp index 8817d7b3d..60430b5a5 100644 --- a/source/combat.cpp +++ b/source/combat.cpp @@ -3429,8 +3429,10 @@ R32 CHandleCombat::GetCombatTimeout( CChar *mChar ) getDelay = static_cast( static_cast( std::min( statOffset, static_cast( 100 ))) + 100 ); } + SI32 speedBonus = 0; SI32 getOffset = 0; - SI32 baseValue = 15000; + SI32 baseValue = (cwmWorldState->ServerData()->ExpansionCoreShardEra() <= ER_LBR) ? 15000 : + ((cwmWorldState->ServerData()->ExpansionCoreShardEra() <= ER_AOS) ? 80000 : 40000); CChar *ourTarg = mChar->GetTarg(); @@ -3455,18 +3457,41 @@ R32 CHandleCombat::GetCombatTimeout( CChar *mChar ) } } + speedBonus = mChar->GetSwingSpeedIncrease(); + + // Swing Speed Increase Cap per AOS + if ( speedBonus > cwmWorldState->ServerData()->SwingSpeedIncreaseCap() ) + { + speedBonus = cwmWorldState->ServerData()->SwingSpeedIncreaseCap(); + } + //Allow faster strikes on fleeing targets if( ValidateObject( ourTarg )) { if( ourTarg->GetNpcWander() == WT_FLEE || ourTarg->GetNpcWander() == WT_SCARED ) { - baseValue = 10000; + baseValue = cwmWorldState->ServerData()->ExpansionCoreShardEra() <= ER_LBR ? 10000 : 53333; } } R32 globalAttackSpeed = cwmWorldState->ServerData()->GlobalAttackSpeed(); //Defaults to 1.0 - getDelay = ( baseValue / ( getDelay * getOffset )) / globalAttackSpeed; + if( cwmWorldState->ServerData()->ExpansionCoreShardEra() <= ER_LBR ) + { + // Weapon swing delay in LBR and earlier + getDelay = baseValue / ( getDelay * getOffset * ( 1 + speedBonus / static_cast( 10 ) )) / globalAttackSpeed; + } + else if( cwmWorldState->ServerData()->ExpansionCoreShardEra() <= ER_AOS ) + { + // Weapon swing delay in AOS or later + getDelay = ( baseValue / ( getDelay * getOffset * ( 1 + speedBonus / static_cast( 10 ) )) / 4 - 0.5 ) / globalAttackSpeed; + } + else + { + // Weapon swing delay in ML or later + getDelay = ( baseValue / ( getDelay * getOffset * ( 1 + speedBonus / static_cast( 10 ) )) * 0.5 ) / globalAttackSpeed; + } + return getDelay; } diff --git a/source/items.cpp b/source/items.cpp index 1cd4a2aaf..6dc07ae74 100644 --- a/source/items.cpp +++ b/source/items.cpp @@ -548,6 +548,7 @@ auto ApplyItemSection( CItem *applyTo, CScriptSection *toApply, std::string sect case DFNTAG_RAIN: applyTo->SetWeatherDamage( RAIN, ndata != 0 ); break; case DFNTAG_SECTIONID: applyTo->SetSectionId( cdata ); break; case DFNTAG_SK_MADE: applyTo->SetMadeWith( static_cast( ndata )); break; + case DFNTAG_SWINGSPEEDINCREASE : applyTo->SetSwingSpeedIncrease( static_cast( ndata )); break; case DFNTAG_SPD: applyTo->SetSpeed( static_cast( ndata )); break; case DFNTAG_STRENGTH: applyTo->SetStrength( static_cast( ndata )); break; case DFNTAG_STRADD: applyTo->SetStrength2( static_cast( ndata )); break; diff --git a/source/ssection.cpp b/source/ssection.cpp index c2a563b47..cbe738b27 100644 --- a/source/ssection.cpp +++ b/source/ssection.cpp @@ -228,6 +228,7 @@ const UI08 dfnDataTypes[DFNTAG_COUNTOFTAGS] = DFN_DOUBLENUMERIC, // DFNTAG_STEALING, DFN_DOUBLENUMERIC, // DFNTAG_STEALTH, DFN_DOUBLENUMERIC, // DFNTAG_SWORDSMANSHIP, + DFN_NUMERIC, // DFNTAG_SWINGSPEEDINCREASE, DFN_DOUBLENUMERIC, // DFNTAG_TACTICS, DFN_DOUBLENUMERIC, // DFNTAG_TAILORING, DFN_DOUBLENUMERIC, // DFNTAG_TAMING, @@ -491,6 +492,7 @@ const std::map strToDFNTag {"STEALING"s, DFNTAG_STEALING}, {"STEALTH"s, DFNTAG_STEALTH}, {"SWORDSMANSHIP"s, DFNTAG_SWORDSMANSHIP}, + {"SWINGSPEEDINCREASE"s, DFNTAG_SWINGSPEEDINCREASE}, {"TACTICS"s, DFNTAG_TACTICS}, {"TAILORING"s, DFNTAG_TAILORING}, {"TAMING"s, DFNTAG_TAMING}, diff --git a/source/ssection.h b/source/ssection.h index a2a660aec..f709d5fc8 100644 --- a/source/ssection.h +++ b/source/ssection.h @@ -221,6 +221,7 @@ enum DFNTAGS DFNTAG_SPATTACK, DFNTAG_SPAWNOBJ, DFNTAG_SPAWNOBJLIST, + DFNTAG_SWINGSPEEDINCREASE, DFNTAG_SPD, DFNTAG_SPELLS, DFNTAG_SPELLWEAVING, From da987195c6f5a18c40de1e6ccf39629aa19a36ed Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 16 Jun 2024 01:42:02 -0500 Subject: [PATCH 037/147] changelog --- source/Changelog.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/Changelog.txt b/source/Changelog.txt index f64afbc32..df389bf4b 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,10 @@ +16/06/2024 - Dragon Slayer/Xuri + Added new DFN tags for Items: + SWINGSPEEDINCREASE=# // increases the rate at which a character uses his or her melee weapon. The rapidity of a character's attack is affected by the base speed of the weapon used, the amount of Stamina possessed, and the amount of SSI his or her items impart. Barehanded combatants swing at the fastest Weapon Base Speed possible. + These are also available as JS Engine object properties: .swingSpeedIncrease + Added INI Settings: + SWINGSPEEDINCREASECAP=# // Max cap for for swing speed increase a char can have. + 1/05/2024 - Dragon Slayer/Xuri Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode. Fixed createfood to check for reagents on cast. From 59c2ba633ae38940a67893720ff7aaed94cd9bbe Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 16 Jun 2024 02:00:40 -0500 Subject: [PATCH 038/147] small format changes --- source/Changelog.txt | 7 +++++-- source/UOXJSPropertyEnums.h | 2 +- source/UOXJSPropertyFuncs.cpp | 4 ++-- source/UOXJSPropertySpecs.h | 2 +- source/items.cpp | 2 +- source/ssection.cpp | 2 +- source/ssection.h | 2 +- 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/source/Changelog.txt b/source/Changelog.txt index df389bf4b..a7927a9ec 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,9 +1,12 @@ 16/06/2024 - Dragon Slayer/Xuri Added new DFN tags for Items: - SWINGSPEEDINCREASE=# // increases the rate at which a character uses his or her melee weapon. The rapidity of a character's attack is affected by the base speed of the weapon used, the amount of Stamina possessed, and the amount of SSI his or her items impart. Barehanded combatants swing at the fastest Weapon Base Speed possible. - These are also available as JS Engine object properties: .swingSpeedIncrease + SPEEDINCREASE=# // item property that increases base weapon swing speed by the specified percentage + These are also available as JS Engine object properties: .speedIncrease Added INI Settings: SWINGSPEEDINCREASECAP=# // Max cap for for swing speed increase a char can have. + Combat code updated with era-specific weapon swing speed calculations for different eras (LBR or earlier/AoS/ML onwards). + Note that speeds are still defined with flat values in DFNs regardless of era, but for ML and beyond speed + will be displayed as swing delay in seconds in item tooltip. 1/05/2024 - Dragon Slayer/Xuri Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode. diff --git a/source/UOXJSPropertyEnums.h b/source/UOXJSPropertyEnums.h index 5e32536e1..f18ed8069 100644 --- a/source/UOXJSPropertyEnums.h +++ b/source/UOXJSPropertyEnums.h @@ -516,6 +516,7 @@ enum CI_Properties CIP_ISCONTTYPE, CIP_CARVESECTION, CIP_SPEED, + CIP_SPDINCREASE, CIP_MULTI, CIP_AMMOID, CIP_AMMOHUE, @@ -533,7 +534,6 @@ enum CI_Properties CIP_ISITEMHELD, CIP_SECTIONID, CIP_STEALABLE, - CIP_SWINGSPEEDINCREASE, CIP_LOCKDDOWNS, CIP_MAXLOCKDOWNS, CIP_TRASHCONTAINERS, diff --git a/source/UOXJSPropertyFuncs.cpp b/source/UOXJSPropertyFuncs.cpp index 3a57d8bba..95c21f73b 100644 --- a/source/UOXJSPropertyFuncs.cpp +++ b/source/UOXJSPropertyFuncs.cpp @@ -675,7 +675,7 @@ JSBool CItemProps_getProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGEPOISON: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( POISON )); break; case CIP_DAMAGERAIN: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( RAIN )); break; case CIP_DAMAGESNOW: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( SNOW )); break; - case CIP_SWINGSPEEDINCREASE: *vp = INT_TO_JSVAL( gPriv->GetSwingSpeedIncrease() ); break; + case CIP_SPDINCREASE: *vp = INT_TO_JSVAL( gPriv->GetSwingSpeedIncrease() ); break; case CIP_SPEED: *vp = INT_TO_JSVAL( gPriv->GetSpeed() ); break; case CIP_NAME2: tString = JS_NewStringCopyZ( cx, gPriv->GetName2().c_str() ); @@ -1322,7 +1322,7 @@ JSBool CItemProps_setProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGERAIN: gPriv->SetWeatherDamage( RAIN, encaps.toBool() ); break; case CIP_DAMAGESNOW: gPriv->SetWeatherDamage( SNOW, encaps.toBool() ); break; case CIP_SPEED: gPriv->SetSpeed( static_cast( encaps.toInt() )); break; - case CIP_SWINGSPEEDINCREASE: gPriv->SetSwingSpeedIncrease( static_cast( encaps.toInt() )); break; + case CIP_SPDINCREASE: gPriv->SetSwingSpeedIncrease( static_cast( encaps.toInt() )); break; case CIP_NAME2: gPriv->SetName2( encaps.toString() ); break; case CIP_RACE: gPriv->SetRace( static_cast( encaps.toInt() )); break; case CIP_MAXHP: gPriv->SetMaxHP( static_cast( encaps.toInt() )); break; diff --git a/source/UOXJSPropertySpecs.h b/source/UOXJSPropertySpecs.h index e918979d4..d8128f877 100644 --- a/source/UOXJSPropertySpecs.h +++ b/source/UOXJSPropertySpecs.h @@ -535,7 +535,7 @@ inline JSPropertySpec CItemProps[] = { "ammoFXHue", CIP_AMMOFXHUE, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "ammoFXRender", CIP_AMMOFXRENDER, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "speed", CIP_SPEED, JSPROP_ENUMANDPERM, nullptr, nullptr }, - { "swingSpeedIncrease", CIP_SWINGSPEEDINCREASE, JSPROP_ENUMANDPERM, nullptr, nullptr }, + { "speedIncrease", CIP_SPDINCREASE, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "multi", CIP_MULTI, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "maxRange", CIP_MAXRANGE, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "baseRange", CIP_BASERANGE, JSPROP_ENUMANDPERM, nullptr, nullptr }, diff --git a/source/items.cpp b/source/items.cpp index 6dc07ae74..c116c984a 100644 --- a/source/items.cpp +++ b/source/items.cpp @@ -548,7 +548,7 @@ auto ApplyItemSection( CItem *applyTo, CScriptSection *toApply, std::string sect case DFNTAG_RAIN: applyTo->SetWeatherDamage( RAIN, ndata != 0 ); break; case DFNTAG_SECTIONID: applyTo->SetSectionId( cdata ); break; case DFNTAG_SK_MADE: applyTo->SetMadeWith( static_cast( ndata )); break; - case DFNTAG_SWINGSPEEDINCREASE : applyTo->SetSwingSpeedIncrease( static_cast( ndata )); break; + case DFNTAG_SPDINCREASE : applyTo->SetSwingSpeedIncrease( static_cast( ndata )); break; case DFNTAG_SPD: applyTo->SetSpeed( static_cast( ndata )); break; case DFNTAG_STRENGTH: applyTo->SetStrength( static_cast( ndata )); break; case DFNTAG_STRADD: applyTo->SetStrength2( static_cast( ndata )); break; diff --git a/source/ssection.cpp b/source/ssection.cpp index cbe738b27..9c3834663 100644 --- a/source/ssection.cpp +++ b/source/ssection.cpp @@ -476,6 +476,7 @@ const std::map strToDFNTag {"SPAWNOBJLIST"s, DFNTAG_SPAWNOBJLIST}, {"SPD"s, DFNTAG_SPD}, {"SPEED"s, DFNTAG_SPD}, + {"SPDINCREASE"s, DFNTAG_SPDINCREASE}, {"SPELLS"s, DFNTAG_SPELLS}, {"SPELLWEAVING"s, DFNTAG_SPELLWEAVING}, {"SPIRITSPEAK"s, DFNTAG_SPIRITSPEAK}, @@ -492,7 +493,6 @@ const std::map strToDFNTag {"STEALING"s, DFNTAG_STEALING}, {"STEALTH"s, DFNTAG_STEALTH}, {"SWORDSMANSHIP"s, DFNTAG_SWORDSMANSHIP}, - {"SWINGSPEEDINCREASE"s, DFNTAG_SWINGSPEEDINCREASE}, {"TACTICS"s, DFNTAG_TACTICS}, {"TAILORING"s, DFNTAG_TAILORING}, {"TAMING"s, DFNTAG_TAMING}, diff --git a/source/ssection.h b/source/ssection.h index f709d5fc8..d98927e49 100644 --- a/source/ssection.h +++ b/source/ssection.h @@ -221,7 +221,7 @@ enum DFNTAGS DFNTAG_SPATTACK, DFNTAG_SPAWNOBJ, DFNTAG_SPAWNOBJLIST, - DFNTAG_SWINGSPEEDINCREASE, + DFNTAG_SPDINCREASE, DFNTAG_SPD, DFNTAG_SPELLS, DFNTAG_SPELLWEAVING, From 28a5fd34a3b60038864801394071b3e20bb10d75 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 16 Jun 2024 02:01:55 -0500 Subject: [PATCH 039/147] Update cBaseObject.cpp --- source/cBaseObject.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp index 19ee8c438..968938e18 100644 --- a/source/cBaseObject.cpp +++ b/source/cBaseObject.cpp @@ -1571,7 +1571,6 @@ Point3_st CBaseObject::GetLocation( void ) const //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject::GetSwingSpeedIncrease() //| CBaseObject::SetSwingSpeedIncrease() -//| Date - 14 June, 2024 //o------------------------------------------------------------------------------------------------o //| Purpose - Gets/Sets the swing speed increase of the Item Equiped //o------------------------------------------------------------------------------------------------o From 77dcb511a30990b97dd9f08bd981f837d3dac218 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 16 Jun 2024 02:03:22 -0500 Subject: [PATCH 040/147] Update cBaseObject.cpp --- source/cBaseObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp index 968938e18..c4280e2c4 100644 --- a/source/cBaseObject.cpp +++ b/source/cBaseObject.cpp @@ -1572,7 +1572,7 @@ Point3_st CBaseObject::GetLocation( void ) const //| Function - CBaseObject::GetSwingSpeedIncrease() //| CBaseObject::SetSwingSpeedIncrease() //o------------------------------------------------------------------------------------------------o -//| Purpose - Gets/Sets the swing speed increase of the Item Equiped +//| Purpose - Gets/Sets the weapon swing speed increase in percentage for item //o------------------------------------------------------------------------------------------------o SI16 CBaseObject::GetSwingSpeedIncrease( void ) const { From b63ceaeeb6445e113199dc61d4bbb7367f1fb576 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 16 Jun 2024 02:04:48 -0500 Subject: [PATCH 041/147] Update cBaseObject.cpp --- source/cBaseObject.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp index bfb143b5d..b0e7a538f 100644 --- a/source/cBaseObject.cpp +++ b/source/cBaseObject.cpp @@ -1039,7 +1039,6 @@ void CBaseObject::IncHP( SI16 amtToChange ) //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject::GetHitChance() //| CBaseObject::SetHitChance() -//| Date - 14 June, 2024 //o------------------------------------------------------------------------------------------------o //| Purpose - Gets/Sets the Defense Chance of the Item Equiped //o------------------------------------------------------------------------------------------------o @@ -1060,7 +1059,6 @@ void CBaseObject::SetHitChance( SI16 newValue ) //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject::GetDefenseChance() //| CBaseObject::SetDefenseChance() -//| Date - 14 June, 2024 //o------------------------------------------------------------------------------------------------o //| Purpose - Gets/Sets the Defense Chance of the Item Equiped //o------------------------------------------------------------------------------------------------o From 81425cc261acd54604922c9b8bec347f65a5233a Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 16 Jun 2024 02:14:38 -0500 Subject: [PATCH 042/147] fixed Era --- source/cBaseObject.cpp | 2 +- source/combat.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp index c4280e2c4..1ce12d3e4 100644 --- a/source/cBaseObject.cpp +++ b/source/cBaseObject.cpp @@ -1572,7 +1572,7 @@ Point3_st CBaseObject::GetLocation( void ) const //| Function - CBaseObject::GetSwingSpeedIncrease() //| CBaseObject::SetSwingSpeedIncrease() //o------------------------------------------------------------------------------------------------o -//| Purpose - Gets/Sets the weapon swing speed increase in percentage for item +//| Purpose - Gets/Sets the item's Swing Speed Increase property (in percentage), which adjusts the base swing speed of the equipped weapon //o------------------------------------------------------------------------------------------------o SI16 CBaseObject::GetSwingSpeedIncrease( void ) const { diff --git a/source/combat.cpp b/source/combat.cpp index 60430b5a5..29049dc28 100644 --- a/source/combat.cpp +++ b/source/combat.cpp @@ -3431,8 +3431,8 @@ R32 CHandleCombat::GetCombatTimeout( CChar *mChar ) SI32 speedBonus = 0; SI32 getOffset = 0; - SI32 baseValue = (cwmWorldState->ServerData()->ExpansionCoreShardEra() <= ER_LBR) ? 15000 : - ((cwmWorldState->ServerData()->ExpansionCoreShardEra() <= ER_AOS) ? 80000 : 40000); + SI32 baseValue = ( cwmWorldState->ServerData()->ExpansionCoreShardEra() <= ER_LBR ) ? 15000 : + (( cwmWorldState->ServerData()->ExpansionCoreShardEra() < ER_ML ) ? 80000 : 40000 ); CChar *ourTarg = mChar->GetTarg(); @@ -3470,7 +3470,8 @@ R32 CHandleCombat::GetCombatTimeout( CChar *mChar ) { if( ourTarg->GetNpcWander() == WT_FLEE || ourTarg->GetNpcWander() == WT_SCARED ) { - baseValue = cwmWorldState->ServerData()->ExpansionCoreShardEra() <= ER_LBR ? 10000 : 53333; + baseValue = ( cwmWorldState->ServerData()->ExpansionCoreShardEra() <= ER_LBR ) ? 10000 : + (( cwmWorldState->ServerData()->ExpansionCoreShardEra() < ER_ML ) ? 53333 : 26680 ); } } @@ -3481,9 +3482,9 @@ R32 CHandleCombat::GetCombatTimeout( CChar *mChar ) // Weapon swing delay in LBR and earlier getDelay = baseValue / ( getDelay * getOffset * ( 1 + speedBonus / static_cast( 10 ) )) / globalAttackSpeed; } - else if( cwmWorldState->ServerData()->ExpansionCoreShardEra() <= ER_AOS ) + else if( cwmWorldState->ServerData()->ExpansionCoreShardEra() < ER_ML ) { - // Weapon swing delay in AOS or later + // Weapon swing delay in SE and earlier getDelay = ( baseValue / ( getDelay * getOffset * ( 1 + speedBonus / static_cast( 10 ) )) / 4 - 0.5 ) / globalAttackSpeed; } else From dba9daedd53ac7318cbce35a232d05a900fd459d Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 16 Jun 2024 02:25:57 -0500 Subject: [PATCH 043/147] format changes --- source/UOXJSPropertyEnums.h | 2 +- source/UOXJSPropertyFuncs.cpp | 4 ++-- source/UOXJSPropertySpecs.h | 2 +- source/cItem.cpp | 2 +- source/items.cpp | 2 +- source/ssection.cpp | 2 +- source/ssection.h | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/UOXJSPropertyEnums.h b/source/UOXJSPropertyEnums.h index f18ed8069..ed8bb09f4 100644 --- a/source/UOXJSPropertyEnums.h +++ b/source/UOXJSPropertyEnums.h @@ -516,7 +516,7 @@ enum CI_Properties CIP_ISCONTTYPE, CIP_CARVESECTION, CIP_SPEED, - CIP_SPDINCREASE, + CIP_SPEEDINCREASE , CIP_MULTI, CIP_AMMOID, CIP_AMMOHUE, diff --git a/source/UOXJSPropertyFuncs.cpp b/source/UOXJSPropertyFuncs.cpp index 95c21f73b..a5fb92713 100644 --- a/source/UOXJSPropertyFuncs.cpp +++ b/source/UOXJSPropertyFuncs.cpp @@ -675,7 +675,7 @@ JSBool CItemProps_getProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGEPOISON: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( POISON )); break; case CIP_DAMAGERAIN: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( RAIN )); break; case CIP_DAMAGESNOW: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( SNOW )); break; - case CIP_SPDINCREASE: *vp = INT_TO_JSVAL( gPriv->GetSwingSpeedIncrease() ); break; + case CIP_SPEEDINCREASE : *vp = INT_TO_JSVAL( gPriv->GetSwingSpeedIncrease() ); break; case CIP_SPEED: *vp = INT_TO_JSVAL( gPriv->GetSpeed() ); break; case CIP_NAME2: tString = JS_NewStringCopyZ( cx, gPriv->GetName2().c_str() ); @@ -1322,7 +1322,7 @@ JSBool CItemProps_setProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGERAIN: gPriv->SetWeatherDamage( RAIN, encaps.toBool() ); break; case CIP_DAMAGESNOW: gPriv->SetWeatherDamage( SNOW, encaps.toBool() ); break; case CIP_SPEED: gPriv->SetSpeed( static_cast( encaps.toInt() )); break; - case CIP_SPDINCREASE: gPriv->SetSwingSpeedIncrease( static_cast( encaps.toInt() )); break; + case CIP_SPEEDINCREASE : gPriv->SetSwingSpeedIncrease( static_cast( encaps.toInt() )); break; case CIP_NAME2: gPriv->SetName2( encaps.toString() ); break; case CIP_RACE: gPriv->SetRace( static_cast( encaps.toInt() )); break; case CIP_MAXHP: gPriv->SetMaxHP( static_cast( encaps.toInt() )); break; diff --git a/source/UOXJSPropertySpecs.h b/source/UOXJSPropertySpecs.h index d8128f877..710cd317e 100644 --- a/source/UOXJSPropertySpecs.h +++ b/source/UOXJSPropertySpecs.h @@ -535,7 +535,7 @@ inline JSPropertySpec CItemProps[] = { "ammoFXHue", CIP_AMMOFXHUE, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "ammoFXRender", CIP_AMMOFXRENDER, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "speed", CIP_SPEED, JSPROP_ENUMANDPERM, nullptr, nullptr }, - { "speedIncrease", CIP_SPDINCREASE, JSPROP_ENUMANDPERM, nullptr, nullptr }, + { "speedIncrease", CIP_SPEEDINCREASE , JSPROP_ENUMANDPERM, nullptr, nullptr }, { "multi", CIP_MULTI, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "maxRange", CIP_MAXRANGE, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "baseRange", CIP_BASERANGE, JSPROP_ENUMANDPERM, nullptr, nullptr }, diff --git a/source/cItem.cpp b/source/cItem.cpp index 2bc30a458..eacbfa112 100644 --- a/source/cItem.cpp +++ b/source/cItem.cpp @@ -1743,7 +1743,7 @@ bool CItem::DumpBody( std::ostream &outStream ) const outStream << "Restock=" + std::to_string( GetRestock() ) + newLine; outStream << "AC=" + std::to_string( GetArmourClass() ) + newLine; outStream << "Rank=" + std::to_string( GetRank() ) + newLine; - outStream << "SwingSpeedIncrease=" + std::to_string( GetSwingSpeedIncrease() ) + newLine; + outStream << "SpeedIncrease=" + std::to_string( GetSwingSpeedIncrease() ) + newLine; outStream << "Sk_Made=" + std::to_string( GetMadeWith() ) + newLine; outStream << "Bools=" + std::to_string(( bools.to_ulong() )) + newLine; outStream << "Good=" + std::to_string( GetGood() ) + newLine; diff --git a/source/items.cpp b/source/items.cpp index c116c984a..d8f687c7a 100644 --- a/source/items.cpp +++ b/source/items.cpp @@ -548,7 +548,7 @@ auto ApplyItemSection( CItem *applyTo, CScriptSection *toApply, std::string sect case DFNTAG_RAIN: applyTo->SetWeatherDamage( RAIN, ndata != 0 ); break; case DFNTAG_SECTIONID: applyTo->SetSectionId( cdata ); break; case DFNTAG_SK_MADE: applyTo->SetMadeWith( static_cast( ndata )); break; - case DFNTAG_SPDINCREASE : applyTo->SetSwingSpeedIncrease( static_cast( ndata )); break; + case DFNTAG_SPEEDINCREASE: applyTo->SetSwingSpeedIncrease( static_cast( ndata )); break; case DFNTAG_SPD: applyTo->SetSpeed( static_cast( ndata )); break; case DFNTAG_STRENGTH: applyTo->SetStrength( static_cast( ndata )); break; case DFNTAG_STRADD: applyTo->SetStrength2( static_cast( ndata )); break; diff --git a/source/ssection.cpp b/source/ssection.cpp index 9c3834663..896203365 100644 --- a/source/ssection.cpp +++ b/source/ssection.cpp @@ -476,7 +476,7 @@ const std::map strToDFNTag {"SPAWNOBJLIST"s, DFNTAG_SPAWNOBJLIST}, {"SPD"s, DFNTAG_SPD}, {"SPEED"s, DFNTAG_SPD}, - {"SPDINCREASE"s, DFNTAG_SPDINCREASE}, + {"SPEEDINCREASE"s, DFNTAG_SPEEDINCREASE}, {"SPELLS"s, DFNTAG_SPELLS}, {"SPELLWEAVING"s, DFNTAG_SPELLWEAVING}, {"SPIRITSPEAK"s, DFNTAG_SPIRITSPEAK}, diff --git a/source/ssection.h b/source/ssection.h index d98927e49..7ac508971 100644 --- a/source/ssection.h +++ b/source/ssection.h @@ -221,7 +221,7 @@ enum DFNTAGS DFNTAG_SPATTACK, DFNTAG_SPAWNOBJ, DFNTAG_SPAWNOBJLIST, - DFNTAG_SPDINCREASE, + DFNTAG_SPEEDINCREASE, DFNTAG_SPD, DFNTAG_SPELLS, DFNTAG_SPELLWEAVING, From ced101feebf28ddebf690c9f94c2efd0daba553a Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 16 Jun 2024 02:33:09 -0500 Subject: [PATCH 044/147] fixes --- source/UOXJSPropertyFuncs.cpp | 4 ++-- source/combat.cpp | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/source/UOXJSPropertyFuncs.cpp b/source/UOXJSPropertyFuncs.cpp index a5fb92713..0ba5ed693 100644 --- a/source/UOXJSPropertyFuncs.cpp +++ b/source/UOXJSPropertyFuncs.cpp @@ -675,7 +675,7 @@ JSBool CItemProps_getProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGEPOISON: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( POISON )); break; case CIP_DAMAGERAIN: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( RAIN )); break; case CIP_DAMAGESNOW: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( SNOW )); break; - case CIP_SPEEDINCREASE : *vp = INT_TO_JSVAL( gPriv->GetSwingSpeedIncrease() ); break; + case CIP_SPEEDINCREASE: *vp = INT_TO_JSVAL( gPriv->GetSwingSpeedIncrease() ); break; case CIP_SPEED: *vp = INT_TO_JSVAL( gPriv->GetSpeed() ); break; case CIP_NAME2: tString = JS_NewStringCopyZ( cx, gPriv->GetName2().c_str() ); @@ -1322,7 +1322,7 @@ JSBool CItemProps_setProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGERAIN: gPriv->SetWeatherDamage( RAIN, encaps.toBool() ); break; case CIP_DAMAGESNOW: gPriv->SetWeatherDamage( SNOW, encaps.toBool() ); break; case CIP_SPEED: gPriv->SetSpeed( static_cast( encaps.toInt() )); break; - case CIP_SPEEDINCREASE : gPriv->SetSwingSpeedIncrease( static_cast( encaps.toInt() )); break; + case CIP_SPEEDINCREASE: gPriv->SetSwingSpeedIncrease( static_cast( encaps.toInt() )); break; case CIP_NAME2: gPriv->SetName2( encaps.toString() ); break; case CIP_RACE: gPriv->SetRace( static_cast( encaps.toInt() )); break; case CIP_MAXHP: gPriv->SetMaxHP( static_cast( encaps.toInt() )); break; diff --git a/source/combat.cpp b/source/combat.cpp index 29049dc28..1c0369ec9 100644 --- a/source/combat.cpp +++ b/source/combat.cpp @@ -3429,7 +3429,6 @@ R32 CHandleCombat::GetCombatTimeout( CChar *mChar ) getDelay = static_cast( static_cast( std::min( statOffset, static_cast( 100 ))) + 100 ); } - SI32 speedBonus = 0; SI32 getOffset = 0; SI32 baseValue = ( cwmWorldState->ServerData()->ExpansionCoreShardEra() <= ER_LBR ) ? 15000 : (( cwmWorldState->ServerData()->ExpansionCoreShardEra() < ER_ML ) ? 80000 : 40000 ); @@ -3457,7 +3456,7 @@ R32 CHandleCombat::GetCombatTimeout( CChar *mChar ) } } - speedBonus = mChar->GetSwingSpeedIncrease(); + SI32 speedBonus = mChar->GetSwingSpeedIncrease(); // Swing Speed Increase Cap per AOS if ( speedBonus > cwmWorldState->ServerData()->SwingSpeedIncreaseCap() ) From 1abd8a0826728de5e326a8228bfe5b937fc91ed4 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 16 Jun 2024 02:38:42 -0500 Subject: [PATCH 045/147] Update cBaseObject.cpp --- source/cBaseObject.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp index 1ce12d3e4..f0263f163 100644 --- a/source/cBaseObject.cpp +++ b/source/cBaseObject.cpp @@ -94,6 +94,7 @@ const SI16 DEFBASE_KILLS = 0; const UI16 DEFBASE_RESIST = 0; const bool DEFBASE_NAMEREQUESTACTIVE = 0; const ExpansionRuleset DEFBASE_ORIGIN = ER_UO; +const SI16 DEFBASE_SWINGSPEEDINCREASE = 0; //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject constructor @@ -110,7 +111,8 @@ loDamage( DEFBASE_LODAMAGE ), weight( DEFBASE_WEIGHT ), mana( DEFBASE_MANA ), stamina( DEFBASE_STAMINA ), scriptTrig( DEFBASE_SCPTRIG ), st2( DEFBASE_STR2 ), dx2( DEFBASE_DEX2 ), in2( DEFBASE_INT2 ), FilePosition( DEFBASE_FP ), poisoned( DEFBASE_POISONED ), carve( DEFBASE_CARVE ), oldLocX( 0 ), oldLocY( 0 ), oldLocZ( 0 ), oldTargLocX( 0 ), oldTargLocY( 0 ), -fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN ) +fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN ), +swingSpeedIncrease( DEFBASE_SWINGSPEEDINCREASE ) { multis = nullptr; tempMulti = INVALIDSERIAL; From f6989ca218146962e9cef0f932fffd0e1d13cd3c Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 16 Jun 2024 02:48:12 -0500 Subject: [PATCH 046/147] Update cBaseObject.cpp --- source/cBaseObject.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp index b0e7a538f..9eedebfff 100644 --- a/source/cBaseObject.cpp +++ b/source/cBaseObject.cpp @@ -94,6 +94,8 @@ const SI16 DEFBASE_KILLS = 0; const UI16 DEFBASE_RESIST = 0; const bool DEFBASE_NAMEREQUESTACTIVE = 0; const ExpansionRuleset DEFBASE_ORIGIN = ER_UO; +const SI16 DEFBASE_HITCHANCE = 0; +const SI16 DEFBASE_DEFENSECHANCE = 0; //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject constructor @@ -110,7 +112,8 @@ loDamage( DEFBASE_LODAMAGE ), weight( DEFBASE_WEIGHT ), mana( DEFBASE_MANA ), stamina( DEFBASE_STAMINA ), scriptTrig( DEFBASE_SCPTRIG ), st2( DEFBASE_STR2 ), dx2( DEFBASE_DEX2 ), in2( DEFBASE_INT2 ), FilePosition( DEFBASE_FP ), poisoned( DEFBASE_POISONED ), carve( DEFBASE_CARVE ), oldLocX( 0 ), oldLocY( 0 ), oldLocZ( 0 ), oldTargLocX( 0 ), oldTargLocY( 0 ), -fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN ) +fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN ), +hitChance( DEFBASE_HITCHANCE ), defenseChance( DEFBASE_DEFENSECHANCE ) { multis = nullptr; tempMulti = INVALIDSERIAL; From 6e4c88bafea71ad2e5b3d53c44d7d6e2887d36e9 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 16 Jun 2024 11:59:45 -0500 Subject: [PATCH 047/147] Update cBaseObject.cpp --- source/cBaseObject.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp index 82435c442..f9c8da3cc 100644 --- a/source/cBaseObject.cpp +++ b/source/cBaseObject.cpp @@ -94,6 +94,7 @@ const SI16 DEFBASE_KILLS = 0; const UI16 DEFBASE_RESIST = 0; const bool DEFBASE_NAMEREQUESTACTIVE = 0; const ExpansionRuleset DEFBASE_ORIGIN = ER_UO; +const SI16 DEFBASE_LOWERSTATREQ = 0; //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject constructor @@ -110,7 +111,8 @@ loDamage( DEFBASE_LODAMAGE ), weight( DEFBASE_WEIGHT ), mana( DEFBASE_MANA ), stamina( DEFBASE_STAMINA ), scriptTrig( DEFBASE_SCPTRIG ), st2( DEFBASE_STR2 ), dx2( DEFBASE_DEX2 ), in2( DEFBASE_INT2 ), FilePosition( DEFBASE_FP ), poisoned( DEFBASE_POISONED ), carve( DEFBASE_CARVE ), oldLocX( 0 ), oldLocY( 0 ), oldLocZ( 0 ), oldTargLocX( 0 ), oldTargLocY( 0 ), -fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN ) +fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN ), +lowerStatReq( DEFBASE_LOWERSTATREQ ) { multis = nullptr; tempMulti = INVALIDSERIAL; From e514b688a9e91776da581aa98858476f1ec286bb Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 16 Jun 2024 12:00:52 -0500 Subject: [PATCH 048/147] Update cBaseObject.cpp --- source/cBaseObject.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp index 51cbb80ae..abeb8590f 100644 --- a/source/cBaseObject.cpp +++ b/source/cBaseObject.cpp @@ -94,6 +94,9 @@ const SI16 DEFBASE_KILLS = 0; const UI16 DEFBASE_RESIST = 0; const bool DEFBASE_NAMEREQUESTACTIVE = 0; const ExpansionRuleset DEFBASE_ORIGIN = ER_UO; +const SI16 DEFBASE_BONUSHEALTH = 0; +const SI16 DEFBASE_BONUSSTAMINA = 0; +const SI16 DEFBASE_BONUSMANA = 0; //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject constructor @@ -110,7 +113,8 @@ loDamage( DEFBASE_LODAMAGE ), weight( DEFBASE_WEIGHT ), mana( DEFBASE_MANA ), stamina( DEFBASE_STAMINA ), scriptTrig( DEFBASE_SCPTRIG ), st2( DEFBASE_STR2 ), dx2( DEFBASE_DEX2 ), in2( DEFBASE_INT2 ), FilePosition( DEFBASE_FP ), poisoned( DEFBASE_POISONED ), carve( DEFBASE_CARVE ), oldLocX( 0 ), oldLocY( 0 ), oldLocZ( 0 ), oldTargLocX( 0 ), oldTargLocY( 0 ), -fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN ) +fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN ), +bonusHits( DEFBASE_BONUSHEALTH ),bonusStam( DEFBASE_BONUSSTAMINA ), bonusMana( DEFBASE_BONUSMANA ) { multis = nullptr; tempMulti = INVALIDSERIAL; From 2694dbc502d90e85eb5a94009a372c8766b5fa1d Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 16 Jun 2024 18:57:27 -0500 Subject: [PATCH 049/147] Match uox3 Style --- source/CPacketSend.cpp | 12 ++++---- source/UOXJSPropertyEnums.h | 6 ++-- source/UOXJSPropertyFuncs.cpp | 12 ++++---- source/UOXJSPropertySpecs.h | 6 ++-- source/cBaseObject.cpp | 44 +++++++++++++-------------- source/cBaseObject.h | 18 +++++------ source/cChar.cpp | 57 +++++++++++++++++------------------ source/cChar.h | 12 ++++---- source/cItem.cpp | 14 ++++----- source/items.cpp | 6 ++-- source/ssection.cpp | 12 ++++---- source/ssection.h | 6 ++-- 12 files changed, 102 insertions(+), 103 deletions(-) diff --git a/source/CPacketSend.cpp b/source/CPacketSend.cpp index dfcf7cd62..c95dbf5fd 100644 --- a/source/CPacketSend.cpp +++ b/source/CPacketSend.cpp @@ -7657,24 +7657,24 @@ void CPToolTip::CopyItemData( CItem& cItem, size_t &totalStringLen, bool addAmou FinalizeData( tempEntry, totalStringLen ); } - if( cItem.GetBonusHits() > 0 ) + if( cItem.GetHealthBonus() > 0 ) { tempEntry.stringNum = 1060431; // hit point increase ~1_val~ - tempEntry.ourText = oldstrutil::number( cItem.GetBonusHits() ); + tempEntry.ourText = oldstrutil::number( cItem.GetHealthBonus() ); FinalizeData( tempEntry, totalStringLen ); } - if( cItem.GetBonusStam() > 0 ) + if( cItem.GetStaminaBonus() > 0 ) { tempEntry.stringNum = 1060484; // stamina increase ~1_val~ - tempEntry.ourText = oldstrutil::number( cItem.GetBonusStam() ); + tempEntry.ourText = oldstrutil::number( cItem.GetStaminaBonus() ); FinalizeData( tempEntry, totalStringLen ); } - if( cItem.GetBonusMana() > 0 ) + if( cItem.GetManaBonus() > 0 ) { tempEntry.stringNum = 1060439; // mana increase ~1_val~ - tempEntry.ourText = oldstrutil::number( cItem.GetBonusMana() ); + tempEntry.ourText = oldstrutil::number( cItem.GetManaBonus() ); FinalizeData( tempEntry, totalStringLen ); } diff --git a/source/UOXJSPropertyEnums.h b/source/UOXJSPropertyEnums.h index f7f187903..2b4bf3091 100644 --- a/source/UOXJSPropertyEnums.h +++ b/source/UOXJSPropertyEnums.h @@ -516,9 +516,9 @@ enum CI_Properties CIP_ISCONTTYPE, CIP_CARVESECTION, CIP_SPEED, - CIP_BONUSHITS, - CIP_BONUSSTAM, - CIP_BONUSMANA, + CIP_HEALTHBONUS, + CIP_STAMINABONUS, + CIP_MANABONUS, CIP_MULTI, CIP_AMMOID, CIP_AMMOHUE, diff --git a/source/UOXJSPropertyFuncs.cpp b/source/UOXJSPropertyFuncs.cpp index a492f112a..8771f2688 100644 --- a/source/UOXJSPropertyFuncs.cpp +++ b/source/UOXJSPropertyFuncs.cpp @@ -676,9 +676,9 @@ JSBool CItemProps_getProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGERAIN: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( RAIN )); break; case CIP_DAMAGESNOW: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( SNOW )); break; case CIP_SPEED: *vp = INT_TO_JSVAL( gPriv->GetSpeed() ); break; - case CIP_BONUSHITS: *vp = INT_TO_JSVAL( gPriv->GetBonusHits() ); break; - case CIP_BONUSSTAM: *vp = INT_TO_JSVAL( gPriv->GetBonusStam() ); break; - case CIP_BONUSMANA: *vp = INT_TO_JSVAL( gPriv->GetBonusMana() ); break; + case CIP_HEALTHBONUS: *vp = INT_TO_JSVAL( gPriv->GetHealthBonus() ); break; + case CIP_STAMINABONUS: *vp = INT_TO_JSVAL( gPriv->GetStaminaBonus() ); break; + case CIP_MANABONUS: *vp = INT_TO_JSVAL( gPriv->GetManaBonus() ); break; case CIP_NAME2: tString = JS_NewStringCopyZ( cx, gPriv->GetName2().c_str() ); *vp = STRING_TO_JSVAL( tString ); @@ -1324,9 +1324,9 @@ JSBool CItemProps_setProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGERAIN: gPriv->SetWeatherDamage( RAIN, encaps.toBool() ); break; case CIP_DAMAGESNOW: gPriv->SetWeatherDamage( SNOW, encaps.toBool() ); break; case CIP_SPEED: gPriv->SetSpeed( static_cast( encaps.toInt() )); break; - case CIP_BONUSHITS: gPriv->SetBonusHits( static_cast( encaps.toInt() )); break; - case CIP_BONUSSTAM: gPriv->SetBonusStam( static_cast( encaps.toInt() )); break; - case CIP_BONUSMANA: gPriv->SetBonusMana( static_cast( encaps.toInt() )); break; + case CIP_HEALTHBONUS: gPriv->SetHealthBonus( static_cast( encaps.toInt() )); break; + case CIP_STAMINABONUS: gPriv->SetStaminaBonus( static_cast( encaps.toInt() )); break; + case CIP_MANABONUS: gPriv->SetManaBonus( static_cast( encaps.toInt() )); break; case CIP_NAME2: gPriv->SetName2( encaps.toString() ); break; case CIP_RACE: gPriv->SetRace( static_cast( encaps.toInt() )); break; case CIP_MAXHP: gPriv->SetMaxHP( static_cast( encaps.toInt() )); break; diff --git a/source/UOXJSPropertySpecs.h b/source/UOXJSPropertySpecs.h index c5a8c8039..8b33d4bc8 100644 --- a/source/UOXJSPropertySpecs.h +++ b/source/UOXJSPropertySpecs.h @@ -535,9 +535,9 @@ inline JSPropertySpec CItemProps[] = { "ammoFXHue", CIP_AMMOFXHUE, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "ammoFXRender", CIP_AMMOFXRENDER, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "speed", CIP_SPEED, JSPROP_ENUMANDPERM, nullptr, nullptr }, - { "bonusHits", CIP_BONUSHITS, JSPROP_ENUMANDPERM, nullptr, nullptr }, - { "bonusStam", CIP_BONUSSTAM, JSPROP_ENUMANDPERM, nullptr, nullptr }, - { "bonusMana", CIP_BONUSMANA, JSPROP_ENUMANDPERM, nullptr, nullptr }, + { "healthBonus", CIP_HEALTHBONUS, JSPROP_ENUMANDPERM, nullptr, nullptr }, + { "staminaBonus", CIP_STAMINABONUS, JSPROP_ENUMANDPERM, nullptr, nullptr }, + { "manaBonus", CIP_MANABONUS, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "multi", CIP_MULTI, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "maxRange", CIP_MAXRANGE, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "baseRange", CIP_BASERANGE, JSPROP_ENUMANDPERM, nullptr, nullptr }, diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp index abeb8590f..131f0417b 100644 --- a/source/cBaseObject.cpp +++ b/source/cBaseObject.cpp @@ -94,9 +94,9 @@ const SI16 DEFBASE_KILLS = 0; const UI16 DEFBASE_RESIST = 0; const bool DEFBASE_NAMEREQUESTACTIVE = 0; const ExpansionRuleset DEFBASE_ORIGIN = ER_UO; -const SI16 DEFBASE_BONUSHEALTH = 0; -const SI16 DEFBASE_BONUSSTAMINA = 0; -const SI16 DEFBASE_BONUSMANA = 0; +const SI16 DEFBASE_HEALTHBONUS = 0; +const SI16 DEFBASE_STAMINABONOS = 0; +const SI16 DEFBASE_MANABONUS = 0; //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject constructor @@ -114,7 +114,7 @@ mana( DEFBASE_MANA ), stamina( DEFBASE_STAMINA ), scriptTrig( DEFBASE_SCPTRIG ), in2( DEFBASE_INT2 ), FilePosition( DEFBASE_FP ), poisoned( DEFBASE_POISONED ), carve( DEFBASE_CARVE ), oldLocX( 0 ), oldLocY( 0 ), oldLocZ( 0 ), oldTargLocX( 0 ), oldTargLocY( 0 ), fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN ), -bonusHits( DEFBASE_BONUSHEALTH ),bonusStam( DEFBASE_BONUSSTAMINA ), bonusMana( DEFBASE_BONUSMANA ) +healthBonus( DEFBASE_HEALTHBONUS ),staminaBonus( DEFBASE_STAMINABONOS ), manaBonus( DEFBASE_MANABONUS ) { multis = nullptr; tempMulti = INVALIDSERIAL; @@ -1636,19 +1636,19 @@ void CBaseObject::SetIntelligence2( SI16 nVal ) } //o------------------------------------------------------------------------------------------------o -//| Function - CBaseObject::GetBonusHits() -//| CBaseObject::SetBonusHits() +//| Function - CBaseObject::GetHealthBonus() +//| CBaseObject::SetHealthBonus() //o------------------------------------------------------------------------------------------------o //| Purpose - Gets/Sets the health max var associated with the object. For chars, it's the //| bonuses (via armour and such) //o------------------------------------------------------------------------------------------------o -SI16 CBaseObject::GetBonusHits( void ) const +SI16 CBaseObject::GetHealthBonus( void ) const { - return bonusHits; + return healthBonus; } -void CBaseObject::SetBonusHits( SI16 nVal ) +void CBaseObject::SetHealthBonus( SI16 nVal ) { - bonusHits = nVal; + healthBonus = nVal; if( CanBeObjType( OT_ITEM )) { @@ -1657,19 +1657,19 @@ void CBaseObject::SetBonusHits( SI16 nVal ) } //o------------------------------------------------------------------------------------------------o -//| Function - CBaseObject::GetBonusStam() -//| CBaseObject::SetBonusStam() +//| Function - CBaseObject::GetStaminaBonus() +//| CBaseObject::SetStaminaBonus() //o------------------------------------------------------------------------------------------------o //| Purpose - Gets/Sets the stamina max var associated with the object. For chars, it's the //| bonuses (via armour and such) //o------------------------------------------------------------------------------------------------o -SI16 CBaseObject::GetBonusStam( void ) const +SI16 CBaseObject::GetStaminaBonus( void ) const { - return bonusStam; + return staminaBonus; } -void CBaseObject::SetBonusStam( SI16 nVal ) +void CBaseObject::SetStaminaBonus( SI16 nVal ) { - bonusStam = nVal; + staminaBonus = nVal; if( CanBeObjType( OT_ITEM )) { @@ -1678,19 +1678,19 @@ void CBaseObject::SetBonusStam( SI16 nVal ) } //o------------------------------------------------------------------------------------------------o -//| Function - CBaseObject::GetBonusMana() -//| CBaseObject::SetBonusMana() +//| Function - CBaseObject::GetManaBonus() +//| CBaseObject::SetManaBonus() //o------------------------------------------------------------------------------------------------o //| Purpose - Gets/Sets the Mana max var associated with the object. For chars, it's the //| bonuses (via armour and such) //o------------------------------------------------------------------------------------------------o -SI16 CBaseObject::GetBonusMana( void ) const +SI16 CBaseObject::GetManaBonus( void ) const { - return bonusMana; + return manaBonus; } -void CBaseObject::SetBonusMana( SI16 nVal ) +void CBaseObject::SetManaBonus( SI16 nVal ) { - bonusMana = nVal; + manaBonus = nVal; if( CanBeObjType( OT_ITEM )) { diff --git a/source/cBaseObject.h b/source/cBaseObject.h index 15563feca..b3c7e98f9 100644 --- a/source/cBaseObject.h +++ b/source/cBaseObject.h @@ -79,9 +79,9 @@ class CBaseObject SI16 st2; SI16 dx2; SI16 in2; - SI16 bonusHits; - SI16 bonusStam; - SI16 bonusMana; + SI16 healthBonus; + SI16 staminaBonus; + SI16 manaBonus; mutable SI32 FilePosition; SERIAL tempMulti; std::string name; @@ -259,14 +259,14 @@ class CBaseObject void IncDexterity( SI16 toInc = 1 ); void IncIntelligence( SI16 toInc = 1 ); - SI16 GetBonusHits( void ) const; - virtual void SetBonusHits( SI16 nVal ); + SI16 GetHealthBonus( void ) const; + virtual void SetHealthBonus( SI16 nVal ); - SI16 GetBonusStam( void ) const; - virtual void SetBonusStam( SI16 nVal ); + SI16 GetStaminaBonus( void ) const; + virtual void SetStaminaBonus( SI16 nVal ); - SI16 GetBonusMana( void ) const; - virtual void SetBonusMana( SI16 nVal ); + SI16 GetManaBonus( void ) const; + virtual void SetManaBonus( SI16 nVal ); virtual void PostLoadProcessing( void ); virtual bool LoadRemnants( void ) = 0; diff --git a/source/cChar.cpp b/source/cChar.cpp index 530053021..bcd9e90f6 100644 --- a/source/cChar.cpp +++ b/source/cChar.cpp @@ -2920,9 +2920,9 @@ bool CChar::WearItem( CItem *toWear ) IncDexterity2( itemLayers[tLayer]->GetDexterity2() ); IncIntelligence2( itemLayers[tLayer]->GetIntelligence2() ); - IncBonusHits( itemLayers[tLayer]->GetBonusHits() ); - IncBonusStam( itemLayers[tLayer]->GetBonusStam() ); - IncBonusMana( itemLayers[tLayer]->GetBonusMana() ); + IncHealthBonus( itemLayers[tLayer]->GetHealthBonus() ); + IncStaminaBonus( itemLayers[tLayer]->GetStaminaBonus() ); + IncManaBonus( itemLayers[tLayer]->GetManaBonus() ); if( toWear->IsPostLoaded() ) { @@ -2984,9 +2984,9 @@ bool CChar::TakeOffItem( ItemLayers Layer ) IncDexterity2( -itemLayers[Layer]->GetDexterity2() ); IncIntelligence2( -itemLayers[Layer]->GetIntelligence2() ); - IncBonusHits( -itemLayers[Layer]->GetBonusHits() ); - IncBonusStam( -itemLayers[Layer]->GetBonusStam() ); - IncBonusMana( -itemLayers[Layer]->GetBonusMana() ); + IncHealthBonus( -itemLayers[Layer]->GetHealthBonus() ); + IncStaminaBonus( -itemLayers[Layer]->GetStaminaBonus() ); + IncManaBonus( -itemLayers[Layer]->GetManaBonus() ); if( itemLayers[Layer]->GetPoisoned() ) { @@ -3796,7 +3796,7 @@ UI16 CChar::GetMaxHP( void ) oldRace = GetRace(); } - return maxHP + GetBonusHits(); + return maxHP + GetHealthBonus(); } void CChar::SetMaxHP( UI16 newmaxhp, UI16 newoldstr, RACEID newoldrace ) { @@ -3856,7 +3856,7 @@ SI16 CChar::GetMaxMana( void ) oldRace = GetRace(); } - return maxMana + GetBonusMana(); + return maxMana + GetManaBonus(); } void CChar::SetMaxMana( SI16 newmaxmana, UI16 newoldint, RACEID newoldrace ) { @@ -3916,7 +3916,7 @@ SI16 CChar::GetMaxStam( void ) oldRace = GetRace(); } - return maxStam + GetBonusStam(); + return maxStam + GetStaminaBonus(); } void CChar::SetMaxStam( SI16 newmaxstam, UI16 newolddex, RACEID newoldrace ) { @@ -5603,72 +5603,71 @@ void CChar::SetIntelligence2( SI16 nVal ) } //o------------------------------------------------------------------------------------------------o -//| Function - CChar::SetBonusHits() +//| Function - CChar::SetHealthBonus() //o------------------------------------------------------------------------------------------------o //| Purpose - Sets bonus Hits stat for character //o------------------------------------------------------------------------------------------------o -void CChar::SetBonusHits( SI16 nVal ) +void CChar::SetHealthBonus( SI16 nVal ) { - CBaseObject::SetBonusHits( nVal ); + CBaseObject::SetHealthBonus( nVal ); Dirty( UT_HITPOINTS ); UpdateRegion(); } //o------------------------------------------------------------------------------------------------o -//| Function - CChar::SetBonusStam() +//| Function - CChar::SetStaminaBonus() //o------------------------------------------------------------------------------------------------o //| Purpose - Sets bonus Stam stat for character //o------------------------------------------------------------------------------------------------o -void CChar::SetBonusStam( SI16 nVal ) +void CChar::SetStaminaBonus( SI16 nVal ) { - CBaseObject::SetBonusStam( nVal ); + CBaseObject::SetStaminaBonus( nVal ); Dirty( UT_STAMINA ); UpdateRegion(); } //o------------------------------------------------------------------------------------------------o -//| Function - CChar::SetBonusMana() +//| Function - CChar::SetManaBonus() //o------------------------------------------------------------------------------------------------o //| Purpose - Sets bonus Mana stat for character //o------------------------------------------------------------------------------------------------o -void CChar::SetBonusMana( SI16 nVal ) +void CChar::SetManaBonus( SI16 nVal ) { - CBaseObject::SetBonusMana( nVal ); + CBaseObject::SetManaBonus( nVal ); Dirty( UT_MANA ); UpdateRegion(); } //o------------------------------------------------------------------------------------------------o -//| Function - CChar::IncBonusHits() -//| Date - 26 May 2024 +//| Function - CChar::IncHealthBonus() //o------------------------------------------------------------------------------------------------o -//| Purpose - Increments GetBonusHits (modifications) by toAdd +//| Purpose - Increments GetHealthBonus (modifications) by toAdd //o------------------------------------------------------------------------------------------------o -void CChar::IncBonusHits( SI16 toAdd ) +void CChar::IncHealthBonus( SI16 toAdd ) { - SetBonusHits( static_cast( GetBonusHits() + toAdd )); + SetHealthBonus( static_cast( GetHealthBonus() + toAdd )); } //o------------------------------------------------------------------------------------------------o -//| Function - CChar::IncBonusStam() +//| Function - CChar::IncStaminaBonus() //| Date - 26 May 2024 //o------------------------------------------------------------------------------------------------o //| Purpose - Increments GetBonusStam (modifications) by toAdd //o------------------------------------------------------------------------------------------------o -void CChar::IncBonusStam( SI16 toAdd ) +void CChar::IncStaminaBonus( SI16 toAdd ) { - SetBonusStam( static_cast( GetBonusStam() + toAdd )); + SetStaminaBonus( static_cast( GetStaminaBonus() + toAdd )); } //o------------------------------------------------------------------------------------------------o -//| Function - CChar::IncBonusMana() +//| Function - CChar::IncManaBonus() //| Date - 26 May 2024 //o------------------------------------------------------------------------------------------------o //| Purpose - Increments GetBonusMana (modifications) by toAdd //o------------------------------------------------------------------------------------------------o -void CChar::IncBonusMana( SI16 toAdd ) +void CChar::IncManaBonus( SI16 toAdd ) { - SetBonusMana( static_cast( GetBonusMana() + toAdd )); + SetManaBonus( static_cast( GetManaBonus() + toAdd )); } //o------------------------------------------------------------------------------------------------o diff --git a/source/cChar.h b/source/cChar.h index 3156340ff..ae387a58c 100644 --- a/source/cChar.h +++ b/source/cChar.h @@ -629,13 +629,13 @@ class CChar : public CBaseObject virtual void SetDexterity2( SI16 newValue ) override; virtual void SetIntelligence2( SI16 newValue ) override; - virtual void SetBonusHits( SI16 newValue ) override; - virtual void SetBonusStam( SI16 newValue ) override; - virtual void SetBonusMana( SI16 newValue ) override; + virtual void SetHealthBonus( SI16 newValue ) override; + virtual void SetStaminaBonus( SI16 newValue ) override; + virtual void SetManaBonus( SI16 newValue ) override; - void IncBonusHits( SI16 toAdd = 1 ); - void IncBonusStam( SI16 toAdd = 1 ); - void IncBonusMana( SI16 toAdd = 1 ); + void IncHealthBonus( SI16 toAdd = 1 ); + void IncStaminaBonus( SI16 toAdd = 1 ); + void IncManaBonus( SI16 toAdd = 1 ); void IncStamina( SI16 toInc ); void IncMana( SI16 toInc ); diff --git a/source/cItem.cpp b/source/cItem.cpp index c345ecdc2..e19ff45d1 100644 --- a/source/cItem.cpp +++ b/source/cItem.cpp @@ -1654,9 +1654,9 @@ auto CItem::CopyData( CItem *target ) -> void target->SetWeightMax( GetWeightMax() ); target->SetBaseWeight( GetBaseWeight() ); target->SetMaxItems( GetMaxItems() ); - target->SetBonusHits( GetBonusHits() ); - target->SetBonusStam( GetBonusStam() ); - target->SetBonusMana( GetBonusMana() ); + target->SetHealthBonus( GetHealthBonus() ); + target->SetStaminaBonus( GetStaminaBonus() ); + target->SetManaBonus( GetManaBonus() ); //target->SetWipeable( IsWipeable() ); target->SetPriv( GetPriv() ); target->SetBaseRange( GetBaseRange() ); @@ -1740,7 +1740,7 @@ bool CItem::DumpBody( std::ostream &outStream ) const outStream << "MaxItems=" + std::to_string( GetMaxItems() ) + newLine; outStream << "MaxHP=" + std::to_string( GetMaxHP() ) + newLine; outStream << "Speed=" + std::to_string( GetSpeed() ) + newLine; - outStream << "BonusStats=" + std::to_string( GetBonusHits() ) + "," + std::to_string( GetBonusStam() ) + "," + std::to_string( GetBonusMana() ) + newLine; + outStream << "BonusStats=" + std::to_string( GetHealthBonus() ) + "," + std::to_string( GetStaminaBonus() ) + "," + std::to_string( GetManaBonus() ) + newLine; outStream << "Movable=" + std::to_string( GetMovable() ) + newLine; outStream << "Priv=" + std::to_string( GetPriv() ) + newLine; outStream << "Value=" + std::to_string( GetBuyValue() ) + "," + std::to_string( GetSellValue() ) + "," + std::to_string( GetVendorPrice() ) + newLine; @@ -1826,9 +1826,9 @@ bool CItem::HandleLine( std::string &UTag, std::string &data ) } else if( UTag == "BONUSSTATS" ) { - SetBonusHits( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( csecs[0], "//" )), nullptr, 0 ))); - SetBonusStam( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( csecs[1], "//" )), nullptr, 0 ))); - SetBonusMana( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( csecs[2], "//" )), nullptr, 0 ))); + SetHealthBonus( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( csecs[0], "//" )), nullptr, 0 ))); + SetStaminaBonus( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( csecs[1], "//" )), nullptr, 0 ))); + SetManaBonus( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( csecs[2], "//" )), nullptr, 0 ))); rValue = true; } break; diff --git a/source/items.cpp b/source/items.cpp index 3bb17bb66..60c6468b7 100644 --- a/source/items.cpp +++ b/source/items.cpp @@ -139,9 +139,9 @@ auto ApplyItemSection( CItem *applyTo, CScriptSection *toApply, std::string sect break; case DFNTAG_AC: applyTo->SetArmourClass( static_cast( ndata )); break; case DFNTAG_BASERANGE: applyTo->SetBaseRange( static_cast( ndata )); break; - case DFNTAG_BONUSHITS: applyTo->SetBonusHits( static_cast( ndata )); break; - case DFNTAG_BONUSSTAM: applyTo->SetBonusStam( static_cast( ndata )); break; - case DFNTAG_BONUSMANA: applyTo->SetBonusMana( static_cast( ndata )); break; + case DFNTAG_HEALTHBONUS: applyTo->SetHealthBonus( static_cast( ndata )); break; + case DFNTAG_STAMINABONUS: applyTo->SetStaminaBonus( static_cast( ndata )); break; + case DFNTAG_MANABONUS: applyTo->SetManaBonus( static_cast( ndata )); break; case DFNTAG_CREATOR: applyTo->SetCreator( ndata ); break; case DFNTAG_COLOUR: applyTo->SetColour( static_cast( ndata )); break; case DFNTAG_COLOURLIST: applyTo->SetColour( AddRandomColor( cdata )); break; diff --git a/source/ssection.cpp b/source/ssection.cpp index dbfc8a475..52f73da5d 100644 --- a/source/ssection.cpp +++ b/source/ssection.cpp @@ -215,9 +215,9 @@ const UI08 dfnDataTypes[DFNTAG_COUNTOFTAGS] = DFN_STRING, // DFNTAG_SPAWNOBJ, DFN_STRING, // DFNTAG_SPAWNOBJLIST, DFN_NUMERIC, // DFNTAG_SPD, - DFN_NUMERIC, // DFNTAG_BONUSHITS, - DFN_NUMERIC, // DFNTAG_BONUSSTAM, - DFN_NUMERIC, // DFNTAG_BONUSMANA, + DFN_NUMERIC, // DFNTAG_HEALTHBONUS, + DFN_NUMERIC, // DFNTAG_STAMINABONUS, + DFN_NUMERIC, // DFNTAG_MANABONUS, DFN_STRING, // DFNTAG_SPELLS, DFN_DOUBLENUMERIC, // DFNTAG_SPELLWEAVING, DFN_DOUBLENUMERIC, // DFNTAG_SPIRITSPEAK, @@ -286,9 +286,9 @@ const std::map strToDFNTag {"BLACKSMITHING"s, DFNTAG_BLACKSMITHING}, {"BOWCRAFT"s, DFNTAG_BOWCRAFT}, {"BUSHIDO"s, DFNTAG_BUSHIDO}, - {"BONUSHITS"s, DFNTAG_BONUSHITS}, - {"BONUSSTAM"s, DFNTAG_BONUSSTAM}, - {"BONUSMANA"s, DFNTAG_BONUSMANA}, + {"HEALTHBONUS"s, DFNTAG_HEALTHBONUS}, + {"STAMINABONUS"s, DFNTAG_STAMINABONUS}, + {"MANABONUS"s, DFNTAG_MANABONUS}, {"CAMPING"s, DFNTAG_CAMPING}, {"CARPENTRY"s, DFNTAG_CARPENTRY}, {"CARTOGRAPHY"s, DFNTAG_CARTOGRAPHY}, diff --git a/source/ssection.h b/source/ssection.h index 8ffc1edc9..ca227c23b 100644 --- a/source/ssection.h +++ b/source/ssection.h @@ -222,9 +222,9 @@ enum DFNTAGS DFNTAG_SPAWNOBJ, DFNTAG_SPAWNOBJLIST, DFNTAG_SPD, - DFNTAG_BONUSHITS, - DFNTAG_BONUSSTAM, - DFNTAG_BONUSMANA, + DFNTAG_HEALTHBONUS, + DFNTAG_STAMINABONUS, + DFNTAG_MANABONUS, DFNTAG_SPELLS, DFNTAG_SPELLWEAVING, DFNTAG_SPIRITSPEAK, From 7c101e668290939e1fe3956163b02b1c16934c47 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 16 Jun 2024 18:58:24 -0500 Subject: [PATCH 050/147] Update Changelog.txt --- source/Changelog.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Changelog.txt b/source/Changelog.txt index c695610cd..61554e478 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,8 +1,8 @@ 13/05/2024 - Dragon Slayer Added three More AOS Props - -BONUSHITS=# - -BONUSMANA=# - -BONUSSTAM=# + -HEALTHBONUS=# + -MANABONUS=# + -STAMINABONUS=# Add this properties to any weapon/armor/jewlery will give the player more hp/mana/stam why its equiped. depending on number you add with it 27/04/2024 - Dragon Slayer/Xuri From c8bceabc303c0ab2e05383f8d409dd9c72f64086 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 16 Jun 2024 19:00:03 -0500 Subject: [PATCH 051/147] Update Changelog.txt --- source/Changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/source/Changelog.txt b/source/Changelog.txt index 61554e478..eb4a9d532 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -4,6 +4,7 @@ -MANABONUS=# -STAMINABONUS=# Add this properties to any weapon/armor/jewlery will give the player more hp/mana/stam why its equiped. depending on number you add with it + These are also available as JS Engine object properties: .healthBonus, .staminaBonus, .manaBonus 27/04/2024 - Dragon Slayer/Xuri Fixed an issue where non-corpse containers - including treasure chests in dungeons - would decay and leave all their contents on the ground. From da9267ac987cc2a09e51208a74e9a93fd454c4fd Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Tue, 18 Jun 2024 18:28:50 -0500 Subject: [PATCH 052/147] Added AOS Leech Properties --- data/js/combat/leechstats.js | 60 ++++++++++++++++++++ data/js/jse_fileassociations.scp | 1 + source/CPacketSend.cpp | 22 ++++++++ source/UOXJSPropertyEnums.h | 4 +- source/UOXJSPropertyFuncs.cpp | 6 ++ source/UOXJSPropertySpecs.h | 3 + source/cBaseObject.cpp | 96 +++++++++++++++++++++++++++++++- source/cBaseObject.h | 16 ++++++ source/cChar.cpp | 8 +++ source/cItem.cpp | 11 ++++ source/items.cpp | 3 + source/ssection.cpp | 6 ++ source/ssection.h | 3 + 13 files changed, 237 insertions(+), 2 deletions(-) create mode 100644 data/js/combat/leechstats.js diff --git a/data/js/combat/leechstats.js b/data/js/combat/leechstats.js new file mode 100644 index 000000000..6663958ba --- /dev/null +++ b/data/js/combat/leechstats.js @@ -0,0 +1,60 @@ +function onEquip( pEquipper, iEquipped ) +{ + pEquipper.AddScriptTrigger( 7003 ); +} + +// Remove script trigger on unequip +function onUnequip( pUnequipper, iUnequipped ) +{ + pUnequipper.RemoveScriptTrigger( 7003 ); +} + +function onDamageDeal( attacker, damaged, damageValue, damageType ) +{ + // Fetch weapon in main hand or secondary hand + var iWeapon = attacker.FindItemLayer( 0x01 ); + if( !ValidateObject( iWeapon )) + { + iWeapon = attacker.FindItemLayer( 0x02 ); + } + + if( ValidateObject( iWeapon )) + { // Apply leech effects based on weapon properties + ApplyLeech( attacker, damaged, damageValue, iWeapon, 'healthLeech', 30 ); + ApplyLeech( attacker, damaged, damageValue, iWeapon, 'staminaLeech', 100 ); + ApplyLeech( attacker, damaged, damageValue, iWeapon, 'manaLeech', 40 ); + } + + return true; +} + +function ApplyLeech( attacker, damaged, damageValue, weapon, leechType, multiplier ) +{ + // Get the leech amount for the specified leech type from the weapon + var leechAmount = weapon[ leechType ]; + if( leechAmount > 0 ) + { // Calculate the minimum and maximum leech values + var minLeech = Math.round( damageValue * ( leechAmount / 100 ) * ( multiplier/100 )); + var maxLeech = Math.round( ( ( weapon.speed / 100 ) * 2500 ) / ( 100 + weapon.speedIncrease )); + var leechAmt = RandomNumber( minLeech, maxLeech ); + + // Apply the leech effect based on the leech type + switch( leechType ) + { + case 'healthLeech': + attacker.Heal( leechAmt ); + damaged.health -= leechAmt; + break; + case 'staminaLeech': + attacker.stamina += leechAmt; + damaged.stamina -= leechAmt; + break; + case 'manaLeech': + attacker.mana += leechAmt; + damaged.mana -= leechAmt; + break; + } + + attacker.SoundEffect( 0x44D, true ); + } +} \ No newline at end of file diff --git a/data/js/jse_fileassociations.scp b/data/js/jse_fileassociations.scp index 2cbb8e3d5..7b16b631a 100644 --- a/data/js/jse_fileassociations.scp +++ b/data/js/jse_fileassociations.scp @@ -329,6 +329,7 @@ // Combat Scripts [7000-7499] //------------------------------------------- 7000=combat/peacemake_effect.js +7003=combat/leechstats.js //------------------------------------------- // Misc Player Scripts [8000-8499] diff --git a/source/CPacketSend.cpp b/source/CPacketSend.cpp index e1d8ee4ca..28f3a2a40 100644 --- a/source/CPacketSend.cpp +++ b/source/CPacketSend.cpp @@ -7465,6 +7465,28 @@ void CPToolTip::CopyItemData( CItem& cItem, size_t &totalStringLen, bool addAmou tempEntry.ourText = oldstrutil::number( cItem.GetTempVar( CITV_MOREZ )); FinalizeData( tempEntry, totalStringLen ); } + + if( cItem.GetManaLeech() > 0 ) + { + tempEntry.stringNum = 1060427; // hit mana leech ~1_val~% + tempEntry.ourText = oldstrutil::number( cItem.GetManaLeech() ); + FinalizeData( tempEntry, totalStringLen ); + } + + if( cItem.GetStaminaLeech() > 0 ) + { + tempEntry.stringNum = 1060430; // hit stamina leech ~1_val~% + tempEntry.ourText = oldstrutil::number( cItem.GetStaminaLeech() ); + FinalizeData( tempEntry, totalStringLen ); + } + + if( cItem.GetHealthLeech() > 0 ) + { + tempEntry.stringNum = 1060422; // hit life leech ~1_val~% + tempEntry.ourText = oldstrutil::number( cItem.GetHealthLeech() ); + FinalizeData( tempEntry, totalStringLen ); + } + if( cItem.GetType() == IT_SPELLCHANNELING ) { tempEntry.stringNum = 1060482; // spell channeling diff --git a/source/UOXJSPropertyEnums.h b/source/UOXJSPropertyEnums.h index af309d496..ada680894 100644 --- a/source/UOXJSPropertyEnums.h +++ b/source/UOXJSPropertyEnums.h @@ -495,7 +495,9 @@ enum CI_Properties CIP_SECTIONALIST, CIP_MININTERVAL, CIP_MAXINTERVAL, - + CIP_HEALTHLEECH, + CIP_STAMINALEECH, + CIP_MANALEECH, CIP_ISNEWBIE, CIP_ISDISPELLABLE, CIP_MADEWITH, diff --git a/source/UOXJSPropertyFuncs.cpp b/source/UOXJSPropertyFuncs.cpp index 3823356f9..2e210e2d0 100644 --- a/source/UOXJSPropertyFuncs.cpp +++ b/source/UOXJSPropertyFuncs.cpp @@ -676,6 +676,9 @@ JSBool CItemProps_getProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGERAIN: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( RAIN )); break; case CIP_DAMAGESNOW: *vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( SNOW )); break; case CIP_SPEED: *vp = INT_TO_JSVAL( gPriv->GetSpeed() ); break; + case CIP_HEALTHLEECH: *vp = INT_TO_JSVAL( gPriv->GetHealthLeech() ); break; + case CIP_STAMINALEECH: *vp = INT_TO_JSVAL( gPriv->GetStaminaLeech() ); break; + case CIP_MANALEECH: *vp = INT_TO_JSVAL( gPriv->GetManaLeech() ); break; case CIP_NAME2: tString = JS_NewStringCopyZ( cx, gPriv->GetName2().c_str() ); *vp = STRING_TO_JSVAL( tString ); @@ -1321,6 +1324,9 @@ JSBool CItemProps_setProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp case CIP_DAMAGERAIN: gPriv->SetWeatherDamage( RAIN, encaps.toBool() ); break; case CIP_DAMAGESNOW: gPriv->SetWeatherDamage( SNOW, encaps.toBool() ); break; case CIP_SPEED: gPriv->SetSpeed( static_cast( encaps.toInt() )); break; + case CIP_HEALTHLEECH: gPriv->SetHealthLeech( static_cast( encaps.toInt() )); break; + case CIP_STAMINALEECH: gPriv->SetStaminaLeech( static_cast( encaps.toInt() )); break; + case CIP_MANALEECH: gPriv->SetManaLeech( static_cast( encaps.toInt() )); break; case CIP_NAME2: gPriv->SetName2( encaps.toString() ); break; case CIP_RACE: gPriv->SetRace( static_cast( encaps.toInt() )); break; case CIP_MAXHP: gPriv->SetMaxHP( static_cast( encaps.toInt() )); break; diff --git a/source/UOXJSPropertySpecs.h b/source/UOXJSPropertySpecs.h index 3149dc0ec..15795c036 100644 --- a/source/UOXJSPropertySpecs.h +++ b/source/UOXJSPropertySpecs.h @@ -535,6 +535,9 @@ inline JSPropertySpec CItemProps[] = { "ammoFXHue", CIP_AMMOFXHUE, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "ammoFXRender", CIP_AMMOFXRENDER, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "speed", CIP_SPEED, JSPROP_ENUMANDPERM, nullptr, nullptr }, + { "healthLeech", CIP_HEALTHLEECH, JSPROP_ENUMANDPERM, nullptr, nullptr }, + { "staminaLeech", CIP_STAMINALEECH, JSPROP_ENUMANDPERM, nullptr, nullptr }, + { "manaLeech", CIP_MANALEECH, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "multi", CIP_MULTI, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "maxRange", CIP_MAXRANGE, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "baseRange", CIP_BASERANGE, JSPROP_ENUMANDPERM, nullptr, nullptr }, diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp index 506c247ac..2c5ce0b89 100644 --- a/source/cBaseObject.cpp +++ b/source/cBaseObject.cpp @@ -94,6 +94,9 @@ const SI16 DEFBASE_KILLS = 0; const UI16 DEFBASE_RESIST = 0; const bool DEFBASE_NAMEREQUESTACTIVE = 0; const ExpansionRuleset DEFBASE_ORIGIN = ER_UO; +const SI16 DEFBASE_HEALTHLEECH = 0; +const SI16 DEFBASE_STAMINALEECH = 0; +const SI16 DEFBASE_MANALEECH = 0; //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject constructor @@ -110,7 +113,8 @@ loDamage( DEFBASE_LODAMAGE ), weight( DEFBASE_WEIGHT ), mana( DEFBASE_MANA ), stamina( DEFBASE_STAMINA ), scriptTrig( DEFBASE_SCPTRIG ), st2( DEFBASE_STR2 ), dx2( DEFBASE_DEX2 ), in2( DEFBASE_INT2 ), FilePosition( DEFBASE_FP ), poisoned( DEFBASE_POISONED ), carve( DEFBASE_CARVE ), oldLocX( 0 ), oldLocY( 0 ), oldLocZ( 0 ), oldTargLocX( 0 ), oldTargLocY( 0 ), -fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN ) +fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN ), +healthLeech( DEFBASE_HEALTHLEECH ), staminaLeech( DEFBASE_STAMINALEECH ), manaLeech( DEFBASE_MANALEECH ) { multis = nullptr; tempMulti = INVALIDSERIAL; @@ -1631,6 +1635,66 @@ void CBaseObject::SetIntelligence2( SI16 nVal ) } } +//o------------------------------------------------------------------------------------------------o +//| Function - CBaseObject::GetHealthLeech() +//| CBaseObject::SetHealthLeech() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Gets/Sets the Health Leech +//o------------------------------------------------------------------------------------------------o +SI16 CBaseObject::GetHealthLeech( void ) const +{ + return healthLeech; +} +void CBaseObject::SetHealthLeech( SI16 nVal ) +{ + healthLeech = nVal; + + if( CanBeObjType( OT_ITEM )) + { + ( static_cast( this ))->UpdateRegion(); + } +} + +//o------------------------------------------------------------------------------------------------o +//| Function - CBaseObject::GetStaminaLeech() +//| CBaseObject::SetStaminaLeech() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Gets/Sets the Stamina Leech +//o------------------------------------------------------------------------------------------------o +SI16 CBaseObject::GetStaminaLeech( void ) const +{ + return staminaLeech; +} +void CBaseObject::SetStaminaLeech( SI16 nVal ) +{ + staminaLeech = nVal; + + if( CanBeObjType( OT_ITEM )) + { + ( static_cast( this ))->UpdateRegion(); + } +} + +//o------------------------------------------------------------------------------------------------o +//| Function - CBaseObject::GetManaLeech() +//| CBaseObject::SetManaLeech() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Gets/Sets the Mana Leech +//o------------------------------------------------------------------------------------------------o +SI16 CBaseObject::GetManaLeech( void ) const +{ + return manaLeech; +} +void CBaseObject::SetManaLeech( SI16 nVal ) +{ + manaLeech = nVal; + + if( CanBeObjType( OT_ITEM )) + { + ( static_cast( this ))->UpdateRegion(); + } +} + //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject::IncStrength() //o------------------------------------------------------------------------------------------------o @@ -1661,6 +1725,36 @@ void CBaseObject::IncIntelligence( SI16 toInc ) SetIntelligence( intelligence + toInc ); } +//o------------------------------------------------------------------------------------------------o +//| Function - CBaseObject::IncHealthLeech() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Increments the object's Health Leech Points value +//o------------------------------------------------------------------------------------------------o +void CBaseObject::IncHealthLeech( SI16 toInc ) +{ + SetHealthLeech( healthLeech + toInc ); +} + +//o------------------------------------------------------------------------------------------------o +//| Function - CBaseObject::IncStaminaLeech() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Increments the object's Stamina Leech Points value +//o------------------------------------------------------------------------------------------------o +void CBaseObject::IncStaminaLeech( SI16 toInc ) +{ + SetStaminaLeech( staminaLeech + toInc ); +} + +//o------------------------------------------------------------------------------------------------o +//| Function - CBaseObject::IncManaLeech() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Increments the object's Mana Leech Points value +//o------------------------------------------------------------------------------------------------o +void CBaseObject::IncManaLeech( SI16 toInc ) +{ + SetManaLeech( manaLeech + toInc ); +} + //o------------------------------------------------------------------------------------------------o //| Function - CBaseObject::DumpFooter() //o------------------------------------------------------------------------------------------------o diff --git a/source/cBaseObject.h b/source/cBaseObject.h index 638e826f7..316cd2530 100644 --- a/source/cBaseObject.h +++ b/source/cBaseObject.h @@ -75,6 +75,9 @@ class CBaseObject SI32 weight; SI16 mana; SI16 stamina; + SI16 healthLeech; + SI16 staminaLeech; + SI16 manaLeech; UI16 scriptTrig; SI16 st2; SI16 dx2; @@ -256,6 +259,19 @@ class CBaseObject void IncDexterity( SI16 toInc = 1 ); void IncIntelligence( SI16 toInc = 1 ); + SI16 GetHealthLeech( void ) const; + virtual void SetHealthLeech( SI16 nVal ); + + SI16 GetStaminaLeech( void ) const; + virtual void SetStaminaLeech( SI16 nVal ); + + SI16 GetManaLeech( void ) const; + virtual void SetManaLeech( SI16 nVal ); + + void IncHealthLeech( SI16 toInc = 1 ); + void IncStaminaLeech( SI16 toInc = 1 ); + void IncManaLeech( SI16 toInc = 1 ); + virtual void PostLoadProcessing( void ); virtual bool LoadRemnants( void ) = 0; diff --git a/source/cChar.cpp b/source/cChar.cpp index 7aa03f6fa..439a72527 100644 --- a/source/cChar.cpp +++ b/source/cChar.cpp @@ -2920,6 +2920,10 @@ bool CChar::WearItem( CItem *toWear ) IncDexterity2( itemLayers[tLayer]->GetDexterity2() ); IncIntelligence2( itemLayers[tLayer]->GetIntelligence2() ); + IncHealthLeech( itemLayers[tLayer]->GetHealthLeech() ); + IncStaminaLeech( itemLayers[tLayer]->GetStaminaLeech() ); + IncManaLeech( itemLayers[tLayer]->GetManaLeech() ); + if( toWear->IsPostLoaded() ) { if( itemLayers[tLayer]->GetPoisoned() ) @@ -2979,6 +2983,10 @@ bool CChar::TakeOffItem( ItemLayers Layer ) IncStrength2( -itemLayers[Layer]->GetStrength2() ); IncDexterity2( -itemLayers[Layer]->GetDexterity2() ); IncIntelligence2( -itemLayers[Layer]->GetIntelligence2() ); + + IncHealthLeech( -itemLayers[Layer]->GetHealthLeech() ); + IncStaminaLeech( -itemLayers[Layer]->GetStaminaLeech() ); + IncManaLeech( -itemLayers[Layer]->GetManaLeech() ); if( itemLayers[Layer]->GetPoisoned() ) { if( itemLayers[Layer]->GetPoisoned() > GetPoisoned() ) diff --git a/source/cItem.cpp b/source/cItem.cpp index 3c6523d5d..672ece4dd 100644 --- a/source/cItem.cpp +++ b/source/cItem.cpp @@ -1644,6 +1644,9 @@ auto CItem::CopyData( CItem *target ) -> void target->SetStamina( GetStamina() ); target->SetStrength( GetStrength() ); target->SetStrength2( GetStrength2() ); + target->SetHealthLeech( GetHealthLeech() ); + target->SetStaminaLeech( GetStaminaLeech() ); + target->SetManaLeech( GetManaLeech() ); target->SetTitle( GetTitle() ); target->SetType( GetType() ); target->SetBuyValue( GetBuyValue() ); @@ -1739,6 +1742,7 @@ bool CItem::DumpBody( std::ostream &outStream ) const outStream << "Speed=" + std::to_string( GetSpeed() ) + newLine; outStream << "Movable=" + std::to_string( GetMovable() ) + newLine; outStream << "Priv=" + std::to_string( GetPriv() ) + newLine; + outStream << "LeechStats=" + std::to_string( GetHealthLeech() ) + "," + std::to_string( GetStaminaLeech() ) + "," + std::to_string( GetManaLeech() ) + newLine; outStream << "Value=" + std::to_string( GetBuyValue() ) + "," + std::to_string( GetSellValue() ) + "," + std::to_string( GetVendorPrice() ) + newLine; outStream << "Restock=" + std::to_string( GetRestock() ) + newLine; outStream << "AC=" + std::to_string( GetArmourClass() ) + newLine; @@ -1922,6 +1926,13 @@ bool CItem::HandleLine( std::string &UTag, std::string &data ) SetWeatherDamage( LIGHTNING, static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )) == 1 ); rValue = true; } + else if( UTag == "LEECHSTATS" ) + { + SetHealthLeech( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( csecs[0], "//" )), nullptr, 0 ))); + SetStaminaLeech( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( csecs[1], "//" )), nullptr, 0 ))); + SetManaLeech( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( csecs[2], "//" )), nullptr, 0 ))); + rValue = true; + } break; case 'M': if( UTag == "MAXITEMS" ) diff --git a/source/items.cpp b/source/items.cpp index 1cd4a2aaf..a3cec1199 100644 --- a/source/items.cpp +++ b/source/items.cpp @@ -138,6 +138,9 @@ auto ApplyItemSection( CItem *applyTo, CScriptSection *toApply, std::string sect } break; case DFNTAG_AC: applyTo->SetArmourClass( static_cast( ndata )); break; + case DFNTAG_HEALTHLEECH: applyTo->SetHealthLeech( static_cast( ndata )); break; + case DFNTAG_STAMINALEECH: applyTo->SetStaminaLeech( static_cast( ndata )); break; + case DFNTAG_MANALEECH: applyTo->SetManaLeech( static_cast( ndata )); break; case DFNTAG_BASERANGE: applyTo->SetBaseRange( static_cast( ndata )); break; case DFNTAG_CREATOR: applyTo->SetCreator( ndata ); break; case DFNTAG_COLOUR: applyTo->SetColour( static_cast( ndata )); break; diff --git a/source/ssection.cpp b/source/ssection.cpp index c2a563b47..2ed0d8b70 100644 --- a/source/ssection.cpp +++ b/source/ssection.cpp @@ -115,6 +115,7 @@ const UI08 dfnDataTypes[DFNTAG_COUNTOFTAGS] = DFN_NODATA, // DFNTAG_HIRELING, DFN_DOUBLENUMERIC, // DFNTAG_HP, DFN_DOUBLENUMERIC, // DFNTAG_HPMAX, + DFN_NUMERIC, // DFNTAG_HEALTHLEECH, DFN_UPPERSTRING, // DFNTAG_ID, DFN_DOUBLENUMERIC, // DFNTAG_IMBUING, DFN_NUMERIC, // DFNTAG_INTADD, @@ -140,6 +141,7 @@ const UI08 dfnDataTypes[DFNTAG_COUNTOFTAGS] = DFN_DOUBLENUMERIC, // DFNTAG_MAGICRESISTANCE, DFN_DOUBLENUMERIC, // DFNTAG_MANA, DFN_DOUBLENUMERIC, // DFNTAG_MANAMAX, + DFN_NUMERIC, // DFNTAG_MANALEECH, DFN_NUMERIC, // DFNTAG_MAXHP, DFN_NUMERIC, // DFNTAG_MAXITEMS, DFN_NUMERIC, // DFNTAG_MAXLOYALTY, @@ -222,6 +224,7 @@ const UI08 dfnDataTypes[DFNTAG_COUNTOFTAGS] = DFN_NUMERIC, // DFNTAG_SPLITCHANCE, DFN_DOUBLENUMERIC, // DFNTAG_STAMINA, DFN_DOUBLENUMERIC, // DFNTAG_STAMINAMAX, + DFN_NUMERIC, // DFNTAG_STAMINALEECH, DFN_DOUBLENUMERIC, // DFNTAG_STRENGTH, DFN_NUMERIC, // DFNTAG_STRADD, DFN_NUMERIC, // DFNTAG_STEALABLE, @@ -370,6 +373,7 @@ const std::map strToDFNTag {"HIRELING"s, DFNTAG_HIRELING}, {"HP"s, DFNTAG_HP}, {"HPMAX"s, DFNTAG_HPMAX}, + {"HEALTHLEECH"s, DFNTAG_HEALTHLEECH}, {"ID"s, DFNTAG_ID}, {"IMBUING"s, DFNTAG_IMBUING}, {"IN"s, DFNTAG_INTELLIGENCE}, @@ -399,6 +403,7 @@ const std::map strToDFNTag {"MAGICRESISTANCE"s, DFNTAG_MAGICRESISTANCE}, {"MANA"s, DFNTAG_MANA}, {"MANAMAX"s, DFNTAG_MANAMAX}, + {"MANALEECH"s, DFNTAG_MANALEECH}, {"MAXHP"s, DFNTAG_MAXHP}, {"MAXITEMS"s, DFNTAG_MAXITEMS}, {"MAXLOYALTY"s, DFNTAG_MAXLOYALTY}, @@ -483,6 +488,7 @@ const std::map strToDFNTag {"ST"s, DFNTAG_STRENGTH}, {"STAMINA"s, DFNTAG_STAMINA}, {"STAMINAMAX"s, DFNTAG_STAMINAMAX}, + {"STAMINALEECH"s, DFNTAG_STAMINALEECH}, {"STR"s, DFNTAG_STRENGTH}, {"STRENGTH"s, DFNTAG_STRENGTH}, {"ST2"s, DFNTAG_STRADD}, diff --git a/source/ssection.h b/source/ssection.h index a2a660aec..be29b8d36 100644 --- a/source/ssection.h +++ b/source/ssection.h @@ -122,6 +122,7 @@ enum DFNTAGS DFNTAG_HIRELING, DFNTAG_HP, DFNTAG_HPMAX, + DFNTAG_HEALTHLEECH, DFNTAG_ID, DFNTAG_IMBUING, DFNTAG_INTADD, @@ -147,6 +148,7 @@ enum DFNTAGS DFNTAG_MAGICRESISTANCE, DFNTAG_MANA, DFNTAG_MANAMAX, + DFNTAG_MANALEECH, DFNTAG_MAXHP, DFNTAG_MAXITEMS, DFNTAG_MAXLOYALTY, @@ -229,6 +231,7 @@ enum DFNTAGS DFNTAG_SPLITCHANCE, DFNTAG_STAMINA, DFNTAG_STAMINAMAX, + DFNTAG_STAMINALEECH, DFNTAG_STRENGTH, DFNTAG_STRADD, DFNTAG_STEALABLE, From 03c2ba6dc03a5c130d097f25e9356677410e6ccb Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Tue, 18 Jun 2024 18:36:04 -0500 Subject: [PATCH 053/147] changelog --- source/Changelog.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/Changelog.txt b/source/Changelog.txt index f64afbc32..ca3c53f46 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,12 @@ +18/06/2024 - Dragon Slayer + Added three new DFN tags for Items: + HEALTHLEECH=# // It gives an attacker the ability to leech health from his opponent every time he successfully delivers a hit adds it to himself. + STAMINALEECH=# // It gives an attacker the ability to leech Stamina from his opponent every time he successfully delivers a hit adds it to himself. + MANALEECH=# // It gives an attacker the ability to leech Mana from his opponent every time he successfully delivers a hit adds it to himself. + These are also available as JS Engine object properties: .healthLeech, .staminaLeech and .manaLeech + Added leechstats.js file that controls the combat for the properties. (script 7003) + To add this script to a weapon only. add in SCRIPT=7003, HEALTHLEECH=# or STAMINALEECH=# or MANALEECH=# it can also be all three on the weapon. + 1/05/2024 - Dragon Slayer/Xuri Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode. Fixed createfood to check for reagents on cast. From d7417c89ff04edea2ee4b59d2e97ebf7b402e042 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 22 Jun 2024 17:00:04 -0500 Subject: [PATCH 054/147] Update cItem.cpp --- source/cItem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/cItem.cpp b/source/cItem.cpp index eacbfa112..44b28b56f 100644 --- a/source/cItem.cpp +++ b/source/cItem.cpp @@ -2128,7 +2128,7 @@ bool CItem::HandleLine( std::string &UTag, std::string &data ) SetStealable( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 ))); rValue = true; } - else if( UTag == "SWINGSPEEDINCREASE" ) + else if( UTag == "SPEEDINCREASE" ) { SetSwingSpeedIncrease( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 ))); rValue = true; From 6dbb01f1241e93a2770f9abca25cd4cca4ced1c6 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 22 Jun 2024 17:03:16 -0500 Subject: [PATCH 055/147] Update special_moves.js --- data/js/combat/special_moves.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 5f2d006a8..1742e5993 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -385,8 +385,8 @@ function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) damage = RandomNumber( 0, 4 ); // If defender is a player, damage is divided by this modifier from uox.ini - if( !pDefender.npc ) - damage /= GetServerSetting( "NPCDAMAGERATE" ); + if( pAttacker.npc && !pDefender.npc ) + damage /= GetServerSetting( "NPCDAMAGERATE" ); return damage; } From d28b8daf166b51c599972fdf055e0c652b1f9cbd Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 22 Jun 2024 17:53:00 -0500 Subject: [PATCH 056/147] Update leechstats.js --- data/js/combat/leechstats.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/data/js/combat/leechstats.js b/data/js/combat/leechstats.js index 6663958ba..fc1086fdf 100644 --- a/data/js/combat/leechstats.js +++ b/data/js/combat/leechstats.js @@ -31,27 +31,23 @@ function onDamageDeal( attacker, damaged, damageValue, damageType ) function ApplyLeech( attacker, damaged, damageValue, weapon, leechType, multiplier ) { // Get the leech amount for the specified leech type from the weapon - var leechAmount = weapon[ leechType ]; - if( leechAmount > 0 ) - { // Calculate the minimum and maximum leech values - var minLeech = Math.round( damageValue * ( leechAmount / 100 ) * ( multiplier/100 )); - var maxLeech = Math.round( ( ( weapon.speed / 100 ) * 2500 ) / ( 100 + weapon.speedIncrease )); - var leechAmt = RandomNumber( minLeech, maxLeech ); + var leechPercentVal = weapon[ leechType ]; + if( leechPercentVal > 0 ) + { + // Calculate the percent of health restored to the attacker + var leechAmt = Math.round( damageValue * ( leechPercentVal / 100 ) * ( multiplier/100 )); // Apply the leech effect based on the leech type switch( leechType ) { case 'healthLeech': attacker.Heal( leechAmt ); - damaged.health -= leechAmt; break; case 'staminaLeech': attacker.stamina += leechAmt; - damaged.stamina -= leechAmt; break; case 'manaLeech': attacker.mana += leechAmt; - damaged.mana -= leechAmt; break; } From 91dd7b936da0bc58c2037b711ef1f30777f98edb Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Thu, 4 Jul 2024 17:43:22 -0500 Subject: [PATCH 057/147] Cleaver ID added Missing Cleaver ID out of the jse_objectassionations.scp --- data/js/jse_objectassociations.scp | 2 ++ source/Changelog.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/data/js/jse_objectassociations.scp b/data/js/jse_objectassociations.scp index 93f7c41d5..25cce9751 100644 --- a/data/js/jse_objectassociations.scp +++ b/data/js/jse_objectassociations.scp @@ -580,6 +580,8 @@ 0x10a4=15007 // Swords +0x0EC2=5009 //cleaver +0x0EC3=5009 //cleaver 0x0EC4=5009 //skinning knife 0x0EC5=5009 //skinning knife 0x0F60=5009 //longsword diff --git a/source/Changelog.txt b/source/Changelog.txt index f64afbc32..8fa5103ab 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,5 @@ +4/07/2024 - Dragon Slayer + Fixed Cleaver ID missing in the jse_objectassociations.scp or carving corpses 1/05/2024 - Dragon Slayer/Xuri Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode. Fixed createfood to check for reagents on cast. From 11b863f2f89d8032f2ffa1870b947e6675cd7a0b Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 7 Jul 2024 14:21:32 -0500 Subject: [PATCH 058/147] Requried Free Hand Added Requirement to drink potion hand has to be free, This can be disabled within the potion.js file by switching the reqfreehand to false. --- data/dictionaries/dictionary.CSY | 1 + data/dictionaries/dictionary.ENG | 1 + data/dictionaries/dictionary.FRE | 1 + data/dictionaries/dictionary.GER | 1 + data/dictionaries/dictionary.ITA | 1 + data/dictionaries/dictionary.POL | 1 + data/dictionaries/dictionary.PTG | 1 + data/dictionaries/dictionary.SPA | 1 + data/dictionaries/dictionary.ZRO | 1 + data/js/item/potion.js | 13 ++++++++++++- source/Changelog.txt | 3 +++ 11 files changed, 24 insertions(+), 1 deletion(-) diff --git a/data/dictionaries/dictionary.CSY b/data/dictionaries/dictionary.CSY index d19756c34..e88385024 100644 --- a/data/dictionaries/dictionary.CSY +++ b/data/dictionaries/dictionary.CSY @@ -3431,6 +3431,7 @@ 6301=Z této knihy se může učit pouze velmistr alchymista. 6302=Tyto informace jste se již dozvěděli. 6303=Naučili jste se vyrábět předměty ze skla. K výrobě těchto předmětů budete muset najít horníky, kteří budou těžit jemný písek. +6304=Musíte mít volnou ruku, abyste mohli pít lektvar. // [7000-7499] AI Scripts 7000=Jsi zločinec a nemáš přístup ke své bankovní schránce. 7001=Který předmět si přeješ uložit do své bankovní schránky? diff --git a/data/dictionaries/dictionary.ENG b/data/dictionaries/dictionary.ENG index c3dc18d54..89e08c4fc 100644 --- a/data/dictionaries/dictionary.ENG +++ b/data/dictionaries/dictionary.ENG @@ -3431,6 +3431,7 @@ 6301=Only a Grandmaster Alchemist can learn from this book. 6302=You have already learned this information. 6303=You have learned to make items from glass. You will need to find miners to mine fine sand for you to make these items. +6304=You must have a free hand to drink a potion. // [7000-7499] AI Scripts 7000=Thou art a criminal and cannot access thy bank box. 7001=Which item do you wish to deposit in your bank box? diff --git a/data/dictionaries/dictionary.FRE b/data/dictionaries/dictionary.FRE index 9465437b6..c76cb9ff6 100644 --- a/data/dictionaries/dictionary.FRE +++ b/data/dictionaries/dictionary.FRE @@ -3595,6 +3595,7 @@ 6301=Seul un grand maître alchimiste peut apprendre de ce livre. 6302=Vous avez déjà appris cette information. 6303=Vous avez appris à fabriquer des objets en verre. Vous devrez trouver des mineurs pour extraire du sable fin pour fabriquer ces objets. +6304=Vous devez avoir les mains libres pour boire une potion. // [7000-7499] AI Scripts 7000=Tu es un criminel et tu ne peux pas accéder à ton coffre de banque. 7001=Quel objet souhaitez-vous déposer dans votre coffret bancaire ? diff --git a/data/dictionaries/dictionary.GER b/data/dictionaries/dictionary.GER index 2376f9a36..3bbec8e76 100644 --- a/data/dictionaries/dictionary.GER +++ b/data/dictionaries/dictionary.GER @@ -3431,6 +3431,7 @@ 6301=Nur ein Großmeister-Alchemist kann aus diesem Buch lernen. 6302=Sie haben diese Informationen bereits erfahren. 6303=Du hast gelernt, Gegenstände aus Glas herzustellen. Sie müssen Bergleute finden, die feinen Sand abbauen, damit Sie diese Gegenstände herstellen können. +6304=Sie müssen freie Hand haben, um einen Trank zu trinken. // [7000-7499] AI Scripts 7000=Du bist ein Verbrecher und kannst nicht auf dein Bankschließfach zugreifen. 7001=Welchen Gegenstand möchten Sie in Ihr Bankschließfach einzahlen? diff --git a/data/dictionaries/dictionary.ITA b/data/dictionaries/dictionary.ITA index 882528064..9b354469d 100644 --- a/data/dictionaries/dictionary.ITA +++ b/data/dictionaries/dictionary.ITA @@ -3431,6 +3431,7 @@ 6301=Solo un Grande Maestro Alchimista può imparare da questo libro. 6302=Hai già appreso questa informazione. 6303=Hai imparato a creare oggetti in vetro. Dovrai trovare minatori che estraggano sabbia fine per poter realizzare questi oggetti. +6304=Devi avere una mano libera per bere una pozione. // [7000-7499] AI Scripts 7000=Tu sei un criminale e non puoi accedere alla tua cassaforte. 7001=Quale oggetto desidera depositare nella sua cassetta di sicurezza? diff --git a/data/dictionaries/dictionary.POL b/data/dictionaries/dictionary.POL index 144ca3bbf..7f920c33f 100644 --- a/data/dictionaries/dictionary.POL +++ b/data/dictionaries/dictionary.POL @@ -3431,6 +3431,7 @@ 6301=Tylko Wielki Mistrz Alchemik może uczyć się z tej książki. 6302=Te informacje już znasz. 6303=Nauczyłeś się robić przedmioty ze szkła. Będziesz musiał znaleźć górników, którzy wydobędą drobny piasek, aby móc wyprodukować te przedmioty. +6304=Musisz mieć wolną rękę, żeby wypić miksturę. // [7000-7499] AI Scripts 7000=Jesteś przestępcą i nie masz dostępu do swojej skrytki bankowej. 7001=Którą pozycję chcesz umieścić w swojej skrytce bankowej? diff --git a/data/dictionaries/dictionary.PTG b/data/dictionaries/dictionary.PTG index 416dcad46..0c550f077 100644 --- a/data/dictionaries/dictionary.PTG +++ b/data/dictionaries/dictionary.PTG @@ -3431,6 +3431,7 @@ 6301=Apenas um Grão-Mestre Alquimista pode aprender com este livro. 6302=Você já aprendeu esta informação. 6303=Você aprendeu a fazer itens de vidro. Você precisará encontrar mineiros para extrair areia fina para fazer esses itens. +6304=Você deve ter a mão livre para beber uma poção. // [7000-7499] AI Scripts 7000=Tu és um criminoso e não podes aceder à tua caixa bancária. 7001=Que artigo deseja depositar na sua caixa bancária? diff --git a/data/dictionaries/dictionary.SPA b/data/dictionaries/dictionary.SPA index aa5807812..488b7e7e2 100644 --- a/data/dictionaries/dictionary.SPA +++ b/data/dictionaries/dictionary.SPA @@ -3431,6 +3431,7 @@ 6301=Sólo un Gran Maestro Alquimista puede aprender de este libro. 6302=Ya has aprendido esta información. 6303=Has aprendido a fabricar objetos de vidrio. Necesitará encontrar mineros que extraigan arena fina para poder fabricar estos artículos. +6304=Debes tener las manos libres para beber una poción. // [7000-7499] Guiones de IA 7000=Eres un delincuente y no puedes acceder a tu caja bancaria. 7001=¿Qué artículo desea depositar en su caja? diff --git a/data/dictionaries/dictionary.ZRO b/data/dictionaries/dictionary.ZRO index 5792f2860..b6eb4041c 100644 --- a/data/dictionaries/dictionary.ZRO +++ b/data/dictionaries/dictionary.ZRO @@ -3426,6 +3426,7 @@ 6301=Only a Grandmaster Alchemist can learn from this book. 6302=You have already learned this information. 6303=You have learned to make items from glass. You will need to find miners to mine fine sand for you to make these items. +6304=You must have a free hand to drink a potion. // [7000-7499] AI Scripts 7000=Thou art a criminal and cannot access thy bank box. 7001=Which item do you wish to deposit in your bank box? diff --git a/data/js/item/potion.js b/data/js/item/potion.js index d92697cfb..efbda987e 100644 --- a/data/js/item/potion.js +++ b/data/js/item/potion.js @@ -6,14 +6,25 @@ const alchemyBonusModifier = parseInt( GetServerSetting( "AlchemyBonusModifier" // Other settings const randomizePotionCountdown = false; // If true, add/remove +1/-1 seconds to explosion potion countdowns +const ReqFreeHands = true; function onUseChecked( pUser, iUsed ) { var socket = pUser.socket; - if ( pUser.visible == 1 || pUser.visible == 2 ) + var itemRHand = pUser.FindItemLayer( 0x01 ); + var itemLHand = pUser.FindItemLayer( 0x02 ); + + if( ReqFreeHands && ( itemRHand != null || itemLHand != null ) ) + { + socket.SysMessage( GetDictionaryEntry( 6304, socket.language ) );// You must have a free hand to drink a potion. + return false; + } + + if( pUser.visible == 1 || pUser.visible == 2 ) { pUser.visible = 0; } + if( socket && iUsed && iUsed.isItem ) { if( pUser.isUsingPotion ) diff --git a/source/Changelog.txt b/source/Changelog.txt index f64afbc32..01d3b26f8 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,6 @@ +7/07/2024 - Dragon Slayer + Added Required Free Hand (js potion). + 1/05/2024 - Dragon Slayer/Xuri Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode. Fixed createfood to check for reagents on cast. From 405780398614aad5b3e63924c9a07761bbe5639c Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Tue, 16 Jul 2024 19:23:06 -0500 Subject: [PATCH 059/147] Gumps.cpp Fallback for older clients that don't support buttontileart --- source/Changelog.txt | 3 +++ source/gumps.cpp | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/source/Changelog.txt b/source/Changelog.txt index f64afbc32..681511311 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,6 @@ +16/07/2024 - Xuri + Fixed Fallback for older clients that don't support buttontileart (gumps.cpp) + 1/05/2024 - Dragon Slayer/Xuri Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode. Fixed createfood to check for reagents on cast. diff --git a/source/gumps.cpp b/source/gumps.cpp index c655634d2..68d8ca7a3 100644 --- a/source/gumps.cpp +++ b/source/gumps.cpp @@ -669,10 +669,21 @@ void BuildAddMenuGump( CSocket *s, UI16 m ) if( tag.data()[0] != '<' && tag.data()[0] != ' ' ) // it actually has a picture, well bugger me! :> { // Draw a frame for the item to make it stand out a touch more. - toSend.addCommand( oldstrutil::format( "checkertrans %u %u %u %u", xOffset + 7, yOffset + 9, 110, 110 )); - toSend.addCommand( oldstrutil::format( "buttontileart %u %u 0x0a9f 0x0aa1 %u %u %u %u %u %u %u", xOffset, yOffset, 1, 0, buttonnum, std::stoi( tag, nullptr, 0 ), 0, 25, 25 )); - toSend.addCommand( oldstrutil::format( "tooltip 1042971 @%s@", data.c_str() )); - toSend.addCommand( oldstrutil::format( "croppedtext %u %u %u %u %u %u", xOffset + 15, yOffset + 85, 100, 20, 50, linenum++ )); + if( s->ClientVerShort() <= CVS_6000 ) + { + // Fallback for older clients that don't support buttontileart + toSend.addCommand( oldstrutil::format("resizepic %u %u %u %u %u", xOffset, yOffset, 0x53, 65, 100 )); + toSend.addCommand( oldstrutil::format("checkertrans %u %u %u %u", xOffset + 7, yOffset + 9, 52, 82 )); + toSend.addCommand( oldstrutil::format("tilepic %u %u %i", xOffset + 5, yOffset + 10, std::stoi(tag, nullptr, 0) )); + toSend.addCommand( oldstrutil::format("croppedtext %u %u %u %u %u %u", xOffset, yOffset + 65, 65, 20, 55, linenum++ )); + } + else + { + toSend.addCommand( oldstrutil::format( "checkertrans %u %u %u %u", xOffset + 7, yOffset + 9, 110, 110 )); + toSend.addCommand( oldstrutil::format( "buttontileart %u %u 0x0a9f 0x0aa1 %u %u %u %u %u %u %u", xOffset, yOffset, 1, 0, buttonnum, std::stoi( tag, nullptr, 0 ), 0, 25, 25 )); + toSend.addCommand( oldstrutil::format( "tooltip 1042971 @%s@", data.c_str() )); + toSend.addCommand( oldstrutil::format( "croppedtext %u %u %u %u %u %u", xOffset + 15, yOffset + 85, 100, 20, 50, linenum++ )); + } toSend.addText( data ); xOffset += XOFFSET; if( xOffset > 640 ) From 35bbb0a6886ab8a92a09f7401549f4dbdd6454ea Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 27 Jul 2024 12:14:42 -0500 Subject: [PATCH 060/147] Update gumps.cpp --- source/gumps.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/gumps.cpp b/source/gumps.cpp index 68d8ca7a3..2218a6828 100644 --- a/source/gumps.cpp +++ b/source/gumps.cpp @@ -669,7 +669,7 @@ void BuildAddMenuGump( CSocket *s, UI16 m ) if( tag.data()[0] != '<' && tag.data()[0] != ' ' ) // it actually has a picture, well bugger me! :> { // Draw a frame for the item to make it stand out a touch more. - if( s->ClientVerShort() <= CVS_6000 ) + if( s->ClientVerShort() <= CVS_70160 ) { // Fallback for older clients that don't support buttontileart toSend.addCommand( oldstrutil::format("resizepic %u %u %u %u %u", xOffset, yOffset, 0x53, 65, 100 )); From 8b11fa7eed93b2627e19ba10dbc1fbc039a6a113 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 4 Aug 2024 18:45:55 -0500 Subject: [PATCH 061/147] skillcheck magery Added Run a skillcheck for NPC to give them a chance to gain skill - if that option is enabled in ini (xuri) --- source/Changelog.txt | 3 +++ source/magic.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/source/Changelog.txt b/source/Changelog.txt index f64afbc32..3da6c65ac 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,6 @@ +4/8/2024 - Dragon Slayer + Added Run a skillcheck for NPC to give them a chance to gain skill - if that option is enabled in ini (xuri) + 1/05/2024 - Dragon Slayer/Xuri Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode. Fixed createfood to check for reagents on cast. diff --git a/source/magic.cpp b/source/magic.cpp index d04ab3f97..11918c522 100644 --- a/source/magic.cpp +++ b/source/magic.cpp @@ -4499,6 +4499,11 @@ void CMagic::CastSpell( CSocket *s, CChar *caster ) caster->StopSpell(); return; } + else if( caster->IsNpc() ) + { + // Run a skillcheck for NPC to give them a chance to gain skill - if that option is enabled in ini + Skills->CheckSkill( caster, MAGERY, lowSkill, highSkill ); + } if( curSpell > 63 && static_cast(curSpell) <= spellCount && spellCount <= 70 ) { From 1e038b1b9b4ab04cbf600a5687ffdb34be543ea8 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 5 Aug 2024 10:46:27 -0500 Subject: [PATCH 062/147] target fix --- data/js/magic/level1targ.js | 1 + 1 file changed, 1 insertion(+) diff --git a/data/js/magic/level1targ.js b/data/js/magic/level1targ.js index a79f92a3c..d8dabced1 100644 --- a/data/js/magic/level1targ.js +++ b/data/js/magic/level1targ.js @@ -95,6 +95,7 @@ function ItemInHandCheck( mChar, mSock, spellType ) } } } + return true; } function onSpellCast( mSock, mChar, directCast, spellNum ) From 96bda4af3f29489e26e768b757ec2e6dc562dfc8 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:29:52 -0500 Subject: [PATCH 063/147] Fixes cooking Fixes duped dictonary number fixed corrected items needed for sweet dough and dough --- data/dictionaries/dictionary.CSY | 2 +- data/dictionaries/dictionary.ENG | 2 +- data/dictionaries/dictionary.FRE | 2 +- data/dictionaries/dictionary.GER | 2 +- data/dictionaries/dictionary.ITA | 2 +- data/dictionaries/dictionary.POL | 2 +- data/dictionaries/dictionary.PTG | 2 +- data/dictionaries/dictionary.SPA | 2 +- data/dictionaries/dictionary.ZRO | 2 +- data/js/skill/craft/cooking.js | 2 +- data/js/skill/craft/itemdetailgump.js | 4 ++-- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/data/dictionaries/dictionary.CSY b/data/dictionaries/dictionary.CSY index d19756c34..c73b6389a 100644 --- a/data/dictionaries/dictionary.CSY +++ b/data/dictionaries/dictionary.CSY @@ -4679,7 +4679,6 @@ 11619=chlebový bochník 11620=pánev sušenek 11621=koláč -11622=muffiny 11622=pečený quiche 11623=pečený masový koláč 11624=pizza s uzeninou @@ -4715,6 +4714,7 @@ 11654=Pro přípravu jídla musíte být v blízkosti zdroje tepla. 11655=Musíte být v blízkosti mlýna, abyste mohli vyrábět mouku. 11656=Musíte být v blízkosti pece, abyste mohli péct jídlo. +11657=muffiny // 11801 - 12000 Dovednost řemeslné výroby // Strana 1 - Dřevěné předměty 11801=Náprava diff --git a/data/dictionaries/dictionary.ENG b/data/dictionaries/dictionary.ENG index c3dc18d54..727ceb1b6 100644 --- a/data/dictionaries/dictionary.ENG +++ b/data/dictionaries/dictionary.ENG @@ -4679,7 +4679,6 @@ 11619=bread loaf 11620=pan of cookies 11621=cake -11622=muffins 11622=baked quiche 11623=baked meat pie 11624=sausage pizza @@ -4715,6 +4714,7 @@ 11654=You must be near a heat source to cook food. 11655=You must be near a mill to create flour. 11656=You must be near an oven to bake food. +11657=muffins // 11801 - 12000 Tinkering Crafting Skill // Page 1 - Wooden Items 11801=Axle diff --git a/data/dictionaries/dictionary.FRE b/data/dictionaries/dictionary.FRE index 9465437b6..0ff49ad3e 100644 --- a/data/dictionaries/dictionary.FRE +++ b/data/dictionaries/dictionary.FRE @@ -4835,7 +4835,6 @@ 11619=miche de pain 11620=panier de biscuits 11621=gâteau -11622=muffins 11622=quiche au four 11623=tarte à la viande cuite au four 11624=pizza à la saucisse @@ -4871,6 +4870,7 @@ 11654=Il faut être près d'une source de chaleur pour cuire les aliments. 11655=Il faut être près d'un moulin pour créer de la farine. 11656=Il faut être près d'un four pour cuire des aliments. +11657=muffins // 11801 - 12000 Compétence en artisanat de bricolage // Page 1 - Objets en bois 11801=Axe diff --git a/data/dictionaries/dictionary.GER b/data/dictionaries/dictionary.GER index 2376f9a36..4bd6e227e 100644 --- a/data/dictionaries/dictionary.GER +++ b/data/dictionaries/dictionary.GER @@ -4679,7 +4679,6 @@ 11619=Brotlaib 11620=Keksdose 11621=Kuchen -11622=Muffins 11622=gebackene Quiche 11623=gebackene Fleischpastete 11624=Wurstpizza @@ -4715,6 +4714,7 @@ 11654=Du musst in der Nähe einer Wärmequelle sein, um Essen zu kochen. 11655=Du musst in der Nähe einer Mühle sein, um Mehl herzustellen. 11656=Du musst in der Nähe eines Ofens sein, um Essen zu backen. +11657=Muffins // 11801 - 12000 Handwerkliches Geschick // Seite 1 - Hölzerne Gegenstände 11801=Achse diff --git a/data/dictionaries/dictionary.ITA b/data/dictionaries/dictionary.ITA index 882528064..3e731fe9f 100644 --- a/data/dictionaries/dictionary.ITA +++ b/data/dictionaries/dictionary.ITA @@ -4679,7 +4679,6 @@ 11619=pagnotta di pane 11620=torta di biscotti 11621=torta -11622=muffin 11622=quiche al forno 11623=pasticcio di carne al forno 11624=pizza con salsiccia @@ -4715,6 +4714,7 @@ 11654=Devi essere vicino a una fonte di calore per cucinare il cibo. 11655=Devi essere vicino a un mulino per creare farina. 11656=Devi essere vicino a un forno per cuocere il cibo. +11657=muffin // 11801 - 12000 Abilità Artigianato Tinkering // Pagina 1 - Oggetti in legno 11801=Assale diff --git a/data/dictionaries/dictionary.POL b/data/dictionaries/dictionary.POL index 144ca3bbf..377632cee 100644 --- a/data/dictionaries/dictionary.POL +++ b/data/dictionaries/dictionary.POL @@ -4679,7 +4679,6 @@ 11619=bochenek chleba 11620=panka ciasteczek 11621=ciasto -11622=muffiny 11622=pieczony quiche 11623=pieczony placek z mięsem 11624=pizza z kiełbasą @@ -4715,6 +4714,7 @@ 11654=Musisz być w pobliżu źródła ciepła, aby gotować jedzenie. 11655=Musisz być w pobliżu młyna, aby wytworzyć mąkę. 11656=Musisz być w pobliżu piekarnika, aby upiec jedzenie. +11657=muffiny // 11801 - 12000 Umiejętność majsterkowania // Strona 1 - Przedmioty z drewna 11801=Oś diff --git a/data/dictionaries/dictionary.PTG b/data/dictionaries/dictionary.PTG index 416dcad46..07e6b7efc 100644 --- a/data/dictionaries/dictionary.PTG +++ b/data/dictionaries/dictionary.PTG @@ -4679,7 +4679,6 @@ 11619=pão de pão 11620=panha de biscoitos 11621=bolo -11622=muffins 11622=quiché cozido 11623=torta de carne assada 11624=sausage pizza @@ -4715,6 +4714,7 @@ 11654=É preciso estar perto de uma fonte de calor para cozinhar os alimentos. 11655=Tem de estar perto de um moinho para criar farinha. 11656=Tem de estar perto de um forno para cozer alimentos. +11657=muffins // 11801 - 12000 Habilidade de Artesanato de Sininho // Página 1 - Artigos de madeira 11801=Eixo diff --git a/data/dictionaries/dictionary.SPA b/data/dictionaries/dictionary.SPA index aa5807812..5aabd7d66 100644 --- a/data/dictionaries/dictionary.SPA +++ b/data/dictionaries/dictionary.SPA @@ -4679,7 +4679,6 @@ 11619=pan de pan 11620=pan de galletas 11621=pastel -11622=magdalenas 11622=quiche al horno 11623=pastel de carne al horno 11624=pizza de salchicha @@ -4715,6 +4714,7 @@ 11654=Debes estar cerca de una fuente de calor para cocinar los alimentos. 11655=Debes estar cerca de un molino para crear harina. 11656=Debes estar cerca de un horno para cocer alimentos. +11657=magdalenas // 11801 - 12000 Habilidad de Artesanía // Página 1 - Artículos de madera 11801=Eje diff --git a/data/dictionaries/dictionary.ZRO b/data/dictionaries/dictionary.ZRO index 5792f2860..33e71a7de 100644 --- a/data/dictionaries/dictionary.ZRO +++ b/data/dictionaries/dictionary.ZRO @@ -4674,7 +4674,6 @@ 11619=bread loaf 11620=pan of cookies 11621=cake -11622=muffins 11622=baked quiche 11623=baked meat pie 11624=sausage pizza @@ -4710,6 +4709,7 @@ 11654=You must be near a heat source to cook food. 11655=You must be near a mill to create flour. 11656=You must be near an oven to bake food. +11657=muffins // 11801 - 12000 Tinkering Crafting Skill // Page 1 - Wooden Items 11801=Axle diff --git a/data/js/skill/craft/cooking.js b/data/js/skill/craft/cooking.js index 654533e8a..1ce12dd8f 100644 --- a/data/js/skill/craft/cooking.js +++ b/data/js/skill/craft/cooking.js @@ -21,7 +21,7 @@ const myPage = [ [ 11611, 11612, 11613, 11614, 11615, 11616, 11617, 11618 ], // Page 3 - Baking - [ 11619, 11620, 11621, 11622, 11623, 11624, 11625, 11626, 11627, 11628, 11629 ], + [11619, 11620, 11621, 11657, 11622, 11623, 11624, 11625, 11626, 11627, 11628, 11629 ], // Page 4 - Barbecue [ 11630, 11631, 11632, 11633, 11634, 11635 ] diff --git a/data/js/skill/craft/itemdetailgump.js b/data/js/skill/craft/itemdetailgump.js index 0f4e1ad20..7ddbe18ee 100644 --- a/data/js/skill/craft/itemdetailgump.js +++ b/data/js/skill/craft/itemdetailgump.js @@ -1525,12 +1525,12 @@ function ItemDetailGump( pUser ) break; case 1501: // Dough createEntry = CreateEntries[1501]; - HARVEST = [11637, 11639]; + HARVEST = [11637, 11638]; mainSkill = parseInt( pUser.skills.cooking ); break; case 1502: // Sweet Dough createEntry = CreateEntries[1502]; - HARVEST = [11607, 11638]; + HARVEST = [11607, 11639]; mainSkill = parseInt( pUser.skills.cooking ); break; case 1503: // Cake Mix From 36f2478be16865ac82b8b62bf88028cb17babaf3 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:01:56 -0500 Subject: [PATCH 064/147] Flipped Imbuing and Mysticism Skill --- data/dfndata/skills/skills.dfn | 8 ++++---- source/Changelog.txt | 2 ++ source/UOXJSPropertySpecs.h | 2 +- source/enums.h | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/data/dfndata/skills/skills.dfn b/data/dfndata/skills/skills.dfn index b28b32a15..28d129929 100644 --- a/data/dfndata/skills/skills.dfn +++ b/data/dfndata/skills/skills.dfn @@ -1206,10 +1206,10 @@ SKILLPOINT=990,5,0 SKILLPOINT=1000,0,0 } -// Imbuing +// Mysticism [SKILL 55] { -NAME=IMBUING +NAME=MYSTICISM STR=0 DEX=0 INT=0 @@ -1227,10 +1227,10 @@ SKILLPOINT=990,5,0 SKILLPOINT=1000,0,0 } -// Mysticism +// Imbuing [SKILL 56] { -NAME=MYSTICISM +NAME=IMBUING STR=0 DEX=0 INT=0 diff --git a/source/Changelog.txt b/source/Changelog.txt index f64afbc32..246193482 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,5 @@ +12/08/2024 - Dragon Slayer + Flipped Imbuing and Mysticism Skill around. 1/05/2024 - Dragon Slayer/Xuri Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode. Fixed createfood to check for reagents on cast. diff --git a/source/UOXJSPropertySpecs.h b/source/UOXJSPropertySpecs.h index 3149dc0ec..8a8ecbc47 100644 --- a/source/UOXJSPropertySpecs.h +++ b/source/UOXJSPropertySpecs.h @@ -675,8 +675,8 @@ inline JSPropertySpec CSkillsProps[] = { "bushido", BUSHIDO, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "ninjitsu", NINJITSU, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "spellweaving", SPELLWEAVING, JSPROP_ENUMANDPERM, nullptr, nullptr }, - { "imbuing", IMBUING, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "mysticism", MYSTICISM, JSPROP_ENUMANDPERM, nullptr, nullptr }, + { "imbuing", IMBUING, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "throwing", THROWING, JSPROP_ENUMANDPERM, nullptr, nullptr }, { "allskills", ALLSKILLS, JSPROP_ENUMANDPERM, nullptr, nullptr }, { nullptr, static_cast(0), static_cast(0), nullptr, nullptr } diff --git a/source/enums.h b/source/enums.h index 75e8786ae..cbfe20548 100644 --- a/source/enums.h +++ b/source/enums.h @@ -373,8 +373,8 @@ enum Skills BUSHIDO, NINJITSU, SPELLWEAVING, - IMBUING, MYSTICISM, + IMBUING, THROWING, ALLSKILLS, // #skills+1 From 5cd9eb9e2771c51f26afe0ad1541154c6c2c21f1 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Tue, 13 Aug 2024 20:15:28 -0500 Subject: [PATCH 065/147] onAttack/onDefend Updated --- .../js/item/equip_effects/weapon_abilities.js | 2 +- data/js/item/magic_weapon_spell_attack.js | 2 +- data/js/npc/ai/monster/ethereal_warrior.js | 2 +- data/js/npc/ai/monster/orc_chopper.js | 2 +- data/js/npc/special/bola_ability.js | 2 +- data/js/npc/special/colossal_blow.js | 2 +- data/js/npc/speech/speech_monster.js | 2 +- source/Changelog.txt | 2 + source/cScript.cpp | 80 ++++++++++--------- source/cScript.h | 4 +- source/combat.cpp | 23 +++++- 11 files changed, 75 insertions(+), 48 deletions(-) diff --git a/data/js/item/equip_effects/weapon_abilities.js b/data/js/item/equip_effects/weapon_abilities.js index 2c18c180c..18f71375a 100644 --- a/data/js/item/equip_effects/weapon_abilities.js +++ b/data/js/item/equip_effects/weapon_abilities.js @@ -14,7 +14,7 @@ function onUnequip( pUnequipper, iUnequipped ) pUnequipper.RemoveScriptTrigger( 5050 ); } -function onAttack( pAttacker, pDefender ) +function onAttack( pAttacker, pDefender, hitStatus, hitLoc, damageDealt ) { const coreShardEra = GetServerSetting( "CoreShardEra" ); var weaponType = TriggerEvent( 2500, "GetWeaponType", pAttacker, null ); diff --git a/data/js/item/magic_weapon_spell_attack.js b/data/js/item/magic_weapon_spell_attack.js index 26abc0be9..ace1dfa4d 100644 --- a/data/js/item/magic_weapon_spell_attack.js +++ b/data/js/item/magic_weapon_spell_attack.js @@ -7,7 +7,7 @@ const scriptID = 3305; // spells.dfn const useAttackerMagerySkill = false; -function onAttack( mAttacker, mDefender ) +function onAttack( mAttacker, mDefender, hitStatus, hitLoc, damageDealt ) { // Fetch weapon in main hand var iWeapon = mAttacker.FindItemLayer( 0x01 ); diff --git a/data/js/npc/ai/monster/ethereal_warrior.js b/data/js/npc/ai/monster/ethereal_warrior.js index fca76d2aa..e0c03e32c 100644 --- a/data/js/npc/ai/monster/ethereal_warrior.js +++ b/data/js/npc/ai/monster/ethereal_warrior.js @@ -114,7 +114,7 @@ function SearchForWounded( srcChar, trgChar, pSock ) } // Handle draining of health, stamina and mana on attack -function onAttack( pAttacker, pDefender ) +function onAttack( pAttacker, pDefender, hitStatus, hitLoc, damageDealt ) { if( !ValidateObject( pDefender )) return; diff --git a/data/js/npc/ai/monster/orc_chopper.js b/data/js/npc/ai/monster/orc_chopper.js index eb28a9ab4..003e5fb87 100644 --- a/data/js/npc/ai/monster/orc_chopper.js +++ b/data/js/npc/ai/monster/orc_chopper.js @@ -1,6 +1,6 @@ // Hits all nearby characters when they attack with their axe -function onAttack( pAttacker, pDefender ) +function onAttack( pAttacker, pDefender, hitStatus, hitLoc, damageDealt ) { pAttacker.SetTempTag( "pDefenderSerial", ( pDefender.serial ).toString() ); AreaCharacterFunction( "HitNearbyTargets", pAttacker, 1 ); diff --git a/data/js/npc/special/bola_ability.js b/data/js/npc/special/bola_ability.js index 2736e2314..39c0691e2 100644 --- a/data/js/npc/special/bola_ability.js +++ b/data/js/npc/special/bola_ability.js @@ -1,5 +1,5 @@ // Allows NPC to swing a bola and dismount a mounted player/character -function onAttack( pAttacker, pDefender ) +function onAttack( pAttacker, pDefender, hitStatus, hitLoc, damageDealt ) { // Don't swing bola if attacker is invalid or dead if( !ValidateObject( pAttacker ) || pAttacker.dead ) diff --git a/data/js/npc/special/colossal_blow.js b/data/js/npc/special/colossal_blow.js index 35a50d327..2ab24df59 100644 --- a/data/js/npc/special/colossal_blow.js +++ b/data/js/npc/special/colossal_blow.js @@ -1,5 +1,5 @@ // Handle Colossal Blow special ability - a stunning attack that applies a peacemaking effect -function onAttack( pAttacker, pDefender ) +function onAttack( pAttacker, pDefender, hitStatus, hitLoc, damageDealt ) { // Don't perform scolossal blow if attacker is invalid or dead if( !ValidateObject( pAttacker ) || pAttacker.dead ) diff --git a/data/js/npc/speech/speech_monster.js b/data/js/npc/speech/speech_monster.js index 016cc59a2..78c72c080 100644 --- a/data/js/npc/speech/speech_monster.js +++ b/data/js/npc/speech/speech_monster.js @@ -152,7 +152,7 @@ function searchForPlayers( srcChar, trgChar, pSock ) } // Triggers when NPC attacks -function onAttack( pAttacker, pDefender ) +function onAttack( pAttacker, pDefender, hitStatus, hitLoc, damageDealt ) { // Random chance to speak when killing someone if( ValidateObject( pDefender ) && pDefender.dead ) diff --git a/source/Changelog.txt b/source/Changelog.txt index 246193482..e8a07e449 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,5 @@ +13/08/2024 - Dragon Slayer/Xuri + The onAttack/onDefend JS Events have been updated with three new parameters (hitStatus, hitLocation, damage) and will now also trigger when attacks miss. 12/08/2024 - Dragon Slayer Flipped Imbuing and Mysticism Skill around. 1/05/2024 - Dragon Slayer/Xuri diff --git a/source/cScript.cpp b/source/cScript.cpp index 88ef1a0e6..456dce5d3 100644 --- a/source/cScript.cpp +++ b/source/cScript.cpp @@ -972,60 +972,66 @@ std::string cScript::OnNameRequest( CBaseObject *myObj, CChar *nameRequester, UI } //o------------------------------------------------------------------------------------------------o -//| Function - cScript::OnAttack() +//| Function - cScript::OnAttack() //o------------------------------------------------------------------------------------------------o -//| Purpose - Triggers for character with event attached when attacking someone -//| Will also trigger the onDefense event for the character being attacked +//| Purpose - Triggers for character with event attached when attacking someone +//| Will also trigger the onDefense event for the character being attacked //o------------------------------------------------------------------------------------------------o -bool cScript::OnAttack( CChar *attacker, CChar *defender ) +bool cScript::OnAttack( CChar *attacker, CChar *defender, bool hitStatus, SI08 hitLoc, UI16 damageDealt ) { - if( !ValidateObject( attacker ) || !ValidateObject( defender )) - return false; + if( !ValidateObject( attacker ) || !ValidateObject( defender )) + return false; - if( !ExistAndVerify( seOnAttack, "onAttack" )) - return false; + if( !ExistAndVerify( seOnAttack, "onAttack" )) + return false; - jsval rval, params[2]; - JSObject *attObj = JSEngine->AcquireObject( IUE_CHAR, attacker, runTime ); - JSObject *defObj = JSEngine->AcquireObject( IUE_CHAR, defender, runTime ); + jsval rval, params[5]; + JSObject *attObj = JSEngine->AcquireObject( IUE_CHAR, attacker, runTime ); + JSObject *defObj = JSEngine->AcquireObject( IUE_CHAR, defender, runTime ); - params[0] = OBJECT_TO_JSVAL( attObj ); - params[1] = OBJECT_TO_JSVAL( defObj ); - JSBool retVal = JS_CallFunctionName( targContext, targObject, "onAttack", 2, params, &rval ); - if( retVal == JS_FALSE ) - { - SetEventExists( seOnAttack, false ); - } + params[0] = OBJECT_TO_JSVAL( attObj ); + params[1] = OBJECT_TO_JSVAL( defObj ); + params[2] = BOOLEAN_TO_JSVAL( hitStatus ); + params[3] = INT_TO_JSVAL( hitLoc ); + params[4] = INT_TO_JSVAL( damageDealt ); + JSBool retVal = JS_CallFunctionName( targContext, targObject, "onAttack", 5, params, &rval ); + if( retVal == JS_FALSE ) + { + SetEventExists( seOnAttack, false ); + } - return ( retVal == JS_TRUE ); + return ( retVal == JS_TRUE ); } //o------------------------------------------------------------------------------------------------o -//| Function - cScript::OnDefense() +//| Function - cScript::OnDefense() //o------------------------------------------------------------------------------------------------o -//| Purpose - Triggers for character with event attached when being attacked +//| Purpose - Triggers for character with event attached when being attacked //o------------------------------------------------------------------------------------------------o -bool cScript::OnDefense( CChar *attacker, CChar *defender ) +bool cScript::OnDefense( CChar *attacker, CChar *defender, bool hitStatus, SI08 hitLoc, UI16 damageReceived ) { - if( !ValidateObject( attacker ) || !ValidateObject( defender )) - return false; + if( !ValidateObject( attacker ) || !ValidateObject( defender )) + return false; - if( !ExistAndVerify( seOnDefense, "onDefense" )) - return false; + if( !ExistAndVerify( seOnDefense, "onDefense" )) + return false; - jsval rval, params[2]; - JSObject *attObj = JSEngine->AcquireObject( IUE_CHAR, attacker, runTime ); - JSObject *defObj = JSEngine->AcquireObject( IUE_CHAR, defender, runTime ); + jsval rval, params[5]; + JSObject *attObj = JSEngine->AcquireObject( IUE_CHAR, attacker, runTime ); + JSObject *defObj = JSEngine->AcquireObject( IUE_CHAR, defender, runTime ); - params[0] = OBJECT_TO_JSVAL( attObj ); - params[1] = OBJECT_TO_JSVAL( defObj ); - JSBool retVal = JS_CallFunctionName( targContext, targObject, "onDefense", 2, params, &rval ); - if( retVal == JS_FALSE ) - { - SetEventExists( seOnDefense, false ); - } + params[0] = OBJECT_TO_JSVAL( attObj ); + params[1] = OBJECT_TO_JSVAL( defObj ); + params[2] = BOOLEAN_TO_JSVAL( hitStatus ); + params[3] = INT_TO_JSVAL( hitLoc ); + params[4] = INT_TO_JSVAL( damageReceived ); + JSBool retVal = JS_CallFunctionName( targContext, targObject, "onDefense", 5, params, &rval ); + if( retVal == JS_FALSE ) + { + SetEventExists( seOnDefense, false ); + } - return ( retVal == JS_TRUE ); + return ( retVal == JS_TRUE ); } //o------------------------------------------------------------------------------------------------o diff --git a/source/cScript.h b/source/cScript.h index f98e13c70..b36053234 100644 --- a/source/cScript.h +++ b/source/cScript.h @@ -199,8 +199,8 @@ class cScript bool OnStat( void ); std::string OnTooltip( CBaseObject *myObj, CSocket *pSocket ); std::string OnNameRequest( CBaseObject *myObj, CChar *nameRequester, UI08 requestSource ); - bool OnAttack( CChar *attacker, CChar *defender ); - bool OnDefense( CChar *attacker, CChar *defender ); + bool OnAttack( CChar *attacker, CChar *defender, bool hitStatus, SI08 hitLoc, UI16 damageDealt ); + bool OnDefense( CChar *attacker, CChar *defender, bool hitStatus, SI08 hitLoc, UI16 damageReceived ); SI08 OnSkillGain( CChar *player, SI08 skill, UI32 skillAmtGained ); SI08 OnSkillLoss( CChar *player, SI08 skill, UI32 skillAmtLost ); bool OnSkillChange( CChar *player, SI08 skill, SI32 skillAmtChanged ); diff --git a/source/combat.cpp b/source/combat.cpp index 8817d7b3d..fba9afa93 100644 --- a/source/combat.cpp +++ b/source/combat.cpp @@ -2916,6 +2916,25 @@ bool CHandleCombat::HandleCombat( CSocket *mSock, CChar& mChar, CChar *ourTarg ) } PlayMissedSoundEffect( &mChar ); + + for( auto scriptTrig : scriptTriggers ) + { + cScript *toExecute = JSMapping->GetScript( scriptTrig ); + if( toExecute != nullptr ) + { + toExecute->OnAttack( &mChar, ourTarg, skillPassed, -1, 0 ); + } + } + + std::vector defScriptTriggers = ourTarg->GetScriptTriggers(); + for( auto scriptTrig : defScriptTriggers ) + { + cScript *toExecute = JSMapping->GetScript( scriptTrig ); + if( toExecute != nullptr ) + { + toExecute->OnDefense( &mChar, ourTarg, skillPassed, -1, 0 ); + } + } } else { @@ -3035,7 +3054,7 @@ bool CHandleCombat::HandleCombat( CSocket *mSock, CChar& mChar, CChar *ourTarg ) cScript *toExecute = JSMapping->GetScript( scriptTrig ); if( toExecute != nullptr ) { - toExecute->OnAttack( &mChar, ourTarg ); + toExecute->OnAttack( &mChar, ourTarg, skillPassed, hitLoc, ourDamage ); } } @@ -3045,7 +3064,7 @@ bool CHandleCombat::HandleCombat( CSocket *mSock, CChar& mChar, CChar *ourTarg ) cScript *toExecute = JSMapping->GetScript( scriptTrig ); if( toExecute != nullptr ) { - toExecute->OnDefense( &mChar, ourTarg ); + toExecute->OnDefense( &mChar, ourTarg, skillPassed, hitLoc, ourDamage ); } } } From 30e223dd050a852c099e53c0aac1d5f5ba2895a6 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Tue, 13 Aug 2024 20:29:19 -0500 Subject: [PATCH 066/147] update --- docs/jsdocs.html | 32 ++++++++++++++++++++++---------- source/Changelog.txt | 2 +- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/docs/jsdocs.html b/docs/jsdocs.html index 8dbe347a8..e8b03501c 100644 --- a/docs/jsdocs.html +++ b/docs/jsdocs.html @@ -431,7 +431,7 @@

January 9th, 2022

Prototype

-

function onAttack( pAttacker, pDefender )

+

function onAttack( pAttacker, pDefender, hitStatus, hitLoc, damageDealt )

Purpose

@@ -443,14 +443,20 @@

January 9th, 2022

Notes

-

After pAttacker's script has been triggered, pDefender's onDefense event also triggers. Note that these events run in addition to hard-coded combat (and/or other combat events), after everything else is done, and do not replace these.

+

After pAttacker's script has been triggered, pDefender's onDefense event also triggers. Note that these events run in addition to hard-coded combat (and/or other combat events), after everything else is done, and do not replace these. hitStatus will be false if attack missed.

Example of usage
-

function onAttack( pAttacker, pDefender )
+
function onAttack( pAttacker, pDefender, hitStatus, hitLoc, damageDealt )
 {
-	pAttacker.TextMessage( "Who lives in that castle?" );
-	pDefender.TextMessage( "Help! Help! I'm being repressed!" );
+    if( hitStatus )
+    {
+	    pAttacker.TextMessage( "Hah! I hit my target for " + damageDealt + "damage" );
+    }
+    else
+    {
+	    pDefender.TextMessage( "Help! Help! I'm being repressed!" );
+    }
 }

@@ -1549,7 +1555,7 @@

January 9th, 2022

Prototype

-

function onDefense( pAttacker, pDefender )

+

function onDefense( pAttacker, pDefender, hitStatus, hitLoc, damageReceived )

Purpose

@@ -1561,14 +1567,20 @@

January 9th, 2022

Notes

-

The event runs at the end of each hard-coded combat "round"

+

The event runs at the end of each hard-coded combat "round". hitStatus will be false if attack missed.

Example of usage
-

function onDefense( pAttacker, pDefender )
+
function onDefense( pAttacker, pDefender, hitStatus, hitLoc, damageReceived  )
 {
-	pAttacker.TextMessage( "Who lives in that castle?" );
-	pDefender.TextMessage( "Help! Help! I'm being repressed!" );
+    if( hitStatus )
+    {
+	    pAttacker.TextMessage( "Hah! I hit my target for " + damageReceived + "damage" );
+    }
+    else
+    {
+	    pDefender.TextMessage( "Help! Help! I'm being repressed!" );
+    }
 }

diff --git a/source/Changelog.txt b/source/Changelog.txt index e8a07e449..742b6fcb0 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,5 +1,5 @@ 13/08/2024 - Dragon Slayer/Xuri - The onAttack/onDefend JS Events have been updated with three new parameters (hitStatus, hitLocation, damage) and will now also trigger when attacks miss. + The onAttack/onDefense JS Events have been updated with three new parameters (hitStatus, hitLocation, damage) and will now also trigger when attacks miss. 12/08/2024 - Dragon Slayer Flipped Imbuing and Mysticism Skill around. 1/05/2024 - Dragon Slayer/Xuri From 5d7ea2bbb625a5f1de5ee1381e95acfbcb3e8bb0 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 18 Aug 2024 14:38:17 -0500 Subject: [PATCH 067/147] update lootlists Missing lootlists for treasure maps --- data/dfndata/items/lootlists.dfn | 49 ++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/data/dfndata/items/lootlists.dfn b/data/dfndata/items/lootlists.dfn index 7a62a53fd..0638b0eee 100644 --- a/data/dfndata/items/lootlists.dfn +++ b/data/dfndata/items/lootlists.dfn @@ -962,4 +962,53 @@ 100|PaintedPlagueMask 100|PaintedDaemonMask 100|PaintedEvilClownMask +} + +// Treasure Map Level 0 +[LOOTLIST TreasureMapLvl0Loot] +{//approximately 1% +990|blank +10|treasuremaplvl0 +} + +// Treasure Map Level 1 +[LOOTLIST TreasureMapLvl1Loot] +{//approximately 1% +990|blank +10|treasuremaplvl1 +} + +// Treasure Map Level 2 +[LOOTLIST TreasureMapLvl2Loot] +{//approximately 1% +990|blank +10|treasuremaplvl2 +} + +// Treasure Map Level 3 +[LOOTLIST TreasureMapLvl3Loot] +{//approximately 1% +990|blank +10|treasuremaplvl3 +} + +// Treasure Map Level 4 +[LOOTLIST TreasureMapLvl4Loot] +{//approximately 1% +990|blank +10|treasuremaplvl4 +} + +// Treasure Map Level 5 +[LOOTLIST TreasureMapLvl5Loot] +{//approximately 1% +990|blank +10|treasuremaplvl5 +} + +// Treasure Map Level 6 +[LOOTLIST TreasureMapLvl6Loot] +{//approximately 1% +990|blank +10|treasuremaplvl6 } \ No newline at end of file From 16a2b4a822881c75f73a6e7082a28e57458b2fb4 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Wed, 21 Aug 2024 19:15:13 -0500 Subject: [PATCH 068/147] just small details cleanup remove couple extra test msgs and fixed spacing --- data/js/item/holidays/addondeedgump.js | 2 +- data/js/item/holidays/candy.js | 2 -- data/js/item/holidays/halloweenmasks.js | 2 +- data/js/item/holidays/headonaspike.js | 6 +++--- data/js/item/holidays/holidaypottedplant.js | 8 ++++---- data/js/item/holidays/pumpkins.js | 20 ++++++++++---------- data/js/item/holidays/snowpile.js | 6 +++--- 7 files changed, 22 insertions(+), 24 deletions(-) diff --git a/data/js/item/holidays/addondeedgump.js b/data/js/item/holidays/addondeedgump.js index 36e94e3e3..1f0851f6e 100644 --- a/data/js/item/holidays/addondeedgump.js +++ b/data/js/item/holidays/addondeedgump.js @@ -181,7 +181,7 @@ function CheckForNearbyDoors( myTarget, itemToCheck, pSocket ) } } - if( myTarget.DistanceTo(itemToCheck) <= 2 ) + if( myTarget.DistanceTo( itemToCheck ) <= 2 ) { return true; } diff --git a/data/js/item/holidays/candy.js b/data/js/item/holidays/candy.js index cbe3cdae9..ed007641a 100644 --- a/data/js/item/holidays/candy.js +++ b/data/js/item/holidays/candy.js @@ -18,7 +18,6 @@ function onUseChecked(pUser, iUsed) } else { - socket.SysMessage("test 1"); if( Acidity <= 30 ) { pUser.SetTempTag( "Acidity", Acidity += 5 ); @@ -26,7 +25,6 @@ function onUseChecked(pUser, iUsed) if ( Toothach == 0) { - socket.SysMessage("test 2"); pUser.SetTempTag( "toothach", 1 ); pUser.StartTimer( 1000, 0, true ); } diff --git a/data/js/item/holidays/halloweenmasks.js b/data/js/item/holidays/halloweenmasks.js index ac1919dd4..f1f031843 100644 --- a/data/js/item/holidays/halloweenmasks.js +++ b/data/js/item/holidays/halloweenmasks.js @@ -3,7 +3,7 @@ function onCreateDFN( objMade, objType ) if( objType == 0 ) { var maskname = ""; - switch(objMade.GetTag( "paintedmask" )) + switch( objMade.GetTag( "paintedmask" )) { case 1: maskname = "A Evil Clown Mask"; break; case 2: maskname = "A Daemon Mask"; break; diff --git a/data/js/item/holidays/headonaspike.js b/data/js/item/holidays/headonaspike.js index 8da857603..44b8b6192 100644 --- a/data/js/item/holidays/headonaspike.js +++ b/data/js/item/holidays/headonaspike.js @@ -4,7 +4,7 @@ function onUseChecked( pUser, iUsed ) var headspike = new Gump; var head = 0; - switch (iUsed.sectionID) + switch( iUsed.sectionID ) { case "MrsTroubleMakersHeadOnASpike": head = 30522; break; case "BrutrinsHeadOnASpike": head = 30522; break; @@ -20,7 +20,7 @@ function onUseChecked( pUser, iUsed ) default: head = 30522; } - headspike.AddGump(100, 100, head); - headspike.Send(pUser); + headspike.AddGump( 100, 100, head ); + headspike.Send( pUser ); headspike.Free(); } \ No newline at end of file diff --git a/data/js/item/holidays/holidaypottedplant.js b/data/js/item/holidays/holidaypottedplant.js index 0cc81122f..df0948203 100644 --- a/data/js/item/holidays/holidaypottedplant.js +++ b/data/js/item/holidays/holidaypottedplant.js @@ -11,14 +11,14 @@ function onUseChecked( pUser, iUsed ) PottedPlantGump( pUser, iUsed ); } -function PottedPlantGump(pUser, iUsed) +function PottedPlantGump( pUser, iUsed ) { var socket = pUser.socket; socket.tempObj = iUsed; var pottedPlant = new Gump; pottedPlant.AddPage( 0 ); - pottedPlant.AddBackground(0, 0, 360, 195, 0xA28); + pottedPlant.AddBackground( 0, 0, 360, 195, 0xA28 ); pottedPlant.AddPage( 1 ); pottedPlant.AddText( 45, 15, 0, "Choose a Potted Plant:" ); @@ -35,7 +35,7 @@ function PottedPlantGump(pUser, iUsed) pottedPlant.Free(); } -function onGumpPress(pSock, pButton, gumpData) +function onGumpPress( pSock, pButton, gumpData ) { var pUser = pSock.currentChar; var iUsed = pSock.tempObj; @@ -48,7 +48,7 @@ function onGumpPress(pSock, pButton, gumpData) } var pottedplant = ""; - if ( pButton >= 1 && pButton <= 5 ) + if( pButton >= 1 && pButton <= 5 ) { var plantIds = [0x11C8, 0x11C9, 0x11CA, 0x11CB, 0x11CC]; pottedplant = "0x" + ( plantIds[pButton - 1] ).toString( 16 ); diff --git a/data/js/item/holidays/pumpkins.js b/data/js/item/holidays/pumpkins.js index e63df2678..68cb883a8 100644 --- a/data/js/item/holidays/pumpkins.js +++ b/data/js/item/holidays/pumpkins.js @@ -16,7 +16,7 @@ function onCreateDFN( objMade, objType ) if( objMade.id == 0x0C6A || objMade.id == 0x0C6B ) { - objMade.weight = Math.floor(Math.random() * ( 2500 - 1200 + 1 ) + 1200); + objMade.weight = Math.floor( Math.random() * ( 2500 - 1200 + 1 ) + 1200 ); } else if( objMade.id == 0x0C6C ) { @@ -72,22 +72,22 @@ function onUseChecked( pUser, iUsed ) // Randomize countdown length, if enabled if( randomizePumpkinCountdown ) { - iUsed.speed = RandomNumber(iUsed.speed - 1, iUsed.speed + 1); + iUsed.speed = RandomNumber( iUsed.speed - 1, iUsed.speed + 1 ); } // Item's speed forms the basis of the countdownTime var countdownTime = iUsed.speed * 1000; // Start the initial timer that shows the first number over the character/object's head - iUsed.StartTimer(200, 1, true); + iUsed.StartTimer( 200, 1, true ); // Start timers with IDs from 2, and count until we reach item's speed + 1 var iCount = 2; - for (iCount = 2; iCount < (iUsed.speed + 2); iCount++) + for( iCount = 2; iCount < ( iUsed.speed + 2 ); iCount++ ) { - iUsed.StartTimer((iCount - 1) * 1000, iCount, true); + iUsed.StartTimer(( iCount - 1) * 1000, iCount, true ); } - socket.CustomTarget(0, GetDictionaryEntry(1348, socket.language)); //Now would be a good time to throw it! + socket.CustomTarget( 0, GetDictionaryEntry( 1348, socket.language )); //Now would be a good time to throw it! } return false; } @@ -96,7 +96,7 @@ function onCallback0( socket, ourObj ) { var mChar = socket.currentChar; var iUsed = socket.tempObj; - if ( mChar && mChar.isChar && iUsed && iUsed.isItem ) + if( mChar && mChar.isChar && iUsed && iUsed.isItem ) { var StrangeByte = socket.GetWord( 1 ); if( StrangeByte == 0 && ourObj ) @@ -107,7 +107,7 @@ function onCallback0( socket, ourObj ) iUsed.container = null; iUsed.Teleport( ourObj ); } - else + else { socket.SysMessage( GetDictionaryEntry( 1646, socket.language )); // You cannot see that @@ -252,7 +252,7 @@ function ApplyExplosionDamage( timerObj, targetChar ) return; // Deal damage, and do criminal check for source character! - targetChar.Damage(RandomNumber( timerObj.lodamage, timerObj.hidamage ), 5, sourceChar, true ); + targetChar.Damage( RandomNumber( timerObj.lodamage, timerObj.hidamage ), 5, sourceChar, true ); // If target is an NPC, make them attack the person who threw the potion! if( targetChar.npc && targetChar.target == null && targetChar.atWar == false ) @@ -299,7 +299,7 @@ function onPickup( iPickedUp, pGrabber, containerObj ) else if( iPickedUp.GetTag( "Named" ) == 0 ) { iPickedUp.name = pGrabber.name + " Pumpkin"; - iPickedUp.SetTag("Named", 1); + iPickedUp.SetTag( "Named", 1 ); } } return true; diff --git a/data/js/item/holidays/snowpile.js b/data/js/item/holidays/snowpile.js index c2e92ecc9..58d289745 100644 --- a/data/js/item/holidays/snowpile.js +++ b/data/js/item/holidays/snowpile.js @@ -59,7 +59,7 @@ function onCallback0( socket, myTarget ) pUser.visible = 0; } - if (!socket.GetWord(1) && myTarget.isChar && myTarget.socket ) + if( !socket.GetWord( 1 ) && myTarget.isChar && myTarget.socket ) { pUser.DoAction( 0x9 ); pUser.SoundEffect( 0x145, true ); @@ -73,10 +73,10 @@ function onCallback0( socket, myTarget ) } } -function onTimer( pUser, timerID ) +function onTimer( pUser, timerID ) { var socket = pUser.socket; - if( pUser.visible == 1 || pUser.visible == 2 ) + if( pUser.visible == 1 || pUser.visible == 2 ) { pUser.visible = 0; } From 17e8f1d71799fd9eb8e02ae58716892f4e5d3556 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 31 Aug 2024 13:40:21 -0500 Subject: [PATCH 069/147] Fixed Height check Fixed Height Check for clicking on dynamic items --- data/js/commands/custom/misc-cmd.js | 8 +++++--- data/js/commands/custom/repeatingcmds.js | 15 ++++++++++----- data/js/commands/targeting/add.js | 17 +++++++++++------ data/js/commands/targeting/tele.js | 6 ++++-- data/js/item/holidays/pumpkins.js | 23 ++++++++++++----------- data/js/item/potion.js | 7 +++++-- data/js/item/teleportrune.js | 3 ++- 7 files changed, 49 insertions(+), 30 deletions(-) diff --git a/data/js/commands/custom/misc-cmd.js b/data/js/commands/custom/misc-cmd.js index 0478985b3..f4ac8589f 100644 --- a/data/js/commands/custom/misc-cmd.js +++ b/data/js/commands/custom/misc-cmd.js @@ -1051,7 +1051,7 @@ function onCallback29( pSock, myTarget ) pSock.SysMessage( tempMsg.replace( /%s/gi, newExpiryTime )); tempMsg = GetDictionaryEntry( 2765, pSock.language ); // // Remaining time: %d seconds - pSock.SysMessage( tempMsg.replace( /%d/gi, (( expiryTime - currentTime ) / 1000 ).toString() )); + pSock.SysMessage(tempMsg.replace(/%d/gi, Math.round(( expiryTime - currentTime ) / 1000 ).toString() )); } else { @@ -1189,9 +1189,10 @@ function onCallback32( socket, ourObj ) var x = socket.GetWord( 11 ); var y = socket.GetWord( 13 ); var z = socket.GetSByte( 16 ); + var StrangeByte = socket.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if( socket.clientMajorVer <= 7 && socket.clientSubVer < 9 ) + if ((StrangeByte == 0 && ourObj.isItem) || (socket.clientMajorVer <= 7 && socket.clientSubVer < 9)) { z += GetTileHeight( socket.GetWord( 17 )); } @@ -1239,9 +1240,10 @@ function onCallback33( socket, ourObj ) var x = socket.GetWord( 11 ); var y = socket.GetWord( 13 ); var z = socket.GetSByte( 16 ); + var StrangeByte = socket.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if( socket.clientMajorVer <= 7 && socket.clientSubVer < 9 ) + if ((StrangeByte == 0 && ourObj.isItem) || (socket.clientMajorVer <= 7 && socket.clientSubVer < 9)) { z += GetTileHeight( socket.GetWord( 17 )); } diff --git a/data/js/commands/custom/repeatingcmds.js b/data/js/commands/custom/repeatingcmds.js index da41a6f27..33e6f5fca 100644 --- a/data/js/commands/custom/repeatingcmds.js +++ b/data/js/commands/custom/repeatingcmds.js @@ -301,9 +301,10 @@ function onCallback6( pSock, myTarget ) var targX = pSock.GetWord( 11 ); var targY = pSock.GetWord( 13 ); var targZ = pSock.GetSByte( 16 ); + var StrangeByte = pSock.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if( pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9 ) + if ((StrangeByte == 0 && ourObj.isItem) || (pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9)) { targZ += GetTileHeight( pSock.GetWord( 17 )); } @@ -466,9 +467,10 @@ function onCallback8( pSock, myTarget ) var targX = pSock.GetWord( 11 ); var targY = pSock.GetWord( 13 ); var targZ = pSock.GetSByte( 16 ); + var StrangeByte = pSock.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if( pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9 ) + if ((StrangeByte == 0 && ourObj.isItem) || (pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9)) { targZ += GetTileHeight( pSock.GetWord( 17 )); } @@ -548,9 +550,10 @@ function onCallback9( pSock, myTarget ) var targX = pSock.GetWord( 11 ); var targY = pSock.GetWord( 13 ); var targZ = pSock.GetSByte( 16 ); + var StrangeByte = pSock.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if( pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9 ) + if ((StrangeByte == 0 && ourObj.isItem) || (pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9)) { targZ += GetTileHeight( pSock.GetWord( 17 )); } @@ -585,9 +588,10 @@ function onCallback10( pSock, myTarget ) var targX = pSock.GetWord( 11 ); var targY = pSock.GetWord( 13 ); var targZ = pSock.GetSByte( 16 ); + var StrangeByte = pSock.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if( pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9 ) + if ((StrangeByte == 0 && ourObj.isItem) || (pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9)) { targZ += GetTileHeight( pSock.GetWord( 17 )); } @@ -628,9 +632,10 @@ function onCallback11( pSock, myTarget ) var targX = pSock.GetWord( 11 ); var targY = pSock.GetWord( 13 ); var targZ = pSock.GetSByte( 16 ); + var StrangeByte = pSock.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if( pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9 ) + if ((StrangeByte == 0 && ourObj.isItem) || (pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9)) { targZ += GetTileHeight( pSock.GetWord( 17 )); } diff --git a/data/js/commands/targeting/add.js b/data/js/commands/targeting/add.js index c5c3f2d0d..124252826 100644 --- a/data/js/commands/targeting/add.js +++ b/data/js/commands/targeting/add.js @@ -110,9 +110,10 @@ function onCallback0( socket, ourObj ) var x = socket.GetWord( 11 ); var y = socket.GetWord( 13 ); var z = socket.GetSByte( 16 ); + var StrangeByte = socket.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if( socket.clientMajorVer <= 7 && socket.clientSubVer < 9 ) + if ((StrangeByte == 0 && ourObj.isItem) || (socket.clientMajorVer <= 7 && socket.clientSubVer < 9)) { z += GetTileHeight( socket.GetWord( 17 )); } @@ -183,7 +184,7 @@ function onCallback1( socket, ourObj ) var z = socket.GetSByte( 16 ); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if( socket.clientMajorVer <= 7 && socket.clientSubVer < 9 ) + if ((StrangeByte == 0 && ourObj.isItem) || (socket.clientMajorVer <= 7 && socket.clientSubVer < 9)) { z += GetTileHeight( socket.GetWord( 17 )); } @@ -257,7 +258,7 @@ function onCallback2( socket, ourObj ) var z = socket.GetSByte( 16 ); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if( socket.clientMajorVer <= 7 && socket.clientSubVer < 9 ) + if ((StrangeByte == 0 && ourObj.isItem) || (socket.clientMajorVer <= 7 && socket.clientSubVer < 9)) { z += GetTileHeight( socket.GetWord( 17 )); } @@ -287,9 +288,10 @@ function onCallback3( socket, ourObj ) var x = socket.GetWord( 11 ); var y = socket.GetWord( 13 ); var z = socket.GetSByte( 16 ); + var StrangeByte = socket.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if( socket.clientMajorVer <= 7 && socket.clientSubVer < 9 ) + if ((StrangeByte == 0 && ourObj.isItem) || (socket.clientMajorVer <= 7 && socket.clientSubVer < 9)) { z += GetTileHeight( socket.GetWord( 17 )); } @@ -324,9 +326,10 @@ function onCallback4( socket, ourObj ) var x = socket.GetWord( 11 ); var y = socket.GetWord( 13 ); var z = socket.GetSByte( 16 ); + var StrangeByte = socket.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if( socket.clientMajorVer <= 7 && socket.clientSubVer < 9 ) + if ((StrangeByte == 0 && ourObj.isItem) || (socket.clientMajorVer <= 7 && socket.clientSubVer < 9)) { z += GetTileHeight( socket.GetWord( 17 )); } @@ -464,4 +467,6 @@ function AddXItemSpawner( socket, cmdString, itemType ) } } } -} \ No newline at end of file +} + +function _restorecontext_() {} \ No newline at end of file diff --git a/data/js/commands/targeting/tele.js b/data/js/commands/targeting/tele.js index c8ce29313..a920fa7cd 100644 --- a/data/js/commands/targeting/tele.js +++ b/data/js/commands/targeting/tele.js @@ -60,9 +60,10 @@ function onCallback1( socket, ourObj ) var x = socket.GetWord( 11 ); var y = socket.GetWord( 13 ); var z = socket.GetSByte( 16 ); + var StrangeByte = socket.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if( socket.clientMajorVer <= 7 && socket.clientSubVer < 9 ) + if ((StrangeByte == 0 && ourObj.isItem) || (socket.clientMajorVer <= 7 && socket.clientSubVer < 9)) { z += GetTileHeight( socket.GetWord( 17 )); } @@ -109,9 +110,10 @@ function onCallback2( socket, ourObj ) targX = socket.GetWord( 11 ); targY = socket.GetWord( 13 ); targZ = socket.GetSByte( 16 ); + var StrangeByte = socket.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if( socket.clientMajorVer <= 7 && socket.clientSubVer < 9 ) + if ((StrangeByte == 0 && ourObj.isItem) || (socket.clientMajorVer <= 7 && socket.clientSubVer < 9)) { targZ += GetTileHeight( socket.GetWord( 17 )); } diff --git a/data/js/item/holidays/pumpkins.js b/data/js/item/holidays/pumpkins.js index e63df2678..6476bf0d3 100644 --- a/data/js/item/holidays/pumpkins.js +++ b/data/js/item/holidays/pumpkins.js @@ -16,7 +16,7 @@ function onCreateDFN( objMade, objType ) if( objMade.id == 0x0C6A || objMade.id == 0x0C6B ) { - objMade.weight = Math.floor(Math.random() * ( 2500 - 1200 + 1 ) + 1200); + objMade.weight = Math.floor( Math.random() * ( 2500 - 1200 + 1 ) + 1200 ); } else if( objMade.id == 0x0C6C ) { @@ -72,22 +72,22 @@ function onUseChecked( pUser, iUsed ) // Randomize countdown length, if enabled if( randomizePumpkinCountdown ) { - iUsed.speed = RandomNumber(iUsed.speed - 1, iUsed.speed + 1); + iUsed.speed = RandomNumber( iUsed.speed - 1, iUsed.speed + 1 ); } // Item's speed forms the basis of the countdownTime var countdownTime = iUsed.speed * 1000; // Start the initial timer that shows the first number over the character/object's head - iUsed.StartTimer(200, 1, true); + iUsed.StartTimer( 200, 1, true ); // Start timers with IDs from 2, and count until we reach item's speed + 1 var iCount = 2; - for (iCount = 2; iCount < (iUsed.speed + 2); iCount++) + for( iCount = 2; iCount < ( iUsed.speed + 2 ); iCount++ ) { - iUsed.StartTimer((iCount - 1) * 1000, iCount, true); + iUsed.StartTimer(( iCount - 1) * 1000, iCount, true ); } - socket.CustomTarget(0, GetDictionaryEntry(1348, socket.language)); //Now would be a good time to throw it! + socket.CustomTarget( 0, GetDictionaryEntry( 1348, socket.language )); //Now would be a good time to throw it! } return false; } @@ -96,7 +96,7 @@ function onCallback0( socket, ourObj ) { var mChar = socket.currentChar; var iUsed = socket.tempObj; - if ( mChar && mChar.isChar && iUsed && iUsed.isItem ) + if( mChar && mChar.isChar && iUsed && iUsed.isItem ) { var StrangeByte = socket.GetWord( 1 ); if( StrangeByte == 0 && ourObj ) @@ -107,7 +107,7 @@ function onCallback0( socket, ourObj ) iUsed.container = null; iUsed.Teleport( ourObj ); } - else + else { socket.SysMessage( GetDictionaryEntry( 1646, socket.language )); // You cannot see that @@ -121,9 +121,10 @@ function onCallback0( socket, ourObj ) var x = socket.GetWord( 11 ); var y = socket.GetWord( 13 ); var z = socket.GetSByte( 16 ); + var StrangeByte = socket.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if( socket.clientMajorVer <= 7 && socket.clientSubVer < 9 ) + if ((StrangeByte == 0 && ourObj.isItem) || (socket.clientMajorVer <= 7 && socket.clientSubVer < 9)) { z += GetTileHeight( socket.GetWord( 17 )); } @@ -252,7 +253,7 @@ function ApplyExplosionDamage( timerObj, targetChar ) return; // Deal damage, and do criminal check for source character! - targetChar.Damage(RandomNumber( timerObj.lodamage, timerObj.hidamage ), 5, sourceChar, true ); + targetChar.Damage( RandomNumber( timerObj.lodamage, timerObj.hidamage ), 5, sourceChar, true ); // If target is an NPC, make them attack the person who threw the potion! if( targetChar.npc && targetChar.target == null && targetChar.atWar == false ) @@ -299,7 +300,7 @@ function onPickup( iPickedUp, pGrabber, containerObj ) else if( iPickedUp.GetTag( "Named" ) == 0 ) { iPickedUp.name = pGrabber.name + " Pumpkin"; - iPickedUp.SetTag("Named", 1); + iPickedUp.SetTag( "Named", 1 ); } } return true; diff --git a/data/js/item/potion.js b/data/js/item/potion.js index d92697cfb..5699ca111 100644 --- a/data/js/item/potion.js +++ b/data/js/item/potion.js @@ -10,10 +10,12 @@ const randomizePotionCountdown = false; // If true, add/remove +1/-1 seconds to function onUseChecked( pUser, iUsed ) { var socket = pUser.socket; - if ( pUser.visible == 1 || pUser.visible == 2 ) + + if( pUser.visible == 1 || pUser.visible == 2 ) { pUser.visible = 0; } + if( socket && iUsed && iUsed.isItem ) { if( pUser.isUsingPotion ) @@ -329,9 +331,10 @@ function onCallback0( socket, ourObj ) var x = socket.GetWord( 11 ); var y = socket.GetWord( 13 ); var z = socket.GetSByte( 16 ); + var StrangeByte = socket.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if( socket.clientMajorVer <= 7 && socket.clientSubVer < 9 ) + if ((StrangeByte == 0 && ourObj.isItem) || (socket.clientMajorVer <= 7 && socket.clientSubVer < 9)) { z += GetTileHeight( socket.GetWord( 17 )); } diff --git a/data/js/item/teleportrune.js b/data/js/item/teleportrune.js index 26ebc39e6..a6b814a6c 100644 --- a/data/js/item/teleportrune.js +++ b/data/js/item/teleportrune.js @@ -37,9 +37,10 @@ function onCallback1( socket, ourObj ) targX = socket.GetWord( 11 ); targY = socket.GetWord( 13 ); targZ = socket.GetSByte( 16 ); + var StrangeByte = socket.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if( socket.clientMajorVer <= 7 && socket.clientSubVer < 9 ) + if ((StrangeByte == 0 && ourObj.isItem) || (socket.clientMajorVer <= 7 && socket.clientSubVer < 9)) { targZ += GetTileHeight( socket.GetWord( 17 )); } From 55da654c049e2fdb2e2f7becc686cd53c99c6059 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 1 Sep 2024 20:00:32 -0500 Subject: [PATCH 070/147] small fix --- data/js/commands/custom/repeatingcmds.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/data/js/commands/custom/repeatingcmds.js b/data/js/commands/custom/repeatingcmds.js index 33e6f5fca..63220f133 100644 --- a/data/js/commands/custom/repeatingcmds.js +++ b/data/js/commands/custom/repeatingcmds.js @@ -304,7 +304,7 @@ function onCallback6( pSock, myTarget ) var StrangeByte = pSock.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if ((StrangeByte == 0 && ourObj.isItem) || (pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9)) + if ((StrangeByte == 0 && myTarget.isItem) || (pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9)) { targZ += GetTileHeight( pSock.GetWord( 17 )); } @@ -470,7 +470,7 @@ function onCallback8( pSock, myTarget ) var StrangeByte = pSock.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if ((StrangeByte == 0 && ourObj.isItem) || (pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9)) + if ((StrangeByte == 0 && myTarget.isItem) || (pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9)) { targZ += GetTileHeight( pSock.GetWord( 17 )); } @@ -553,7 +553,7 @@ function onCallback9( pSock, myTarget ) var StrangeByte = pSock.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if ((StrangeByte == 0 && ourObj.isItem) || (pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9)) + if ((StrangeByte == 0 && myTarget.isItem) || (pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9)) { targZ += GetTileHeight( pSock.GetWord( 17 )); } @@ -591,7 +591,7 @@ function onCallback10( pSock, myTarget ) var StrangeByte = pSock.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if ((StrangeByte == 0 && ourObj.isItem) || (pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9)) + if ((StrangeByte == 0 && myTarget.isItem) || (pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9)) { targZ += GetTileHeight( pSock.GetWord( 17 )); } @@ -635,7 +635,7 @@ function onCallback11( pSock, myTarget ) var StrangeByte = pSock.GetWord(1); // If connected with a client lower than v7.0.9, manually add height of targeted tile - if ((StrangeByte == 0 && ourObj.isItem) || (pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9)) + if ((StrangeByte == 0 && myTarget.isItem) || (pSock.clientMajorVer <= 7 && pSock.clientSubVer < 9)) { targZ += GetTileHeight( pSock.GetWord( 17 )); } From aa0c7c04af1d5c8fc476e239c67d72684cdeba62 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Fri, 27 Sep 2024 22:24:08 -0500 Subject: [PATCH 071/147] onTurnBoat Event Added new onEvent for Uox3 Js --- source/boats.cpp | 17 +++++++++++++++++ source/cScript.cpp | 32 ++++++++++++++++++++++++++++++++ source/cScript.h | 2 ++ 3 files changed, 51 insertions(+) diff --git a/source/boats.cpp b/source/boats.cpp index 8829b2249..60f57cd58 100644 --- a/source/boats.cpp +++ b/source/boats.cpp @@ -7,6 +7,9 @@ #include "cEffects.h" #include "Dictionary.h" #include "StringUtility.hpp" +#include "CJSMapping.h" +#include "cScript.h" +#include "CJSEngine.h" #define XP 0 @@ -898,6 +901,20 @@ void TurnBoat( CBoatObj *b, bool rightTurn, bool disableChecks ) { tSock->Send( &prSend ); } + + auto scriptTriggers = b->GetScriptTriggers(); + for( auto scriptTrig : scriptTriggers ) + { + auto toExecute = JSMapping->GetScript( scriptTrig ); + if( toExecute ) + { + if( toExecute->OnBoatTurn( b, olddir, b->GetDir() ) == 1 ) + { + // A script with the event returned true; prevent other scripts from running + break; + } + } + } } void TurnBoat( CSocket *mSock, CBoatObj *myBoat, CItem *tiller, UI08 dir, bool rightTurn ) diff --git a/source/cScript.cpp b/source/cScript.cpp index 88ef1a0e6..3c6e66c10 100644 --- a/source/cScript.cpp +++ b/source/cScript.cpp @@ -1624,6 +1624,38 @@ SI08 cScript::OnMultiLogout( CMultiObj *iMulti, CChar *cPlayer ) return TryParseJSVal( rval ); } +//o------------------------------------------------------------------------------------------------o +//| Function - cScript::OnBoatTurn() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Triggers for Boat after it has turned successfully +//o------------------------------------------------------------------------------------------------o +SI08 cScript::OnBoatTurn( CBoatObj *iBoat, UI08 oldDir, UI08 newDir ) +{ + const SI08 RV_NOFUNC = -1; + if( !ValidateObject( iBoat )) + return RV_NOFUNC; + + if( !ExistAndVerify( seOnBoatTurn, "onBoatTurn" )) + return RV_NOFUNC; + + jsval params[3], rval; + JSObject *myBoat = JSEngine->AcquireObject( IUE_ITEM, iBoat, runTime ); + + + params[0] = OBJECT_TO_JSVAL( myBoat ); + params[1] = INT_TO_JSVAL( oldDir ); + params[2] = INT_TO_JSVAL( newDir ); + + JSBool retVal = JS_CallFunctionName( targContext, targObject, "onBoatTurn", 3, params, &rval ); + if( retVal == JS_FALSE ) + { + SetEventExists( seOnBoatTurn, false ); + return RV_NOFUNC; + } + + return TryParseJSVal( rval ); +} + //o------------------------------------------------------------------------------------------------o //| Function - cScript::OnEquipAttempt() //o------------------------------------------------------------------------------------------------o diff --git a/source/cScript.h b/source/cScript.h index f98e13c70..1c168e137 100644 --- a/source/cScript.h +++ b/source/cScript.h @@ -40,6 +40,7 @@ enum ScriptEvent seOnEntrance, // ** seOnLeaving, // ** seOnMultiLogout, // ** + seOnBoatTurn, // ** seOnEquipAttempt, // ** seOnEquip, // ** seOnUnequipAttempt, // ** @@ -216,6 +217,7 @@ class cScript SI08 OnEntrance( CMultiObj *left, CBaseObject *leaving ); SI08 OnLeaving( CMultiObj *left, CBaseObject *leaving ); SI08 OnMultiLogout( CMultiObj* iMulti, CChar* cPlayer ); + SI08 OnBoatTurn( CBoatObj* iMulti, UI08 oldDir, UI08 newDir ); SI08 OnEquipAttempt( CChar *equipper, CItem *equipping ); SI08 OnEquip( CChar *equipper, CItem *equipping ); SI08 OnUnequipAttempt( CChar *equipper, CItem *equipping ); From 4b5c926d86831363d02f04e9ba5efbd599af9e77 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Fri, 27 Sep 2024 22:28:35 -0500 Subject: [PATCH 072/147] Function Fixes functions for checking boats. Also magic.js had IsBoat spelling wrong been corrected --- data/js/commands/targeting/magic.js | 2 +- source/UOXJSMethods.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/js/commands/targeting/magic.js b/data/js/commands/targeting/magic.js index a88799299..43aec9093 100644 --- a/data/js/commands/targeting/magic.js +++ b/data/js/commands/targeting/magic.js @@ -52,7 +52,7 @@ function onCallback1( socket, ourObj ) var serialPart4 = ( shipSerial % 256 ); var shipMulti = CalcMultiFromSer( serialPart1, serialPart2, serialPart3, serialPart4 ); - if( ValidateObject( shipMulti ) && shipMulti.isBoat() ) + if( ValidateObject( shipMulti ) && shipMulti.IsBoat() ) { if( shipMulti.worldnumber == socket.currentChar.worldnumber && shipMulti.instanceID == socket.currentChar.instanceID ) { diff --git a/source/UOXJSMethods.cpp b/source/UOXJSMethods.cpp index e139beb79..640da03db 100644 --- a/source/UOXJSMethods.cpp +++ b/source/UOXJSMethods.cpp @@ -7155,7 +7155,7 @@ JSBool CBase_FirstItem( JSContext *cx, JSObject *obj, uintN argc, [[maybe_unused { firstItem = ( static_cast( myObj ))->GetContainsList()->First(); } - else if( myObj->GetObjType() == OT_MULTI ) + else if( myObj->GetObjType() == OT_MULTI || myObj->GetObjType() == OT_BOAT ) { firstItem = ( static_cast( myObj ))->GetItemsInMultiList()->First(); } @@ -7206,7 +7206,7 @@ JSBool CBase_NextItem( JSContext *cx, JSObject *obj, uintN argc, [[maybe_unused] { nextItem = ( static_cast( myObj ))->GetContainsList()->Next(); } - else if( myObj->GetObjType() == OT_MULTI ) + else if( myObj->GetObjType() == OT_MULTI || myObj->GetObjType() == OT_BOAT ) { nextItem = ( static_cast( myObj ))->GetItemsInMultiList()->Next(); } @@ -7256,7 +7256,7 @@ JSBool CBase_FinishedItems( JSContext *cx, JSObject *obj, uintN argc, [[maybe_un { *rval = BOOLEAN_TO_JSVAL(( static_cast( myObj ))->GetContainsList()->Finished() ); } - else if( myObj->GetObjType() == OT_MULTI ) + else if( myObj->GetObjType() == OT_MULTI || myObj->GetObjType() == OT_BOAT ) { *rval = BOOLEAN_TO_JSVAL(( static_cast( myObj ))->GetItemsInMultiList()->Finished() ); } From 18efdc5573069e7f271384d3f3a904515181a2f6 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:11:58 -0500 Subject: [PATCH 073/147] puzzle chest This was osi Puzzle chest for kahldun. --- data/dfndata/items/containers/metal.dfn | 9 + data/js/item/puzzlechest.js | 444 ++++++++++++++++++++++++ data/js/jse_fileassociations.scp | 1 + 3 files changed, 454 insertions(+) create mode 100644 data/js/item/puzzlechest.js diff --git a/data/dfndata/items/containers/metal.dfn b/data/dfndata/items/containers/metal.dfn index d891d69a2..5b6875213 100644 --- a/data/dfndata/items/containers/metal.dfn +++ b/data/dfndata/items/containers/metal.dfn @@ -134,3 +134,12 @@ maxitems=125 { get=0x0e40 0x0e41 } + +[puzzlechest] +{ +get=base_item +name=metal chest +id=0x0e41 +movable=2 +script=5061 +} diff --git a/data/js/item/puzzlechest.js b/data/js/item/puzzlechest.js new file mode 100644 index 000000000..16ab40d89 --- /dev/null +++ b/data/js/item/puzzlechest.js @@ -0,0 +1,444 @@ +const PuzzleChestCylinder = { + None: 0xE73, + LightBlue: 0x186F, + Blue: 0x186A, + Green: 0x186B, + Orange: 0x186C, + Purple: 0x186D, + Red: 0x186E, + DarkBlue: 0x1869, + Yellow: 0x1870 +}; + +function PuzzleChestSolution( cylinders ) +{ + this.cylinders = cylinders || [ + RandomCylinder(), + RandomCylinder(), + RandomCylinder(), + RandomCylinder(), + RandomCylinder() + ]; +} + +function RandomCylinder() +{ + var randomValue = RandomNumber( 0, 8 ); + switch ( randomValue ) + { + case 0: return PuzzleChestCylinder.LightBlue; + case 1: return PuzzleChestCylinder.Blue; + case 2: return PuzzleChestCylinder.Green; + case 3: return PuzzleChestCylinder.Orange; + case 4: return PuzzleChestCylinder.Purple; + case 5: return PuzzleChestCylinder.Red; + case 6: return PuzzleChestCylinder.DarkBlue; + default: return PuzzleChestCylinder.Yellow; + } +} + +function CompareSolutions( solutionCylinders, guessCylinders ) +{ + var correctCylinders = 0; + var correctColors = 0; + var matchesSrc = [false, false, false, false, false]; + var matchesDst = [false, false, false, false, false]; + + // Check for exact matches ( correct position and color ) + for ( var i = 0; i < solutionCylinders.length; i++ ) + { + if( solutionCylinders[i] == guessCylinders[i] ) + { + correctCylinders++; + matchesSrc[i] = true; + matchesDst[i] = true; + } + } + + // Check for color matches ( wrong position ) + for ( var i = 0; i < solutionCylinders.length; i++ ) + { + if( !matchesSrc[i] ) + { + for ( var j = 0; j < guessCylinders.length; j++ ) + { + if( solutionCylinders[i] == guessCylinders[j] && !matchesDst[j] ) + { + correctColors++; + matchesDst[j] = true; + break; + } + } + } + } + + return { + correctCylinders: correctCylinders, + correctColors: correctColors + }; +} + +function onCreateDFN( objMade, objType ) +{ + if( objType == 0 ) + { + objMade.SetTag( "locked", "true" ); // Lock the chest by default + var solution = new PuzzleChestSolution(); + objMade.SetTag( "solution", SerializeSolution( solution )); // Store the solution as a serialized string + } +} + +function onUseChecked( pUser, pItem ) +{ + var socket = pUser.socket; + socket.tempObj = pItem; + + if( pItem.GetTag( "locked" ) == "true" ) + { + var serializedSolution = pItem.GetTag( "solution" ); + var solution = DeserializeSolution( serializedSolution ); + var lastGuess = pUser.GetTag( "lastGuess" ); + + // Initialize lastGuess if it doesn't exist + if( !lastGuess ) + { + lastGuess = new PuzzleChestSolution(); + pUser.SetTag( "lastGuess", SerializeSolution( lastGuess )); + } + else + { + lastGuess = DeserializeSolution( pUser.GetTag( "lastGuess" )); + } + + // Calculate the number of correct cylinders and colors + var result = CompareSolutions( solution.cylinders, lastGuess.cylinders ); + + // Generate hints based on player's lockpicking skill + var hints = GenerateHints( pUser, result.correctCylinders, result.correctColors ); + + // Show the puzzle gump to the player + ShowPuzzleGump( pUser, pItem, solution, 0 ); // Pass the solution and default check = 0 + } +} + +function onGumpPress( pSock, pButton, gumpData ) +{ + var pUser = pSock.currentChar; + var pItem = pSock.tempObj; // Access the temporary object from the socket + + // Deserialize the puzzle solution and the last guess from the player's tags + var solution = DeserializeSolution( pItem.GetTag( "solution" )); + var lastGuess = DeserializeSolution( pUser.GetTag( "lastGuess" )); + + if( pButton == 1 ) + { + // Submit button ( ID 1 ) + var result = CompareSolutions( solution.cylinders, lastGuess.cylinders ); + if( result.correctCylinders == 5 ) + { + // Unlock the chest ifthe guess is correct + pItem.SetTag( "locked", "false" ); + pUser.SysMessage( "The chest unlocks!" ); + pUser.SoundEffect( 0x241, true ); // Play unlock sound effect + + // Reward the player and clear the puzzle + RewardPlayer( pUser, pItem ); + pUser.SetTag( "lastGuess", null ); + pItem.Delete( ); // Delete the chest after it's unlocked + } + else + { + // Generate hints for incorrect guesses + var hints = GenerateHints( pUser, result.correctCylinders, result.correctColors ); + + // Show a status gump with hints and apply damage for incorrect guess + ShowStatusGump( pUser, result.correctCylinders, result.correctColors, hints.hint1, hints.hint2 ); + DamagePlayer( pUser ); // Apply damage to the player for incorrect guesses + } + } + else if( pButton >= 10 && pButton <= 17 ) + { + // Handle left and right buttons to change cylinder color + var selectedCylinderIndex = gumpData.getButton( 0 ); // Determine which cylinder was selected via radio buttons + + if( selectedCylinderIndex >= 0 && selectedCylinderIndex <= 4 ) + { + // Handle the color change based on which button was pressed ( cylinder color buttons 10-17 ) + switch ( pButton ) + { + case 10: + lastGuess.cylinders[selectedCylinderIndex] = PuzzleChestCylinder.LightBlue; + break; + case 11: + lastGuess.cylinders[selectedCylinderIndex] = PuzzleChestCylinder.Blue; + break; + case 12: + lastGuess.cylinders[selectedCylinderIndex] = PuzzleChestCylinder.Green; + break; + case 13: + lastGuess.cylinders[selectedCylinderIndex] = PuzzleChestCylinder.Orange; + break; + case 14: + lastGuess.cylinders[selectedCylinderIndex] = PuzzleChestCylinder.Purple; + break; + case 15: + lastGuess.cylinders[selectedCylinderIndex] = PuzzleChestCylinder.Red; + break; + case 16: + lastGuess.cylinders[selectedCylinderIndex] = PuzzleChestCylinder.DarkBlue; + break; + case 17: + lastGuess.cylinders[selectedCylinderIndex] = PuzzleChestCylinder.Yellow; + break; + } + } + + // Update the player's last guess + pUser.SetTag( "lastGuess", SerializeSolution( lastGuess )); + + // Redraw the puzzle gump to reflect the updated guess + ShowPuzzleGump( pUser, pItem, lastGuess, selectedCylinderIndex ); + } + else if( pButton == 100 ) + { + // OK button in status gump ( ID 100 ) + // Reshow the puzzle gump after closing the status gump + ShowPuzzleGump( pUser, pItem, lastGuess, 0 ); // Reshow the puzzle with the correct solution + } +} + +function ShowPuzzleGump( pUser, pItem, lastGuess, check ) +{ + var myGump = new Gump; + + // Add the main background and title + myGump.AddBackground( 25, 0, 500, 410, 0x53 ); + myGump.AddGump( 62, 20, 0x67, 0 ); // Title image + myGump.AddHTMLGump( 80, 36, 110, 70, false, false, "A Puzzle Lock" ); + + // Instructions + myGump.AddHTMLGump( 214, 26, 270, 90, false, false, + "Correctly choose the sequence of cylinders needed to open the latch. Each cylinder may potentially be used more than once. Beware! A false attempt could be deadly!" ); + + // Left cylinder buttons + AddLeftCylinderButton( myGump, 62, 130, PuzzleChestCylinder.LightBlue, 10 ); + AddLeftCylinderButton( myGump, 62, 180, PuzzleChestCylinder.Blue, 11 ); + AddLeftCylinderButton( myGump, 62, 230, PuzzleChestCylinder.Green, 12 ); + AddLeftCylinderButton( myGump, 62, 280, PuzzleChestCylinder.Orange, 13 ); + + // Right cylinder buttons + AddRightCylinderButton( myGump, 451, 130, PuzzleChestCylinder.Purple, 14 ); + AddRightCylinderButton( myGump, 451, 180, PuzzleChestCylinder.Red, 15 ); + AddRightCylinderButton( myGump, 451, 230, PuzzleChestCylinder.DarkBlue, 16 ); + AddRightCylinderButton( myGump, 451, 280, PuzzleChestCylinder.Yellow, 17 ); + + var solution = DeserializeSolution( pItem.GetTag( "solution" )); + // Call AddLockpickingHints with the solution from the chest + AddLockpickingHints( myGump, pUser, solution ); + + // Previous guess + var lastGuess = DeserializeSolution( pUser.GetTag( "lastGuess" )); + if( lastGuess ) + { + myGump.AddHTMLGump( 127, 249, 170, 20, false, false, "Thy previous guess:" ); + myGump.AddBackground( 290, 247, 115, 25, 0x13EC ); + + // Add each cylinder of the previous guess + for ( var i = 0; i < lastGuess.cylinders.length; i++ ) + { + AddCylinder( myGump, 281 + ( i * 22 ), 254, lastGuess.cylinders[i] ); + } + } + + // Pedestals for current guess + AddPedestal( myGump, 140, 270, lastGuess.cylinders[0], 0, check == 0 ); + AddPedestal( myGump, 195, 270, lastGuess.cylinders[1], 1, check == 1 ); + AddPedestal( myGump, 250, 270, lastGuess.cylinders[2], 2, check == 2 ); + AddPedestal( myGump, 305, 270, lastGuess.cylinders[3], 3, check == 3 ); + AddPedestal( myGump, 360, 270, lastGuess.cylinders[4], 4, check == 4 ); + + // Submit button + myGump.AddButton( 258, 370, 0xFA5, 0xFA7, 1, 0, 1 ); + + // Send the gump to the player + myGump.Send( pUser ); + myGump.Free( ); // Clear this gump from UOX memory +} + +function AddLockpickingHints( myGump, pUser, pChestSolution ) +{ + var lockpickingSkill = pUser.baseskills.lockpicking; // Lockpicking skill in UOX3 + + if( lockpickingSkill >= 600 ) + { + myGump.AddHTMLGump( 160, 125, 230, 24, false, false, "Lockpicking hint:" ); // Display the hint header + myGump.AddBackground( 159, 150, 230, 95, 0x13EC ); // Hint background + + // Add hints based on lockpicking skill thresholds + if( lockpickingSkill >= 800 ) + { + // Show the first correct cylinder from the chest solution + myGump.AddHTMLGump( 165, 157, 200, 40, false, false, "In the first slot:" ); + AddCylinder( myGump, 350, 165, pChestSolution.cylinders[0] ); // Show the first cylinder + + // Indicate that a cylinder is used in an unknown slot + myGump.AddHTMLGump( 165, 197, 200, 40, false, false, "Used in an unknown slot:" ); + AddCylinder( myGump, 350, 200, pChestSolution.cylinders[1] ); // Show the second cylinder as a hint + + if( lockpickingSkill >= 900 ) + { + // Add a hint for the third correct cylinder + AddCylinder( myGump, 350, 212, pChestSolution.cylinders[2] ); // Add third hint + } + if( lockpickingSkill >= 1000 ) + { + // Add a hint for the fourth correct cylinder + AddCylinder( myGump, 350, 224, pChestSolution.cylinders[3] ); // Add fourth hint + } + } + else + { + // Provide a basic hint ifthe player's skill is between 600-799 + myGump.AddHTMLGump( 165, 157, 200, 40, false, false, "Used in an unknown slot:" ); + AddCylinder( myGump, 350, 160, pChestSolution.cylinders[0] ); // Show the first cylinder as a basic hint + + if( lockpickingSkill >= 700 ) + { + // Add a second hint ifthe player's skill is 700-799 + AddCylinder( myGump, 350, 172, pChestSolution.cylinders[1] ); // Add second hint for 700+ skill + } + } + } +} + +function AddLeftCylinderButton( myGump, x, y, cylinder, buttonID ) +{ + myGump.AddBackground( x, y, 30, 30, 0x13EC ); + AddCylinder( myGump, x - 7, y + 10, cylinder ); + myGump.AddButton( x + 38, y + 9, 0x13A8, 0x13A9, 1, 0, buttonID ); +} + +function AddRightCylinderButton( myGump, x, y, cylinder, buttonID ) +{ + myGump.AddBackground( x, y, 30, 30, 0x13EC ); + AddCylinder( myGump, x - 7, y + 10, cylinder ); + myGump.AddButton( x - 26, y + 9, 0x13A8, 0x13A9, 1, 0, buttonID ); +} + +function AddCylinder( myGump, x, y, cylinder ) +{ + if( cylinder != PuzzleChestCylinder.None ) + { + myGump.AddPicture( x, y, cylinder ); + } + else + { + myGump.AddPicture( x + 9, y, cylinder ); + } +} + +function AddPedestal( myGump, x, y, cylinder, switchID, initialState ) +{ + myGump.AddPicture( x, y, 0xB10 ); + myGump.AddPicture( x - 23, y + 12, 0xB12 ); + myGump.AddPicture( x + 23, y + 12, 0xB13 ); + myGump.AddPicture( x, y + 23, 0xB11 ); + + if( cylinder != PuzzleChestCylinder.None ) + { + myGump.AddPicture( x, y + 2, 0x51A ); + AddCylinder( myGump, x - 1, y + 19, cylinder ); + } else { + myGump.AddPicture( x, y + 2, 0x521 ); + } + + // Use AddRadio to allow selection of one cylinder at a time + myGump.AddRadio( x + 7, y + 65, 0x867, initialState ? 1 : 0, switchID ); +} + +function ShowStatusGump( pUser, correctCylinders, correctColors ) +{ + var myGump = new Gump; + + myGump.AddBackground( 50, 50, 300, 200, 0x13BE ); // Add background + myGump.AddHTMLGump( 60, 60, 250, 25, false, false, "
Incorrect Guess!
" ); // Title text + + // Display number of correct guesses + myGump.AddHTMLGump( 60, 90, 250, 25, false, false, "Correct Cylinders: " + correctCylinders ); + myGump.AddHTMLGump( 60, 120, 250, 25, false, false, "Correct Colors ( wrong position ): " + correctColors ); + + // Add OK button + myGump.AddButton( 150, 170, 0xFA5, 0xFA7, 1, 0, 100 ); // OK button + + // Send the gump to the player + myGump.Send( pUser ); + myGump.Free( ); +} + +function RewardPlayer( pUser, pItem ) +{ + pUser.SysMessage( "You find some treasure inside the chest!" ); + CreateDFNItem( pUser.socket, pUser, "0x0eed", 500, "ITEM", true ); // Drop 500 gold +} + +function GenerateHints( pUser, correctCylinders, correctColors ) +{ + var lockpickingSkill = pUser.CheckSkill( 24, 0, 1000 ); + var hint1 = ""; + var hint2 = ""; + + if( RandomNumber( 0, 1000 ) < lockpickingSkill ) + { + if( correctCylinders > 0 ) + { + hint1 = "One of the cylinders is in the first slot."; + } + if( correctColors > 0 ) + { + hint2 = "Some colors are used, but thou art not certain where."; + } + } + + return { hint1: hint1, hint2: hint2 }; +} + +function DamagePlayer( pUser ) +{ + var randomEffect = RandomNumber( 0, 3 ); + switch ( randomEffect ) + { + case 0: + pUser.SysMessage( "A toxic vapor envelops thee." ); + pUser.Damage( RandomNumber( 10, 40 )); + break; + case 1: + pUser.SysMessage( "Searing heat scorches thy skin." ); + pUser.Damage( RandomNumber( 10, 40 )); + break; + case 2: + pUser.SysMessage( "Pain lances through thee from a sharp metal blade." ); + pUser.Damage( RandomNumber( 10, 40 )); + break; + default: + pUser.SysMessage( "Lightning arcs through thy body." ); + pUser.Damage( RandomNumber( 10, 40 )); + break; + } +} + +function SerializeSolution( solution ) +{ + return solution.cylinders.join( "," ); +} + +function DeserializeSolution( data ) +{ + var cylinderStrings = data.split( "," ); + var cylinders = []; + + for ( var i = 0; i < cylinderStrings.length; i++ ) { + cylinders.push( parseInt( cylinderStrings[i], 10 )); + } + + return new PuzzleChestSolution( cylinders ); +} diff --git a/data/js/jse_fileassociations.scp b/data/js/jse_fileassociations.scp index 2cbb8e3d5..63e6837f6 100644 --- a/data/js/jse_fileassociations.scp +++ b/data/js/jse_fileassociations.scp @@ -283,6 +283,7 @@ 5058=item/bagofsending.js 5059=item/powderoftranslocation.js 5060=item/elixirofingots.js +5061=item/puzzlechest.js //------------------------------------------- // treasure maps and chest [5400-5405] From 26ffc40d7c0dd1580fb2d8cf7de1662b6a27bd6f Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Thu, 10 Oct 2024 21:41:29 -0500 Subject: [PATCH 074/147] Small Fix fixed checkbox --- data/js/item/puzzlechest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/js/item/puzzlechest.js b/data/js/item/puzzlechest.js index 16ab40d89..37e2f5fed 100644 --- a/data/js/item/puzzlechest.js +++ b/data/js/item/puzzlechest.js @@ -353,7 +353,7 @@ function AddPedestal( myGump, x, y, cylinder, switchID, initialState ) } // Use AddRadio to allow selection of one cylinder at a time - myGump.AddRadio( x + 7, y + 65, 0x867, initialState ? 1 : 0, switchID ); + myGump.AddRadio( x + 7, y + 65, 0x868, initialState ? 1 : 0, switchID ); } function ShowStatusGump( pUser, correctCylinders, correctColors ) From 4cca79bb8be8b383ccff0e75b78eaedc8c32214e Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 12 Oct 2024 14:58:54 -0500 Subject: [PATCH 075/147] ML House add-ons Added a lot of the ML House Add-ons including deeds and the furniture item its. --- data/dfndata/house/house_ml.dfn | 828 ++++++++++++++++++ .../items/building/furniture/furniture_ml.dfn | 487 ++++++++++ .../items/deeds/houseaddon_deeds_ml.dfn | 191 ++++ 3 files changed, 1506 insertions(+) create mode 100644 data/dfndata/house/house_ml.dfn create mode 100644 data/dfndata/items/building/furniture/furniture_ml.dfn create mode 100644 data/dfndata/items/deeds/houseaddon_deeds_ml.dfn diff --git a/data/dfndata/house/house_ml.dfn b/data/dfndata/house/house_ml.dfn new file mode 100644 index 000000000..57d6fe89d --- /dev/null +++ b/data/dfndata/house/house_ml.dfn @@ -0,0 +1,828 @@ +// House Addon - Alchemist Table (East) +[HOUSE 300] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=2 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=alchemisttabledeedeast +HOUSE_ITEM=1000 +HOUSE_ITEM=1001 +} + +// House Addon - Alchemist Table (South) +[HOUSE 301] +{ +ID=0x14F0 +SPACEX=2 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=alchemisttablesouthdeed +HOUSE_ITEM=1002 +HOUSE_ITEM=1003 +} + +// House Addon - Elven Bed (East) +[HOUSE 302] +{ +ID=0x14F0 +SPACEX=2 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=elvenbedeastdeed +HOUSE_ITEM=1004 +HOUSE_ITEM=1005 +} + +// House Addon - Elven Bed (South) +[HOUSE 303] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=2 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=elvenbedsouthdeed +HOUSE_ITEM=1006 +HOUSE_ITEM=1007 +} + +// House Addon - Elven Loveseat (East) +[HOUSE 304] +{ +ID=0x14F0 +SPACEX=2 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=elvenloveseateastdeed +HOUSE_ITEM=1008 +HOUSE_ITEM=1009 +} + +// House Addon - Elven Loveseat (South) +[HOUSE 305] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=2 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=elvenloveseatsouthdeed +HOUSE_ITEM=1010 +HOUSE_ITEM=1011 +} + +// House Addon - Elven Wash Basin (East) +[HOUSE 306] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=2 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=elvenwashbasineastdeed +HOUSE_ITEM=1012 +HOUSE_ITEM=1013 +} + +// House Addon - Elven Wash Basin (South) +[HOUSE 307] +{ +ID=0x14F0 +SPACEX=2 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=elvenwashbasinsouthdeed +HOUSE_ITEM=1014 +HOUSE_ITEM=1015 +} + +// House Addon - Fancy Couch (East) +[HOUSE 308] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=3 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=fancycoucheastdeed +HOUSE_ITEM=1016 +HOUSE_ITEM=1017 +HOUSE_ITEM=1018 +} + +// House Addon - Fancy Couch (North) +[HOUSE 309] +{ +ID=0x14F0 +SPACEX=3 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=fancycouchnorthdeed +HOUSE_ITEM=1019 +HOUSE_ITEM=1020 +HOUSE_ITEM=1021 +} + +// House Addon - Fancy Couch (South) +[HOUSE 310] +{ +ID=0x14F0 +SPACEX=3 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=fancycouchsouthdeed +HOUSE_ITEM=1022 +HOUSE_ITEM=1023 +HOUSE_ITEM=1024 +} + +// House Addon - Fancy Couch (West) +[HOUSE 311] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=3 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=fancycouchwestdeed +HOUSE_ITEM=1025 +HOUSE_ITEM=1026 +HOUSE_ITEM=1027 +} + +// House Addon - Hardwood Table (East) +[HOUSE 312] +{ +ID=0x14F0 +SPACEX=3 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=hardwoodtableeastdeed +HOUSE_ITEM=1028 +HOUSE_ITEM=1029 +HOUSE_ITEM=1030 +} + +// House Addon - Hardwood Table (South) +[HOUSE 313] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=3 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=hardwoodtablesouthdeed +HOUSE_ITEM=1031 +HOUSE_ITEM=1032 +HOUSE_ITEM=1033 +} + +// House Addon - Fancy Loveseat (East) +[HOUSE 314] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=2 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=fancyloveseateastdeed +HOUSE_ITEM=1034 +HOUSE_ITEM=1035 +} + +// House Addon - Fancy Loveseat (North) +[HOUSE 315] +{ +ID=0x14F0 +SPACEX=2 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=fancyloveseatnorthdeed +HOUSE_ITEM=1036 +HOUSE_ITEM=1037 +} + +// House Addon - Fancy Loveseat (South) +[HOUSE 316] +{ +ID=0x14F0 +SPACEX=2 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=fancyloveseatsouthdeed +HOUSE_ITEM=1038 +HOUSE_ITEM=1039 +} + +// House Addon - Fancy Loveseat (West) +[HOUSE 317] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=2 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=fancyloveseatwestdeed +HOUSE_ITEM=1040 +HOUSE_ITEM=1041 +} + +// House Addon - Ornate Table (East) +[HOUSE 318] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=3 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=ornatetableeastdeed +HOUSE_ITEM=1042 +HOUSE_ITEM=1043 +HOUSE_ITEM=1044 +} + +// House Addon - Ornate Table (South) +[HOUSE 319] +{ +ID=0x14F0 +SPACEX=3 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=ornatetablesouthdeed +HOUSE_ITEM=1045 +HOUSE_ITEM=1046 +HOUSE_ITEM=1047 +} + +// House Addon - Plush Loveseat (East) +[HOUSE 320] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=2 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=plushloveseateastdeed +HOUSE_ITEM=1048 +HOUSE_ITEM=1049 +} + +// House Addon - Plush Loveseat (South) +[HOUSE 321] +{ +ID=0x14F0 +SPACEX=2 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=plushloveseatsouthdeed +HOUSE_ITEM=1050 +HOUSE_ITEM=1051 +} + +// House Addon - Tall Elven Bed (East) +[HOUSE 322] +{ +ID=0x14F0 +SPACEX=3 +SPACEY=2 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=tallelvenbedeastdeed +HOUSE_ITEM=1052 +HOUSE_ITEM=1053 +HOUSE_ITEM=1054 +HOUSE_ITEM=1055 +} + +// House Addon - Tall Elven Bed (South) +[HOUSE 323] +{ +ID=0x14F0 +SPACEX=2 +SPACEY=3 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=tallelvenbedsouthdeed +HOUSE_ITEM=1056 +HOUSE_ITEM=1057 +HOUSE_ITEM=1058 +HOUSE_ITEM=1059 +} + +[HOUSE ITEM 1000] +{ alchemist table part 1 (east) +ITEM=0x3077 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1001] +{ alchemist table part 2 (east) +ITEM=0x3078 +X=0 +Y=-1 +Z=0 +} + +[HOUSE ITEM 1002] +{ alchemist table part 1 (south) +ITEM=0x3079 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1003] +{ alchemist table part 2 (south) +ITEM=0x307A +X=-1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1004] +{ elven bed part 1 (east) +ITEM=0x304D +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1005] +{ elven bed part 2 (east) +ITEM=0x304C +X=1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1006] +{ elven bed part 1 (south) +ITEM=0x3050 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1007] +{ +elven bed part 2 (south) +ITEM=0x3051 +X=0 +Y=-1 +Z=0 +} + +[HOUSE ITEM 1008] +{ elven loveseat part 1 (east) +ITEM=0x3089 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1009] +{ elven loveseat part 2 (east) +ITEM=0x3088 +X=1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1010] +{ elven loveseat part 1 (south) +ITEM=0x308A +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1011] +{ elven loveseat part 2 (south) +ITEM=0x308B +X=0 +Y=-1 +Z=0 +} + +[HOUSE ITEM 1012] +{ elven wash basin part 1 (east) +ITEM=0x30DF +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1013] +{ elven wash basin part 2 (east) +ITEM=0x30E0 +X=0 +Y=1 +Z=0 +} + +[HOUSE ITEM 1014] +{ elven wash basin part 1 (south) +ITEM=0x30E1 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1015] +{ elven wash basin part 2 (south) +ITEM=0x30E2 +X=1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1016] +{ fancy couch part 1 (east) +ITEM=0x4C8C +X=0 +Y=-1 +Z=0 +} + +[HOUSE ITEM 1017] +{ fancy couch part 2 (east) +ITEM=0x4C8A +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1018] +{ fancy couch part 3 (east) +ITEM=0x4C8B +X=0 +Y=1 +Z=0 +} + +[HOUSE ITEM 1019] +{ fancy couch part 1 (north) +ITEM=0x9C62 +X=-1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1020] +{ fancy couch part 2 (north) +ITEM=0x9C61 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1021] +{ fancy couch part 3 (north) +ITEM=0x9C60 +X=1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1022] +{ fancy couch part 1 (south) +ITEM=0x4C8D +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1023] +{ fancy couch part 2 (south) +ITEM=0x4C8E +X=-1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1024] +{ fancy couch part 3 (south) +ITEM=0x4C8F +X=1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1025] +{ fancy couch part 1 (west) +ITEM=0x9C5F +X=0 +Y=-1 +Z=0 +} + +[HOUSE ITEM 1026] +{ fancy couch part 2 (west) +ITEM=0x9C5E +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1027] +{ fancy couch part 3 (west) +ITEM=0x9C5D +X=0 +Y=1 +Z=0 +} + +[HOUSE ITEM 1028] +{ hardwood table part 1 (east) +ITEM=0x3094 +X=-1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1029] +{ hardwood table part 2 (east) +ITEM=0x3093 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1030] +{ hardwood table part 3 (east) +ITEM=0x3092 +X=1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1031] +{ hardwood table part 1 (south) +ITEM=0x3095 +X=0 +Y=1 +Z=0 +} + +[HOUSE ITEM 1032] +{ hardwood table part 2 (south) +ITEM=0x3096 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1033] +{ hardwood table part 3 (south) +ITEM=0x3097 +X=0 +Y=-1 +Z=0 +} + +[HOUSE ITEM 1034] +{ fancy loveseat part 1 (east) +ITEM=0x4C88 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1035] +{ fancy loveseat part 2 (east) +ITEM=0x4C89 +X=0 +Y=1 +Z=0 +} + +[HOUSE ITEM 1036] +{ fancy loveseat part 1 (north) +ITEM=0x9C5A +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1037] +{ fancy loveseat part 2 (north) +ITEM=0x9C59 +X=1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1038] +{ fancy loveseat part 1 (south) +ITEM=0x4C87 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1039] +{ fancy loveseat part 2 (south) +ITEM=0x4C86 +X=1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1040] +{ fancy loveseat part 1 (west) +ITEM=0x9C58 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1041] +{ fancy loveseat part 2 (west) +ITEM=0x9C57 +X=0 +Y=1 +Z=0 +} + +[HOUSE ITEM 1042] +{ ornate table part 1 (east) +ITEM=0x308F +X=0 +Y=1 +Z=0 +} + +[HOUSE ITEM 1043] +{ ornate table part 2 (east) +ITEM=0x3090 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1044] +{ ornate table part 3 (east) +ITEM=0x3091 +X=0 +Y=-1 +Z=0 +} + +[HOUSE ITEM 1045] +{ ornate table part 1 (south) +ITEM=0x308E +X=-1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1046] +{ ornate table part 2 (south) +ITEM=0x308D +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1047] +{ ornate table part 3 (south) +ITEM=0x308C +X=1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1048] +{ plush loveseat part 1 (east) +ITEM=0x4C84 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1049] +{ plush loveseat part 2 (east) +ITEM=0x4C85 +X=0 +Y=1 +Z=0 +} + +[HOUSE ITEM 1050] +{ plush loveseat part 1 (south) +ITEM=0x4C83 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1051] +{ plush loveseat part 2 (south) +ITEM=0x4C82 +X=1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1052] +{ tall elven bed part 1 (east) +ITEM=0x3054 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1053] +{ tall elven bed part 2 (east) +ITEM=0x3053 +X=1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1054] +{ tall elven bed part 3 (east) +ITEM=0x3055 +X=2 +Y=-1 +Z=0 +} + +[HOUSE ITEM 1055] +{ tall elven bed part 4 (east) +ITEM=0x3052 +X=2 +Y=0 +Z=0 +} + +[HOUSE ITEM 1056] +{ tall elven bed part 1 (south) +ITEM=0x3058 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1057] +{ tall elven bed part 2 (south) +ITEM=0x3057 +X=-1 +Y=1 +Z=0 +} + +[HOUSE ITEM 1058] +{ tall elven bed part 3 (south) +ITEM=0x3059 +X=0 +Y=-1 +Z=0 +} + +[HOUSE ITEM 1059] +{ tall elven bed part 4 (south) +ITEM=0x3056 +X=0 +Y=1 +Z=0 +} \ No newline at end of file diff --git a/data/dfndata/items/building/furniture/furniture_ml.dfn b/data/dfndata/items/building/furniture/furniture_ml.dfn new file mode 100644 index 000000000..fa2d2a8fe --- /dev/null +++ b/data/dfndata/items/building/furniture/furniture_ml.dfn @@ -0,0 +1,487 @@ +// Elven Bed (East) +[0x304D] +{ +get=base_item +name=Elven Bed (East) Part 1 +id=0x304D +weight=1000 +movable=1 +} + +[0x304C] +{ +get=base_item +name=Elven Bed (East) Part 2 +id=0x304C +weight=1000 +movable=1 +} + +// Elven Bed (South) +[0x3050] +{ +get=base_item +name=Elven Bed (South) Part 1 +id=0x3050 +weight=1000 +movable=1 +} + +[0x3051] +{ +get=base_item +name=Elven Bed (South) Part 2 +id=0x3051 +weight=1000 +movable=1 +} + +// Alchemist Table (East) +[0x3077] +{ +get=base_item +name=Alchemist Table (East) Part 1 +id=0x3077 +weight=1000 +movable=1 +} + +[0x3078] +{ +get=base_item +name=Alchemist Table (East) Part 2 +id=0x3078 +weight=1000 +movable=1 +} + +// Alchemist Table (South) +[0x3079] +{ +get=base_item +name=Alchemist Table (South) Part 1 +id=0x3079 +weight=1000 +movable=1 +} + +[0x307A] +{ +get=base_item +name=Alchemist Table (South) Part 2 +id=0x307A +weight=1000 +movable=1 +} + +// Elven Loveseat (East) +[0x3089] +{ +get=base_item +name=Elven Loveseat (East) Part 1 +id=0x3089 +weight=1000 +movable=1 +} + +[0x3088] +{ +get=base_item +name=Elven Loveseat (East) Part 2 +id=0x3088 +weight=1000 +movable=1 +} + +// Elven Loveseat (South) +[0x308A] +{ +get=base_item +name=Elven Loveseat (South) Part 1 +id=0x308A +weight=1000 +movable=1 +} + +[0x308B] +{ +get=base_item +name=Elven Loveseat (South) Part 2 +id=0x308B +weight=1000 +movable=1 +} + +// Elven Wash Basin (East) +[0x30DF] +{ +get=base_item +name=Elven Wash Basin (East) Part 1 +id=0x30DF +weight=1000 +movable=1 +} + +[0x30E0] +{ +get=base_item +name=Elven Wash Basin (East) Part 2 +id=0x30E0 +weight=1000 +movable=1 +} + +// Elven Wash Basin (South) +[0x30E1] +{ +get=base_item +name=Elven Wash Basin (South) Part 1 +id=0x30E1 +weight=1000 +movable=1 +} + +[0x30E2] +{ +get=base_item +name=Elven Wash Basin (South) Part 2 +id=0x30E2 +weight=1000 +movable=1 +} + +// Fancy Couch (East) +[0x4C8C] +{ +get=base_item +name=Fancy Couch (East) Part 1 +id=0x4C8C +weight=1000 +movable=1 +} + +[0x4C8A] +{ +get=base_item +name=Fancy Couch (East) Part 2 +id=0x4C8A +weight=1000 +movable=1 +} + +[0x4C8B] +{ +get=base_item +name=Fancy Couch (East) Part 3 +id=0x4C8B +weight=1000 +movable=1 +} + +// Fancy Couch (North) +[0x9C62] +{ +get=base_item +name=Fancy Couch (North) Part 1 +id=0x9C62 +weight=1000 +movable=1 +} + +[0x9C61] +{ +get=base_item +name=Fancy Couch (North) Part 2 +id=0x9C61 +weight=1000 +movable=1 +} + +[0x9C60] +{ +get=base_item +name=Fancy Couch (North) Part 3 +id=0x9C60 +weight=1000 +movable=1 +} + +// Fancy Couch (South) +[0x4C8D] +{ +get=base_item +name=Fancy Couch (South) Part 1 +id=0x4C8D +weight=1000 +movable=1 +} + +[0x4C8E] +{ +get=base_item +name=Fancy Couch (South) Part 2 +id=0x4C8E +weight=1000 +movable=1 +} + +[0x4C8F] +{ +get=base_item +name=Fancy Couch (South) Part 3 +id=0x4C8F +weight=1000 +movable=1 +} + +// Fancy Couch (West) +[0x9C5F] +{ +get=base_item +name=Fancy Couch (West) Part 1 +id=0x9C5F +weight=1000 +movable=1 +} + +[0x9C5E] +{ +get=base_item +name=Fancy Couch (West) Part 2 +id=0x9C5E +weight=1000 +movable=1 +} + +[0x9C5D] +{ +get=base_item +name=Fancy Couch (West) Part 3 +id=0x9C5D +weight=1000 +movable=1 +} + +// Hardwood Table (East) +[0x3094] +{ +get=base_item +name=Hardwood Table (East) Part 1 +id=0x3094 +weight=1000 +movable=1 +} + +[0x3093] +{ +get=base_item +name=Hardwood Table (East) Part 2 +id=0x3093 +weight=1000 +movable=1 +} + +[0x3092] +{ +get=base_item +name=Hardwood Table (East) Part 3 +id=0x3092 +weight=1000 +movable=1 +} + +// Hardwood Table (South) +[0x3095] +{ +get=base_item +name=Hardwood Table (South) Part 1 +id=0x3095 +weight=1000 +movable=1 +} + +[0x3096] +{ +get=base_item +name=Hardwood Table (South) Part 2 +id=0x3096 +weight=1000 +movable=1 +} + +[0x3097] +{ +get=base_item +name=Hardwood Table (South) Part 3 +id=0x3097 +weight=1000 +movable=1 +} + +// Ornate Table (East) +[0x308F] +{ +get=base_item +name=Ornate Table (East) Part 1 +id=0x308F +weight=1000 +movable=1 +} + +[0x3090] +{ +get=base_item +name=Ornate Table (East) Part 2 +id=0x3090 +weight=1000 +movable=1 +} + +[0x3091] +{ +get=base_item +name=Ornate Table (East) Part 3 +id=0x3091 +weight=1000 +movable=1 +} + +// Ornate Table (South) +[0x308E] +{ +get=base_item +name=Ornate Table (South) Part 1 +id=0x308E +weight=1000 +movable=1 +} + +[0x308D] +{ +get=base_item +name=Ornate Table (South) Part 2 +id=0x308D +weight=1000 +movable=1 +} + +[0x308C] +{ +get=base_item +name=Ornate Table (South) Part 3 +id=0x308C +weight=1000 +movable=1 +} + +// Plush Loveseat (East) +[0x4C84] +{ +get=base_item +name=Plush Loveseat (East) Part 1 +id=0x4C84 +weight=1000 +movable=1 +} + +[0x4C85] +{ +get=base_item +name=Plush Loveseat (East) Part 2 +id=0x4C85 +weight=1000 +movable=1 +} + +// Plush Loveseat (South) +[0x4C83] +{ +get=base_item +name=Plush Loveseat (South) Part 1 +id=0x4C83 +weight=1000 +movable=1 +} + +[0x4C82] +{ +get=base_item +name=Plush Loveseat (South) Part 2 +id=0x4C82 +weight=1000 +movable=1 +} + +// Tall Elven Bed (East) +[0x3054] +{ +get=base_item +name=Tall Elven Bed (East) Part 1 +id=0x3054 +weight=1000 +movable=1 +} + +[0x3053] +{ +get=base_item +name=Tall Elven Bed (East) Part 2 +id=0x3053 +weight=1000 +movable=1 +} + +[0x3055] +{ +get=base_item +name=Tall Elven Bed (East) Part 3 +id=0x3055 +weight=1000 +movable=1 +} + +[0x3052] +{ +get=base_item +name=Tall Elven Bed (East) Part 4 +id=0x3052 +weight=1000 +movable=1 +} + +// Tall Elven Bed (South) +[0x3058] +{ +get=base_item +name=Tall Elven Bed (South) Part 1 +id=0x3058 +weight=1000 +movable=1 +} + +[0x3057] +{ +get=base_item +name=Tall Elven Bed (South) Part 2 +id=0x3057 +weight=1000 +movable=1 +} + +[0x3059] +{ +get=base_item +name=Tall Elven Bed (South) Part 3 +id=0x3059 +weight=1000 +movable=1 +} + +[0x3056] +{ +get=base_item +name=Tall Elven Bed (South) Part 4 +id=0x3056 +weight=1000 +movable=1 +} \ No newline at end of file diff --git a/data/dfndata/items/deeds/houseaddon_deeds_ml.dfn b/data/dfndata/items/deeds/houseaddon_deeds_ml.dfn new file mode 100644 index 000000000..c366542f4 --- /dev/null +++ b/data/dfndata/items/deeds/houseaddon_deeds_ml.dfn @@ -0,0 +1,191 @@ +// Elven Bed (East) Deed +[elvenbedeastdeed] +{ +name=Elven Bed (East) +id=0x14F0 +morex=300 +} + +// Elven Bed (South) Deed +[elvenbedsouthdeed] +{ +name=Elven Bed (South) +id=0x14F0 +morex=301 +} + +// Alchemist Table (East) Deed +[alchemisttabledeedeast] +{ +name=Alchemist Table (East) +id=0x14F0 +morex=300 +} + +// Alchemist Table (South) Deed +[alchemisttablesouthdeed] +{ +name=Alchemist Table (South) +id=0x14F0 +morex=301 +} + +// Elven Loveseat (East) Deed +[elvenloveseateastdeed] +{ +name=Elven Loveseat (East) +id=0x14F0 +morex=304 +} + +// Elven Loveseat (South) Deed +[elvenloveseatsouthdeed] +{ +name=Elven Loveseat (South) +id=0x14F0 +morex=305 +} + +// Elven Wash Basin (East) Deed +[elvenwashbasineastdeed] +{ +name=Elven Wash Basin (East) +id=0x14F0 +morex=306 +} + +// Elven Wash Basin (South) Deed +[elvenwashbasinsouthdeed] +{ +name=Elven Wash Basin (South) +id=0x14F0 +morex=307 +} + +// Fancy Couch (East) Deed +[fancycoucheastdeed] +{ +name=Fancy Couch (East) +id=0x14F0 +morex=308 +} + +// Fancy Couch (North) Deed +[fancycouchnorthdeed] +{ +name=Fancy Couch (North) +id=0x14F0 +morex=309 +} + +// Fancy Couch (South) Deed +[fancycouchsouthdeed] +{ +name=Fancy Couch (South) +id=0x14F0 +morex=310 +} + +// Fancy Couch (West) Deed +[fancycouchwestdeed] +{ +name=Fancy Couch (West) +id=0x14F0 +morex=311 +} + +// Hardwood Table (East) Deed +[hardwoodtableeastdeed] +{ +name=Hardwood Table (East) +id=0x14F0 +morex=312 +} + +// Hardwood Table (South) Deed +[hardwoodtablesouthdeed] +{ +name=Hardwood Table (South) +id=0x14F0 +morex=313 +} + +// Fancy Loveseat (East) Deed +[fancyloveseateastdeed] +{ +name=Fancy Loveseat (East) +id=0x14F0 +morex=314 +} + +// Fancy Loveseat (North) Deed +[fancyloveseatnorthdeed] +{ +name=Fancy Loveseat (North) +id=0x14F0 +morex=315 +} + +// Fancy Loveseat (South) Deed +[fancyloveseatsouthdeed] +{ +name=Fancy Loveseat (South) +id=0x14F0 +morex=316 +} + +// Fancy Loveseat (West) Deed +[fancyloveseatwestdeed] +{ +name=Fancy Loveseat (West) +id=0x14F0 +morex=317 +} + +// Ornate Table (East) Deed +[ornatetableeastdeed] +{ +name=Ornate Table (East) +id=0x14F0 +morex=318 +} + +// Ornate Table (South) Deed +[ornatetablesouthdeed] +{ +name=Ornate Table (South) +id=0x14F0 +morex=319 +} + +// Plush Loveseat (East) Deed +[plushloveseateastdeed] +{ +name=Plush Loveseat (East) +id=0x14F0 +morex=320 +} + +// Plush Loveseat (South) Deed +[plushloveseatsouthdeed] +{ +name=Plush Loveseat (South) +id=0x14F0 +morex=321 +} + +// Tall Elven Bed (East) Deed +[tallelvenbedeastdeed] +{ +name=Tall Elven Bed (East) +id=0x14F0 +morex=322 +} + +// Tall Elven Bed (South) Deed +[tallelvenbedsouthdeed] +{ +name=Tall Elven Bed (South) +id=0x14F0 +morex=323 +} \ No newline at end of file From 5ffa3c7250779d512c80761bc09171fbc3c52f4d Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 12 Oct 2024 17:25:38 -0500 Subject: [PATCH 076/147] Mini Houses Added in AOS All the Mini House Add-Ons --- data/dfndata/house/house_aos.dfn | 290 ++++++++++++++++++ .../building/furniture/minihouse_parts.dfn | 180 +++++++++++ .../items/deeds/minihouseaddon_deeds.dfn | 79 +++++ 3 files changed, 549 insertions(+) create mode 100644 data/dfndata/house/house_aos.dfn create mode 100644 data/dfndata/items/building/furniture/minihouse_parts.dfn create mode 100644 data/dfndata/items/deeds/minihouseaddon_deeds.dfn diff --git a/data/dfndata/house/house_aos.dfn b/data/dfndata/house/house_aos.dfn new file mode 100644 index 000000000..b601740ca --- /dev/null +++ b/data/dfndata/house/house_aos.dfn @@ -0,0 +1,290 @@ +// House Addon - Mini House: Stone and Plaster +[HOUSE 500] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=stoneandplastermini +HOUSE_ITEM=1500 +} + +// House Addon - Mini House: Field Stone +[HOUSE 501] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=fieldstonemini +HOUSE_ITEM=1501 +} + +// House Addon - Mini House: Small Brick +[HOUSE 502] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=smallbrickmini +HOUSE_ITEM=1502 +} + +// House Addon - Mini House: Wooden +[HOUSE 503] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=woodenmini +HOUSE_ITEM=1503 +} + +// House Addon - Mini House: Wood and Plaster +[HOUSE 504] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=woodandplastermini +HOUSE_ITEM=1504 +} + +// House Addon - Mini House: Thatched-Roof Cottage +[HOUSE 505] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=thatchedroofcottage +HOUSE_ITEM=1505 +} + +// House Addon - Mini House: Brick +[HOUSE 506] +{ +ID=0x14F0 +SPACEX=4 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=brickmini +HOUSE_ITEM=1506 +HOUSE_ITEM=1507 +HOUSE_ITEM=1508 +HOUSE_ITEM=1509 +} + +// House Addon - Mini House: Two-Story Wood and Plaster +[HOUSE 507] +{ +ID=0x14F0 +SPACEX=2 +SPACEY=2 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=twostorywoodandplastermini +HOUSE_ITEM=1510 +HOUSE_ITEM=1511 +HOUSE_ITEM=1512 +HOUSE_ITEM=1513 +} + +// House Addon - Mini House: Malas Mountain Pass +[HOUSE 508] +{ +ID=0x14F0 +SPACEX=2 +SPACEY=2 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=malasmountainpassmini +HOUSE_ITEM=1514 +HOUSE_ITEM=1515 +HOUSE_ITEM=1516 +HOUSE_ITEM=1517 +} + +// House Addon - Mini House: Church at Night +[HOUSE 509] +{ +ID=0x14F0 +SPACEX=1 +SPACEY=1 +CHARX=0 +CHARY=0 +CHARZ=0 +HOUSE_DEED=churchatnightmini +HOUSE_ITEM=1518 +} + +[HOUSE ITEM 1500] +{ mini house part 1 (Stone and Plaster) +ITEM=0x22C4 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1501] +{ mini house part 1 (Field Stone) +ITEM=0x22DE +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1502] +{ mini house part 1 (Small Brick) +ITEM=0x22DF +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1503] +{ mini house part 1 (Wooden) +ITEM=0x22C9 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1504] +{ mini house part 1 (Wood and Plaster) +ITEM=0x22E0 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1505] +{ mini house part 1 (Thatched-Roof Cottage) +ITEM=0x22E1 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1506] +{ mini house part 1 (Brick) +ITEM=0x22CD +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1507] +{ mini house part 2 (Brick) +ITEM=0x22CB +X=1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1508] +{ mini house part 3 (Brick) +ITEM=0x22CC +X=2 +Y=0 +Z=0 +} + +[HOUSE ITEM 1509] +{ mini house part 4 (Brick) +ITEM=0x22CA +X=3 +Y=0 +Z=0 +} + +[HOUSE ITEM 1510] +{ mini house part 1 (Two-Story Wood and Plaster) +ITEM=0x2301 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1511] +{ mini house part 2 (Two-Story Wood and Plaster) +ITEM=0x2302 +X=1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1512] +{ mini house part 3 (Two-Story Wood and Plaster) +ITEM=0x2304 +X=0 +Y=1 +Z=0 +} + +[HOUSE ITEM 1513] +{ mini house part 4 (Two-Story Wood and Plaster) +ITEM=0x2303 +X=1 +Y=1 +Z=0 +} + +[HOUSE ITEM 1514] +{ mini house part 1 (Malas Mountain Pass) +ITEM=0x2316 +X=0 +Y=0 +Z=0 +} + +[HOUSE ITEM 1515] +{ mini house part 2 (Malas Mountain Pass) +ITEM=0x2315 +X=1 +Y=0 +Z=0 +} + +[HOUSE ITEM 1516] +{ mini house part 3 (Malas Mountain Pass) +ITEM=0x2314 +X=0 +Y=1 +Z=0 +} + +[HOUSE ITEM 1517] +{ mini house part 4 (Malas Mountain Pass) +ITEM=0x2313 +X=1 +Y=1 +Z=0 +} + +[HOUSE ITEM 1518] +{ mini house part 1 (Church at Night) +ITEM=0x2318 +X=0 +Y=0 +Z=0 +} \ No newline at end of file diff --git a/data/dfndata/items/building/furniture/minihouse_parts.dfn b/data/dfndata/items/building/furniture/minihouse_parts.dfn new file mode 100644 index 000000000..6e308fa08 --- /dev/null +++ b/data/dfndata/items/building/furniture/minihouse_parts.dfn @@ -0,0 +1,180 @@ +// Base Item for Mini House: Stone and Plaster +[0x22C4] +{ +get=base_item +name=Mini House: Stone and Plaster +id=0x22C4 +weight=1000 +movable=1 +} + +// Base Item for Mini House: Field Stone +[0x22DE] +{ +get=base_item +name=Mini House: Field Stone +id=0x22DE +weight=1000 +movable=1 +} + +// Base Item for Mini House: Small Brick +[0x22DF] +{ +get=base_item +name=Mini House: Small Brick +id=0x22DF +weight=1000 +movable=1 +} + +// Base Item for Mini House: Wooden +[0x22C9] +{ +get=base_item +name=Mini House: Wooden +id=0x22C9 +weight=1000 +movable=1 +} + +// Base Item for Mini House: Wood and Plaster +[0x22E0] +{ +get=base_item +name=Mini House: Wood and Plaster +id=0x22E0 +weight=1000 +movable=1 +} + +// Base Item for Mini House: Thatched-Roof Cottage +[0x22E1] +{ +get=base_item +name=Mini House: Thatched-Roof Cottage +id=0x22E1 +weight=1000 +movable=1 +} + +// Base Items for Mini House: Brick +[0x22CD] +{ +get=base_item +name=Mini House: Brick Part 1 +id=0x22CD +weight=1000 +movable=1 +} + +[0x22CB] +{ +get=base_item +name=Mini House: Brick Part 2 +id=0x22CB +weight=1000 +movable=1 +} + +[0x22CC] +{ +get=base_item +name=Mini House: Brick Part 3 +id=0x22CC +weight=1000 +movable=1 +} + +[0x22CA] +{ +get=base_item +name=Mini House: Brick Part 4 +id=0x22CA +weight=1000 +movable=1 +} + +// Base Items for Mini House: Two-Story Wood and Plaster +[0x2301] +{ +get=base_item +name=Mini House: Two-Story Wood and Plaster Part 1 +id=0x2301 +weight=1000 +movable=1 +} + +[0x2302] +{ +get=base_item +name=Mini House: Two-Story Wood and Plaster Part 2 +id=0x2302 +weight=1000 +movable=1 +} + +[0x2304] +{ +get=base_item +name=Mini House: Two-Story Wood and Plaster Part 3 +id=0x2304 +weight=1000 +movable=1 +} + +[0x2303] +{ +get=base_item +name=Mini House: Two-Story Wood and Plaster Part 4 +id=0x2303 +weight=1000 +movable=1 +} + +// Base Items for Mini House: Malas Mountain Pass +[0x2316] +{ +get=base_item +name=Mini House: Malas Mountain Pass Part 1 +id=0x2316 +weight=1000 +movable=1 +} + +[0x2315] +{ +get=base_item +name=Mini House: Malas Mountain Pass Part 2 +id=0x2315 +weight=1000 +movable=1 +} + +[0x2314] +{ +get=base_item +name=Mini House: Malas Mountain Pass Part 3 +id=0x2314 +weight=1000 +movable=1 +} + +[0x2313] +{ +get=base_item +name=Mini House: Malas Mountain Pass Part 4 +id=0x2313 +weight=1000 +movable=1 +} + +// Base Item for Mini House: Church at Night +[0x2318] +{ +get=base_item +name=Mini House: Church at Night +id=0x2318 +weight=1000 +movable=1 +} \ No newline at end of file diff --git a/data/dfndata/items/deeds/minihouseaddon_deeds.dfn b/data/dfndata/items/deeds/minihouseaddon_deeds.dfn new file mode 100644 index 000000000..0e516c52f --- /dev/null +++ b/data/dfndata/items/deeds/minihouseaddon_deeds.dfn @@ -0,0 +1,79 @@ +// Deed for Stone and Plaster Mini House +[stoneandplastermini] +{ +name=Mini House: Stone and Plaster +id=0x14F0 +morex=500 +} + +// Deed for Field Stone Mini House +[fieldstonemini] +{ +name=Mini House: Field Stone +id=0x14F0 +morex=501 +} + +// Deed for Small Brick Mini House +[smallbrickmini] +{ +name=Mini House: Small Brick +id=0x14F0 +morex=502 +} + +// Deed for Wooden Mini House +[woodenmini] +{ +name=Mini House: Wooden +id=0x14F0 +morex=503 +} + +// Deed for Wood and Plaster Mini House +[woodandplastermini] +{ +name=Mini House: Wood and Plaster +id=0x14F0 +morex=504 +} + +// Deed for Thatched-Roof Cottage Mini House +[thatchedroofcottage] +{ +name=Mini House: Thatched-Roof Cottage +id=0x14F0 +morex=505 +} + +// Deed for Brick Mini House +[brickmini] +{ +name=Mini House: Brick +id=0x14F0 +morex=506 +} + +// Deed for Two-Story Wood and Plaster Mini House +[twostorywoodandplastermini] +{ +name=Mini House: Two-Story Wood and Plaster +id=0x14F0 +morex=507 +} + +// Deed for Malas Mountain Pass Mini House +[malasmountainpassmini] +{ +name=Mini House: Malas Mountain Pass +id=0x14F0 +morex=508 +} + +// Deed for Church at Night Mini House +[churchatnightmini] +{ +name=Mini House: Church at Night +id=0x14F0 +morex=509 +} \ No newline at end of file From 887534411e975a07e370576281fee27e6e12b349 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 12 Oct 2024 23:36:05 -0500 Subject: [PATCH 077/147] Update minihouse_parts.dfn --- .../building/furniture/minihouse_parts.dfn | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/data/dfndata/items/building/furniture/minihouse_parts.dfn b/data/dfndata/items/building/furniture/minihouse_parts.dfn index 6e308fa08..9385ee133 100644 --- a/data/dfndata/items/building/furniture/minihouse_parts.dfn +++ b/data/dfndata/items/building/furniture/minihouse_parts.dfn @@ -6,6 +6,7 @@ name=Mini House: Stone and Plaster id=0x22C4 weight=1000 movable=1 +origin=aos } // Base Item for Mini House: Field Stone @@ -16,6 +17,7 @@ name=Mini House: Field Stone id=0x22DE weight=1000 movable=1 +origin=aos } // Base Item for Mini House: Small Brick @@ -26,6 +28,7 @@ name=Mini House: Small Brick id=0x22DF weight=1000 movable=1 +origin=aos } // Base Item for Mini House: Wooden @@ -36,6 +39,7 @@ name=Mini House: Wooden id=0x22C9 weight=1000 movable=1 +origin=aos } // Base Item for Mini House: Wood and Plaster @@ -46,6 +50,7 @@ name=Mini House: Wood and Plaster id=0x22E0 weight=1000 movable=1 +origin=aos } // Base Item for Mini House: Thatched-Roof Cottage @@ -56,6 +61,7 @@ name=Mini House: Thatched-Roof Cottage id=0x22E1 weight=1000 movable=1 +origin=aos } // Base Items for Mini House: Brick @@ -66,6 +72,7 @@ name=Mini House: Brick Part 1 id=0x22CD weight=1000 movable=1 +origin=aos } [0x22CB] @@ -75,6 +82,7 @@ name=Mini House: Brick Part 2 id=0x22CB weight=1000 movable=1 +origin=aos } [0x22CC] @@ -84,6 +92,7 @@ name=Mini House: Brick Part 3 id=0x22CC weight=1000 movable=1 +origin=aos } [0x22CA] @@ -93,6 +102,7 @@ name=Mini House: Brick Part 4 id=0x22CA weight=1000 movable=1 +origin=aos } // Base Items for Mini House: Two-Story Wood and Plaster @@ -103,6 +113,7 @@ name=Mini House: Two-Story Wood and Plaster Part 1 id=0x2301 weight=1000 movable=1 +origin=aos } [0x2302] @@ -112,6 +123,7 @@ name=Mini House: Two-Story Wood and Plaster Part 2 id=0x2302 weight=1000 movable=1 +origin=aos } [0x2304] @@ -121,6 +133,7 @@ name=Mini House: Two-Story Wood and Plaster Part 3 id=0x2304 weight=1000 movable=1 +origin=aos } [0x2303] @@ -130,6 +143,7 @@ name=Mini House: Two-Story Wood and Plaster Part 4 id=0x2303 weight=1000 movable=1 +origin=aos } // Base Items for Mini House: Malas Mountain Pass @@ -140,6 +154,7 @@ name=Mini House: Malas Mountain Pass Part 1 id=0x2316 weight=1000 movable=1 +origin=aos } [0x2315] @@ -149,6 +164,7 @@ name=Mini House: Malas Mountain Pass Part 2 id=0x2315 weight=1000 movable=1 +origin=aos } [0x2314] @@ -158,6 +174,7 @@ name=Mini House: Malas Mountain Pass Part 3 id=0x2314 weight=1000 movable=1 +origin=aos } [0x2313] @@ -167,6 +184,7 @@ name=Mini House: Malas Mountain Pass Part 4 id=0x2313 weight=1000 movable=1 +origin=aos } // Base Item for Mini House: Church at Night @@ -177,4 +195,5 @@ name=Mini House: Church at Night id=0x2318 weight=1000 movable=1 +origin=aos } \ No newline at end of file From afed30f0eadc1b3d98202a6405f52ec8f2459f6b Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 12 Oct 2024 23:38:33 -0500 Subject: [PATCH 078/147] Update furniture_ml.dfn --- .../items/building/furniture/furniture_ml.dfn | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/data/dfndata/items/building/furniture/furniture_ml.dfn b/data/dfndata/items/building/furniture/furniture_ml.dfn index fa2d2a8fe..89bfaff42 100644 --- a/data/dfndata/items/building/furniture/furniture_ml.dfn +++ b/data/dfndata/items/building/furniture/furniture_ml.dfn @@ -6,6 +6,7 @@ name=Elven Bed (East) Part 1 id=0x304D weight=1000 movable=1 +origin=ml } [0x304C] @@ -15,6 +16,7 @@ name=Elven Bed (East) Part 2 id=0x304C weight=1000 movable=1 +origin=ml } // Elven Bed (South) @@ -25,6 +27,7 @@ name=Elven Bed (South) Part 1 id=0x3050 weight=1000 movable=1 +origin=ml } [0x3051] @@ -34,6 +37,7 @@ name=Elven Bed (South) Part 2 id=0x3051 weight=1000 movable=1 +origin=ml } // Alchemist Table (East) @@ -44,6 +48,7 @@ name=Alchemist Table (East) Part 1 id=0x3077 weight=1000 movable=1 +origin=ml } [0x3078] @@ -53,6 +58,7 @@ name=Alchemist Table (East) Part 2 id=0x3078 weight=1000 movable=1 +origin=ml } // Alchemist Table (South) @@ -63,6 +69,7 @@ name=Alchemist Table (South) Part 1 id=0x3079 weight=1000 movable=1 +origin=ml } [0x307A] @@ -72,6 +79,7 @@ name=Alchemist Table (South) Part 2 id=0x307A weight=1000 movable=1 +origin=ml } // Elven Loveseat (East) @@ -82,6 +90,7 @@ name=Elven Loveseat (East) Part 1 id=0x3089 weight=1000 movable=1 +origin=ml } [0x3088] @@ -91,6 +100,7 @@ name=Elven Loveseat (East) Part 2 id=0x3088 weight=1000 movable=1 +origin=ml } // Elven Loveseat (South) @@ -101,6 +111,7 @@ name=Elven Loveseat (South) Part 1 id=0x308A weight=1000 movable=1 +origin=ml } [0x308B] @@ -110,6 +121,7 @@ name=Elven Loveseat (South) Part 2 id=0x308B weight=1000 movable=1 +origin=ml } // Elven Wash Basin (East) @@ -120,6 +132,7 @@ name=Elven Wash Basin (East) Part 1 id=0x30DF weight=1000 movable=1 +origin=ml } [0x30E0] @@ -129,6 +142,7 @@ name=Elven Wash Basin (East) Part 2 id=0x30E0 weight=1000 movable=1 +origin=ml } // Elven Wash Basin (South) @@ -139,6 +153,7 @@ name=Elven Wash Basin (South) Part 1 id=0x30E1 weight=1000 movable=1 +origin=ml } [0x30E2] @@ -148,6 +163,7 @@ name=Elven Wash Basin (South) Part 2 id=0x30E2 weight=1000 movable=1 +origin=ml } // Fancy Couch (East) @@ -158,6 +174,7 @@ name=Fancy Couch (East) Part 1 id=0x4C8C weight=1000 movable=1 +origin=ml } [0x4C8A] @@ -167,6 +184,7 @@ name=Fancy Couch (East) Part 2 id=0x4C8A weight=1000 movable=1 +origin=ml } [0x4C8B] @@ -176,6 +194,7 @@ name=Fancy Couch (East) Part 3 id=0x4C8B weight=1000 movable=1 +origin=ml } // Fancy Couch (North) @@ -186,6 +205,7 @@ name=Fancy Couch (North) Part 1 id=0x9C62 weight=1000 movable=1 +origin=ml } [0x9C61] @@ -195,6 +215,7 @@ name=Fancy Couch (North) Part 2 id=0x9C61 weight=1000 movable=1 +origin=ml } [0x9C60] @@ -204,6 +225,7 @@ name=Fancy Couch (North) Part 3 id=0x9C60 weight=1000 movable=1 +origin=ml } // Fancy Couch (South) @@ -214,6 +236,7 @@ name=Fancy Couch (South) Part 1 id=0x4C8D weight=1000 movable=1 +origin=ml } [0x4C8E] @@ -223,6 +246,7 @@ name=Fancy Couch (South) Part 2 id=0x4C8E weight=1000 movable=1 +origin=ml } [0x4C8F] @@ -232,6 +256,7 @@ name=Fancy Couch (South) Part 3 id=0x4C8F weight=1000 movable=1 +origin=ml } // Fancy Couch (West) @@ -242,6 +267,7 @@ name=Fancy Couch (West) Part 1 id=0x9C5F weight=1000 movable=1 +origin=ml } [0x9C5E] @@ -251,6 +277,7 @@ name=Fancy Couch (West) Part 2 id=0x9C5E weight=1000 movable=1 +origin=ml } [0x9C5D] @@ -260,6 +287,7 @@ name=Fancy Couch (West) Part 3 id=0x9C5D weight=1000 movable=1 +origin=ml } // Hardwood Table (East) @@ -270,6 +298,7 @@ name=Hardwood Table (East) Part 1 id=0x3094 weight=1000 movable=1 +origin=ml } [0x3093] @@ -279,6 +308,7 @@ name=Hardwood Table (East) Part 2 id=0x3093 weight=1000 movable=1 +origin=ml } [0x3092] @@ -288,6 +318,7 @@ name=Hardwood Table (East) Part 3 id=0x3092 weight=1000 movable=1 +origin=ml } // Hardwood Table (South) @@ -298,6 +329,7 @@ name=Hardwood Table (South) Part 1 id=0x3095 weight=1000 movable=1 +origin=ml } [0x3096] @@ -307,6 +339,7 @@ name=Hardwood Table (South) Part 2 id=0x3096 weight=1000 movable=1 +origin=ml } [0x3097] @@ -316,6 +349,7 @@ name=Hardwood Table (South) Part 3 id=0x3097 weight=1000 movable=1 +origin=ml } // Ornate Table (East) @@ -326,6 +360,7 @@ name=Ornate Table (East) Part 1 id=0x308F weight=1000 movable=1 +origin=ml } [0x3090] @@ -335,6 +370,7 @@ name=Ornate Table (East) Part 2 id=0x3090 weight=1000 movable=1 +origin=ml } [0x3091] @@ -344,6 +380,7 @@ name=Ornate Table (East) Part 3 id=0x3091 weight=1000 movable=1 +origin=ml } // Ornate Table (South) @@ -354,6 +391,7 @@ name=Ornate Table (South) Part 1 id=0x308E weight=1000 movable=1 +origin=ml } [0x308D] @@ -363,6 +401,7 @@ name=Ornate Table (South) Part 2 id=0x308D weight=1000 movable=1 +origin=ml } [0x308C] @@ -372,6 +411,7 @@ name=Ornate Table (South) Part 3 id=0x308C weight=1000 movable=1 +origin=ml } // Plush Loveseat (East) @@ -382,6 +422,7 @@ name=Plush Loveseat (East) Part 1 id=0x4C84 weight=1000 movable=1 +origin=ml } [0x4C85] @@ -391,6 +432,7 @@ name=Plush Loveseat (East) Part 2 id=0x4C85 weight=1000 movable=1 +origin=ml } // Plush Loveseat (South) @@ -401,6 +443,7 @@ name=Plush Loveseat (South) Part 1 id=0x4C83 weight=1000 movable=1 +origin=ml } [0x4C82] @@ -410,6 +453,7 @@ name=Plush Loveseat (South) Part 2 id=0x4C82 weight=1000 movable=1 +origin=ml } // Tall Elven Bed (East) @@ -420,6 +464,7 @@ name=Tall Elven Bed (East) Part 1 id=0x3054 weight=1000 movable=1 +origin=ml } [0x3053] @@ -429,6 +474,7 @@ name=Tall Elven Bed (East) Part 2 id=0x3053 weight=1000 movable=1 +origin=ml } [0x3055] @@ -438,6 +484,7 @@ name=Tall Elven Bed (East) Part 3 id=0x3055 weight=1000 movable=1 +origin=ml } [0x3052] @@ -447,6 +494,7 @@ name=Tall Elven Bed (East) Part 4 id=0x3052 weight=1000 movable=1 +origin=ml } // Tall Elven Bed (South) @@ -457,6 +505,7 @@ name=Tall Elven Bed (South) Part 1 id=0x3058 weight=1000 movable=1 +origin=ml } [0x3057] @@ -466,6 +515,7 @@ name=Tall Elven Bed (South) Part 2 id=0x3057 weight=1000 movable=1 +origin=ml } [0x3059] @@ -475,6 +525,7 @@ name=Tall Elven Bed (South) Part 3 id=0x3059 weight=1000 movable=1 +origin=ml } [0x3056] @@ -484,4 +535,5 @@ name=Tall Elven Bed (South) Part 4 id=0x3056 weight=1000 movable=1 +origin=ml } \ No newline at end of file From ad394e1f0ccf7d4038d291d38ec7c322ef39a077 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 14 Oct 2024 19:54:36 -0500 Subject: [PATCH 079/147] CheckInstaLog Added Added the CheckInstaLog function to check if a specific location is within an instant logout zone (SEFunctions.cpp). --- docs/jsdocs.html | 1167 +++++++++++++++++++++------------------- source/Changelog.txt | 3 + source/SEFunctions.cpp | 40 ++ source/SEFunctions.h | 2 + source/cScript.cpp | 1 + 5 files changed, 648 insertions(+), 565 deletions(-) diff --git a/docs/jsdocs.html b/docs/jsdocs.html index 8dbe347a8..98d42d786 100644 --- a/docs/jsdocs.html +++ b/docs/jsdocs.html @@ -6339,80 +6339,113 @@

January 9th, 2022

  • Miscellaneous Functions
    -
    +
    -
    - - -
    -
    -

    Prototype

    -

    int BASEITEMSERIAL();

    -

    int INVALIDSERIAL();

    -

    int INVALIDID();

    -

    int INVALIDCOLOUR();

    -
    -
    -

    Purpose

    -

    BASEITEMSERIAL() - Gets the constant that defines the base value used as starting point for item serials. If an object serial is lower than this, it probably belongs to a character. If it's higher, it belongs to an item.
    - INVALIDSERIAL() - Gets the constant defining an invalid serial. If an object serial matches this, it's invalid!
    - INVALIDID() - Gets the constant defining an invalid ID. If an object's ID matches this, it's probably not a valid ID!
    - INVALIDCOLOUR() - Gets the constant defining an invalid colour. If an object's colour is equal or higher than this, it's probably not a valid colour!

    -
    -
    -

    Example of usage

    -
    var baseItemSerial = BASEITEMSERIAL();
    +                        
    + + +
    +
    +

    Prototype

    +

    int BASEITEMSERIAL();

    +

    int INVALIDSERIAL();

    +

    int INVALIDID();

    +

    int INVALIDCOLOUR();

    +
    +
    +

    Purpose

    +

    + BASEITEMSERIAL() - Gets the constant that defines the base value used as starting point for item serials. If an object serial is lower than this, it probably belongs to a character. If it's higher, it belongs to an item.
    + INVALIDSERIAL() - Gets the constant defining an invalid serial. If an object serial matches this, it's invalid!
    + INVALIDID() - Gets the constant defining an invalid ID. If an object's ID matches this, it's probably not a valid ID!
    + INVALIDCOLOUR() - Gets the constant defining an invalid colour. If an object's colour is equal or higher than this, it's probably not a valid colour! +

    +
    +
    +

    Example of usage

    +
    var baseItemSerial = BASEITEMSERIAL();
     var invalidSerial = INVALIDSERIAL();
     var invalidID = INVALIDID();
     var invalidColour = INVALIDCOLOUR();
     									
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    PARTY CreateParty( partyleader );

    -
    -
    -

    Purpose

    -

    Create a new party/group with the specified character as leader

    -
    -
    -

    Example of usage

    -
    // Create a new party (myParty) with pUser as the leader
    +                        
    + + +
    +
    +

    Prototype

    +

    PARTY CreateParty( partyleader );

    +
    +
    +

    Purpose

    +

    Create a new party/group with the specified character as leader

    +
    +
    +

    Example of usage

    +
    // Create a new party (myParty) with pUser as the leader
     var myParty = CreateParty( pUser );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int DistanceBetween( x1, y1, x2, y2 );

    -

    int DistanceBetween( x1, y1, z1, x2, y2, z2 );

    -

    int DistanceBetween( objA, objB );

    -

    int DistanceBetween( objA, objB, checkZ );

    -
    -
    -

    Purpose

    -

    Get the distance between two sets of coordinates or objects on either 2D or 3D plane

    -
    -
    -

    Notes

    -

    Parameters: x1, y1, z1, x2, y2, z2 = coordinates
    - checkZ = true if distance between two objects should take into account Z axis

    -
    -
    -

    Example of usage

    -
    // Get distance between two sets of x, y coordinates
    +                        
    + + +
    +
    +

    Prototype

    +

    JSBool CheckInstaLog( x, y, world, instanceID );

    +
    +
    +

    Purpose

    +

    Checks if a specific location ( x, y, world, instanceID ) is within an instant logout zone.

    +
    +
    +

    Example of usage

    +
    // Check if the player is in an instant logout zone
    +var isInstaLog = CheckInstaLog(targX, targY, worldNumber, instanceID);
    +
    +if( isInstaLog )
    +{
    +    // Handle instant logout
    +}
    +else
    +{
    +    // Handle other logout scenarios
    +}
    +
    +
    +
    + +
    + + +
    +
    +

    Prototype

    +

    int DistanceBetween( x1, y1, x2, y2 );

    +

    int DistanceBetween( x1, y1, z1, x2, y2, z2 );

    +

    int DistanceBetween( objA, objB );

    +

    int DistanceBetween( objA, objB, checkZ );

    +
    +
    +

    Purpose

    +

    Get the distance between two sets of coordinates or objects on either 2D or 3D plane

    +
    +
    +

    Notes

    +

    + Parameters: x1, y1, z1, x2, y2, z2 = coordinates
    + checkZ = true if distance between two objects should take into account Z axis +

    +
    +
    +

    Example of usage

    +
    // Get distance between two sets of x, y coordinates
     var distance1 = DistanceBetween( pUser.x, pUser.y, iUsed.x, iUsed.y );
     
     // Get distance between two sets of x, y, z coordinates
    @@ -6423,157 +6456,159 @@ 

    January 9th, 2022

    // Get distance between pUser and iUsed using 3D coordinates var distance2 = DistanceBetween( pUser, iUsed, true );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool DoesEventExist( scriptID, eventToCheck );

    -
    -
    -

    Purpose

    -

    Check for existence of a named JS event/function in another script

    -
    -
    -

    Notes

    -

    Parameters: scriptID = ID of the script to check
    - eventToCheck = name of event/function to look for

    -
    -
    -

    Example of usage

    -
    // Check if a custom function exists in a specific script (0), and trigger it with TriggerEvent() if it does:
    +                        
    + + +
    +
    +

    Prototype

    +

    bool DoesEventExist( scriptID, eventToCheck );

    +
    +
    +

    Purpose

    +

    Check for existence of a named JS event/function in another script

    +
    +
    +

    Notes

    +

    + Parameters: scriptID = ID of the script to check
    + eventToCheck = name of event/function to look for +

    +
    +
    +

    Example of usage

    +
    // Check if a custom function exists in a specific script (0), and trigger it with TriggerEvent() if it does:
     if( DoesEventExist( 0, "MyCustomFunction" ))
     {
     	TriggerEvent( 0, "MyCustomFunction", [additional parameters] );
     }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int GetAccountCount();

    -
    -
    -

    Purpose

    -

    Gets the total amount of accounts on the server

    -
    -
    -

    Example of usage

    -
    var totalAccounts = GetAccountCount();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    int GetAccountCount();

    +
    +
    +

    Purpose

    +

    Gets the total amount of accounts on the server

    +
    +
    +

    Example of usage

    +
    var totalAccounts = GetAccountCount();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool GetClientFeature( ClientFeaturesBitNum );

    -
    -
    -

    Purpose

    -

    Check if a specific client features is enabled. For a list of features that can be checked this way, see [settings]->clientFeatures List in the UOX.INI Settings section of the UOX3 Documentation.

    -
    -
    -

    Example of usage

    -
    // AoS bit from list of client features
    +                        
    + + +
    +
    +

    Prototype

    +

    bool GetClientFeature( ClientFeaturesBitNum );

    +
    +
    +

    Purpose

    +

    Check if a specific client features is enabled. For a list of features that can be checked this way, see [settings]->clientFeatures List in the UOX.INI Settings section of the UOX3 Documentation.

    +
    +
    +

    Example of usage

    +
    // AoS bit from list of client features
     var aosFeaturesEnabled = GetClientFeature( 0x10 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    string GetDictionaryEntry( entryNum [, language ] );

    -
    -
    -

    Purpose

    -

    Pulls entry from the dictionary file based on language (or server default, if no language parameter is ).

    -
    -
    -

    Example of usage

    -
    var textString = GetDictionaryEntry( 1, socket.language );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    string GetDictionaryEntry( entryNum [, language ] );

    +
    +
    +

    Purpose

    +

    Pulls entry from the dictionary file based on language (or server default, if no language parameter is ).

    +
    +
    +

    Example of usage

    +
    var textString = GetDictionaryEntry( 1, socket.language );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int GetMurderThreshold();

    -
    -
    -

    Purpose

    -

    Returns the number of kills needed to be branded as a murderer and turn red.

    -
    -
    -

    Notes

    -

    See also: Character .murderCount and .murderer properties

    -
    -
    -

    Example of usage

    -
    if( GetMurderThreshold() > pTalking.murderCount )
    +                        
    + + +
    +
    +

    Prototype

    +

    int GetMurderThreshold();

    +
    +
    +

    Purpose

    +

    Returns the number of kills needed to be branded as a murderer and turn red.

    +
    +
    +

    Notes

    +

    See also: Character .murderCount and .murderer properties

    +
    +
    +

    Example of usage

    +
    if( GetMurderThreshold() > pTalking.murderCount )
     {
     	TextMessage( pTalkingTo, "Surely sir, you must be a murderer.  I bid you adieu" );
     	EmoteMessage( pTalkingTo, "*scampers off*" );
     }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int GetPlayerCount();

    -
    -
    -

    Purpose

    -

    Gets the total amount of players online on the server

    -
    -
    -

    Example of usage

    -
    var totalOnlinePlayers = GetPlayerCount();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    int GetPlayerCount();

    +
    +
    +

    Purpose

    +

    Gets the total amount of players online on the server

    +
    +
    +

    Example of usage

    +
    var totalOnlinePlayers = GetPlayerCount();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    SOSObject GetRandomSOSArea( worldNum, instanceID );

    -
    -
    -

    Purpose

    -

    Gets a random SOS area from list of such areas loaded from [SOSAREAS] section of regions.dfn

    -
    -
    -

    Example of usage

    -
    // Fetch reference to a random SOS area
    +                        
    + + +
    +
    +

    Prototype

    +

    SOSObject GetRandomSOSArea( worldNum, instanceID );

    +
    +
    +

    Purpose

    +

    Gets a random SOS area from list of such areas loaded from [SOSAREAS] section of regions.dfn

    +
    +
    +

    Example of usage

    +
    // Fetch reference to a random SOS area
     var sosArea = GetRandomSOSArea( pUser.worldNum, pUser.instanceID );
     
     // Pick a random location within the selected sosArea
    @@ -6587,112 +6622,112 @@ 

    January 9th, 2022

    sosMsg.more = sosMsg.instanceID; // See UOX3/js/item/waterstainedsos.js for full example, including validation for whether the chosen location is suitable, and not blocked by dynamic items, static items or map tiles
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool GetServerFeature( ServerFeaturesBitNum );

    -
    -
    -

    Purpose

    -

    Check if a specific server features is enabled. For a list of features that can be checked this way, see [settings]->serverFeatures List in the UOX.INI Settings section of the UOX3 Documentation.

    -
    -
    -

    Example of usage

    -
    // ContextMenus bit from list of server features
    +                        
    + + +
    +
    +

    Prototype

    +

    bool GetServerFeature( ServerFeaturesBitNum );

    +
    +
    +

    Purpose

    +

    Check if a specific server features is enabled. For a list of features that can be checked this way, see [settings]->serverFeatures List in the UOX.INI Settings section of the UOX3 Documentation.

    +
    +
    +

    Example of usage

    +
    // ContextMenus bit from list of server features
     var contextMenusEnabled = GetServerFeature( 0x08 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    string GetServerSetting( serverSettingString );

    -
    -
    -

    Purpose

    -

    Fetches the value of a specified server setting and returns it as a string. Wrap in parseInt() if expected value returned is an int.

    -
    -
    -

    Example of usage

    -
    // Returns 1 if GUARDSACTIVE is set to 1 in UOX.INI, or 0 if set to 0.
    +                        
    + + +
    +
    +

    Prototype

    +

    string GetServerSetting( serverSettingString );

    +
    +
    +

    Purpose

    +

    Fetches the value of a specified server setting and returns it as a string. Wrap in parseInt() if expected value returned is an int.

    +
    +
    +

    Example of usage

    +
    // Returns 1 if GUARDSACTIVE is set to 1 in UOX.INI, or 0 if set to 0.
     var guardsActive = GetServerSetting( "GUARDSACTIVE" );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    SOCKET GetSocketFromIndex( socketIndex );

    -
    -
    -

    Purpose

    -

    Create a socket-object based on the specified socketIndex

    -
    -
    -

    Example of usage

    -
    // Fetch whichever socket is connected to the server as socket/connection 0
    +                        
    + + +
    +
    +

    Prototype

    +

    SOCKET GetSocketFromIndex( socketIndex );

    +
    +
    +

    Purpose

    +

    Create a socket-object based on the specified socketIndex

    +
    +
    +

    Example of usage

    +
    // Fetch whichever socket is connected to the server as socket/connection 0
     var socket = GetSocketFromIndex( 0 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool IsInBuilding( x, y, z, world, instance, checkHeight );

    -
    -
    -

    Purpose

    -

    Returns true if specified location is inside a static building (underneath static items), or if player is inside a multi.

    -
    -
    -

    Notes

    -

    If checkHeight argument is true, player is only deemed inside a multi if there are multi-items above the player's head. If player is in a courtyard/on a rooftop, they will be deemed to be NOT in the building. checkHeight is not used for the static part of the function, only for multis.

    -
    -
    -

    Example of usage

    -
    var isCharInBuilding = IsInBuilding( myChar.x, myChar.y, myChar.z, myChar.worldnumber, myChar.instanceID, true );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    bool IsInBuilding( x, y, z, world, instance, checkHeight );

    +
    +
    +

    Purpose

    +

    Returns true if specified location is inside a static building (underneath static items), or if player is inside a multi.

    +
    +
    +

    Notes

    +

    If checkHeight argument is true, player is only deemed inside a multi if there are multi-items above the player's head. If player is in a courtyard/on a rooftop, they will be deemed to be NOT in the building. checkHeight is not used for the static part of the function, only for multis.

    +
    +
    +

    Example of usage

    +
    var isCharInBuilding = IsInBuilding( myChar.x, myChar.y, myChar.z, myChar.worldnumber, myChar.instanceID, true );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int IterateOver( objectType );

    -
    -
    -

    Purpose

    -

    Iterates over all objects of specified type in the world.

    -
    -
    -

    Notes

    -

    For every object it comes across, the iterator will call a function onIterate( object ) in the same script. Supported object types: "BASEOBJ", "CHARACTER", "ITEM", "SPAWNER", "MULTI", "BOAT"

    -
    -
    -

    Example of usage

    -
    var itemCount = IterateOver( "ITEM" );
    +                        
    + + +
    +
    +

    Prototype

    +

    int IterateOver( objectType );

    +
    +
    +

    Purpose

    +

    Iterates over all objects of specified type in the world.

    +
    +
    +

    Notes

    +

    For every object it comes across, the iterator will call a function onIterate( object ) in the same script. Supported object types: "BASEOBJ", "CHARACTER", "ITEM", "SPAWNER", "MULTI", "BOAT"

    +
    +
    +

    Example of usage

    +
    var itemCount = IterateOver( "ITEM" );
     Console.log( itemCount + " items found!" );
     ...
     function onIterate( myObject )
    @@ -6701,111 +6736,113 @@ 

    January 9th, 2022

    // ... optionally do something here return true; }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int Moon( moonNum );

    -

    void Moon( moonNum, newVal );

    -
    -
    -

    Purpose

    -

    Get and set the server moon values for the two moons Felucca (0) and Trammel (1)

    -
    -
    -

    Example of usage

    -
    var feluccaMoonphase = Moon( 0 );
    +                        
    + + +
    +
    +

    Prototype

    +

    int Moon( moonNum );

    +

    void Moon( moonNum, newVal );

    +
    +
    +

    Purpose

    +

    Get and set the server moon values for the two moons Felucca (0) and Trammel (1)

    +
    +
    +

    Example of usage

    +
    var feluccaMoonphase = Moon( 0 );
     var TrammelMoonphase = Moon( 1 );
     Moon( 0, 7 ); //Set the moon Felucca to moonphase 7
     Moon( 1, 3 ); //Set the moon Trammel to moonphase 3
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int RandomNumber( loNum, hiNum );

    -
    -
    -

    Purpose

    -

    Returns a random number between loNum (inclusive) and hiNum (inclusive)

    -
    -
    -

    Example of usage

    -
    var iNum = RandomNumber( 0, 10 );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    int RandomNumber( loNum, hiNum );

    +
    +
    +

    Purpose

    +

    Returns a random number between loNum (inclusive) and hiNum (inclusive)

    +
    +
    +

    Example of usage

    +
    var iNum = RandomNumber( 0, 10 );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Reload( subSystemID );

    -
    -
    -

    Purpose

    -

    Dynamically reloads one (or all) of UOX3's subsystems without having to restart UOX3

    -
    -
    -

    Notes

    -

    Supported subSystemIDs: -

      -
    • 0 - Regions/TeleportLocations
    • -
    • 1 - Spawn Regions
    • -
    • 2 - Spells
    • -
    • 3 - Commands
    • -
    • 4 - DFNs/Skills
    • -
    • 5 - JScripts
    • -
    • 6 - HTML Templates
    • -
    • 7 - INI
    • -
    • 8 - Everything
    • -
    • 9 - Accounts
    • -
    • 10 - Dictionaries
    • -

    -
    -
    -

    Example of usage

    -
    // Reload all DFNs (and Skill system)
    +                        
    + + +
    +
    +

    Prototype

    +

    void Reload( subSystemID );

    +
    +
    +

    Purpose

    +

    Dynamically reloads one (or all) of UOX3's subsystems without having to restart UOX3

    +
    +
    +

    Notes

    +

    + Supported subSystemIDs: +

      +
    • 0 - Regions/TeleportLocations
    • +
    • 1 - Spawn Regions
    • +
    • 2 - Spells
    • +
    • 3 - Commands
    • +
    • 4 - DFNs/Skills
    • +
    • 5 - JScripts
    • +
    • 6 - HTML Templates
    • +
    • 7 - INI
    • +
    • 8 - Everything
    • +
    • 9 - Accounts
    • +
    • 10 - Dictionaries
    • +
    +

    +
    +
    +

    Example of usage

    +
    // Reload all DFNs (and Skill system)
     Reload( 4 );
     
     // Reload INI file
     Reload( 7 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void ReloadJSFile( scriptID );

    -
    -
    -

    Purpose

    -

    Dynamically reloads script with specified scriptID from jse_fileassociations.scp without having to restart UOX3

    -
    -
    -

    Notes

    -

    Cannot be used to validate sockets

    -
    -
    -

    Example of usage

    -
    // Example of how this is used by 'reloadjsfile command
    +                        
    + + +
    +
    +

    Prototype

    +

    void ReloadJSFile( scriptID );

    +
    +
    +

    Purpose

    +

    Dynamically reloads script with specified scriptID from jse_fileassociations.scp without having to restart UOX3

    +
    +
    +

    Notes

    +

    Cannot be used to validate sockets

    +
    +
    +

    Example of usage

    +
    // Example of how this is used by 'reloadjsfile command
     function CommandRegistration()
     {
     	RegisterCommand( "reloadjsfile", 3, true ); //Reload JavaScript file
    @@ -6818,70 +6855,70 @@ 

    January 9th, 2022

    ReloadJSFile( scriptID ); }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int RollDice( numDie, faces, addition );

    -
    -
    -

    Purpose

    -

    Rolls a faces sided die numDie times and adds addition. The example is for a DnD style dice like: 2d3+1

    -
    -
    -

    Example of usage

    -
    // Roll a DnD style dice of type 2d3+1 (2 dice with 3 faces, add 1 to result)
    +                        
    + + +
    +
    +

    Prototype

    +

    int RollDice( numDie, faces, addition );

    +
    +
    +

    Purpose

    +

    Rolls a faces sided die numDie times and adds addition. The example is for a DnD style dice like: 2d3+1

    +
    +
    +

    Example of usage

    +
    // Roll a DnD style dice of type 2d3+1 (2 dice with 3 faces, add 1 to result)
     var mDie = RollDice( 2, 3, 1 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool/int/string/object TriggerEvent( scriptID, "functionName", argument1, argument2 );

    -
    -
    -

    Purpose

    -

    Calls script with specified scriptID, runs function in said script that matches "functionName", with the defined function arguments. The called upon script can return a value in the form of a boolean, int, string or an object

    -
    -
    -

    Example of usage

    -
    // Calls script with ID 8000 and runs function "onUseChecked" with function parameters pUser and iUsed
    +                        
    + + +
    +
    +

    Prototype

    +

    bool/int/string/object TriggerEvent( scriptID, "functionName", argument1, argument2 );

    +
    +
    +

    Purpose

    +

    Calls script with specified scriptID, runs function in said script that matches "functionName", with the defined function arguments. The called upon script can return a value in the form of a boolean, int, string or an object

    +
    +
    +

    Example of usage

    +
    // Calls script with ID 8000 and runs function "onUseChecked" with function parameters pUser and iUsed
     var returnVal = TriggerEvent( 8000, "onUseChecked", pUser, iUsed );
     
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    TriggerTrap( pChar/pSock, iTrap );

    -
    -
    -

    Purpose

    -

    pChar/pSock triggers trap on iTrap object (if any trap is present on object)

    -
    -
    -

    Notes

    -

    Trap will only trigger if both first two parts of MOREZ value is set on object; first part needs to be set to 1 to indicate object is trapped, second part needs to specify damage amount to apply.

    -
    -
    -

    Example of usage

    -
    // Setup trap on iTrap object
    +                        
    + + +
    +
    +

    Prototype

    +

    TriggerTrap( pChar/pSock, iTrap );

    +
    +
    +

    Purpose

    +

    pChar/pSock triggers trap on iTrap object (if any trap is present on object)

    +
    +
    +

    Notes

    +

    Trap will only trigger if both first two parts of MOREZ value is set on object; first part needs to be set to 1 to indicate object is trapped, second part needs to specify damage amount to apply.

    +
    +
    +

    Example of usage

    +
    // Setup trap on iTrap object
     // First part of value (01) indicates object is trapped
     // Second part of value (32) defines damage dealt (32 = 0x32 = 50 damage)
     // Third (00) and Fourth (00) parts, unused here, normally indicate the min/max skill required to disarm trap
    @@ -6890,148 +6927,148 @@ 

    January 9th, 2022

    // Trigger the trap TriggerTrap( pChar, iTrap );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void UseItem( pSock/mChar, iToUse );

    -
    -
    -

    Purpose

    -

    To allow characters (and NPCs in particular) to trigger item-use functionality of items

    -
    -
    -

    Notes

    -

    Either a socket or a character can be passed in as a parameter of the UseItem function. If a socket is passed in, UOX3 will derive the character using the item from said socket.

    -
    -
    -

    Example of usage

    -
    // If an item has type 12, make NPC use the door to open it
    +                        
    + + +
    +
    +

    Prototype

    +

    void UseItem( pSock/mChar, iToUse );

    +
    +
    +

    Purpose

    +

    To allow characters (and NPCs in particular) to trigger item-use functionality of items

    +
    +
    +

    Notes

    +

    Either a socket or a character can be passed in as a parameter of the UseItem function. If a socket is passed in, UOX3 will derive the character using the item from said socket.

    +
    +
    +

    Example of usage

    +
    // If an item has type 12, make NPC use the door to open it
     if( myItem.type == 12 )
     {
     	mChar.TextMessage( "A door! What's on the other side?" );
     	UseItem( mChar, iToUse );
     }
     
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool ValidateObject( object );

    -
    -
    -

    Purpose

    -

    Returns true if argument is a valid object (Item, Character, Multi, Boat, Spawner)

    -
    -
    -

    Notes

    -

    Cannot be used to validate sockets

    -
    -
    -

    Example of usage

    -
    if( !ValidateObject( iUsed ))
    +                        
    + + +
    +
    +

    Prototype

    +

    bool ValidateObject( object );

    +
    +
    +

    Purpose

    +

    Returns true if argument is a valid object (Item, Character, Multi, Boat, Spawner)

    +
    +
    +

    Notes

    +

    Cannot be used to validate sockets

    +
    +
    +

    Example of usage

    +
    if( !ValidateObject( iUsed ))
     	return;
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    [int] WorldBrightLevel( [lightlevel] );

    -
    -
    -

    Purpose

    -

    Get/Set the "maximum brightness" light-level for daytime across the entire world

    -
    -
    -

    Notes

    -

    If no parameter is provided, function will return current "maximum brightness" light-level for daytime instead.

    -
    -
    -

    Example of usage

    -
    // Set maximum world brightness level to 1
    +                        
    + + +
    +
    +

    Prototype

    +

    [int] WorldBrightLevel( [lightlevel] );

    +
    +
    +

    Purpose

    +

    Get/Set the "maximum brightness" light-level for daytime across the entire world

    +
    +
    +

    Notes

    +

    If no parameter is provided, function will return current "maximum brightness" light-level for daytime instead.

    +
    +
    +

    Example of usage

    +
    // Set maximum world brightness level to 1
     WorldBrightLevel( 1 );
     
     // Get current maximum world brightness level
     var lightLevel = WorldBrightLevel();
     
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    [int] WorldDarkLevel( [lightlevel] );

    -
    -
    -

    Purpose

    -

    Get/Set the "minimum brightness" light-level for night-time across the entire world

    -
    -
    -

    Notes

    -

    If no parameter is provided, function will return current "minimum brightness" light-level for night-time instead.

    -
    -
    -

    Example of usage

    -
    // Set minimum world brightness level to 15
    +                        
    + + +
    +
    +

    Prototype

    +

    [int] WorldDarkLevel( [lightlevel] );

    +
    +
    +

    Purpose

    +

    Get/Set the "minimum brightness" light-level for night-time across the entire world

    +
    +
    +

    Notes

    +

    If no parameter is provided, function will return current "minimum brightness" light-level for night-time instead.

    +
    +
    +

    Example of usage

    +
    // Set minimum world brightness level to 15
     WorldDarkLevel( 15 );
     
     // Get current maximum world brightness level
     var lightLevel = WorldDarkLevel();
     
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    [int] WorldDungeonLevel( [lightlevel] );

    -
    -
    -

    Purpose

    -

    Get/Set the fixed light-level for any regions marked as dungeons

    -
    -
    -

    Notes

    -

    If no parameter is provided, function will return current fixed light-level for dungeons instead.

    -
    -
    -

    Example of usage

    -
    // Set fixed dungeon light level to 12
    +                        
    + + +
    +
    +

    Prototype

    +

    [int] WorldDungeonLevel( [lightlevel] );

    +
    +
    +

    Purpose

    +

    Get/Set the fixed light-level for any regions marked as dungeons

    +
    +
    +

    Notes

    +

    If no parameter is provided, function will return current fixed light-level for dungeons instead.

    +
    +
    +

    Example of usage

    +
    // Set fixed dungeon light level to 12
     WorldDungeonLevel( 12 );
     
     // Get current fixed light level of dungeons
     var lightLevel = WorldDungeonLevel();
     
    -
    -
    -
    +
    +
    +
    -
    +
  • diff --git a/source/Changelog.txt b/source/Changelog.txt index f64afbc32..ca281ff53 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,6 @@ +14/10/2024 - Dragon Slayer +    Added the CheckInstaLog function to check if a specific location is within an instant logout zone (SEFunctions.cpp). (thanks, Xuri) + 1/05/2024 - Dragon Slayer/Xuri Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode. Fixed createfood to check for reagents on cast. diff --git a/source/SEFunctions.cpp b/source/SEFunctions.cpp index 1700d8e55..92d74c28b 100644 --- a/source/SEFunctions.cpp +++ b/source/SEFunctions.cpp @@ -287,6 +287,46 @@ JSBool SE_CalcCharFromSer( JSContext *cx, [[maybe_unused]] JSObject *obj, uintN return JS_TRUE; } +//o------------------------------------------------------------------------------------------------o +//| Function - SE_CheckInstaLog() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Checks if a specific location is within an instant logout zone +//o------------------------------------------------------------------------------------------------o +JSBool SE_CheckInstaLog( JSContext *cx, [[maybe_unused]] JSObject *obj, uintN argc, jsval *argv, jsval *rval ) +{ + if( argc != 4 ) + { + ScriptError( cx, "CheckInstaLog: Invalid number of parameters (4)" ); + return JS_FALSE; + } + + SI16 targX = static_cast( JSVAL_TO_INT( argv[0] )); + SI16 targY = static_cast( JSVAL_TO_INT( argv[1] )); + UI08 targWorld = static_cast( JSVAL_TO_INT( argv[2] )); + UI16 targInstanceId = static_cast( JSVAL_TO_INT( argv[3] )); + + auto logLocs = cwmWorldState->logoutLocs; + + *rval = JSVAL_FALSE; + + if( logLocs.size() > 0 ) + { + for( size_t i = 0; i < logLocs.size(); ++i ) + { + if( logLocs[i].worldNum == targWorld && logLocs[i].instanceId == targInstanceId ) + { + if(( targX >= logLocs[i].x1 && targX <= logLocs[i].x2 ) && ( targY >= logLocs[i].y1 && targY <= logLocs[i].y2 )) + { + *rval = JSVAL_TRUE; + return JS_TRUE; + } + } + } + } + + return JS_TRUE; +} + //o------------------------------------------------------------------------------------------------o //| Function - SE_DoMovingEffect() //o------------------------------------------------------------------------------------------------o diff --git a/source/SEFunctions.h b/source/SEFunctions.h index 904a1fabd..adde69ee0 100644 --- a/source/SEFunctions.h +++ b/source/SEFunctions.h @@ -47,6 +47,8 @@ SEngineFunc SE_CalcCharFromSer; // *** SEngineFunc SE_CalcItemFromSer; // *** SEngineFunc SE_CalcMultiFromSer; // *** +SEngineFunc SE_CheckInstaLog; + SEngineFunc SE_MakeItem; // *** SEngineFunc SE_CommandLevelReq; // * diff --git a/source/cScript.cpp b/source/cScript.cpp index 88ef1a0e6..d92186313 100644 --- a/source/cScript.cpp +++ b/source/cScript.cpp @@ -55,6 +55,7 @@ static JSFunctionSpec my_functions[] = { "CalcCharFromSer", SE_CalcCharFromSer, 1, 0, 0 }, { "CalcItemFromSer", SE_CalcItemFromSer, 1, 0, 0 }, { "CalcMultiFromSer", SE_CalcMultiFromSer, 1, 0, 0 }, + { "CheckInstaLog", SE_CheckInstaLog, 4, 0, 0 }, { "GetHour", SE_GetHour, 0, 0, 0 }, { "GetMinute", SE_GetMinute, 0, 0, 0 }, { "GetDay", SE_GetDay, 0, 0, 0 }, From f8700f6464be037ea12c6b6aad44f13ddde3d3f7 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 20 Oct 2024 17:35:48 -0500 Subject: [PATCH 080/147] Added SetRandomColor Applies a random color from specified colorlist to character or item --- docs/jsdocs.html | 3207 ++++++++++++++++++++------------------- source/Changelog.txt | 3 + source/UOXJSMethods.cpp | 29 + source/UOXJSMethods.h | 5 +- 4 files changed, 1671 insertions(+), 1573 deletions(-) diff --git a/docs/jsdocs.html b/docs/jsdocs.html index 8dbe347a8..8e97fc239 100644 --- a/docs/jsdocs.html +++ b/docs/jsdocs.html @@ -8551,356 +8551,366 @@

    January 9th, 2022

  • Character Methods
    -
    +
    -
    - - -
    -
    -

    Prototype

    -

    void AddAggressorFlag( otherChar )

    -
    -
    -

    Purpose

    -

    Adds aggressor flag for character towards target character

    -
    -
    -

    Example of usage

    -
    pUser.AddAggressorFlag( otherChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void AddAggressorFlag( otherChar )

    +
    +
    +

    Purpose

    +

    Adds aggressor flag for character towards target character

    +
    +
    +

    Example of usage

    +
    pUser.AddAggressorFlag( otherChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void AddFriend( pChar )

    -
    -
    -

    Purpose

    -

    Adds a player to an NPC pet/follower's friend list

    -
    -
    -

    Example of usage

    -
    myPet.AddFriend( pChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void AddFriend( pChar )

    +
    +
    +

    Purpose

    +

    Adds a player to an NPC pet/follower's friend list

    +
    +
    +

    Example of usage

    +
    myPet.AddFriend( pChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void AddPermaGreyFlag( otherChar )

    -
    -
    -

    Purpose

    -

    Adds permagrey flag for character towards target character

    -
    -
    -

    Example of usage

    -
    pUser.AddPermaGreyFlag( otherChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void AddPermaGreyFlag( otherChar )

    +
    +
    +

    Purpose

    +

    Adds permagrey flag for character towards target character

    +
    +
    +

    Example of usage

    +
    pUser.AddPermaGreyFlag( otherChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void AddSpell( spellNum )

    -
    -
    -

    Purpose

    -

    Adds specified spell to the first spellbook in character's pack

    -
    -
    -

    Example of usage

    -
    myChar.AddSpell( 3 ); //adds Feeblemind spell to myChar's spellbook (if he has one)
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void AddSpell( spellNum )

    +
    +
    +

    Purpose

    +

    Adds specified spell to the first spellbook in character's pack

    +
    +
    +

    Example of usage

    +
    myChar.AddSpell( 3 ); //adds Feeblemind spell to myChar's spellbook (if he has one)
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void BoltEffect()

    -
    -
    -

    Purpose

    -

    Plays the lightning bolt effect on specified character to all nearby players

    -
    -
    -

    Example of usage

    -
    myChar.BoltEffect();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void BoltEffect()

    +
    +
    +

    Purpose

    +

    Plays the lightning bolt effect on specified character to all nearby players

    +
    +
    +

    Example of usage

    +
    myChar.BoltEffect();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void BreakConcentration()
    - void BreakConcentration( socket )

    -
    -
    -

    Purpose

    -

    Break a caster's concentration

    -
    -
    -

    Example of usage

    -
    myNPC.BreakConcentration(); //for NPCs, who have no sockets
    +                        
    + + +
    +
    +

    Prototype

    +

    + + void BreakConcentration()
    + void BreakConcentration( socket ) +
    +

    +
    +
    +

    Purpose

    +

    Break a caster's concentration

    +
    +
    +

    Example of usage

    +
    myNPC.BreakConcentration(); //for NPCs, who have no sockets
     myPlayer.BreakConcentration( mSocket ); //for players, who DO have sockets
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void BuyFrom( targNPC )

    -
    -
    -

    Purpose

    -

    Brings up targNPC's shopkeeper gump or player vendor backpack for buying

    -
    -
    -

    Example of usage

    -
    myChar.BuyFrom( myNPC );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void BuyFrom( targNPC )

    +
    +
    +

    Purpose

    +

    Brings up targNPC's shopkeeper gump or player vendor backpack for buying

    +
    +
    +

    Example of usage

    +
    myChar.BuyFrom( myNPC );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int CalculateControlChance( pChar );

    -
    -
    -

    Purpose

    -

    Returns chance (in values ranging from 0 to 1000) of pChar (player) successfully controlling a pet

    -
    -
    -

    Example of usage

    -
    var controlChance = myPet.CalculateControlChance( pChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    int CalculateControlChance( pChar );

    +
    +
    +

    Purpose

    +

    Returns chance (in values ranging from 0 to 1000) of pChar (player) successfully controlling a pet

    +
    +
    +

    Example of usage

    +
    var controlChance = myPet.CalculateControlChance( pChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool CanSee( object );
    - bool CanSee( x, y, z );

    -
    -
    -

    Purpose

    -

    LineOfSight-checking; check if character/socket can see a specified object/target location

    -
    -
    -

    Example of usage

    -
    if( !myChar.CanSee( targetChar ))
    +                        
    + + +
    +
    +

    Prototype

    +

    + + bool CanSee( object );
    + bool CanSee( x, y, z ); +
    +

    +
    +
    +

    Purpose

    +

    LineOfSight-checking; check if character/socket can see a specified object/target location

    +
    +
    +

    Example of usage

    +
    if( !myChar.CanSee( targetChar ))
     return;
     
     if( myChar.CanSee( targetChar.x, targetChar.y, targetChar.z )
     {
     	// ...Do stuff here
     }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void CastSpell( spellNum [, directCast])

    -
    -
    -

    Purpose

    -

    Causes character to cast spellNum. Character can be an NPC or PC, and spellNum can be any valid spell number from 0 to 65. The optional boolean parameter directCast can be used to make the character automatically cast the spell at their current target (if spell is targeted)

    -
    -
    -

    Example of usage

    -
    // Player casts recall spell
    +                        
    + + +
    +
    +

    Prototype

    +

    void CastSpell( spellNum [, directCast])

    +
    +
    +

    Purpose

    +

    Causes character to cast spellNum. Character can be an NPC or PC, and spellNum can be any valid spell number from 0 to 65. The optional boolean parameter directCast can be used to make the character automatically cast the spell at their current target (if spell is targeted)

    +
    +
    +

    Example of usage

    +
    // Player casts recall spell
     pUser.CastSpell( 32 );
     
     // NPC casts lightning bolt at their current target
     myNPC.CastSpell( 30, true );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void CheckAggressorFlag( otherChar )

    -
    -
    -

    Purpose

    -

    Check if character has an aggressor flag towards target character

    -
    -
    -

    Example of usage

    -
    if( pUser.CheckAggressorFlag( otherChar ))
    +                        
    + + +
    +
    +

    Prototype

    +

    void CheckAggressorFlag( otherChar )

    +
    +
    +

    Purpose

    +

    Check if character has an aggressor flag towards target character

    +
    +
    +

    Example of usage

    +
    if( pUser.CheckAggressorFlag( otherChar ))
     {
     	// ... do something
     }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void CheckPermaGreyFlag( otherChar )

    -
    -
    -

    Purpose

    -

    Check if character has an active permagrey flag towards target character

    -
    -
    -

    Example of usage

    -
    if( pUser.CheckPermaGreyFlag( otherChar ))
    +                        
    + + +
    +
    +

    Prototype

    +

    void CheckPermaGreyFlag( otherChar )

    +
    +
    +

    Purpose

    +

    Check if character has an active permagrey flag towards target character

    +
    +
    +

    Example of usage

    +
    if( pUser.CheckPermaGreyFlag( otherChar ))
     {
     	// ... do something
     }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool CheckSkill( skillNum, minSkill, maxSkill )

    -

    bool CheckSkill( skillNum, minSkill, maxSkill, isCraftSkill )

    -
    -
    -

    Purpose

    -

    Returns true if the result of a skillcheck for skill skillNum is between minSkill and maxSkill

    -
    -
    -

    Notes

    -

    If the optional parameter isCraftSkill is set to true, UOX3 uses an alternate skill check formula that provides a minimum 50% chance of success if player at least meets minimum requirements for crafting an item

    -
    -
    -

    Example of usage

    -
    // If result of skill check for myChar's skill #1 (alchemy) is between 20.0 and 100.0
    +                        
    + + +
    +
    +

    Prototype

    +

    bool CheckSkill( skillNum, minSkill, maxSkill )

    +

    bool CheckSkill( skillNum, minSkill, maxSkill, isCraftSkill )

    +
    +
    +

    Purpose

    +

    Returns true if the result of a skillcheck for skill skillNum is between minSkill and maxSkill

    +
    +
    +

    Notes

    +

    If the optional parameter isCraftSkill is set to true, UOX3 uses an alternate skill check formula that provides a minimum 50% chance of success if player at least meets minimum requirements for crafting an item

    +
    +
    +

    Example of usage

    +
    // If result of skill check for myChar's skill #1 (alchemy) is between 20.0 and 100.0
     if( myChar.CheckSkill( 1, 200, 1000 ))
     {
     	...
     }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void ClearAggressorFlags()

    -
    -
    -

    Purpose

    -

    Clears all the character's aggressor flags towards other characters

    -
    -
    -

    Example of usage

    -
    pUser.ClearAggressorFlags();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void ClearAggressorFlags()

    +
    +
    +

    Purpose

    +

    Clears all the character's aggressor flags towards other characters

    +
    +
    +

    Example of usage

    +
    pUser.ClearAggressorFlags();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void ClearPermaGreyFlags()

    -
    -
    -

    Purpose

    -

    Clears all the character's aggressor flags towards other characters

    -
    -
    -

    Example of usage

    -
    pUser.ClearPermaGreyFlags();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void ClearPermaGreyFlags()

    +
    +
    +

    Purpose

    +

    Clears all the character's aggressor flags towards other characters

    +
    +
    +

    Example of usage

    +
    pUser.ClearPermaGreyFlags();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void ClearFriendList();

    -
    -
    -

    Purpose

    -

    Clears an NPC pet/follower's friend list

    -
    -
    -

    Example of usage

    -
    myPet.ClearFriendList();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void ClearFriendList();

    +
    +
    +

    Purpose

    +

    Clears an NPC pet/follower's friend list

    +
    +
    +

    Example of usage

    +
    myPet.ClearFriendList();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void CustomTarget( targetNum, toSay )

    -
    -
    -

    Purpose

    -

    Very similar to PopUpTarget. It's a callback situation instead. targetNum must be between 0 and 255. Character says toSay, and is shown a cursor. Re-enters the script associated with the socket's player (i.e. player who gets the cursor). Enters function name based on the value of tNum. if tNum is 0, then the function would be onCallback0. Prototype of callback is:
    - function onCallback0( pSock, myTarget )

    -
    -
    -

    Example of usage

    -
    // User double-clicks an item, which brings up a custom target cursor
    +                        
    + + +
    +
    +

    Prototype

    +

    void CustomTarget( targetNum, toSay )

    +
    +
    +

    Purpose

    +

    + Very similar to PopUpTarget. It's a callback situation instead. targetNum must be between 0 and 255. Character says toSay, and is shown a cursor. Re-enters the script associated with the socket's player (i.e. player who gets the cursor). Enters function name based on the value of tNum. if tNum is 0, then the function would be onCallback0. Prototype of callback is:
    + function onCallback0( pSock, myTarget ) +

    +
    +
    +

    Example of usage

    +
    // User double-clicks an item, which brings up a custom target cursor
     function onUseChecked( pUser, iUsed )
     {
     	pUser.CustomTarget( 0, "Select your custom target:" );
    @@ -8911,32 +8921,36 @@ 

    January 9th, 2022

    { // ... do something with target here }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Damage( amount )
    - void Damage( amount, damageType )
    - void Damage( amount, damageType, attacker )
    - void Damage( amount, damageType, attacker, doRepSys )

    -
    -
    -

    Purpose

    -

    Cause damage to a character.

    -
    -
    -

    Notes

    -

    damageType represents the type of damage done (1 = Physical, 2 = Light, 3 = Rain, 4 = Cold, 5 = Heat, 6 = Lightning/Energy, 7 = Poison, 8 = Snow). doRepSys true/false defines whether a criminal check should be done for attacker

    -
    -
    -

    Example of usage

    -
    // Deal 15 damage to myChar (defaults to Physical damage)
    +                        
    + + +
    +
    +

    Prototype

    +

    + + void Damage( amount )
    + void Damage( amount, damageType )
    + void Damage( amount, damageType, attacker )
    + void Damage( amount, damageType, attacker, doRepSys ) +
    +

    +
    +
    +

    Purpose

    +

    Cause damage to a character.

    +
    +
    +

    Notes

    +

    damageType represents the type of damage done (1 = Physical, 2 = Light, 3 = Rain, 4 = Cold, 5 = Heat, 6 = Lightning/Energy, 7 = Poison, 8 = Snow). doRepSys true/false defines whether a criminal check should be done for attacker

    +
    +
    +

    Example of usage

    +
    // Deal 15 damage to myChar (defaults to Physical damage)
     myChar.Damage( 15 );
     
     // Deal 15 Heat/Fire damage to myChar, with attackerChar as source
    @@ -8944,337 +8958,353 @@ 

    January 9th, 2022

    // Deal 15 Lightning damage to myChar, with attackerChar as source, and flag set to do rep check for criminal flag myChar.Damage( 15, 6, attackerChar, true );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int Defense( hitLoc, damageType, doArmorDamage )

    -
    -
    -

    Purpose

    -

    Returns the defense value against damageType of the armor item at the location hitLoc and does armor damage if needed

    -
    -
    -

    Notes

    -

    hit locations:0 = whole char, 1 = body, 2 = arms, 3 = head, 4 = legs, 5 = neck, 6 = the rest
    - damage types: 0 = None, 1 = Physical, 2 = Light, 3 = Rain, 4 = Cold, 5 = Heat, 6 = Lightning, 7 = Poison, 8 = Snow, 9 = Storm

    -
    -
    -

    Example of usage

    -
    // Get the defense value of the head armor against Physical damage and damage the armor:
    +                        
    + + +
    +
    +

    Prototype

    +

    int Defense( hitLoc, damageType, doArmorDamage )

    +
    +
    +

    Purpose

    +

    Returns the defense value against damageType of the armor item at the location hitLoc and does armor damage if needed

    +
    +
    +

    Notes

    +

    + hit locations:0 = whole char, 1 = body, 2 = arms, 3 = head, 4 = legs, 5 = neck, 6 = the rest
    + damage types: 0 = None, 1 = Physical, 2 = Light, 3 = Rain, 4 = Cold, 5 = Heat, 6 = Lightning, 7 = Poison, 8 = Snow, 9 = Storm +

    +
    +
    +

    Example of usage

    +
    // Get the defense value of the head armor against Physical damage and damage the armor:
     value = mChar.Defense( 3, 1, true);
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int DirectionTo( trgObj )
    - int DirectionTo( x, y );

    -
    -
    -

    Purpose

    -

    Returns the direction (0 = North, 1 = North-East, 2 = East, 3 = South-East, 4 = South, 5 = South-West, 6 = West, 7 = North-West) from character to trgObj/location

    -
    -
    -

    Example of usage

    -
    var dir = myChar.DirectionTo( trgChar );
    +                        
    + + +
    +
    +

    Prototype

    +

    + + int DirectionTo( trgObj )
    + int DirectionTo( x, y ); +
    +

    +
    +
    +

    Purpose

    +

    Returns the direction (0 = North, 1 = North-East, 2 = East, 3 = South-East, 4 = South, 5 = South-West, 6 = West, 7 = North-West) from character to trgObj/location

    +
    +
    +

    Example of usage

    +
    var dir = myChar.DirectionTo( trgChar );
     var dir = myChar.DirectionTo( trgChar.x, trgChar.y );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Dismount()

    -
    -
    -

    Purpose

    -

    Dismounts character

    -
    -
    -

    Example of usage

    -
    myChar.Dismount()
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void Dismount()

    +
    +
    +

    Purpose

    +

    Dismounts character

    +
    +
    +

    Example of usage

    +
    myChar.Dismount()
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void DoAction( trgAction subAction )

    -
    -
    -

    Purpose

    -

    Makes character play the action trgAction. If subAction is specified, will play action using the "new" animation packet 0xE2, which supports subActions. This is also required for any gargoyle-specific animations.

    -
    -
    -

    Notes

    -

    Pre-v7.0.0.0:
    - Human/Elf actions range from 0x01 to 0x22.
    - Animals have animations in 0x00 to 0x0c range.
    - Monsters have animations in 0x00 to 0x15 range, though not all monsters support all these animations.

    -

    v7.0.0.0+:
    - All character actions range from 0x00 to 0x0f, with some animations registered as sub-actions

    -
    -
    -

    Example of usage

    -
    myChar.DoAction( 0x0B );
    +                        
    + + +
    +
    +

    Prototype

    +

    void DoAction( trgAction subAction )

    +
    +
    +

    Purpose

    +

    Makes character play the action trgAction. If subAction is specified, will play action using the "new" animation packet 0xE2, which supports subActions. This is also required for any gargoyle-specific animations.

    +
    +
    +

    Notes

    +

    + Pre-v7.0.0.0:
    + Human/Elf actions range from 0x01 to 0x22.
    + Animals have animations in 0x00 to 0x0c range.
    + Monsters have animations in 0x00 to 0x15 range, though not all monsters support all these animations. +

    +

    + v7.0.0.0+:
    + All character actions range from 0x00 to 0x0f, with some animations registered as sub-actions +

    +
    +
    +

    Example of usage

    +
    myChar.DoAction( 0x0B );
     // or a gargoyle action & subAction
     myChar.DoAction( 0x00, 0x03 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    CHARACTER Dupe();

    -
    -
    -

    Purpose

    -

    Dupes specified character

    -
    -
    -

    Notes

    -

    Location of duped character must be manually set

    -
    -
    -

    Example of usage

    -
    // Create a duplicate of myChar
    +                        
    + + +
    +
    +

    Prototype

    +

    CHARACTER Dupe();

    +
    +
    +

    Purpose

    +

    Dupes specified character

    +
    +
    +

    Notes

    +

    Location of duped character must be manually set

    +
    +
    +

    Example of usage

    +
    // Create a duplicate of myChar
     var dupedChar = myChar.Dupe();
     
     // Teleport the duped character to the same location as myChar
     dupedChar.Teleport( myChar );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void EmoteMessage( message )

    -
    -
    -

    Purpose

    -

    Causes the Char to emote message. You have to put the start and end * manually in!

    -
    -
    -

    Example of usage

    -
    myChar.EmoteMessage( "*looks around*" );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void EmoteMessage( message )

    +
    +
    +

    Purpose

    +

    Causes the Char to emote message. You have to put the start and end * manually in!

    +
    +
    +

    Example of usage

    +
    myChar.EmoteMessage( "*looks around*" );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void ExecuteCommand( cmdString )

    -
    -
    -

    Purpose

    -

    Executes the command cmdString (should include any params)

    -
    -
    -

    Example of usage

    -
    myChar.ExecuteCommand( "add 0x04a9" );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void ExecuteCommand( cmdString )

    +
    +
    +

    Purpose

    +

    Executes the command cmdString (should include any params)

    +
    +
    +

    Example of usage

    +
    myChar.ExecuteCommand( "add 0x04a9" );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void ExplodeItem( myItem, damage, damageType, explodeNearby )

    -
    -
    -

    Purpose

    -

    Deletes specified item by exploding it, dealing damage to the character and potentially nearby characters

    -
    -
    -

    Example of usage

    -
    // Explode item and deal damage only to myChar
    +                        
    + + +
    +
    +

    Prototype

    +

    void ExplodeItem( myItem, damage, damageType, explodeNearby )

    +
    +
    +

    Purpose

    +

    Deletes specified item by exploding it, dealing damage to the character and potentially nearby characters

    +
    +
    +

    Example of usage

    +
    // Explode item and deal damage only to myChar
     myChar.ExplodeItem( myItem, 25, 5, false );
     
     // Explode item and deal damage to all characters within a radius of 2 tiles (hardcoded range)
     myChar.ExplodeItem( myItem, 25, 5, true );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    Item FindItemLayer( layer )

    -
    -
    -

    Purpose

    -

    A return value of -1 indicates there was no item at that particular layer. A common list of layers follow:

    -

    0x01 - Single-Hand item/weapon
    - 0x02 - Two-Hand item/weapon (including Shield)
    - 0x03 - Foot Covering/Armor
    - 0x04 - Leg Covering (including Pants, Shorts, Bone/Chain/Ring legs)
    - 0x05 - Chest Clothing/Female Chest Armor
    - 0x06 - Head Covering/Armor
    - 0x07 - Hand Covering/Armor
    - 0x08 - Ring
    - 0x09 - N/A (not used)
    - 0x0A - Neck Covering/Armor
    - 0x0B - Hair
    - 0x0C - Waist (Half-Apron)
    - 0x0D - Torso (inner)(Chest Armor)
    - 0x0E - Bracelet
    - 0x0F - N/A (no info)
    - 0x10 - Facial Hair
    - 0x11 - Torso (Middle)(Surcoat, Tunic, Full Apron, Sash)
    - 0x12 - Earrings
    - 0x13 - Arm Covering/Armor
    - 0x14 - Back (Cloak)
    - 0x15 - BackPack
    - 0x16 - Torso (outer)(Robe)
    - 0x17 - Legs (outer)(Skirt/Kilt)
    - 0x18 - Legs (inner)(Leg Armor)
    - 0x19 - Mount (Horse, Ostard, etc.)
    - 0x1A - NPC Buy Restock Container
    - 0x1B - NPC Buy No Restock Container
    - 0x1C - NPC Sell Container
    - 0x1D - Bank Box

    -
    -
    -

    Example of usage

    -
    var leftHand = myChar.FindItemLayer( 1 );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    Item FindItemLayer( layer )

    +
    +
    +

    Purpose

    +

    A return value of -1 indicates there was no item at that particular layer. A common list of layers follow:

    +

    + 0x01 - Single-Hand item/weapon
    + 0x02 - Two-Hand item/weapon (including Shield)
    + 0x03 - Foot Covering/Armor
    + 0x04 - Leg Covering (including Pants, Shorts, Bone/Chain/Ring legs)
    + 0x05 - Chest Clothing/Female Chest Armor
    + 0x06 - Head Covering/Armor
    + 0x07 - Hand Covering/Armor
    + 0x08 - Ring
    + 0x09 - N/A (not used)
    + 0x0A - Neck Covering/Armor
    + 0x0B - Hair
    + 0x0C - Waist (Half-Apron)
    + 0x0D - Torso (inner)(Chest Armor)
    + 0x0E - Bracelet
    + 0x0F - N/A (no info)
    + 0x10 - Facial Hair
    + 0x11 - Torso (Middle)(Surcoat, Tunic, Full Apron, Sash)
    + 0x12 - Earrings
    + 0x13 - Arm Covering/Armor
    + 0x14 - Back (Cloak)
    + 0x15 - BackPack
    + 0x16 - Torso (outer)(Robe)
    + 0x17 - Legs (outer)(Skirt/Kilt)
    + 0x18 - Legs (inner)(Leg Armor)
    + 0x19 - Mount (Horse, Ostard, etc.)
    + 0x1A - NPC Buy Restock Container
    + 0x1B - NPC Buy No Restock Container
    + 0x1C - NPC Sell Container
    + 0x1D - Bank Box +

    +
    +
    +

    Example of usage

    +
    var leftHand = myChar.FindItemLayer( 1 );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    Item FindItemSection( sectionID )

    -
    -
    -

    Purpose

    -

    Looks for item with specific sectionID in character's backpack

    -
    -
    -

    Example of usage

    -
    var runebook = myPlayer.FindItemSection( "runebook" ); // does the player have a runebook?
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    Item FindItemSection( sectionID )

    +
    +
    +

    Purpose

    +

    Looks for item with specific sectionID in character's backpack

    +
    +
    +

    Example of usage

    +
    var runebook = myPlayer.FindItemSection( "runebook" ); // does the player have a runebook?
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    Item FindItemType( itemType )

    -
    -
    -

    Purpose

    -

    Look for items of a certain type in character's pack

    -
    -
    -

    Example of usage

    -
    var spellBook = myPlayer.FindItemType( 9 ); //does the player have a spellbook?
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    Item FindItemType( itemType )

    +
    +
    +

    Purpose

    +

    Look for items of a certain type in character's pack

    +
    +
    +

    Example of usage

    +
    var spellBook = myPlayer.FindItemType( 9 ); //does the player have a spellbook?
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Follow( followTarget )

    -
    -
    -

    Purpose

    -

    Forces NPC to follow specified target

    -
    -
    -

    Example of usage

    -
    myNPC.Follow( followTarget );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void Follow( followTarget )

    +
    +
    +

    Purpose

    +

    Forces NPC to follow specified target

    +
    +
    +

    Example of usage

    +
    myNPC.Follow( followTarget );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Gate( item )
    - void Gate( x, y, z, world )

    -
    -
    -

    Purpose

    -

    Opens a gate to the location marked on an item, or to a specific set of coordinates

    -
    -
    -

    Example of usage

    -
    // Opens a gate to coordinates from a recall rune (targItem)
    +                        
    + + +
    +
    +

    Prototype

    +

    + + void Gate( item )
    + void Gate( x, y, z, world ) +
    +

    +
    +
    +

    Purpose

    +

    Opens a gate to the location marked on an item, or to a specific set of coordinates

    +
    +
    +

    Example of usage

    +
    // Opens a gate to coordinates from a recall rune (targItem)
     myChar.Gate( targItem );
     
     // Opens a gate to Lord British's throne room
     myChar.Gate( 1329, 1624, 50 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    FRIENDLIST GetFriendList();

    -
    -
    -

    Purpose

    -

    Gets an NPC pet/follower's friend list

    -
    -
    -

    Example of usage

    -
    // Get pet's friend list
    +                        
    + + +
    +
    +

    Prototype

    +

    FRIENDLIST GetFriendList();

    +
    +
    +

    Purpose

    +

    Gets an NPC pet/follower's friend list

    +
    +
    +

    Example of usage

    +
    // Get pet's friend list
     var friendList = myPet.GetFriendList();
     for( var i = 0; i < friendList.length; i++ )
     {
    @@ -9283,25 +9313,25 @@ 

    January 9th, 2022

    myPet.TextMessage( friendList[i].name + " is my friend!" ); } }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    PETLIST GetPetList();

    -
    -
    -

    Purpose

    -

    Gets list of character's pets/followers

    -
    -
    -

    Example of usage

    -
    // Get myChar's pet/follower list
    +                        
    + + +
    +
    +

    Prototype

    +

    PETLIST GetPetList();

    +
    +
    +

    Purpose

    +

    Gets list of character's pets/followers

    +
    +
    +

    Example of usage

    +
    // Get myChar's pet/follower list
     var petList = myChar.GetPetList();
     for( var i = 0; i < petList.length; i++ )
     {
    @@ -9310,27 +9340,28 @@ 

    January 9th, 2022

    myChar.TextMessage( petList[i].name + " is my pet and/or follower!" ); } }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int GetTimer( timerID )

    -

    int SetTimer( timerID, numMilliSeconds )

    -
    -
    -

    Purpose

    -

    Get a timestamp for when timer will run out, or set the time in milliseconds until specified timer expires for a Character object

    -
    -
    -

    Notes

    -

    Supported timerIDs for Characters -

    Timer.TIMEOUT 		// Time until next attack can be done in combat
    +                        
    + + +
    +
    +

    Prototype

    +

    int GetTimer( timerID )

    +

    int SetTimer( timerID, numMilliSeconds )

    +
    +
    +

    Purpose

    +

    Get a timestamp for when timer will run out, or set the time in milliseconds until specified timer expires for a Character object

    +
    +
    +

    Notes

    +

    + Supported timerIDs for Characters +

    Timer.TIMEOUT 		// Time until next attack can be done in combat
     Timer.INVIS			// Time until invisible character becomes visible
     Timer.HUNGER		// Time until character grows more hungry
     Timer.THIRST		// Time until character grows more thirsty
    @@ -9355,720 +9386,752 @@ 

    January 9th, 2022

    Timer.IDLEANIMTIME // Time until next time character plays idle animation Timer.LOGOUT // Time it takes for a player char to vanish after logout Timer.YOUNGHEAL // Time until next time Young player can be healed by NPC healer -Timer.YOUNGMESSAGE // Time until next time Young player is warned about dangerous looking monsters in overworld

    -

    See also: GetTimer()/SetTimer() Socket Methods.

    -
    -
    -

    Example of usage

    -
    // Get a timestamp for when criminal flag expires, and spit out milliseconds left
    +Timer.YOUNGMESSAGE 	// Time until next time Young player is warned about dangerous looking monsters in overworld
    +

    +

    See also: GetTimer()/SetTimer() Socket Methods.

    +
    +
    +

    Example of usage

    +
    // Get a timestamp for when criminal flag expires, and spit out milliseconds left
     var criminalTimestamp = myChar.GetTimer( Timer.CRIMFLAG );
     myChar.TextMessage(( myTarget.GetTimer( Timer.CRIMFLAG ) - GetCurrentClock() ).toString() );
     
     // Set time from now in milliseconds that criminal flag will last, after making character a criminal
     myChar.criminal = true;
     myChar.SetTimer( timer.CRIMFLAG, 3000 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool HasBeenOwner( pChar );

    -
    -
    -

    Purpose

    -

    Returns whether character pChar has previously owned the pet (is on pet's owner list)

    -
    -
    -

    Example of usage

    -
    // Get myChar's pet/follower list
    +                        
    + + +
    +
    +

    Prototype

    +

    bool HasBeenOwner( pChar );

    +
    +
    +

    Purpose

    +

    Returns whether character pChar has previously owned the pet (is on pet's owner list)

    +
    +
    +

    Example of usage

    +
    // Get myChar's pet/follower list
     if( myPet.HasBeenOwner( pChar ))
     {
     	myPet.TextMessage( "Hey, you owned me earlier, I'll let you tame me easier this time around!" );
     }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Heal( amount ); - void Heal( amount, pHealer );

    -
    -
    -

    Purpose

    -

    Heals a character for specified amount, with optional argument to provide character who healed

    -
    -
    -

    Example of usage

    -
    myChar.Heal( 15 );
    +                        
    + + +
    +
    +

    Prototype

    +

    + + void Heal( amount ); + void Heal( amount, pHealer ); + +

    +
    +
    +

    Purpose

    +

    Heals a character for specified amount, with optional argument to provide character who healed

    +
    +
    +

    Example of usage

    +
    myChar.Heal( 15 );
     myChar.Heal( 15, healerChar );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool InitiateCombat( targetChar );

    -
    -
    -

    Purpose

    -

    Attempts to initiate combat with target character

    -
    -
    -

    Example of usage

    -
    if( myNPC.InitiateCombat( otherChar ))
    +                        
    + + +
    +
    +

    Prototype

    +

    bool InitiateCombat( targetChar );

    +
    +
    +

    Purpose

    +

    Attempts to initiate combat with target character

    +
    +
    +

    Example of usage

    +
    if( myNPC.InitiateCombat( otherChar ))
     {
     	myNPC.TextMessage( "Yes! I managed to initiate combat with " + otherChar.name + "!" );
     }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void InvalidateAttacker();

    -
    -
    -

    Purpose

    -

    Resets the attacker attack so that it cancels attack setup.

    -
    -
    -

    Example of usage

    -
    myNPC.InvalidateAttacker();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void InvalidateAttacker();

    +
    +
    +

    Purpose

    +

    Resets the attacker attack so that it cancels attack setup.

    +
    +
    +

    Example of usage

    +
    myNPC.InvalidateAttacker();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void InitWanderArea()

    -
    -
    -

    Purpose

    -

    Initialize a WanderArea (10x10 box, or 10 radius circle) for the specified NPC. Will only work if their wander-mode is already set to box or circle.

    -
    -
    -

    Example of usage

    -
    myNPC.InitWanderArea();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void InitWanderArea()

    +
    +
    +

    Purpose

    +

    Initialize a WanderArea (10x10 box, or 10 radius circle) for the specified NPC. Will only work if their wander-mode is already set to box or circle.

    +
    +
    +

    Example of usage

    +
    myNPC.InitWanderArea();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void IsAggressor()

    -

    void IsAggressor( [bool]checkForPlayerOnly)

    -
    -
    -

    Purpose

    -

    Returns true/false depending on whether character has any active aggressor flags

    -
    -
    -

    Notes

    -

    If checkForPlayerOnly flag is true, any aggressor flags towards NPCs are ignored

    -
    -
    -

    Example of usage

    -
    var isAggressor = pUser.IsAggressor();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void IsAggressor()

    +

    void IsAggressor( [bool]checkForPlayerOnly)

    +
    +
    +

    Purpose

    +

    Returns true/false depending on whether character has any active aggressor flags

    +
    +
    +

    Notes

    +

    If checkForPlayerOnly flag is true, any aggressor flags towards NPCs are ignored

    +
    +
    +

    Example of usage

    +
    var isAggressor = pUser.IsAggressor();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void IsPermaGrey( otherChar )

    -

    void IsPermaGrey( [bool]checkForPlayerOnly)

    -
    -
    -

    Purpose

    -

    Returns true/false depending on whether character has any active permagrey flags

    -
    -
    -

    Notes

    -

    If checkForPlayerOnly flag is true, any permagrey flags towards NPCs are ignored

    -
    -
    -

    Example of usage

    -
    var isPermaGrey = pUser.IsPermaGrey();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void IsPermaGrey( otherChar )

    +

    void IsPermaGrey( [bool]checkForPlayerOnly)

    +
    +
    +

    Purpose

    +

    Returns true/false depending on whether character has any active permagrey flags

    +
    +
    +

    Notes

    +

    If checkForPlayerOnly flag is true, any permagrey flags towards NPCs are ignored

    +
    +
    +

    Example of usage

    +
    var isPermaGrey = pUser.IsPermaGrey();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Jail()
    - void Jail( numSecsToJail )

    -
    -
    -

    Purpose

    -

    Jails character for n seconds if specified. If no duration is specified, defaults to 24 hours.

    -
    -
    -

    Example of usage

    -
    myChar.Jail( 1000 );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    + + void Jail()
    + void Jail( numSecsToJail ) +
    +

    +
    +
    +

    Purpose

    +

    Jails character for n seconds if specified. If no duration is specified, defaults to 24 hours.

    +
    +
    +

    Example of usage

    +
    myChar.Jail( 1000 );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Kill()

    -
    -
    -

    Purpose

    -

    Kills the character. If onDeathBlow JS event is present for character's script, it triggers

    -
    -
    -

    Example of usage

    -
    myChar.Kill();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void Kill()

    +
    +
    +

    Purpose

    +

    Kills the character. If onDeathBlow JS event is present for character's script, it triggers

    +
    +
    +

    Example of usage

    +
    myChar.Kill();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void MagicEffect( spellID )

    -
    -
    -

    Purpose

    -

    Applies spell effects of specified spell to character

    -
    -
    -

    Example of usage

    -
    myChar.MagicEffect( 43 );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void MagicEffect( spellID )

    +
    +
    +

    Purpose

    +

    Applies spell effects of specified spell to character

    +
    +
    +

    Example of usage

    +
    myChar.MagicEffect( 43 );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void MakeMenu( menu )

    -
    -
    -

    Purpose

    -

    Opens up make menu menu and sends it to character's socket

    -
    -
    -

    Example of usage

    -
    // Can be used with a character
    +                        
    + + +
    +
    +

    Prototype

    +

    void MakeMenu( menu )

    +
    +
    +

    Purpose

    +

    Opens up make menu menu and sends it to character's socket

    +
    +
    +

    Example of usage

    +
    // Can be used with a character
     myChar.MakeMenu( 1 );
     
     // Or with a socket
     mySocket.MakeMenu( 1 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Mark( item )

    -
    -
    -

    Purpose

    -

    Marks an item with the characters current location to be used later for recall or gate

    -
    -
    -

    Example of usage

    -
    myChar.Mark( targItem );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void Mark( item )

    +
    +
    +

    Purpose

    +

    Marks an item with the characters current location to be used later for recall or gate

    +
    +
    +

    Example of usage

    +
    myChar.Mark( targItem );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void OpenBank( trgSock )

    -
    -
    -

    Purpose

    -

    Opens character's bank, sending it to trgSock

    -
    -
    -

    Example of usage

    -
    myPlayer.OpenBank( trgSock );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void OpenBank( trgSock )

    +
    +
    +

    Purpose

    +

    Opens character's bank, sending it to trgSock

    +
    +
    +

    Example of usage

    +
    myPlayer.OpenBank( trgSock );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void OpenLayer( socket, layerToOpen )

    -
    -
    -

    Purpose

    -

    Opens the specified layer of the character for the specified socket

    -
    -
    -

    Example of usage

    -
    myChar.OpenLayer( socket, 0x15 );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void OpenLayer( socket, layerToOpen )

    +
    +
    +

    Purpose

    +

    Opens the specified layer of the character for the specified socket

    +
    +
    +

    Example of usage

    +
    myChar.OpenLayer( socket, 0x15 );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void PopUpTarget( tNum, toSay )

    -
    -
    -

    Purpose

    -

    Provides a call to hard-coded targeting cursors.

    -
    -
    -

    Notes

    -

    tNum must be between 0 and 255 inclusive. Says toSay, and shows a cursor. Note that some of these might depend on factors in code to actually work, and might not have much effect when ran through a script - or could grant access to functionality that a player would normally not have access to.

    -
    -
    -

    Example of usage

    +
    + + +
    +
    +

    Prototype

    +

    void PopUpTarget( tNum, toSay )

    +
    +
    +

    Purpose

    +

    Provides a call to hard-coded targeting cursors.

    +
    +
    +

    Notes

    +

    tNum must be between 0 and 255 inclusive. Says toSay, and shows a cursor. Note that some of these might depend on factors in code to actually work, and might not have much effect when ran through a script - or could grant access to functionality that a player would normally not have access to.

    +
    +
    +

    Example of usage

    // Can be used with a character object
     myChar.PopUpTarget( 1, "Where do you wish to teleport to?" );
    -
    - - -
    -

    1 - TELEPORT (teleports character to target location)
    - 2 - DYE (will reset targeted item to default colour)
    - 4 - REPAIRMETAL (Targeted metal item will be repaired. Checks Blacksmithing skill)
    - 5 - DYEALL (used to give color to dyetubs)
    - 6 - DVAT (Used for dying objects with the colour of the used dye tub)
    - 9 - ITEMID (Select item to identify. Checks Item Identification skill)
    - 10 - FISH (Select fishing location. Checks Fishing skill)
    - 11 - INFO (Get info on targeted tile)
    - 13 - SMITH (Blacksmithing skill usage via tools)
    - 14 - MINE (Mining skill usage via tools)
    - 15 - SMELTORE (Ore smelting targeting cursor)
    - 16 - WSTATS (Show wander/movement details for targeted NPC)
    - 17 - NPCRESURRECT (Used by NPC healers to resurrect dead players. In this context only works if target is identical to popuptarget user. Self-resurrection item?)
    - (To be continued) -

    -
    -
    -
    +
    + + +
    +

    + 1 - TELEPORT (teleports character to target location)
    + 2 - DYE (will reset targeted item to default colour)
    + 4 - REPAIRMETAL (Targeted metal item will be repaired. Checks Blacksmithing skill)
    + 5 - DYEALL (used to give color to dyetubs)
    + 6 - DVAT (Used for dying objects with the colour of the used dye tub)
    + 9 - ITEMID (Select item to identify. Checks Item Identification skill)
    + 10 - FISH (Select fishing location. Checks Fishing skill)
    + 11 - INFO (Get info on targeted tile)
    + 13 - SMITH (Blacksmithing skill usage via tools)
    + 14 - MINE (Mining skill usage via tools)
    + 15 - SMELTORE (Ore smelting targeting cursor)
    + 16 - WSTATS (Show wander/movement details for targeted NPC)
    + 17 - NPCRESURRECT (Used by NPC healers to resurrect dead players. In this context only works if target is identical to popuptarget user. Self-resurrection item?)
    + (To be continued) +

    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void ReactOnDamage( damageType, attackerChar );

    -
    -
    -

    Purpose

    -

    Lets a character react to damage by an attacker

    -
    -
    -

    Notes

    -

    In practical terms, this is what happens when a character reacts to damage: -

      -
    • attackerChar's attackFirst property is set to true
    • -
    • Character's attacker property is set to attackerChar
    • -
    • Character's attackFirst property is set to false
    • -
    • If character is an NPC, and was hidden upon taking damage, they're exposed to view
    • -
    • If character is an NPC, and was not already in combat mode, they enter combat mode with attackerChar as target
    • -
    • If character is a Player, their concentration is broken (i.e. any active Meditation effect is cancelled)
    • -
    -

    -
    -
    -

    Example of usage

    -
    myChar.ReactOnDamage( 2, attackerChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void ReactOnDamage( damageType, attackerChar );

    +
    +
    +

    Purpose

    +

    Lets a character react to damage by an attacker

    +
    +
    +

    Notes

    +

    + In practical terms, this is what happens when a character reacts to damage: +

      +
    • attackerChar's attackFirst property is set to true
    • +
    • Character's attacker property is set to attackerChar
    • +
    • Character's attackFirst property is set to false
    • +
    • If character is an NPC, and was hidden upon taking damage, they're exposed to view
    • +
    • If character is an NPC, and was not already in combat mode, they enter combat mode with attackerChar as target
    • +
    • If character is a Player, their concentration is broken (i.e. any active Meditation effect is cancelled)
    • +
    +

    +
    +
    +

    Example of usage

    +
    myChar.ReactOnDamage( 2, attackerChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Recall( item )

    -
    -
    -

    Purpose

    -

    Recalls character to the location marked on specified item (if any).

    -
    -
    -

    Example of usage

    -
    myChar.Recall( targItem );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void Recall( item )

    +
    +
    +

    Purpose

    +

    Recalls character to the location marked on specified item (if any).

    +
    +
    +

    Example of usage

    +
    myChar.Recall( targItem );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Release()

    -
    -
    -

    Purpose

    -

    Releases character from jail.

    -
    -
    -

    Example of usage

    -
    myChar.Release();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void Release()

    +
    +
    +

    Purpose

    +

    Releases character from jail.

    +
    +
    +

    Example of usage

    +
    myChar.Release();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void RemoveAggressorFlag( otherChar )

    -
    -
    -

    Purpose

    -

    Removes character's aggressor flag towards target character

    -
    -
    -

    Example of usage

    -
    pUser.RemoveAggressorFlag( otherChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void RemoveAggressorFlag( otherChar )

    +
    +
    +

    Purpose

    +

    Removes character's aggressor flag towards target character

    +
    +
    +

    Example of usage

    +
    pUser.RemoveAggressorFlag( otherChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void RemoveFriend( pChar )

    -
    -
    -

    Purpose

    -

    Removes a player from an NPC pet/follower's friend list

    -
    -
    -

    Example of usage

    -
    myPet.RemoveFriend( pChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void RemoveFriend( pChar )

    +
    +
    +

    Purpose

    +

    Removes a player from an NPC pet/follower's friend list

    +
    +
    +

    Example of usage

    +
    myPet.RemoveFriend( pChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void RemovePermaGreyFlag( otherChar )

    -
    -
    -

    Purpose

    -

    Removes character's permagrey flag towards target character

    -
    -
    -

    Example of usage

    -
    pUser.RemovePermaGreyFlag( otherChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void RemovePermaGreyFlag( otherChar )

    +
    +
    +

    Purpose

    +

    Removes character's permagrey flag towards target character

    +
    +
    +

    Example of usage

    +
    pUser.RemovePermaGreyFlag( otherChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int Resist( resistanceType );

    -

    void Resist( resistanceType, amount );

    -
    -
    -

    Purpose

    -

    Used to get/set the resistance type and amount of a character

    -
    -
    -

    Notes

    -

    Supported resistanceTypes:
    -

      -
    • 1 - Armor
    • -
    • 2 - Light
    • -
    • 3 - Water
    • -
    • 4 - Cold
    • -
    • 5 - Heat
    • -
    • 6 - Energy
    • -
    • 7 - Poison
    • -
    -

    -
    -
    -

    Example of usage

    -
    pUser.Resist( 1, 20 );
    +                        
    + + +
    +
    +

    Prototype

    +

    int Resist( resistanceType );

    +

    void Resist( resistanceType, amount );

    +
    +
    +

    Purpose

    +

    Used to get/set the resistance type and amount of a character

    +
    +
    +

    Notes

    +

    + Supported resistanceTypes:
    +

      +
    • 1 - Armor
    • +
    • 2 - Light
    • +
    • 3 - Water
    • +
    • 4 - Cold
    • +
    • 5 - Heat
    • +
    • 6 - Energy
    • +
    • 7 - Poison
    • +
    +

    +
    +
    +

    Example of usage

    +
    pUser.Resist( 1, 20 );
     //or...
     var coldResist = pUser.Resist( 4 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int ResourceCount( realItemID );

    -

    int ResourceCount( realItemID, colour );

    -

    int ResourceCount( realItemID, colour, moreVal );

    -
    -
    -

    Purpose

    -

    Returns the amount of items with specified ID realItemID, colour (optional) and MORE value (optional) from character's backpack

    -
    -
    -

    Notes

    -

    A colour value of -1 will make UOX3 count ANY item of the specified realItemID regardless of colour. If moreVal is specified, UOX3 will only count items with a matching MORE value.

    -
    -
    -

    Example of usage

    -
    // Count all items in character's backpack with specified ID (0x1bf2) and colour (0)
    +                        
    + + +
    +
    +

    Prototype

    +

    int ResourceCount( realItemID );

    +

    int ResourceCount( realItemID, colour );

    +

    int ResourceCount( realItemID, colour, moreVal );

    +
    +
    +

    Purpose

    +

    Returns the amount of items with specified ID realItemID, colour (optional) and MORE value (optional) from character's backpack

    +
    +
    +

    Notes

    +

    A colour value of -1 will make UOX3 count ANY item of the specified realItemID regardless of colour. If moreVal is specified, UOX3 will only count items with a matching MORE value.

    +
    +
    +

    Example of usage

    +
    // Count all items in character's backpack with specified ID (0x1bf2) and colour (0)
     var iCount = myChar.ResourceCount( 0x1bf2, 0 );
     
     // Count all items in character's backpack with specified ID (0x1bf2), of ANY colour
     var iCount = myChar.ResourceCount( 0x1bf2, -1 );
     
    -// Count all items in character's backpack with specified ID (0x1bf2), colour (0x0482) and MORE value (1)
    -var iCount = myChar.ResourceCount( 0x1bf2, 0x0482, 1 );
    -
    -
    -
    - -
    - - -
    -
    -

    Prototype

    -

    void Resurrect()

    -
    -
    -

    Purpose

    -

    Resurrects the deceased character.

    -
    -
    -

    Example of usage

    -
    myChar.Resurrect();
    -
    -
    -
    - -
    - - -
    -
    -

    Prototype

    -

    void RunTo( object, maxSteps );

    -

    void RunTo( x, y, maxSteps );

    -
    -
    -

    Purpose

    -

    Makes the (NPC only) character run to a specific object/location, halting if it takes too many steps.

    -
    -
    -

    Example of usage

    -
    myNPC.RunTo( pUser, 10 );
    -
    -
    -
    - -
    - - -
    -
    -

    Prototype

    -

    void SellTo( myNPC );

    -
    -
    -

    Purpose

    -

    Brings up the shopkeeper gump for selling to vendor myNPC.

    -
    -
    -

    Example of usage

    -
    myChar.SellTo( myNPC );
    -
    -
    -
    - -
    - - -
    -
    -

    Prototype

    -

    void SetInvisible( visibility, timeLength );

    -
    -
    -

    Purpose

    -

    Sets character to the specified visibility level for the specified amount of time (in milliseconds).

    -
    -
    -

    Notes

    -

    Supported visibility levels: -

      -
    • 0 - Visible to all
    • -
    • 1 - Temporarily hidden (Hiding skill)
    • -
    • 2 - Magically hidden
    • -
    • 3 - Permanently hidden (GM hidden)
    • -
    • 4 - Ghost hidden (normal state of ghost players)
    • -
    -

    -
    -
    -

    Example of usage

    -
    myChar.SetInvisible( 1, 1000 );
    -
    -
    -
    +// Count all items in character's backpack with specified ID (0x1bf2), colour (0x0482) and MORE value (1) +var iCount = myChar.ResourceCount( 0x1bf2, 0x0482, 1 );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SetPoisoned( poisonLevel, duration )

    -
    -
    -

    Purpose

    -

    Applies a specified level of poison to a character for a specified amount of time (in milliseconds).

    -
    -
    -

    Example of usage

    -
    // Gives myChar a level 2 poison for 10 seconds.
    +                        
    + + +
    +
    +

    Prototype

    +

    void Resurrect()

    +
    +
    +

    Purpose

    +

    Resurrects the deceased character.

    +
    +
    +

    Example of usage

    +
    myChar.Resurrect();
    +
    +
    +
    + +
    + + +
    +
    +

    Prototype

    +

    void RunTo( object, maxSteps );

    +

    void RunTo( x, y, maxSteps );

    +
    +
    +

    Purpose

    +

    Makes the (NPC only) character run to a specific object/location, halting if it takes too many steps.

    +
    +
    +

    Example of usage

    +
    myNPC.RunTo( pUser, 10 );
    +
    +
    +
    + +
    + + +
    +
    +

    Prototype

    +

    void SellTo( myNPC );

    +
    +
    +

    Purpose

    +

    Brings up the shopkeeper gump for selling to vendor myNPC.

    +
    +
    +

    Example of usage

    +
    myChar.SellTo( myNPC );
    +
    +
    +
    + +
    + + +
    +
    +

    Prototype

    +

    void SetInvisible( visibility, timeLength );

    +
    +
    +

    Purpose

    +

    Sets character to the specified visibility level for the specified amount of time (in milliseconds).

    +
    +
    +

    Notes

    +

    + Supported visibility levels: +

      +
    • 0 - Visible to all
    • +
    • 1 - Temporarily hidden (Hiding skill)
    • +
    • 2 - Magically hidden
    • +
    • 3 - Permanently hidden (GM hidden)
    • +
    • 4 - Ghost hidden (normal state of ghost players)
    • +
    +

    +
    +
    +

    Example of usage

    +
    myChar.SetInvisible( 1, 1000 );
    +
    +
    +
    + +
    + + +
    +
    +

    Prototype

    +

    void SetPoisoned( poisonLevel, duration )

    +
    +
    +

    Purpose

    +

    Applies a specified level of poison to a character for a specified amount of time (in milliseconds).

    +
    +
    +

    Example of usage

    +
    // Gives myChar a level 2 poison for 10 seconds.
     myChar.SetPoisoned( 2, 10000 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SetRandomName( nameListID );

    -
    -
    -

    Purpose

    -

    Applies a random name from a specified namelist to character/item.

    -
    -
    -

    Notes

    -

    Trivia: Int values were originally used for namelist IDs in dfndata/npc/namelists.dfn or dfndata/items/namelists.dfn, and those still persist, but they are actually strings, and any string can be used as a namelist ID. Doesn't have to be a number!

    -
    -
    -

    Example of usage

    -
    myChar/myItem.SetRandomName( "19" ); // Apply random name from Savage Warriors namelist or can get random name from items namelist depending on how its used.
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void SetRandomName( nameListID );

    +
    +
    +

    Purpose

    +

    Applies a random name from a specified namelist to character/item.

    +
    +
    +

    Notes

    +

    Trivia: Int values were originally used for namelist IDs in dfndata/npc/namelists.dfn or dfndata/items/namelists.dfn, and those still persist, but they are actually strings, and any string can be used as a namelist ID. Doesn't have to be a number!

    +
    +
    +

    Example of usage

    +
    myChar/myItem.SetRandomName( "19" ); // Apply random name from Savage Warriors namelist or can get random name from items namelist depending on how its used.
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SetSkillByName( "skillName", value );

    -
    -
    -

    Purpose

    -

    Sets the skill specified by name to the specified value.

    -
    -
    -

    Notes

    -

    Name must be the same as in skills.dfn, or "ALLSKILLS" to set all skills at once.

    -
    -
    -

    Example of usage

    -
    myChar.SetSkillByName( "alchemy", 1000 );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void SetRandomColor( colorListID );

    +
    +
    +

    Purpose

    +

    Applies a random color from a specified colorlist to character/item.

    +
    +
    +

    Example of usage

    +
    myChar/myItem.SetRandomColor( "1" ); // Apply random color from Savage Warriors skin or can get random color from items colorlist depending on how its used.
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SpeechInput( speechID [, speechItem] );

    -
    -
    -

    Purpose

    -

    Calls up the onSpeechInput event using specified ID, with the text the user types. Also supports an optional speechItem parameter, which allows passing along an object to the onSPeechInput event.

    -
    -
    -

    Example of usage

    -
    // Example 1, in some function, we call upon user to enter some text:
    +                        
    + + +
    +
    +

    Prototype

    +

    void SetSkillByName( "skillName", value );

    +
    +
    +

    Purpose

    +

    Sets the skill specified by name to the specified value.

    +
    +
    +

    Notes

    +

    Name must be the same as in skills.dfn, or "ALLSKILLS" to set all skills at once.

    +
    +
    +

    Example of usage

    +
    myChar.SetSkillByName( "alchemy", 1000 );
    +
    +
    +
    + +
    + + +
    +
    +

    Prototype

    +

    void SpeechInput( speechID [, speechItem] );

    +
    +
    +

    Purpose

    +

    Calls up the onSpeechInput event using specified ID, with the text the user types. Also supports an optional speechItem parameter, which allows passing along an object to the onSPeechInput event.

    +
    +
    +

    Example of usage

    +
    // Example 1, in some function, we call upon user to enter some text:
     myChar.SpeechInput( 1 );
     
     // When user enters their text, the onSpeechInput() event gets triggered
    @@ -10088,48 +10151,48 @@ 

    January 9th, 2022

    iUsed.name = pSpeech; } }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SpellFail();

    -
    -
    -

    Purpose

    -

    Does the actions associated in code with spell failure. Use after character fails to cast a spell, will play fail-effect, sound and give player default fail-message

    -
    -
    -

    Notes

    -

    SoundID is the ID of the sound to play. If bAllHear is true, then everyone nearby hears it. If it's false, then only the Character hears it.

    -
    -
    -

    Example of usage

    -
    myChar.SpellFail();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void SpellFail();

    +
    +
    +

    Purpose

    +

    Does the actions associated in code with spell failure. Use after character fails to cast a spell, will play fail-effect, sound and give player default fail-message

    +
    +
    +

    Notes

    +

    SoundID is the ID of the sound to play. If bAllHear is true, then everyone nearby hears it. If it's false, then only the Character hears it.

    +
    +
    +

    Example of usage

    +
    myChar.SpellFail();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SpellMoveEffect( targetChar, mSpell );

    -
    -
    -

    Purpose

    -

    Plays the MOVEFX effect of the specified spell in SPELLS.DFN, going from the character to the target

    -
    -
    -

    Example of usage

    -
    // Get ID of spell being cast
    +                        
    + + +
    +
    +

    Prototype

    +

    void SpellMoveEffect( targetChar, mSpell );

    +
    +
    +

    Purpose

    +

    Plays the MOVEFX effect of the specified spell in SPELLS.DFN, going from the character to the target

    +
    +
    +

    Example of usage

    +
    // Get ID of spell being cast
     var spellNum	= mChar.spellCast;
     
     // Get Spell object based on ID
    @@ -10137,25 +10200,25 @@ 

    January 9th, 2022

    // Play mSpell's MOVEFX from mChar to targetChar mChar.SpellMoveEffect( targetChar, mSpell );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SpellStaticEffect( mSpell );

    -
    -
    -

    Purpose

    -

    Play the STATFX effect specified for the specified spell in SPELLS.DFN, on the character

    -
    -
    -

    Example of usage

    -
    // Get ID of spell being cast
    +                        
    + + +
    +
    +

    Prototype

    +

    void SpellStaticEffect( mSpell );

    +
    +
    +

    Purpose

    +

    Play the STATFX effect specified for the specified spell in SPELLS.DFN, on the character

    +
    +
    +

    Example of usage

    +
    // Get ID of spell being cast
     var spellNum	= mChar.spellCast;
     
     // Get Spell object based on ID
    @@ -10163,111 +10226,111 @@ 

    January 9th, 2022

    // Play mSpell's MOVEFX from mChar to targetChar targetChar.SpellStaticEffect( mSpell );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SysMessage( [msgColor,] string message, ... );

    -
    -
    -

    Purpose

    -

    Sends a string as a system message. Accepts up to 10 additional arguments which can be injected into the string as needed. Text colour can also be provided as an optional parameter prior to the string itself

    -
    -
    -

    Example of usage

    -
    myChar.SysMessage( "Isn't the world great?" );
    +                        
    + + +
    +
    +

    Prototype

    +

    void SysMessage( [msgColor,] string message, ... );

    +
    +
    +

    Purpose

    +

    Sends a string as a system message. Accepts up to 10 additional arguments which can be injected into the string as needed. Text colour can also be provided as an optional parameter prior to the string itself

    +
    +
    +

    Example of usage

    +
    myChar.SysMessage( "Isn't the world great?" );
     myChar.SysMessage( GetDictionaryEntry(388), myNPC.name ); // Hello sir! My name is %s and I will be working for you.
     myChar.SysMessage( 0x42, "This message has a different color!" );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void TurnToward( trgObj );

    -

    void TurnToward( x, y );

    -
    -
    -

    Purpose

    -

    Turn Character towards trgObj/specified location

    -
    -
    -

    Example of usage

    -
    myNPC.TurnToward( myObject );
    +                        
    + + +
    +
    +

    Prototype

    +

    void TurnToward( trgObj );

    +

    void TurnToward( x, y );

    +
    +
    +

    Purpose

    +

    Turn Character towards trgObj/specified location

    +
    +
    +

    Example of usage

    +
    myNPC.TurnToward( myObject );
     myNPC.TurnToward( myObject.x, myObject.y );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void UpdateAggressorFlagTimestamp( otherChar )

    -
    -
    -

    Purpose

    -

    Updates the expiry timestamp of character's aggressor flag towards target character

    -
    -
    -

    Example of usage

    -
    pUser.UpdateAggressorFlagTimestamp( otherChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void UpdateAggressorFlagTimestamp( otherChar )

    +
    +
    +

    Purpose

    +

    Updates the expiry timestamp of character's aggressor flag towards target character

    +
    +
    +

    Example of usage

    +
    pUser.UpdateAggressorFlagTimestamp( otherChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void UpdatePermaGreyFlagTimestamp( otherChar )

    -
    -
    -

    Purpose

    -

    Updates the expiry timestamp of character's permagrey flag towards target character

    -
    -
    -

    Example of usage

    -
    pUser.UpdatePermaGreyFlagTimestamp( otherChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void UpdatePermaGreyFlagTimestamp( otherChar )

    +
    +
    +

    Purpose

    +

    Updates the expiry timestamp of character's permagrey flag towards target character

    +
    +
    +

    Example of usage

    +
    pUser.UpdatePermaGreyFlagTimestamp( otherChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int UseResource( amount, itemID );

    -

    int UseResource( amount, itemID, colour );

    -

    int UseResource( amount, itemID, colour, moreVal );

    -
    -
    -

    Purpose

    -

    Removes amount of items with specified itemID, colour (optional) and MORE value (optional) from character's backpack, and returns amount deleted

    -
    -
    -

    Notes

    -

    If an item of the specified resource is found with .usesLeft property higher than 1, the appropriate amount of uses is extracted from said item before eventually deleting the resource item itself.

    -
    -
    -

    Example of usage

    -
    // Use resource of specific ID, with specific color (0)
    +                        
    + + +
    +
    +

    Prototype

    +

    int UseResource( amount, itemID );

    +

    int UseResource( amount, itemID, colour );

    +

    int UseResource( amount, itemID, colour, moreVal );

    +
    +
    +

    Purpose

    +

    Removes amount of items with specified itemID, colour (optional) and MORE value (optional) from character's backpack, and returns amount deleted

    +
    +
    +

    Notes

    +

    If an item of the specified resource is found with .usesLeft property higher than 1, the appropriate amount of uses is extracted from said item before eventually deleting the resource item itself.

    +
    +
    +

    Example of usage

    +
    // Use resource of specific ID, with specific color (0)
     myChar.UseResource( 5, 0x1bf2, 0 );
     
     // Use resource of specific ID, and colour
    @@ -10275,97 +10338,97 @@ 

    January 9th, 2022

    // Use resource of specific ID, colour and MORE value myChar.UseResource( 5, 0x1bf2, 0x0482, 1 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void WalkTo( object, maxSteps );

    -

    void WalkTo( x, y, maxSteps );

    -
    -
    -

    Purpose

    -

    Makes the (NPC only) character walk to a specific object/location, halting if it takes too many steps.

    -
    -
    -

    Example of usage

    -
    myNPC.WalkTo( pUser, 10 );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void WalkTo( object, maxSteps );

    +

    void WalkTo( x, y, maxSteps );

    +
    +
    +

    Purpose

    +

    Makes the (NPC only) character walk to a specific object/location, halting if it takes too many steps.

    +
    +
    +

    Example of usage

    +
    myNPC.WalkTo( pUser, 10 );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Wander( x1, y1, x2, y2 );

    -

    void Wander( x1, y1, radius );

    -
    -
    -

    Purpose

    -

    Specifies a wander area for an NPC, as either a box or a circle

    -
    -
    -

    Notes

    -

    NPCs will return to their wander area if they reset after combat, or if they wander too far off

    -
    -
    -

    Example of usage

    -
    // Specify a box set of coordinates as the NPC's wander area
    +                        
    + + +
    +
    +

    Prototype

    +

    void Wander( x1, y1, x2, y2 );

    +

    void Wander( x1, y1, radius );

    +
    +
    +

    Purpose

    +

    Specifies a wander area for an NPC, as either a box or a circle

    +
    +
    +

    Notes

    +

    NPCs will return to their wander area if they reset after combat, or if they wander too far off

    +
    +
    +

    Example of usage

    +
    // Specify a box set of coordinates as the NPC's wander area
     myNPC.Wander( 5593, 1203, 5608, 1206 );
     
     // Specify a circle with radius of 10 as the NPC's wander area
     myNPC.Wander( 5600, 1204, 10 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void WhisperMessage( message );

    -
    -
    -

    Purpose

    -

    Causes the Character to whisper a message that can be seen only by nearby players (within 1 tile)

    -
    -
    -

    Example of usage

    -
    myChar.WhisperMessage( "Shhhhh, we're hunting wabbits!" );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void WhisperMessage( message );

    +
    +
    +

    Purpose

    +

    Causes the Character to whisper a message that can be seen only by nearby players (within 1 tile)

    +
    +
    +

    Example of usage

    +
    myChar.WhisperMessage( "Shhhhh, we're hunting wabbits!" );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void YellMessage( message );

    -
    -
    -

    Purpose

    -

    Causes the Character to yell a message to all players within range (36 tiles)

    -
    -
    -

    Example of usage

    -
    myChar.YellMessage( "YARGH!" );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void YellMessage( message );

    +
    +
    +

    Purpose

    +

    Causes the Character to yell a message to all players within range (36 tiles)

    +
    +
    +

    Example of usage

    +
    myChar.YellMessage( "YARGH!" );
    +
    +
    +
    -
    +
  • diff --git a/source/Changelog.txt b/source/Changelog.txt index f64afbc32..a5eb5a82e 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,6 @@ +20/10/2024 - Dragon Slayer + Added SetRandomColor("#") to js functions. (Thanks, Xuri) + 1/05/2024 - Dragon Slayer/Xuri Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode. Fixed createfood to check for reagents on cast. diff --git a/source/UOXJSMethods.cpp b/source/UOXJSMethods.cpp index e139beb79..5fc566cf1 100644 --- a/source/UOXJSMethods.cpp +++ b/source/UOXJSMethods.cpp @@ -7969,6 +7969,35 @@ JSBool CBase_SetRandomName( JSContext *cx, JSObject *obj, uintN argc, jsval *arg return JS_TRUE; } +UI16 AddRandomColor( const std::string& colorlist ); +//o------------------------------------------------------------------------------------------------o +//| Function - CBase_SetRandomColor() +//| Prototype - bool SetRandomColor( "colorlist" ) +//o------------------------------------------------------------------------------------------------o +//| Purpose - Applies a random color from specified colorlist to character or item +//o------------------------------------------------------------------------------------------------o +JSBool CBase_SetRandomColor( JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval ) +{ + if( argc != 1 ) + { + ScriptError( cx, "SetRandomColor: Invalid number of arguments (takes 1, colorlist string)" ); + return JS_FALSE; + } + + CBaseObject *mObj = static_cast( JS_GetPrivate( cx, obj )); + std::string colorlist = JS_GetStringBytes( JS_ValueToString( cx, argv[0] )); + + if( !colorlist.empty() ) + { + mObj->SetColour( AddRandomColor( colorlist )); + *rval = JSVAL_TRUE; + return JS_TRUE; + } + + *rval = JSVAL_FALSE; + return JS_TRUE; +} + //o------------------------------------------------------------------------------------------------o //| Function - CChar_SetSkillByName() //| Prototype - bool SetSkillByName( "skillName", value ) diff --git a/source/UOXJSMethods.h b/source/UOXJSMethods.h index c7a879fc8..447dd5c12 100644 --- a/source/UOXJSMethods.h +++ b/source/UOXJSMethods.h @@ -193,6 +193,7 @@ JSMethodFunc CBase_HasScriptTrigger; JSMethodFunc CBase_RemoveScriptTrigger; JSMethodFunc CBase_Refresh; JSMethodFunc CBase_SetRandomName; +JSMethodFunc CBase_SetRandomColor; // Multi Methods JSMethodFunc CMulti_GetMultiCorner; @@ -431,6 +432,7 @@ inline JSFunctionSpec CChar_Methods[] = { "Recall", CChar_Recall, 1, 0, 0 }, { "Mark", CChar_Mark, 1, 0, 0 }, { "SetRandomName", CBase_SetRandomName, 1, 0, 0 }, + { "SetRandomColor", CBase_SetRandomColor, 1, 0, 0 }, { "SetSkillByName", CChar_SetSkillByName, 2, 0, 0 }, { "Kill", CChar_Kill, 0, 0, 0 }, { "Resurrect", CChar_Resurrect, 0, 0, 0 }, @@ -566,7 +568,8 @@ inline JSFunctionSpec CItem_Methods[] = { "FinishedChars", CMulti_FinishedChars, 1, 0, 0 }, //{ "SetMoreSerial", CBase_SetMoreSerial, 1, 0, 0 }, - { "SetRandomName", CBase_SetRandomName, 1, 0, 0 }, + { "SetRandomName", CBase_SetRandomName, 1, 0, 0 }, + { "SetRandomColor", CBase_SetRandomColor, 1, 0, 0 }, { nullptr, nullptr, 0, 0, 0 } }; From 5724bb8c11f57be5b0db4e87d4c32df796f9b023 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 7 Dec 2024 12:45:18 -0600 Subject: [PATCH 081/147] Updaed 0xf1 packet The packet now reflects the current CUO Web Ping and remains backward compatible with older ping statuses. --- .../network/0xf1_freeshardServerPoll.js | 42 +++++++++++++++++-- source/Changelog.txt | 3 ++ 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/data/js/server/network/0xf1_freeshardServerPoll.js b/data/js/server/network/0xf1_freeshardServerPoll.js index 4b278c240..33e2f1434 100644 --- a/data/js/server/network/0xf1_freeshardServerPoll.js +++ b/data/js/server/network/0xf1_freeshardServerPoll.js @@ -1,6 +1,6 @@ // Handler for Freeshard Server Poll requests from // CUO Web (https://play.classicuo.org) -// Last Updated: 5. September, 2022 +// Last Updated: 3. Decemeber, 2024 function PacketRegistration() { @@ -27,7 +27,18 @@ function onPacketReceive( pSocket, packetNum, subCommand ) else { Console.Print( "Freeshard Server Poll Packet detected, responding..." ); - SendServerPollInfo( pSocket ); + SendServerPollInfoCompact( pSocket ); + } + break; + case 0xFF: + if( !GetServerSetting( "FREESHARDSERVERPOLL" )) + { + Console.Print( "Freeshard Server Poll Packet detected; response disabled via FREESHARDPOLL ini-setting.\n" ); + } + else + { + Console.Print( "Freeshard Server Poll Packet detected, responding..." ); + SendServerPollInfoExtended( pSocket ); } break; default: @@ -36,7 +47,7 @@ function onPacketReceive( pSocket, packetNum, subCommand ) return; } -function SendServerPollInfo( pSocket ) +function SendServerPollInfoCompact( pSocket ) { var uptime = Math.floor( GetCurrentClock() / 1000 ) - Math.floor( GetStartTime() / 1000 ); var totalAccounts = GetAccountCount(); @@ -55,8 +66,31 @@ function SendServerPollInfo( pSocket ) toSend.WriteLong( 15, uptime ); // Server Uptime toSend.WriteLong( 19, memoryHigh ); // Max memory usage - no need to send toSend.WriteLong( 23, memoryLow ); // Min memory usage - no need to send - pSocket.Send( toSend ); + pSocket.Send(toSend); toSend.Free(); Console.Print( "Done!\n" ); Console.Log( "Response sent to Freeshard Server Poll Packet (totalOnline: " + totalOnline + ", upTimeInSeconds: " + uptime ); } + +function SendServerPollInfoExtended( pSocket ) +{ + var protocolVersion = 2; + var shardName = GetServerSetting( "SERVERNAME" ); + var uptime = Math.floor( GetCurrentClock() / 1000 ) - Math.floor( GetStartTime() / 1000 ); + var totalOnline = GetPlayerCount(); + var totalItems = 0; + var totalChars = 0; + var totalMemory = 0; + var statsStr = "UOX3, Name=" + shardName + ", Age=" + Math.round( uptime / 60 / 60 ) + ", Clients=" + totalOnline + ", Items=" + totalItems + ", Chars=" + totalChars + ", Mem=" + totalMemory + "K, Ver=" + protocolVersion; + var toSend = new Packet; + + toSend.ReserveSize( statsStr.length + 2 ); + toSend.WriteByte( 0, 0x53 ); // PacketID + toSend.WriteShort( 1, statsStr.length ); // Length + toSend.WriteString( 3, statsStr, statsStr.length ); + toSend.WriteByte( statsStr.length + 1, 0x00 ); // null terminated + pSocket.Send( toSend ); + toSend.Free(); + Console.Print( "Done!\n" ); + Console.Log( "Response sent to Freeshard Server Poll Packet (totalOnline: " + totalOnline + ", upTimeInSeconds: " + uptime ); +} \ No newline at end of file diff --git a/source/Changelog.txt b/source/Changelog.txt index f64afbc32..205fd42de 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,6 @@ +07/12/2024 - Dragon Slayer +Updated the packet 0xf1 to reflect the current CUO Web Ping while maintaining backward compatibility with older ping statuses. (0xf1_freeshardServerPoll.js) (Thanks Karasho and Xuri) + 1/05/2024 - Dragon Slayer/Xuri Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode. Fixed createfood to check for reagents on cast. From 5621389ef6ca3b8d0793218415ec8a01ad364c18 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 15 Dec 2024 09:29:57 -0600 Subject: [PATCH 082/147] Adding Ressurrect Penalty Script that controls any type penalty you want on the char after resurrecting. --- data/js/jse_fileassociations.scp | 1 + data/js/player/death/resurrectpenalty.js | 127 +++++++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 data/js/player/death/resurrectpenalty.js diff --git a/data/js/jse_fileassociations.scp b/data/js/jse_fileassociations.scp index 2cbb8e3d5..9ba410a8f 100644 --- a/data/js/jse_fileassociations.scp +++ b/data/js/jse_fileassociations.scp @@ -335,6 +335,7 @@ //------------------------------------------- 8000=player/death/return_stolen_items.js 8001=player/young_player.js +8002=player/death/resurrectpenalty.js // House Scripts [15000-15500] 15000=server/house/house.js diff --git a/data/js/player/death/resurrectpenalty.js b/data/js/player/death/resurrectpenalty.js new file mode 100644 index 000000000..600957f73 --- /dev/null +++ b/data/js/player/death/resurrectpenalty.js @@ -0,0 +1,127 @@ +function ResurrectFamePenalty( pUser ) +{ + if( pUser.fame > 0 ) + { + // Calculate 10% of the fame + var amount = Math.floor( pUser.fame / 10 ); + pUser.fame -= amount; + } +} + +function ResurrectKarmaPenalty( pUser ) +{ + if( pUser.karma > 0 ) + { + // Calculate 10% of the karma + var amount = Math.floor( pUser.karma / 10 ); + pUser.karma -= amount; + } +} + +function ResurrectMurderPenalty( pUser ) +{ + // Ensure the pUser has committed at least 5 short-term murders + if( pUser.murdercount >= 5 ) + { + // Calculate the loss percentage + var loss = ( 100.0 - ( 4.0 + ( pUser.murdercount / 5.0 ))) / 100.0; + + // Clamp the loss percentage between 85% and 95% + if( loss < 0.85 ) + { + loss = 0.85; // Minimum 15% reduction + } + else if( loss > 0.95 ) + { + loss = 0.95; // Maximum 5% reduction + } + + // Apply penalties to strength, intelligence, and dexterity + if( pUser.strength * loss > 10 ) + { + pUser.strength = RandomNumber( 10, pUser.strength * loss ); + } + if( pUser.intelligence * loss > 10 ) + { + pUser.intelligence = RandomNumber( 10, pUser.intelligence * loss ); + } + if( pUser.dexterity * loss > 10 ) + { + pUser.dexterity = RandomNumber( 10, pUser.dexterity * loss ); + } + } +} + +function ResurrectSkillPenalty( pUser ) +{ + // Define the reduction range (89% to 91%) + var reductionMin = 89; + var reductionMax = 91; + + var originalSkills = []; // Array to store original skill values + + // Apply a 10% reduction to all 64 skills + for( var skillID = 0; skillID < 64; skillID++ ) + { + var baseSkill = pUser.Skills[ skillID ]; // Get skill value + var reducedSkill = RandomNumber( + (baseSkill * reductionMin) / 100, + (baseSkill * reductionMax) / 100 + ); + originalSkills.push( baseSkill ); // Store original skill value + pUser.Skills[ skillID ] = reducedSkill; // Apply the reduced skill value + } + + pUser.SetTag( "originalSkills", originalSkills.join( "," )); + + // Start the recovery timer + pUser.StartTimer( 15000, 0, false ); // 15 seconds interval, calls back to the current script + pUser.SetTag( "recoveryCount", 0 ); // Track recovery intervals +} + +// Recovery handler triggered by StartTimer +function onTimer( timerObj, timerID ) +{ + if( timerID == 0 ) + { + var recoveryCount = timerObj.GetTag( "recoveryCount" ); + var maxRecoveryCount = 100; // 100 intervals = 25 minutes + + // Parse the original skills from the tag + var originalSkills = timerObj.GetTag( "originalSkills" ).split( "," ); + + // Iterate through all skills and gradually restore + for( var skillID = 0; skillID < 64; skillID++ ) + { + var reducedSkill = timerObj.Skills[skillID]; + var originalSkill = parseInt( originalSkills[skillID] ); + + if( reducedSkill < originalSkill ) + { + // Randomize recovery by adding between 0.1% and 0.11% of the original value + var recoveryStep = RandomNumber( + (originalSkill * 0.1) / 100, + (originalSkill * 0.11) / 100 + ); + timerObj.Skills[ skillID ] = Math.min( originalSkill, reducedSkill + recoveryStep ); + } + } + + recoveryCount++; + timerObj.SetTag( "recoveryCount", recoveryCount ); + + // If recovery is not complete, restart the timer + if( recoveryCount < maxRecoveryCount ) + { + timerObj.StartTimer( 15000, 0, false ); // 15 seconds interval + } + else + { + // Recovery complete + timerObj.SetTag( "recoveryCount", null ); + timerObj.SetTag( "originalSkills", null ); + } + } +} + +function _restorecontext_() {} \ No newline at end of file From 45405e9db4b1cb02ced7151c946ae373e4cb939c Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Fri, 20 Dec 2024 20:04:43 -0600 Subject: [PATCH 083/147] onSpellTargetSelect, two parameters corrected onSpellTargetSelect had two parameters are in the wrong order in docs now been corerected. (Thanks Xuri --- docs/jsdocs.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/jsdocs.html b/docs/jsdocs.html index 8dbe347a8..8665ea36c 100644 --- a/docs/jsdocs.html +++ b/docs/jsdocs.html @@ -4018,7 +4018,7 @@

    January 9th, 2022

    Prototype

    -

    function onSpellTargetSelect( pCaster, myTarget, spellID )

    +

    function onSpellTargetSelect( myTarget, pCaster, spellID )

    Purpose

    @@ -4043,7 +4043,7 @@

    January 9th, 2022

    Example of usage

    // Script attached to an NPC that's immune to magic, where event returns 2 to reject spell being cast
    -function onSpellTargetSelect( pCaster, myTarget, spellID )
    +function onSpellTargetSelect( myTarget, pCaster, spellID )
     {
     	var socket = pCaster.socket;
     	if( socket != null )
    
    From 062463abf49f9e924589a9c11efb3bce1596948b Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Sat, 4 Jan 2025 03:42:27 -0600
    Subject: [PATCH 084/147] Fixed Event
    
    Fixed Oncombathit
    ---
     source/cScript.cpp | 60 ++++++++++++++++++++++++----------------------
     source/cScript.h   |  3 ++-
     2 files changed, 33 insertions(+), 30 deletions(-)
    
    diff --git a/source/cScript.cpp b/source/cScript.cpp
    index fb0ae479f..be5c134ff 100644
    --- a/source/cScript.cpp
    +++ b/source/cScript.cpp
    @@ -3802,35 +3802,6 @@ SI08 cScript::OnAICombatTarget( CChar *attacker, CChar *target )
     	return TryParseJSVal( rval );
     }
     
    -//o------------------------------------------------------------------------------------------------o
    -//|	Function	-	cScript::onCombatHit()
    -//o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Triggers for character with event attached when someone has taken damage
    -//|					Will also trigger the onDefense event for the character being hit
    -//o------------------------------------------------------------------------------------------------o
    -bool cScript::onCombatHit( CChar *attacker, CChar *defender )
    -{
    -	if( !ValidateObject( attacker ) || !ValidateObject( defender ))
    -		return false;
    -
    -	if( !ExistAndVerify( seOnCombatHit, "onCombatHit" ))
    -		return false;
    -
    -	jsval rval, params[2];
    -	JSObject *attObj = JSEngine->AcquireObject( IUE_CHAR, attacker, runTime );
    -	JSObject *defObj = JSEngine->AcquireObject( IUE_CHAR, defender, runTime );
    -
    -	params[0] = OBJECT_TO_JSVAL( attObj );
    -	params[1] = OBJECT_TO_JSVAL( defObj );
    -	JSBool retVal = JS_CallFunctionName( targContext, targObject, "onCombatHit", 2, params, &rval );
    -	if( retVal == JS_FALSE )
    -	{
    -		SetEventExists( seOnCombatHit, false );
    -	}
    -
    -	return ( retVal == JS_TRUE );
    -}
    -
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	cScript::OnCombatStart()
     //|	Date		-	23rd January, 2006
    @@ -3900,6 +3871,37 @@ SI08 cScript::OnCombatEnd( CChar *currChar, CChar *targChar )
     	return TryParseJSVal( rval );
     }
     
    +//o------------------------------------------------------------------------------------------------o
    +//|	Function	-	cScript::OnCombatHit()
    +//o------------------------------------------------------------------------------------------------o
    +//|	Purpose		-	Triggers for character with event attached when someone has taken damage.
    +//|					
    +//o------------------------------------------------------------------------------------------------o
    +SI08 cScript::OnCombatHit( CChar *attacker, CChar *defender )
    +{
    +	const SI08 RV_NOFUNC = -1;
    +	if( !ValidateObject( attacker ) || !ValidateObject( defender ))
    +		return RV_NOFUNC;
    +
    +	if( !ExistAndVerify( seOnCombatHit, "onCombatHit" ))
    +		return RV_NOFUNC;
    +
    +	jsval rval, params[2];
    +	JSObject *attObj = JSEngine->AcquireObject( IUE_CHAR, attacker, runTime );
    +	JSObject *defObj = JSEngine->AcquireObject( IUE_CHAR, defender, runTime );
    +
    +	params[0] = OBJECT_TO_JSVAL( attObj );
    +	params[1] = OBJECT_TO_JSVAL( defObj );
    +	JSBool retVal = JS_CallFunctionName( targContext, targObject, "onCombatHit", 2, params, &rval );
    +	if( retVal == JS_FALSE )
    +	{
    +		SetEventExists( seOnCombatHit, false );
    +		return RV_NOFUNC;
    +	}
    +
    +	return TryParseJSVal( rval );
    +}
    +
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	cScript::OnDeathBlow()
     //|	Date		-	8th February, 2006
    diff --git a/source/cScript.h b/source/cScript.h
    index 10330e719..0909bb721 100644
    --- a/source/cScript.h
    +++ b/source/cScript.h
    @@ -96,6 +96,7 @@ enum ScriptEvent
     	seOnCombatStart,		//	**	allows overriding what happens when combat is initiated
     	seOnAICombatTarget,		//	**	allows overriding target selection taking place for regular AI behaviours
     	seOnCombatEnd,			//	**	allows overriding what happens when combat ends
    +	seOnCombatHit,			//	**	allows overriding what happens when combat hits
     	seOnDeathBlow,
     	seOnCombatDamageCalc,
     	seOnDamage,
    @@ -279,7 +280,7 @@ class cScript
     	SI08		OnSkillGump( CChar *mChar );
     	SI08		OnUseBandageMacro( CSocket *mSock, CChar *targChar, CItem *bandageItem );
     	SI08		OnAICombatTarget( CChar *attacker, CChar *target );
    -	bool		onCombatHit( CChar *attacker, CChar *defender );
    +	SI08		OnCombatHit( CChar *attacker, CChar *defender );
     	SI08		OnCombatStart( CChar *attacker, CChar *defender );
     	SI08		OnCombatEnd( CChar *attacker, CChar *defender );
     
    
    From e56f4391dc8cde19b000ab314fc05ca371a340d2 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Sat, 4 Jan 2025 03:48:50 -0600
    Subject: [PATCH 085/147] Update combat.cpp
    
    ---
     source/combat.cpp | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/source/combat.cpp b/source/combat.cpp
    index f6bcebe15..bba282006 100644
    --- a/source/combat.cpp
    +++ b/source/combat.cpp
    @@ -2999,7 +2999,7 @@ bool CHandleCombat::HandleCombat( CSocket *mSock, CChar& mChar, CChar *ourTarg )
     					cScript *toExecute = JSMapping->GetScript( scriptTrig );
     					if( toExecute != nullptr )
     					{
    -						toExecute->onCombatHit( &mChar, ourTarg );
    +						toExecute->OnCombatHit( &mChar, ourTarg );
     					}
     				}
     
    
    From bc3cfdbe2e7a42a4bfbd217cecb2c71eaa145041 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Tue, 14 Jan 2025 21:24:23 -0600
    Subject: [PATCH 086/147] Update to Speed Increase
    
    This now works on the chars as well as items, After reading more on this and finding it out it was part of the chars not just a  new tag for items.
    ---
     data/js/commands/targeting/set.js | 7 +++++++
     source/UOXJSPropertyEnums.h       | 1 +
     source/UOXJSPropertyFuncs.cpp     | 2 ++
     source/UOXJSPropertySpecs.h       | 1 +
     source/cChar.cpp                  | 7 +++++++
     5 files changed, 18 insertions(+)
    
    diff --git a/data/js/commands/targeting/set.js b/data/js/commands/targeting/set.js
    index e9b4f3226..ce7e87172 100644
    --- a/data/js/commands/targeting/set.js
    +++ b/data/js/commands/targeting/set.js
    @@ -169,6 +169,13 @@ function onCallback0( socket, ourObj )
     		ourObj.tempdex = nVal;
     		okMsg( socket );
     		break;
    +	case "SPEEDINC":
    +	case "SPEEDINCREASE":
    +	case "SWINGSPEEDINC":
    +	case "SWINGSPEEDINCREASE":
    +		ourObj.speedIncrease = nVal;
    +		okMsg( socket );
    +		break;
     	case "WIPABLE":
     	case "WIPEABLE":
     		ourObj.wipable = ( nVal == 1 );
    diff --git a/source/UOXJSPropertyEnums.h b/source/UOXJSPropertyEnums.h
    index ed8bb09f4..38467649f 100644
    --- a/source/UOXJSPropertyEnums.h
    +++ b/source/UOXJSPropertyEnums.h
    @@ -339,6 +339,7 @@ enum CC_Properties
     	CCP_SPAWNSERIAL,
     	CCP_SPATTACK,
     	CCP_SPDELAY,
    +	CCP_SPEEDINCREASE,
     	CCP_AITYPE,
     	CCP_SPLIT,
     	CCP_SPLITCHANCE,
    diff --git a/source/UOXJSPropertyFuncs.cpp b/source/UOXJSPropertyFuncs.cpp
    index 0ba5ed693..7342ff71e 100644
    --- a/source/UOXJSPropertyFuncs.cpp
    +++ b/source/UOXJSPropertyFuncs.cpp
    @@ -1996,6 +1996,7 @@ JSBool CCharacterProps_getProperty( JSContext *cx, JSObject *obj, jsval id, jsva
     			case CCP_HOUSEICONS:	*vp = BOOLEAN_TO_JSVAL( gPriv->ViewHouseAsIcon() );			break;
     			case CCP_SPATTACK:		*vp = INT_TO_JSVAL( gPriv->GetSpAttack() );					break;
     			case CCP_SPDELAY:		*vp = INT_TO_JSVAL( gPriv->GetSpDelay() );					break;
    +			case CCP_SPEEDINCREASE:	*vp = INT_TO_JSVAL( gPriv->GetSwingSpeedIncrease() );		break;
     			case CCP_AITYPE:		*vp = INT_TO_JSVAL( gPriv->GetNpcAiType() );				break;
     			case CCP_SPLIT:			*vp = INT_TO_JSVAL( gPriv->GetSplit() );					break;
     			case CCP_SPLITCHANCE:	*vp = INT_TO_JSVAL( gPriv->GetSplitChance() );				break;
    @@ -2501,6 +2502,7 @@ JSBool CCharacterProps_setProperty( JSContext *cx, JSObject *obj, jsval id, jsva
     			case CCP_HOUSEICONS:	gPriv->SetViewHouseAsIcon( encaps.toBool() );				break;
     			case CCP_SPATTACK:		gPriv->SetSpAttack( static_cast( encaps.toInt() ));	break;
     			case CCP_SPDELAY:		gPriv->SetSpDelay( static_cast( encaps.toInt() ));	break;
    +			case CCP_SPEEDINCREASE:	gPriv->SetSwingSpeedIncrease( static_cast( encaps.toInt() ));		break;
     			case CCP_AITYPE:		gPriv->SetNPCAiType( static_cast( encaps.toInt() ));	break;
     			case CCP_SPLIT:			gPriv->SetSplit( static_cast( encaps.toInt() ));		break;
     			case CCP_SPLITCHANCE:	gPriv->SetSplitChance( static_cast( encaps.toInt() ));break;
    diff --git a/source/UOXJSPropertySpecs.h b/source/UOXJSPropertySpecs.h
    index 710cd317e..4e53b84be 100644
    --- a/source/UOXJSPropertySpecs.h
    +++ b/source/UOXJSPropertySpecs.h
    @@ -357,6 +357,7 @@ inline JSPropertySpec CCharacterProps[] =
     	{ "houseicons",		CCP_HOUSEICONS,		JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "spattack",		CCP_SPATTACK,		JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "spdelay",		CCP_SPDELAY,		JSPROP_ENUMANDPERM, nullptr, nullptr },
    +	{ "speedIncrease",	CCP_SPEEDINCREASE,	JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "aitype",			CCP_AITYPE,			JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "split",			CCP_SPLIT,			JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "splitchance",	CCP_SPLITCHANCE,	JSPROP_ENUMANDPERM, nullptr, nullptr },
    diff --git a/source/cChar.cpp b/source/cChar.cpp
    index 182409af1..2767609dc 100644
    --- a/source/cChar.cpp
    +++ b/source/cChar.cpp
    @@ -2398,6 +2398,7 @@ void CChar::CopyData( CChar *target )
     	target->SetDisabled( IsDisabled() );
     	target->SetCanHire( CanBeHired() );
     	target->SetCanTrain( CanTrain() );
    +	target->SetSwingSpeedIncrease( GetSwingSpeedIncrease() );
     	target->SetLastOn( GetLastOn() );
     	target->SetLastOnSecs( GetLastOnSecs() );
     	target->SetPlayTime( GetPlayTime() );
    @@ -3139,6 +3140,7 @@ bool CChar::DumpBody( std::ostream &outStream ) const
     	//-------------------------------------------------------------------------------------------
     	outStream << "CanRun=" + std::to_string((( CanRun() && IsNpc() ) ? 1 : 0 )) + newLine;
     	outStream << "CanAttack=" + std::to_string(( GetCanAttack() ? 1 : 0 )) + newLine;
    +	outStream << "SpeedInc=" + std::to_string( GetSwingSpeedIncrease() ) + newLine;
     	outStream << "AllMove=" + std::to_string(( AllMove() ? 1 : 0 )) + newLine;
     	outStream << "IsNpc=" + std::to_string(( IsNpc() ? 1 : 0 )) + newLine;
     	outStream << "IsShop=" + std::to_string(( IsShop() ? 1 : 0 )) + newLine;
    @@ -4822,6 +4824,11 @@ bool CChar::HandleLine( std::string &UTag, std::string &data )
     					SetEmoteColour( static_cast( std::stoul (oldstrutil::trim( oldstrutil::removeTrailing( csecs[1], "//" )), nullptr, 0 )));
     					rValue = true;
     				}
    +				else if( UTag == "SPEEDINC" )
    +				{
    +					SetSwingSpeedIncrease( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )));
    +					rValue = true;
    +				}
     				else if( UTag == "STABLED" )
     				{
     					SetStabled( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )) == 1 );
    
    From cd35741ff276118143e46d1f023851059bc20a36 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Tue, 14 Jan 2025 21:44:16 -0600
    Subject: [PATCH 087/147] Update
    
    Updated so they work directly on chars for the DCI and HCI just like retail AOS
    ---
     source/UOXJSPropertyEnums.h   |  2 ++
     source/UOXJSPropertyFuncs.cpp |  4 ++++
     source/UOXJSPropertySpecs.h   |  2 ++
     source/cChar.cpp              | 16 +++++++++++++++-
     4 files changed, 23 insertions(+), 1 deletion(-)
    
    diff --git a/source/UOXJSPropertyEnums.h b/source/UOXJSPropertyEnums.h
    index f471df16e..a99bd3628 100644
    --- a/source/UOXJSPropertyEnums.h
    +++ b/source/UOXJSPropertyEnums.h
    @@ -339,6 +339,8 @@ enum CC_Properties
     	CCP_SPAWNSERIAL,
     	CCP_SPATTACK,
     	CCP_SPDELAY,
    +	CCP_HITCHANCE,
    +	CCP_DEFENSECHANCE,
     	CCP_AITYPE,
     	CCP_SPLIT,
     	CCP_SPLITCHANCE,
    diff --git a/source/UOXJSPropertyFuncs.cpp b/source/UOXJSPropertyFuncs.cpp
    index 02ff0cbb2..ef170971c 100644
    --- a/source/UOXJSPropertyFuncs.cpp
    +++ b/source/UOXJSPropertyFuncs.cpp
    @@ -1998,6 +1998,8 @@ JSBool CCharacterProps_getProperty( JSContext *cx, JSObject *obj, jsval id, jsva
     			case CCP_HOUSEICONS:	*vp = BOOLEAN_TO_JSVAL( gPriv->ViewHouseAsIcon() );			break;
     			case CCP_SPATTACK:		*vp = INT_TO_JSVAL( gPriv->GetSpAttack() );					break;
     			case CCP_SPDELAY:		*vp = INT_TO_JSVAL( gPriv->GetSpDelay() );					break;
    +			case CCP_HITCHANCE:		*vp = INT_TO_JSVAL( gPriv->GetHitChance() );				break;
    +			case CCP_DEFENSECHANCE:	*vp = INT_TO_JSVAL( gPriv->GetDefenseChance() );			break;
     			case CCP_AITYPE:		*vp = INT_TO_JSVAL( gPriv->GetNpcAiType() );				break;
     			case CCP_SPLIT:			*vp = INT_TO_JSVAL( gPriv->GetSplit() );					break;
     			case CCP_SPLITCHANCE:	*vp = INT_TO_JSVAL( gPriv->GetSplitChance() );				break;
    @@ -2503,6 +2505,8 @@ JSBool CCharacterProps_setProperty( JSContext *cx, JSObject *obj, jsval id, jsva
     			case CCP_HOUSEICONS:	gPriv->SetViewHouseAsIcon( encaps.toBool() );				break;
     			case CCP_SPATTACK:		gPriv->SetSpAttack( static_cast( encaps.toInt() ));	break;
     			case CCP_SPDELAY:		gPriv->SetSpDelay( static_cast( encaps.toInt() ));	break;
    +			case CCP_HITCHANCE:		gPriv->SetHitChance( static_cast( encaps.toInt() ));	break;
    +			case CCP_DEFENSECHANCE:	gPriv->SetDefenseChance( static_cast( encaps.toInt() ));	break;
     			case CCP_AITYPE:		gPriv->SetNPCAiType( static_cast( encaps.toInt() ));	break;
     			case CCP_SPLIT:			gPriv->SetSplit( static_cast( encaps.toInt() ));		break;
     			case CCP_SPLITCHANCE:	gPriv->SetSplitChance( static_cast( encaps.toInt() ));break;
    diff --git a/source/UOXJSPropertySpecs.h b/source/UOXJSPropertySpecs.h
    index b77c023aa..1585d151a 100644
    --- a/source/UOXJSPropertySpecs.h
    +++ b/source/UOXJSPropertySpecs.h
    @@ -357,6 +357,8 @@ inline JSPropertySpec CCharacterProps[] =
     	{ "houseicons",		CCP_HOUSEICONS,		JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "spattack",		CCP_SPATTACK,		JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "spdelay",		CCP_SPDELAY,		JSPROP_ENUMANDPERM, nullptr, nullptr },
    +	{ "hitChance",		CCP_HITCHANCE,		JSPROP_ENUMANDPERM, nullptr, nullptr },
    +	{ "defenseChance",	CCP_DEFENSECHANCE,	JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "aitype",			CCP_AITYPE,			JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "split",			CCP_SPLIT,			JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "splitchance",	CCP_SPLITCHANCE,	JSPROP_ENUMANDPERM, nullptr, nullptr },
    diff --git a/source/cChar.cpp b/source/cChar.cpp
    index 6bb36cb56..eb70922f6 100644
    --- a/source/cChar.cpp
    +++ b/source/cChar.cpp
    @@ -2411,6 +2411,8 @@ void CChar::CopyData( CChar *target )
     	target->SetNextAct( nextAct );
     	target->SetSquelched( GetSquelched() );
     	target->SetMeditating( IsMeditating() );
    +	target->SetHitChance( GetHitChance() );
    +	target->SetDefenseChance( GetDefenseChance() );
     	target->SetStealth( stealth );
     	target->SetRunning( running );
     	target->SetRace( GetRace() );
    @@ -3141,6 +3143,8 @@ bool CChar::DumpBody( std::ostream &outStream ) const
     	//-------------------------------------------------------------------------------------------
     	outStream << "CanRun=" + std::to_string((( CanRun() && IsNpc() ) ? 1 : 0 )) + newLine;
     	outStream << "CanAttack=" + std::to_string(( GetCanAttack() ? 1 : 0 )) + newLine;
    +	outStream << "HitChance=" + std::to_string( GetHitChance() ) + newLine;
    +	outStream << "DefChance=" + std::to_string( GetDefenseChance() ) + newLine;
     	outStream << "AllMove=" + std::to_string(( AllMove() ? 1 : 0 )) + newLine;
     	outStream << "IsNpc=" + std::to_string(( IsNpc() ? 1 : 0 )) + newLine;
     	outStream << "IsShop=" + std::to_string(( IsShop() ? 1 : 0 )) + newLine;
    @@ -4379,6 +4383,11 @@ bool CChar::HandleLine( std::string &UTag, std::string &data )
     					SetDead(( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )) == 1 ));
     					rValue = true;
     				}
    +				else if( UTag == "DEFCHANCE" )
    +				{
    +					SetDefenseChance( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )));
    +					rValue = true;
    +				}
     				break;
     			case 'E':
     				if( UTag == "EMOTION" )
    @@ -4467,7 +4476,12 @@ bool CChar::HandleLine( std::string &UTag, std::string &data )
     				}
     				break;
     			case 'H':
    -				if( UTag == "HUNGER" )
    +				if( UTag == "HITCHANCE" )
    +				{
    +					SetHitChance( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )));
    +					rValue = true;
    +				}
    +				else if( UTag == "HUNGER" )
     				{
     					SetHunger( static_cast( std::stoi( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )));
     					rValue = true;
    
    From b82b9dcc6005fde43380c592cf208a925fe51c97 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Tue, 14 Jan 2025 22:16:11 -0600
    Subject: [PATCH 088/147] update
    
    ---
     data/js/commands/targeting/get.js | 3 +++
     data/js/commands/targeting/set.js | 5 +----
     source/UOXJSPropertyEnums.h       | 4 ++--
     source/UOXJSPropertyFuncs.cpp     | 8 ++++----
     source/UOXJSPropertySpecs.h       | 4 ++--
     source/cBaseObject.cpp            | 7 ++++---
     source/cChar.cpp                  | 4 ++--
     source/cItem.cpp                  | 5 +++--
     8 files changed, 21 insertions(+), 19 deletions(-)
    
    diff --git a/data/js/commands/targeting/get.js b/data/js/commands/targeting/get.js
    index 365d3a2b3..8f3e3e691 100644
    --- a/data/js/commands/targeting/get.js
    +++ b/data/js/commands/targeting/get.js
    @@ -169,6 +169,9 @@ function onCallback0( socket, ourObj )
     	case "SECTIONID":
     		socket.SysMessage( ourObj.sectionID );
     		break;
    +	case "SWINGSPEEDINC":
    +		socket.SysMessage( swingSpeedIncrease );
    +		break;
     	case "SHOULDSAVE":
     		socket.SysMessage( ourObj.shouldSave );
     		break;
    diff --git a/data/js/commands/targeting/set.js b/data/js/commands/targeting/set.js
    index ce7e87172..9bd3cc0bb 100644
    --- a/data/js/commands/targeting/set.js
    +++ b/data/js/commands/targeting/set.js
    @@ -169,11 +169,8 @@ function onCallback0( socket, ourObj )
     		ourObj.tempdex = nVal;
     		okMsg( socket );
     		break;
    -	case "SPEEDINC":
    -	case "SPEEDINCREASE":
     	case "SWINGSPEEDINC":
    -	case "SWINGSPEEDINCREASE":
    -		ourObj.speedIncrease = nVal;
    +		ourObj.swingSpeedIncrease = nVal;
     		okMsg( socket );
     		break;
     	case "WIPABLE":
    diff --git a/source/UOXJSPropertyEnums.h b/source/UOXJSPropertyEnums.h
    index 38467649f..23e9c5062 100644
    --- a/source/UOXJSPropertyEnums.h
    +++ b/source/UOXJSPropertyEnums.h
    @@ -339,7 +339,7 @@ enum CC_Properties
     	CCP_SPAWNSERIAL,
     	CCP_SPATTACK,
     	CCP_SPDELAY,
    -	CCP_SPEEDINCREASE,
    +	CCP_SWINGSPEEDINCREASE,
     	CCP_AITYPE,
     	CCP_SPLIT,
     	CCP_SPLITCHANCE,
    @@ -517,7 +517,7 @@ enum CI_Properties
     	CIP_ISCONTTYPE,
     	CIP_CARVESECTION,
     	CIP_SPEED,
    -	CIP_SPEEDINCREASE  ,
    +	CIP_SWINGSPEEDINCREASE,
     	CIP_MULTI,
     	CIP_AMMOID,
     	CIP_AMMOHUE,
    diff --git a/source/UOXJSPropertyFuncs.cpp b/source/UOXJSPropertyFuncs.cpp
    index 7342ff71e..6da1688db 100644
    --- a/source/UOXJSPropertyFuncs.cpp
    +++ b/source/UOXJSPropertyFuncs.cpp
    @@ -675,7 +675,7 @@ JSBool CItemProps_getProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp
     			case CIP_DAMAGEPOISON:		*vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( POISON ));	break;
     			case CIP_DAMAGERAIN:		*vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( RAIN ));	break;
     			case CIP_DAMAGESNOW:		*vp = BOOLEAN_TO_JSVAL( gPriv->GetWeatherDamage( SNOW ));	break;
    -			case CIP_SPEEDINCREASE:	*vp = INT_TO_JSVAL( gPriv->GetSwingSpeedIncrease() );			break;
    +			case CIP_SWINGSPEEDINCREASE:	*vp = INT_TO_JSVAL( gPriv->GetSwingSpeedIncrease() );			break;
     			case CIP_SPEED:			*vp = INT_TO_JSVAL( gPriv->GetSpeed() );			break;
     			case CIP_NAME2:
     				tString = JS_NewStringCopyZ( cx, gPriv->GetName2().c_str() );
    @@ -1322,7 +1322,7 @@ JSBool CItemProps_setProperty( JSContext *cx, JSObject *obj, jsval id, jsval *vp
     			case CIP_DAMAGERAIN:	gPriv->SetWeatherDamage( RAIN, encaps.toBool() );			break;
     			case CIP_DAMAGESNOW:	gPriv->SetWeatherDamage( SNOW, encaps.toBool() );			break;
     			case CIP_SPEED:			gPriv->SetSpeed( static_cast( encaps.toInt() ));		break;
    -			case CIP_SPEEDINCREASE:	gPriv->SetSwingSpeedIncrease( static_cast( encaps.toInt() ));	break;
    +			case CIP_SWINGSPEEDINCREASE:	gPriv->SetSwingSpeedIncrease( static_cast( encaps.toInt() ));	break;
     			case CIP_NAME2:			gPriv->SetName2( encaps.toString() );						break;
     			case CIP_RACE:			gPriv->SetRace( static_cast( encaps.toInt() ));		break;
     			case CIP_MAXHP:			gPriv->SetMaxHP( static_cast( encaps.toInt() ));		break;
    @@ -1996,7 +1996,7 @@ JSBool CCharacterProps_getProperty( JSContext *cx, JSObject *obj, jsval id, jsva
     			case CCP_HOUSEICONS:	*vp = BOOLEAN_TO_JSVAL( gPriv->ViewHouseAsIcon() );			break;
     			case CCP_SPATTACK:		*vp = INT_TO_JSVAL( gPriv->GetSpAttack() );					break;
     			case CCP_SPDELAY:		*vp = INT_TO_JSVAL( gPriv->GetSpDelay() );					break;
    -			case CCP_SPEEDINCREASE:	*vp = INT_TO_JSVAL( gPriv->GetSwingSpeedIncrease() );		break;
    +			case CCP_SWINGSPEEDINCREASE:	*vp = INT_TO_JSVAL( gPriv->GetSwingSpeedIncrease() );		break;
     			case CCP_AITYPE:		*vp = INT_TO_JSVAL( gPriv->GetNpcAiType() );				break;
     			case CCP_SPLIT:			*vp = INT_TO_JSVAL( gPriv->GetSplit() );					break;
     			case CCP_SPLITCHANCE:	*vp = INT_TO_JSVAL( gPriv->GetSplitChance() );				break;
    @@ -2502,7 +2502,7 @@ JSBool CCharacterProps_setProperty( JSContext *cx, JSObject *obj, jsval id, jsva
     			case CCP_HOUSEICONS:	gPriv->SetViewHouseAsIcon( encaps.toBool() );				break;
     			case CCP_SPATTACK:		gPriv->SetSpAttack( static_cast( encaps.toInt() ));	break;
     			case CCP_SPDELAY:		gPriv->SetSpDelay( static_cast( encaps.toInt() ));	break;
    -			case CCP_SPEEDINCREASE:	gPriv->SetSwingSpeedIncrease( static_cast( encaps.toInt() ));		break;
    +			case CCP_SWINGSPEEDINCREASE:	gPriv->SetSwingSpeedIncrease( static_cast( encaps.toInt() ));		break;
     			case CCP_AITYPE:		gPriv->SetNPCAiType( static_cast( encaps.toInt() ));	break;
     			case CCP_SPLIT:			gPriv->SetSplit( static_cast( encaps.toInt() ));		break;
     			case CCP_SPLITCHANCE:	gPriv->SetSplitChance( static_cast( encaps.toInt() ));break;
    diff --git a/source/UOXJSPropertySpecs.h b/source/UOXJSPropertySpecs.h
    index 4e53b84be..07374bd3f 100644
    --- a/source/UOXJSPropertySpecs.h
    +++ b/source/UOXJSPropertySpecs.h
    @@ -357,7 +357,7 @@ inline JSPropertySpec CCharacterProps[] =
     	{ "houseicons",		CCP_HOUSEICONS,		JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "spattack",		CCP_SPATTACK,		JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "spdelay",		CCP_SPDELAY,		JSPROP_ENUMANDPERM, nullptr, nullptr },
    -	{ "speedIncrease",	CCP_SPEEDINCREASE,	JSPROP_ENUMANDPERM, nullptr, nullptr },
    +	{ "swingSpeedIncrease",	CCP_SWINGSPEEDINCREASE,	JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "aitype",			CCP_AITYPE,			JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "split",			CCP_SPLIT,			JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "splitchance",	CCP_SPLITCHANCE,	JSPROP_ENUMANDPERM, nullptr, nullptr },
    @@ -536,7 +536,7 @@ inline JSPropertySpec CItemProps[] =
     	{ "ammoFXHue",		CIP_AMMOFXHUE,		JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "ammoFXRender",	CIP_AMMOFXRENDER,	JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "speed",			CIP_SPEED,			JSPROP_ENUMANDPERM, nullptr, nullptr },
    -	{ "speedIncrease",		CIP_SPEEDINCREASE ,		JSPROP_ENUMANDPERM, nullptr, nullptr },
    +	{ "swingSpeedIncrease",		CIP_SWINGSPEEDINCREASE ,		JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "multi",			CIP_MULTI,			JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "maxRange",		CIP_MAXRANGE,		JSPROP_ENUMANDPERM, nullptr, nullptr },
     	{ "baseRange",		CIP_BASERANGE,		JSPROP_ENUMANDPERM, nullptr, nullptr },
    diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp
    index f0263f163..1fccdb2e5 100644
    --- a/source/cBaseObject.cpp
    +++ b/source/cBaseObject.cpp
    @@ -1572,9 +1572,10 @@ Point3_st CBaseObject::GetLocation( void ) const
     
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CBaseObject::GetSwingSpeedIncrease()
    -//|					CBaseObject::SetSwingSpeedIncrease()
    +//|					CBaseObject::SetSwingSpeedBonus()
     //o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Gets/Sets the item's Swing Speed Increase  property (in percentage), which adjusts the base swing speed of the equipped weapon
    +//|	Purpose		-	Gets/Sets the item's Swing Speed Bonus property (in percentage), which 
    +//|					adjusts the base swing speed of the equipped weapon, or characters
     //o------------------------------------------------------------------------------------------------o
     SI16 CBaseObject::GetSwingSpeedIncrease( void ) const
     {
    @@ -1686,7 +1687,7 @@ void CBaseObject::IncIntelligence( SI16 toInc )
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CBaseObject::IncSwingSpeedIncrease()
     //o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Increments the object's swing speed value
    +//|	Purpose		-	Increments the object's swing speed bonus value
     //o------------------------------------------------------------------------------------------------o
     void CBaseObject::IncSwingSpeedIncrease( SI16 toInc )
     {
    diff --git a/source/cChar.cpp b/source/cChar.cpp
    index 2767609dc..9092667c1 100644
    --- a/source/cChar.cpp
    +++ b/source/cChar.cpp
    @@ -3140,7 +3140,7 @@ bool CChar::DumpBody( std::ostream &outStream ) const
     	//-------------------------------------------------------------------------------------------
     	outStream << "CanRun=" + std::to_string((( CanRun() && IsNpc() ) ? 1 : 0 )) + newLine;
     	outStream << "CanAttack=" + std::to_string(( GetCanAttack() ? 1 : 0 )) + newLine;
    -	outStream << "SpeedInc=" + std::to_string( GetSwingSpeedIncrease() ) + newLine;
    +	outStream << "SwingSpeedInc=" + std::to_string( GetSwingSpeedIncrease() ) + newLine;
     	outStream << "AllMove=" + std::to_string(( AllMove() ? 1 : 0 )) + newLine;
     	outStream << "IsNpc=" + std::to_string(( IsNpc() ? 1 : 0 )) + newLine;
     	outStream << "IsShop=" + std::to_string(( IsShop() ? 1 : 0 )) + newLine;
    @@ -4824,7 +4824,7 @@ bool CChar::HandleLine( std::string &UTag, std::string &data )
     					SetEmoteColour( static_cast( std::stoul (oldstrutil::trim( oldstrutil::removeTrailing( csecs[1], "//" )), nullptr, 0 )));
     					rValue = true;
     				}
    -				else if( UTag == "SPEEDINC" )
    +				else if( UTag == "SWINGSPEEDINCREASE" )
     				{
     					SetSwingSpeedIncrease( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )));
     					rValue = true;
    diff --git a/source/cItem.cpp b/source/cItem.cpp
    index 44b28b56f..c6d4e3114 100644
    --- a/source/cItem.cpp
    +++ b/source/cItem.cpp
    @@ -1644,6 +1644,7 @@ auto CItem::CopyData( CItem *target ) -> void
     	target->SetStamina( GetStamina() );
     	target->SetStrength( GetStrength() );
     	target->SetStrength2( GetStrength2() );
    +	target->SetSwingSpeedIncrease( GetSwingSpeedIncrease() );
     	target->SetTitle( GetTitle() );
     	target->SetType( GetType() );
     	target->SetBuyValue( GetBuyValue() );
    @@ -1743,7 +1744,7 @@ bool CItem::DumpBody( std::ostream &outStream ) const
     	outStream << "Restock=" + std::to_string( GetRestock() ) + newLine;
     	outStream << "AC=" + std::to_string( GetArmourClass() ) + newLine;
     	outStream << "Rank=" + std::to_string( GetRank() ) + newLine;
    -	outStream << "SpeedIncrease=" + std::to_string( GetSwingSpeedIncrease() ) + newLine;
    +	outStream << "SwingSpeedInc=" + std::to_string( GetSwingSpeedIncrease() ) + newLine;
     	outStream << "Sk_Made=" + std::to_string( GetMadeWith() ) + newLine;
     	outStream << "Bools=" + std::to_string(( bools.to_ulong() )) + newLine;
     	outStream << "Good=" + std::to_string( GetGood() ) + newLine;
    @@ -2128,7 +2129,7 @@ bool CItem::HandleLine( std::string &UTag, std::string &data )
     					SetStealable( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )));
     					rValue = true;
     				}
    -				else if( UTag == "SPEEDINCREASE" )
    +				else if( UTag == "SWINGSPEEDINCREASE" )
     				{
     					SetSwingSpeedIncrease( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )));
     					rValue = true;
    
    From 481f716f6ea1cdbd2684005141160cb41a44faac Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Tue, 14 Jan 2025 22:32:25 -0600
    Subject: [PATCH 089/147] update
    
    ---
     source/items.cpp    | 2 +-
     source/npcs.cpp     | 1 +
     source/ssection.cpp | 2 +-
     source/ssection.h   | 2 +-
     4 files changed, 4 insertions(+), 3 deletions(-)
    
    diff --git a/source/items.cpp b/source/items.cpp
    index d8f687c7a..b100a143d 100644
    --- a/source/items.cpp
    +++ b/source/items.cpp
    @@ -548,7 +548,7 @@ auto ApplyItemSection( CItem *applyTo, CScriptSection *toApply, std::string sect
     			case DFNTAG_RAIN:			applyTo->SetWeatherDamage( RAIN, ndata != 0 );			break;
     			case DFNTAG_SECTIONID:		applyTo->SetSectionId( cdata );							break;
     			case DFNTAG_SK_MADE:		applyTo->SetMadeWith( static_cast( ndata ));		break;
    -			case DFNTAG_SPEEDINCREASE:	applyTo->SetSwingSpeedIncrease( static_cast( ndata ));		break;
    +			case DFNTAG_SWINGSPEEDINCREASE:	applyTo->SetSwingSpeedIncrease( static_cast( ndata ));		break;
     			case DFNTAG_SPD:			applyTo->SetSpeed( static_cast( ndata ));			break;
     			case DFNTAG_STRENGTH:		applyTo->SetStrength( static_cast( ndata ));		break;
     			case DFNTAG_STRADD:			applyTo->SetStrength2( static_cast( ndata ));		break;
    diff --git a/source/npcs.cpp b/source/npcs.cpp
    index 36005b420..0f8400f7d 100644
    --- a/source/npcs.cpp
    +++ b/source/npcs.cpp
    @@ -1583,6 +1583,7 @@ auto CCharStuff::ApplyNpcSection( CChar *applyTo, CScriptSection *NpcCreation, s
     			case DFNTAG_PEACEMAKING:		skillToSet = PEACEMAKING;				break;
     			case DFNTAG_PROVOCATION:		skillToSet = PROVOCATION;				break;
     			case DFNTAG_POISONING:			skillToSet = POISONING;					break;
    +			case DFNTAG_SWINGSPEEDINCREASE:	applyTo->SetSwingSpeedIncrease( static_cast( ndata ));		break;
     			case DFNTAG_RESISTFIRE:
     				if( ndata >= 0 )
     				{
    diff --git a/source/ssection.cpp b/source/ssection.cpp
    index 896203365..9729c867a 100644
    --- a/source/ssection.cpp
    +++ b/source/ssection.cpp
    @@ -476,7 +476,7 @@ const std::map strToDFNTag
     	{"SPAWNOBJLIST"s,		DFNTAG_SPAWNOBJLIST},
     	{"SPD"s,				DFNTAG_SPD},
     	{"SPEED"s,				DFNTAG_SPD},
    -	{"SPEEDINCREASE"s,		DFNTAG_SPEEDINCREASE},
    +	{"SWINGSPEEDINCREASE"s,	DFNTAG_SWINGSPEEDINCREASE},
     	{"SPELLS"s,				DFNTAG_SPELLS},
     	{"SPELLWEAVING"s,		DFNTAG_SPELLWEAVING},
     	{"SPIRITSPEAK"s,		DFNTAG_SPIRITSPEAK},
    diff --git a/source/ssection.h b/source/ssection.h
    index 7ac508971..f709d5fc8 100644
    --- a/source/ssection.h
    +++ b/source/ssection.h
    @@ -221,7 +221,7 @@ enum DFNTAGS
     	DFNTAG_SPATTACK,
     	DFNTAG_SPAWNOBJ,
     	DFNTAG_SPAWNOBJLIST,
    -	DFNTAG_SPEEDINCREASE,
    +	DFNTAG_SWINGSPEEDINCREASE,
     	DFNTAG_SPD,
     	DFNTAG_SPELLS,
     	DFNTAG_SPELLWEAVING,
    
    From 171770910361850ac2e0854b52e26b053e27cf0e Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Tue, 14 Jan 2025 23:04:16 -0600
    Subject: [PATCH 090/147] Fixed Weapon Swing Delay
    
    Now you can create a curse state with he swing delay to help balance them magic weapons
    ---
     source/combat.cpp | 15 +++++++++++----
     1 file changed, 11 insertions(+), 4 deletions(-)
    
    diff --git a/source/combat.cpp b/source/combat.cpp
    index 1c0369ec9..9d0627316 100644
    --- a/source/combat.cpp
    +++ b/source/combat.cpp
    @@ -3476,20 +3476,27 @@ R32 CHandleCombat::GetCombatTimeout( CChar *mChar )
     
     	R32 globalAttackSpeed = cwmWorldState->ServerData()->GlobalAttackSpeed(); //Defaults to 1.0
     
    +	R32 speedFactor = 1 + speedBonus / 10.0f;
    +
    +	// Prevent zero or negative multipliers
    +	if( speedFactor < 0.1f )
    +		speedFactor = 0.1f;
    +
    +
     	if( cwmWorldState->ServerData()->ExpansionCoreShardEra() <= ER_LBR )
     	{
     		// Weapon swing delay in LBR and earlier
    -		getDelay = baseValue / ( getDelay * getOffset * ( 1 + speedBonus / static_cast( 10 ) )) / globalAttackSpeed;
    +		getDelay = baseValue / ( getDelay * getOffset * speedFactor ) / globalAttackSpeed;
     	}
     	else if( cwmWorldState->ServerData()->ExpansionCoreShardEra() < ER_ML )
     	{
    -		// Weapon swing delay in SE and earlier
    -		getDelay = ( baseValue / ( getDelay * getOffset * ( 1 + speedBonus / static_cast( 10 ) )) / 4 - 0.5 ) / globalAttackSpeed;
    +		// Weapon swing delay in SE or earlier
    +		getDelay = ( baseValue / ( getDelay * getOffset * speedFactor ) / 4 - 0.5 ) / globalAttackSpeed;
     	}
     	else
     	{
     		// Weapon swing delay in ML or later
    -		getDelay = ( baseValue / ( getDelay * getOffset * ( 1 + speedBonus / static_cast( 10 ) )) * 0.5 ) / globalAttackSpeed;
    +		getDelay = ( baseValue / ( getDelay * getOffset * speedFactor ) * 0.5 ) / globalAttackSpeed;
     	}
     
     	return getDelay;
    
    From 9b9f90d8b0a94efb6da4a33fdb96f6afdabdf73e Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Tue, 14 Jan 2025 23:28:03 -0600
    Subject: [PATCH 091/147] update
    
    ---
     source/cBaseObject.cpp |  4 ++--
     source/cChar.cpp       |  2 +-
     source/combat.cpp      | 12 +++++++++---
     source/npcs.cpp        |  2 ++
     4 files changed, 14 insertions(+), 6 deletions(-)
    
    diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp
    index 9eedebfff..e98c3c693 100644
    --- a/source/cBaseObject.cpp
    +++ b/source/cBaseObject.cpp
    @@ -1043,7 +1043,7 @@ void CBaseObject::IncHP( SI16 amtToChange )
     //|	Function	-	CBaseObject::GetHitChance()
     //|					CBaseObject::SetHitChance()
     //o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Gets/Sets the Defense Chance of the Item Equiped
    +//|	Purpose		-	Gets/Sets the Defense Chance of the Item(s) Equiped or Character
     //o------------------------------------------------------------------------------------------------o
     SI16 CBaseObject::GetHitChance( void ) const
     {
    @@ -1063,7 +1063,7 @@ void CBaseObject::SetHitChance( SI16 newValue )
     //|	Function	-	CBaseObject::GetDefenseChance()
     //|					CBaseObject::SetDefenseChance()
     //o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Gets/Sets the Defense Chance of the Item Equiped
    +//|	Purpose		-	Gets/Sets the Defense Chance of the Item(s) Equiped or Character
     //o------------------------------------------------------------------------------------------------o
     SI16 CBaseObject::GetDefenseChance( void ) const
     {
    diff --git a/source/cChar.cpp b/source/cChar.cpp
    index eb70922f6..3ae819d15 100644
    --- a/source/cChar.cpp
    +++ b/source/cChar.cpp
    @@ -4383,7 +4383,7 @@ bool CChar::HandleLine( std::string &UTag, std::string &data )
     					SetDead(( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )) == 1 ));
     					rValue = true;
     				}
    -				else if( UTag == "DEFCHANCE" )
    +				else if( UTag == "DEFENSECHANCE" )
     				{
     					SetDefenseChance( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )));
     					rValue = true;
    diff --git a/source/combat.cpp b/source/combat.cpp
    index 066e3e80e..256f04c3c 100644
    --- a/source/combat.cpp
    +++ b/source/combat.cpp
    @@ -2877,18 +2877,24 @@ bool CHandleCombat::HandleCombat( CSocket *mSock, CChar& mChar, CChar *ourTarg )
     				R32 attHitChanceBonus = 0;
     				R32 defDefenseChanceBonus = 0;
     				R32 maxAttHitChanceBonus = 45;
    +
     				if( cwmWorldState->ServerData()->ExpansionCombatHitChance() >= ER_SA && mChar.GetBodyType() == BT_GARGOYLE )
     				{
     					// If attacker is a Gargoyle player, and ExpansionCombatHitChance is ER_SA or higher, use 50 as hitchance bonus cap instead of 45
     					maxAttHitChanceBonus = 50;
     				}
     				
    -				// Fetch bonuses to hitChance/defenseChance from AoS item properties
    +				// Fetch bonuses to hitChance/defenseChance from AoS item properties or characters
     				attHitChanceBonus = mChar.GetHitChance();
     				defDefenseChanceBonus = mChar.GetDefenseChance();
     
    -				R32 attackerHitChance = ( static_cast( attackSkill / 10 ) + 20 ) * ( 100 + std::min( attHitChanceBonus, static_cast( maxAttHitChanceBonus )));
    -				R32 defenderDefenseChance = ( static_cast( defendSkill / 10 ) + 20 ) * ( 100 + std::min( defDefenseChanceBonus, static_cast( 45 )));
    +				// Clamp to ensure valid bonus ranges (e.g., no multiplier below 1)
    +				R32 effectiveAttHitChanceBonus = std::max(-99.0f, std::min( attHitChanceBonus, maxAttHitChanceBonus )); // Cap at -99 and maxAttHitChanceBonus
    +				R32 effectiveDefDefenseChanceBonus = std::max(-99.0f, std::min( defDefenseChanceBonus, 45.0f )); // Cap at -99 and 45
    +
    +				// Calculate the attacker's hit chance and defender's defense chance
    +				R32 attackerHitChance = ( static_cast( attackSkill / 10 ) + 20 ) * ( 100 + effectiveAttHitChanceBonus );
    +				R32 defenderDefenseChance = ( static_cast( defendSkill / 10 ) + 20 ) * ( 100 + effectiveDefDefenseChanceBonus );
     				hitChance = ( attackerHitChance / ( defenderDefenseChance * 2 )) * 100;
     
     				// Always leave at least 2% chance to hit
    diff --git a/source/npcs.cpp b/source/npcs.cpp
    index 36005b420..a749b95aa 100644
    --- a/source/npcs.cpp
    +++ b/source/npcs.cpp
    @@ -1541,6 +1541,8 @@ auto CCharStuff::ApplyNpcSection( CChar *applyTo, CScriptSection *NpcCreation, s
     			case DFNTAG_NAMELIST:			SetRandomName( applyTo, cdata );		break;
     			case DFNTAG_NECROMANCY:			skillToSet = NECROMANCY;				break;
     			case DFNTAG_NINJITSU:			skillToSet = NINJITSU;					break;
    +			case DFNTAG_HITCHANCE:			applyTo->SetHitChance( static_cast( ndata ));		break;
    +			case DFNTAG_DEFENSECHANCE:		applyTo->SetDefenseChance( static_cast( ndata ));		break;
     			case DFNTAG_NPCWANDER:
     				if( !isGate )
     				{
    
    From 41c7ee467664ed3242d8c40603f4be83e8e4a571 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Thu, 16 Jan 2025 18:36:53 -0600
    Subject: [PATCH 092/147] Moved Leech Props
    
    Moved Leech props to just items
    ---
     source/cBaseObject.cpp | 96 +-----------------------------------------
     source/cBaseObject.h   | 16 -------
     source/cItem.cpp       | 83 +++++++++++++++++++++++++++++++++++-
     source/cItem.h         | 16 +++++++
     4 files changed, 99 insertions(+), 112 deletions(-)
    
    diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp
    index 2c5ce0b89..506c247ac 100644
    --- a/source/cBaseObject.cpp
    +++ b/source/cBaseObject.cpp
    @@ -94,9 +94,6 @@ const SI16			DEFBASE_KILLS		= 0;
     const UI16			DEFBASE_RESIST 		= 0;
     const bool			DEFBASE_NAMEREQUESTACTIVE = 0;
     const ExpansionRuleset	DEFBASE_ORIGIN	= ER_UO;
    -const SI16			DEFBASE_HEALTHLEECH = 0;
    -const SI16			DEFBASE_STAMINALEECH = 0;
    -const SI16			DEFBASE_MANALEECH = 0;
     
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CBaseObject constructor
    @@ -113,8 +110,7 @@ loDamage( DEFBASE_LODAMAGE ), weight( DEFBASE_WEIGHT ),
     mana( DEFBASE_MANA ), stamina( DEFBASE_STAMINA ), scriptTrig( DEFBASE_SCPTRIG ), st2( DEFBASE_STR2 ), dx2( DEFBASE_DEX2 ),
     in2( DEFBASE_INT2 ), FilePosition( DEFBASE_FP ),
     poisoned( DEFBASE_POISONED ), carve( DEFBASE_CARVE ), oldLocX( 0 ), oldLocY( 0 ), oldLocZ( 0 ), oldTargLocX( 0 ), oldTargLocY( 0 ),
    -fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN ),
    -healthLeech( DEFBASE_HEALTHLEECH ), staminaLeech( DEFBASE_STAMINALEECH ), manaLeech( DEFBASE_MANALEECH )
    +fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN )
     {
     	multis = nullptr;
     	tempMulti = INVALIDSERIAL;
    @@ -1635,66 +1631,6 @@ void CBaseObject::SetIntelligence2( SI16 nVal )
     	}
     }
     
    -//o------------------------------------------------------------------------------------------------o
    -//|	Function	-	CBaseObject::GetHealthLeech()
    -//|					CBaseObject::SetHealthLeech()
    -//o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Gets/Sets the Health Leech
    -//o------------------------------------------------------------------------------------------------o
    -SI16 CBaseObject::GetHealthLeech( void ) const
    -{
    -	return healthLeech;
    -}
    -void CBaseObject::SetHealthLeech( SI16 nVal )
    -{
    -	healthLeech = nVal;
    -
    -	if( CanBeObjType( OT_ITEM ))
    -	{
    -		( static_cast( this ))->UpdateRegion();
    -	}
    -}
    -
    -//o------------------------------------------------------------------------------------------------o
    -//|	Function	-	CBaseObject::GetStaminaLeech()
    -//|					CBaseObject::SetStaminaLeech()
    -//o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Gets/Sets the Stamina Leech
    -//o------------------------------------------------------------------------------------------------o
    -SI16 CBaseObject::GetStaminaLeech( void ) const
    -{
    -	return staminaLeech;
    -}
    -void CBaseObject::SetStaminaLeech( SI16 nVal )
    -{
    -	staminaLeech = nVal;
    -
    -	if( CanBeObjType( OT_ITEM ))
    -	{
    -		( static_cast( this ))->UpdateRegion();
    -	}
    -}
    -
    -//o------------------------------------------------------------------------------------------------o
    -//|	Function	-	CBaseObject::GetManaLeech()
    -//|					CBaseObject::SetManaLeech()
    -//o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Gets/Sets the Mana Leech
    -//o------------------------------------------------------------------------------------------------o
    -SI16 CBaseObject::GetManaLeech( void ) const
    -{
    -	return manaLeech;
    -}
    -void CBaseObject::SetManaLeech( SI16 nVal )
    -{
    -	manaLeech = nVal;
    -
    -	if( CanBeObjType( OT_ITEM ))
    -	{
    -		( static_cast( this ))->UpdateRegion();
    -	}
    -}
    -
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CBaseObject::IncStrength()
     //o------------------------------------------------------------------------------------------------o
    @@ -1725,36 +1661,6 @@ void CBaseObject::IncIntelligence( SI16 toInc )
     	SetIntelligence( intelligence + toInc );
     }
     
    -//o------------------------------------------------------------------------------------------------o
    -//|	Function	-	CBaseObject::IncHealthLeech()
    -//o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Increments the object's Health Leech Points value
    -//o------------------------------------------------------------------------------------------------o
    -void CBaseObject::IncHealthLeech( SI16 toInc )
    -{
    -	SetHealthLeech( healthLeech + toInc );
    -}
    -
    -//o------------------------------------------------------------------------------------------------o
    -//|	Function	-	CBaseObject::IncStaminaLeech()
    -//o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Increments the object's Stamina Leech Points value
    -//o------------------------------------------------------------------------------------------------o
    -void CBaseObject::IncStaminaLeech( SI16 toInc )
    -{
    -	SetStaminaLeech( staminaLeech + toInc );
    -}
    -
    -//o------------------------------------------------------------------------------------------------o
    -//|	Function	-	CBaseObject::IncManaLeech()
    -//o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Increments the object's Mana Leech Points value
    -//o------------------------------------------------------------------------------------------------o
    -void CBaseObject::IncManaLeech( SI16 toInc )
    -{
    -	SetManaLeech( manaLeech + toInc );
    -}
    -
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CBaseObject::DumpFooter()
     //o------------------------------------------------------------------------------------------------o
    diff --git a/source/cBaseObject.h b/source/cBaseObject.h
    index 316cd2530..638e826f7 100644
    --- a/source/cBaseObject.h
    +++ b/source/cBaseObject.h
    @@ -75,9 +75,6 @@ class CBaseObject
     	SI32				weight;
     	SI16				mana;
     	SI16				stamina;
    -	SI16				healthLeech;
    -	SI16				staminaLeech;
    -	SI16				manaLeech;
     	UI16				scriptTrig;
     	SI16				st2;
     	SI16				dx2;
    @@ -259,19 +256,6 @@ class CBaseObject
     	void					IncDexterity( SI16 toInc = 1 );
     	void					IncIntelligence( SI16 toInc = 1 );
     
    -	SI16					GetHealthLeech( void ) const;
    -	virtual void			SetHealthLeech( SI16 nVal );
    -
    -	SI16					GetStaminaLeech( void ) const;
    -	virtual void			SetStaminaLeech( SI16 nVal );
    -
    -	SI16					GetManaLeech( void ) const;
    -	virtual void			SetManaLeech( SI16 nVal );
    -
    -	void					IncHealthLeech( SI16 toInc = 1 );
    -	void					IncStaminaLeech( SI16 toInc = 1 );
    -	void					IncManaLeech( SI16 toInc = 1 );
    -
     	virtual void			PostLoadProcessing( void );
     	virtual bool			LoadRemnants( void ) = 0;
     
    diff --git a/source/cItem.cpp b/source/cItem.cpp
    index 672ece4dd..45559d0a9 100644
    --- a/source/cItem.cpp
    +++ b/source/cItem.cpp
    @@ -93,6 +93,9 @@ const UI16			DEFITEM_MAXUSES			= 0;
     const UI16			DEFITEM_REGIONNUM 		= 255;
     const UI16			DEFITEM_TEMPLASTTRADED	= 0;
     const SI08			DEFITEM_STEALABLE	 	= 1;
    +const SI16			DEFITEM_HEALTHLEECH		= 0;
    +const SI16			DEFITEM_STAMINALEECH	= 0;
    +const SI16			DEFITEM_MANALEECH		= 0;
     
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CItem()
    @@ -107,7 +110,7 @@ spd( DEFITEM_SPEED ), maxHp( DEFITEM_MAXHP ), amount( DEFITEM_AMOUNT ),
     layer( DEFITEM_LAYER ), type( DEFITEM_TYPE ), offspell( DEFITEM_OFFSPELL ), entryMadeFrom( DEFITEM_ENTRYMADEFROM ),
     creator( DEFITEM_CREATOR ), gridLoc( DEFITEM_GRIDLOC ), weightMax( DEFITEM_WEIGHTMAX ), baseWeight( DEFITEM_BASEWEIGHT ), maxItems( DEFITEM_MAXITEMS ),
     maxRange( DEFITEM_MAXRANGE ), baseRange( DEFITEM_BASERANGE ), maxUses( DEFITEM_MAXUSES ), usesLeft( DEFITEM_USESLEFT ), regionNum( DEFITEM_REGIONNUM ), 
    -tempLastTraded( DEFITEM_TEMPLASTTRADED ), stealable( DEFITEM_STEALABLE )
    +tempLastTraded( DEFITEM_TEMPLASTTRADED ), stealable( DEFITEM_STEALABLE ), healthLeech( DEFITEM_HEALTHLEECH ), staminaLeech( DEFITEM_STAMINALEECH ), manaLeech( DEFITEM_MANALEECH )
     {
     	spells[0]	= spells[1] = spells[2] = 0;
     	value[0]	= value[1] = value[2] = 0;
    @@ -542,6 +545,54 @@ auto CItem::SetSpawnerList( bool newValue ) -> void
     	UpdateRegion();
     }
     
    +//o------------------------------------------------------------------------------------------------o
    +//|	Function	-	CItem::GetHealthLeech()
    +//|					CItem::SetHealthLeech()
    +//o------------------------------------------------------------------------------------------------o
    +//|	Purpose		-	Gets/Sets the Health Leech
    +//o------------------------------------------------------------------------------------------------o
    +SI16 CItem::GetHealthLeech( void ) const
    +{
    +	return healthLeech;
    +}
    +void CItem::SetHealthLeech( SI16 nVal )
    +{
    +	healthLeech = nVal;
    +	UpdateRegion();
    +}
    +
    +//o------------------------------------------------------------------------------------------------o
    +//|	Function	-	CItem::GetStaminaLeech()
    +//|					CItem::SetStaminaLeech()
    +//o------------------------------------------------------------------------------------------------o
    +//|	Purpose		-	Gets/Sets the Stamina Leech
    +//o------------------------------------------------------------------------------------------------o
    +SI16 CItem::GetStaminaLeech( void ) const
    +{
    +	return staminaLeech;
    +}
    +void CItem::SetStaminaLeech( SI16 nVal )
    +{
    +	staminaLeech = nVal;
    +	UpdateRegion();
    +}
    +
    +//o------------------------------------------------------------------------------------------------o
    +//|	Function	-	CItem::GetManaLeech()
    +//|					CItem::SetManaLeech()
    +//o------------------------------------------------------------------------------------------------o
    +//|	Purpose		-	Gets/Sets the Mana Leech
    +//o------------------------------------------------------------------------------------------------o
    +SI16 CItem::GetManaLeech( void ) const
    +{
    +	return manaLeech;
    +}
    +void CItem::SetManaLeech( SI16 nVal )
    +{
    +	manaLeech = nVal;
    +	UpdateRegion();
    +}
    +
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CItem::GetName2()
     //|					CItem::SetName2()
    @@ -1340,6 +1391,36 @@ auto CItem::SetWeightMax( SI32 newValue ) -> void
     	UpdateRegion();
     }
     
    +//o------------------------------------------------------------------------------------------------o
    +//|	Function	-	CItem::IncHealthLeech()
    +//o------------------------------------------------------------------------------------------------o
    +//|	Purpose		-	Increments the object's Health Leech Points value
    +//o------------------------------------------------------------------------------------------------o
    +void CItem::IncHealthLeech( SI16 toInc )
    +{
    +	SetHealthLeech( healthLeech + toInc );
    +}
    +
    +//o------------------------------------------------------------------------------------------------o
    +//|	Function	-	CItem::IncStaminaLeech()
    +//o------------------------------------------------------------------------------------------------o
    +//|	Purpose		-	Increments the object's Stamina Leech Points value
    +//o------------------------------------------------------------------------------------------------o
    +void CItem::IncStaminaLeech( SI16 toInc )
    +{
    +	SetStaminaLeech( staminaLeech + toInc );
    +}
    +
    +//o------------------------------------------------------------------------------------------------o
    +//|	Function	-	CItem::IncManaLeech()
    +//o------------------------------------------------------------------------------------------------o
    +//|	Purpose		-	Increments the object's Mana Leech Points value
    +//o------------------------------------------------------------------------------------------------o
    +void CItem::IncManaLeech( SI16 toInc )
    +{
    +	SetManaLeech( manaLeech + toInc );
    +}
    +
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CItem::GetBaseWeight()
     //|					CItem::SetBaseWeight()
    diff --git a/source/cItem.h b/source/cItem.h
    index 3a3b60e5d..542aa62d6 100644
    --- a/source/cItem.h
    +++ b/source/cItem.h
    @@ -41,6 +41,9 @@ class CItem : public CBaseObject
     	TIMERVAL		decayTime;
     	UI08			spd;			// The speed of the weapon
     	UI16			maxHp;			// Max number of hit points an item can have.
    +	SI16			healthLeech;
    +	SI16			staminaLeech;
    +	SI16			manaLeech;
     	UI16			amount;			// Amount of items in pile
     	ItemLayers		layer;			// Layer if equipped on paperdoll
     	ItemTypes		type;			// For things that do special things on doubleclicking
    @@ -166,6 +169,19 @@ class CItem : public CBaseObject
     
     	auto			InDungeon() -> bool;
     
    +	virtual SI16	GetHealthLeech( void ) const;
    +	virtual void	SetHealthLeech( SI16 nVal );
    +
    +	virtual SI16	GetStaminaLeech( void ) const;
    +	virtual void	SetStaminaLeech( SI16 nVal );
    +
    +	virtual SI16	GetManaLeech( void ) const;
    +	virtual void	SetManaLeech( SI16 nVal );
    +
    +	void			IncHealthLeech( SI16 toInc = 1 );
    +	void			IncStaminaLeech( SI16 toInc = 1 );
    +	void			IncManaLeech( SI16 toInc = 1 );
    +
     	auto			GetLayer() const -> ItemLayers;
     	auto			SetLayer( ItemLayers newValue ) -> void;
     
    
    From 6583a518dfbafc305a5adf4aad156478dedd849d Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Thu, 16 Jan 2025 19:09:59 -0600
    Subject: [PATCH 093/147] Revert "Moved Leech Props"
    
    This reverts commit 41c7ee467664ed3242d8c40603f4be83e8e4a571.
    ---
     source/cBaseObject.cpp | 96 +++++++++++++++++++++++++++++++++++++++++-
     source/cBaseObject.h   | 16 +++++++
     source/cItem.cpp       | 83 +-----------------------------------
     source/cItem.h         | 16 -------
     4 files changed, 112 insertions(+), 99 deletions(-)
    
    diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp
    index 506c247ac..2c5ce0b89 100644
    --- a/source/cBaseObject.cpp
    +++ b/source/cBaseObject.cpp
    @@ -94,6 +94,9 @@ const SI16			DEFBASE_KILLS		= 0;
     const UI16			DEFBASE_RESIST 		= 0;
     const bool			DEFBASE_NAMEREQUESTACTIVE = 0;
     const ExpansionRuleset	DEFBASE_ORIGIN	= ER_UO;
    +const SI16			DEFBASE_HEALTHLEECH = 0;
    +const SI16			DEFBASE_STAMINALEECH = 0;
    +const SI16			DEFBASE_MANALEECH = 0;
     
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CBaseObject constructor
    @@ -110,7 +113,8 @@ loDamage( DEFBASE_LODAMAGE ), weight( DEFBASE_WEIGHT ),
     mana( DEFBASE_MANA ), stamina( DEFBASE_STAMINA ), scriptTrig( DEFBASE_SCPTRIG ), st2( DEFBASE_STR2 ), dx2( DEFBASE_DEX2 ),
     in2( DEFBASE_INT2 ), FilePosition( DEFBASE_FP ),
     poisoned( DEFBASE_POISONED ), carve( DEFBASE_CARVE ), oldLocX( 0 ), oldLocY( 0 ), oldLocZ( 0 ), oldTargLocX( 0 ), oldTargLocY( 0 ),
    -fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN )
    +fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN ),
    +healthLeech( DEFBASE_HEALTHLEECH ), staminaLeech( DEFBASE_STAMINALEECH ), manaLeech( DEFBASE_MANALEECH )
     {
     	multis = nullptr;
     	tempMulti = INVALIDSERIAL;
    @@ -1631,6 +1635,66 @@ void CBaseObject::SetIntelligence2( SI16 nVal )
     	}
     }
     
    +//o------------------------------------------------------------------------------------------------o
    +//|	Function	-	CBaseObject::GetHealthLeech()
    +//|					CBaseObject::SetHealthLeech()
    +//o------------------------------------------------------------------------------------------------o
    +//|	Purpose		-	Gets/Sets the Health Leech
    +//o------------------------------------------------------------------------------------------------o
    +SI16 CBaseObject::GetHealthLeech( void ) const
    +{
    +	return healthLeech;
    +}
    +void CBaseObject::SetHealthLeech( SI16 nVal )
    +{
    +	healthLeech = nVal;
    +
    +	if( CanBeObjType( OT_ITEM ))
    +	{
    +		( static_cast( this ))->UpdateRegion();
    +	}
    +}
    +
    +//o------------------------------------------------------------------------------------------------o
    +//|	Function	-	CBaseObject::GetStaminaLeech()
    +//|					CBaseObject::SetStaminaLeech()
    +//o------------------------------------------------------------------------------------------------o
    +//|	Purpose		-	Gets/Sets the Stamina Leech
    +//o------------------------------------------------------------------------------------------------o
    +SI16 CBaseObject::GetStaminaLeech( void ) const
    +{
    +	return staminaLeech;
    +}
    +void CBaseObject::SetStaminaLeech( SI16 nVal )
    +{
    +	staminaLeech = nVal;
    +
    +	if( CanBeObjType( OT_ITEM ))
    +	{
    +		( static_cast( this ))->UpdateRegion();
    +	}
    +}
    +
    +//o------------------------------------------------------------------------------------------------o
    +//|	Function	-	CBaseObject::GetManaLeech()
    +//|					CBaseObject::SetManaLeech()
    +//o------------------------------------------------------------------------------------------------o
    +//|	Purpose		-	Gets/Sets the Mana Leech
    +//o------------------------------------------------------------------------------------------------o
    +SI16 CBaseObject::GetManaLeech( void ) const
    +{
    +	return manaLeech;
    +}
    +void CBaseObject::SetManaLeech( SI16 nVal )
    +{
    +	manaLeech = nVal;
    +
    +	if( CanBeObjType( OT_ITEM ))
    +	{
    +		( static_cast( this ))->UpdateRegion();
    +	}
    +}
    +
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CBaseObject::IncStrength()
     //o------------------------------------------------------------------------------------------------o
    @@ -1661,6 +1725,36 @@ void CBaseObject::IncIntelligence( SI16 toInc )
     	SetIntelligence( intelligence + toInc );
     }
     
    +//o------------------------------------------------------------------------------------------------o
    +//|	Function	-	CBaseObject::IncHealthLeech()
    +//o------------------------------------------------------------------------------------------------o
    +//|	Purpose		-	Increments the object's Health Leech Points value
    +//o------------------------------------------------------------------------------------------------o
    +void CBaseObject::IncHealthLeech( SI16 toInc )
    +{
    +	SetHealthLeech( healthLeech + toInc );
    +}
    +
    +//o------------------------------------------------------------------------------------------------o
    +//|	Function	-	CBaseObject::IncStaminaLeech()
    +//o------------------------------------------------------------------------------------------------o
    +//|	Purpose		-	Increments the object's Stamina Leech Points value
    +//o------------------------------------------------------------------------------------------------o
    +void CBaseObject::IncStaminaLeech( SI16 toInc )
    +{
    +	SetStaminaLeech( staminaLeech + toInc );
    +}
    +
    +//o------------------------------------------------------------------------------------------------o
    +//|	Function	-	CBaseObject::IncManaLeech()
    +//o------------------------------------------------------------------------------------------------o
    +//|	Purpose		-	Increments the object's Mana Leech Points value
    +//o------------------------------------------------------------------------------------------------o
    +void CBaseObject::IncManaLeech( SI16 toInc )
    +{
    +	SetManaLeech( manaLeech + toInc );
    +}
    +
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CBaseObject::DumpFooter()
     //o------------------------------------------------------------------------------------------------o
    diff --git a/source/cBaseObject.h b/source/cBaseObject.h
    index 638e826f7..316cd2530 100644
    --- a/source/cBaseObject.h
    +++ b/source/cBaseObject.h
    @@ -75,6 +75,9 @@ class CBaseObject
     	SI32				weight;
     	SI16				mana;
     	SI16				stamina;
    +	SI16				healthLeech;
    +	SI16				staminaLeech;
    +	SI16				manaLeech;
     	UI16				scriptTrig;
     	SI16				st2;
     	SI16				dx2;
    @@ -256,6 +259,19 @@ class CBaseObject
     	void					IncDexterity( SI16 toInc = 1 );
     	void					IncIntelligence( SI16 toInc = 1 );
     
    +	SI16					GetHealthLeech( void ) const;
    +	virtual void			SetHealthLeech( SI16 nVal );
    +
    +	SI16					GetStaminaLeech( void ) const;
    +	virtual void			SetStaminaLeech( SI16 nVal );
    +
    +	SI16					GetManaLeech( void ) const;
    +	virtual void			SetManaLeech( SI16 nVal );
    +
    +	void					IncHealthLeech( SI16 toInc = 1 );
    +	void					IncStaminaLeech( SI16 toInc = 1 );
    +	void					IncManaLeech( SI16 toInc = 1 );
    +
     	virtual void			PostLoadProcessing( void );
     	virtual bool			LoadRemnants( void ) = 0;
     
    diff --git a/source/cItem.cpp b/source/cItem.cpp
    index 45559d0a9..672ece4dd 100644
    --- a/source/cItem.cpp
    +++ b/source/cItem.cpp
    @@ -93,9 +93,6 @@ const UI16			DEFITEM_MAXUSES			= 0;
     const UI16			DEFITEM_REGIONNUM 		= 255;
     const UI16			DEFITEM_TEMPLASTTRADED	= 0;
     const SI08			DEFITEM_STEALABLE	 	= 1;
    -const SI16			DEFITEM_HEALTHLEECH		= 0;
    -const SI16			DEFITEM_STAMINALEECH	= 0;
    -const SI16			DEFITEM_MANALEECH		= 0;
     
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CItem()
    @@ -110,7 +107,7 @@ spd( DEFITEM_SPEED ), maxHp( DEFITEM_MAXHP ), amount( DEFITEM_AMOUNT ),
     layer( DEFITEM_LAYER ), type( DEFITEM_TYPE ), offspell( DEFITEM_OFFSPELL ), entryMadeFrom( DEFITEM_ENTRYMADEFROM ),
     creator( DEFITEM_CREATOR ), gridLoc( DEFITEM_GRIDLOC ), weightMax( DEFITEM_WEIGHTMAX ), baseWeight( DEFITEM_BASEWEIGHT ), maxItems( DEFITEM_MAXITEMS ),
     maxRange( DEFITEM_MAXRANGE ), baseRange( DEFITEM_BASERANGE ), maxUses( DEFITEM_MAXUSES ), usesLeft( DEFITEM_USESLEFT ), regionNum( DEFITEM_REGIONNUM ), 
    -tempLastTraded( DEFITEM_TEMPLASTTRADED ), stealable( DEFITEM_STEALABLE ), healthLeech( DEFITEM_HEALTHLEECH ), staminaLeech( DEFITEM_STAMINALEECH ), manaLeech( DEFITEM_MANALEECH )
    +tempLastTraded( DEFITEM_TEMPLASTTRADED ), stealable( DEFITEM_STEALABLE )
     {
     	spells[0]	= spells[1] = spells[2] = 0;
     	value[0]	= value[1] = value[2] = 0;
    @@ -545,54 +542,6 @@ auto CItem::SetSpawnerList( bool newValue ) -> void
     	UpdateRegion();
     }
     
    -//o------------------------------------------------------------------------------------------------o
    -//|	Function	-	CItem::GetHealthLeech()
    -//|					CItem::SetHealthLeech()
    -//o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Gets/Sets the Health Leech
    -//o------------------------------------------------------------------------------------------------o
    -SI16 CItem::GetHealthLeech( void ) const
    -{
    -	return healthLeech;
    -}
    -void CItem::SetHealthLeech( SI16 nVal )
    -{
    -	healthLeech = nVal;
    -	UpdateRegion();
    -}
    -
    -//o------------------------------------------------------------------------------------------------o
    -//|	Function	-	CItem::GetStaminaLeech()
    -//|					CItem::SetStaminaLeech()
    -//o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Gets/Sets the Stamina Leech
    -//o------------------------------------------------------------------------------------------------o
    -SI16 CItem::GetStaminaLeech( void ) const
    -{
    -	return staminaLeech;
    -}
    -void CItem::SetStaminaLeech( SI16 nVal )
    -{
    -	staminaLeech = nVal;
    -	UpdateRegion();
    -}
    -
    -//o------------------------------------------------------------------------------------------------o
    -//|	Function	-	CItem::GetManaLeech()
    -//|					CItem::SetManaLeech()
    -//o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Gets/Sets the Mana Leech
    -//o------------------------------------------------------------------------------------------------o
    -SI16 CItem::GetManaLeech( void ) const
    -{
    -	return manaLeech;
    -}
    -void CItem::SetManaLeech( SI16 nVal )
    -{
    -	manaLeech = nVal;
    -	UpdateRegion();
    -}
    -
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CItem::GetName2()
     //|					CItem::SetName2()
    @@ -1391,36 +1340,6 @@ auto CItem::SetWeightMax( SI32 newValue ) -> void
     	UpdateRegion();
     }
     
    -//o------------------------------------------------------------------------------------------------o
    -//|	Function	-	CItem::IncHealthLeech()
    -//o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Increments the object's Health Leech Points value
    -//o------------------------------------------------------------------------------------------------o
    -void CItem::IncHealthLeech( SI16 toInc )
    -{
    -	SetHealthLeech( healthLeech + toInc );
    -}
    -
    -//o------------------------------------------------------------------------------------------------o
    -//|	Function	-	CItem::IncStaminaLeech()
    -//o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Increments the object's Stamina Leech Points value
    -//o------------------------------------------------------------------------------------------------o
    -void CItem::IncStaminaLeech( SI16 toInc )
    -{
    -	SetStaminaLeech( staminaLeech + toInc );
    -}
    -
    -//o------------------------------------------------------------------------------------------------o
    -//|	Function	-	CItem::IncManaLeech()
    -//o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Increments the object's Mana Leech Points value
    -//o------------------------------------------------------------------------------------------------o
    -void CItem::IncManaLeech( SI16 toInc )
    -{
    -	SetManaLeech( manaLeech + toInc );
    -}
    -
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CItem::GetBaseWeight()
     //|					CItem::SetBaseWeight()
    diff --git a/source/cItem.h b/source/cItem.h
    index 542aa62d6..3a3b60e5d 100644
    --- a/source/cItem.h
    +++ b/source/cItem.h
    @@ -41,9 +41,6 @@ class CItem : public CBaseObject
     	TIMERVAL		decayTime;
     	UI08			spd;			// The speed of the weapon
     	UI16			maxHp;			// Max number of hit points an item can have.
    -	SI16			healthLeech;
    -	SI16			staminaLeech;
    -	SI16			manaLeech;
     	UI16			amount;			// Amount of items in pile
     	ItemLayers		layer;			// Layer if equipped on paperdoll
     	ItemTypes		type;			// For things that do special things on doubleclicking
    @@ -169,19 +166,6 @@ class CItem : public CBaseObject
     
     	auto			InDungeon() -> bool;
     
    -	virtual SI16	GetHealthLeech( void ) const;
    -	virtual void	SetHealthLeech( SI16 nVal );
    -
    -	virtual SI16	GetStaminaLeech( void ) const;
    -	virtual void	SetStaminaLeech( SI16 nVal );
    -
    -	virtual SI16	GetManaLeech( void ) const;
    -	virtual void	SetManaLeech( SI16 nVal );
    -
    -	void			IncHealthLeech( SI16 toInc = 1 );
    -	void			IncStaminaLeech( SI16 toInc = 1 );
    -	void			IncManaLeech( SI16 toInc = 1 );
    -
     	auto			GetLayer() const -> ItemLayers;
     	auto			SetLayer( ItemLayers newValue ) -> void;
     
    
    From 14ac6f5060d4454b7638b1a7e9839f0597ed91a5 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Thu, 16 Jan 2025 23:55:15 -0600
    Subject: [PATCH 094/147] update
    
    Moved to citems from cbaseobjects sinc ethis can only be added to items.
    ---
     source/cBaseObject.cpp | 25 +------------------------
     source/cBaseObject.h   |  4 ----
     source/cItem.cpp       | 20 +++++++++++++++++++-
     source/cItem.h         |  4 ++++
     4 files changed, 24 insertions(+), 29 deletions(-)
    
    diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp
    index f9c8da3cc..506c247ac 100644
    --- a/source/cBaseObject.cpp
    +++ b/source/cBaseObject.cpp
    @@ -94,7 +94,6 @@ const SI16			DEFBASE_KILLS		= 0;
     const UI16			DEFBASE_RESIST 		= 0;
     const bool			DEFBASE_NAMEREQUESTACTIVE = 0;
     const ExpansionRuleset	DEFBASE_ORIGIN	= ER_UO;
    -const SI16			DEFBASE_LOWERSTATREQ = 0;
     
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CBaseObject constructor
    @@ -111,8 +110,7 @@ loDamage( DEFBASE_LODAMAGE ), weight( DEFBASE_WEIGHT ),
     mana( DEFBASE_MANA ), stamina( DEFBASE_STAMINA ), scriptTrig( DEFBASE_SCPTRIG ), st2( DEFBASE_STR2 ), dx2( DEFBASE_DEX2 ),
     in2( DEFBASE_INT2 ), FilePosition( DEFBASE_FP ),
     poisoned( DEFBASE_POISONED ), carve( DEFBASE_CARVE ), oldLocX( 0 ), oldLocY( 0 ), oldLocZ( 0 ), oldTargLocX( 0 ), oldTargLocY( 0 ),
    -fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN ),
    -lowerStatReq( DEFBASE_LOWERSTATREQ )
    +fame( DEFBASE_FAME ), karma( DEFBASE_KARMA ), kills( DEFBASE_KILLS ), subRegion( DEFBASE_SUBREGION ), nameRequestActive( DEFBASE_NAMEREQUESTACTIVE ), origin( DEFBASE_ORIGIN )
     {
     	multis = nullptr;
     	tempMulti = INVALIDSERIAL;
    @@ -1038,27 +1036,6 @@ void CBaseObject::IncHP( SI16 amtToChange )
     	SetHP( hitpoints + amtToChange );
     }
     
    -//o------------------------------------------------------------------------------------------------o
    -//|	Function	-	CBaseObject::GetLowerStatReq()
    -//|					CBaseObject::GetLowerStatReq()
    -//|	Date		-	30 April, 2024
    -//o------------------------------------------------------------------------------------------------o
    -//|	Purpose		-	Gets/Sets the Stat Requirements of the object
    -//o------------------------------------------------------------------------------------------------o
    -SI16 CBaseObject::GetLowerStatReq( void ) const
    -{
    -	return lowerStatReq;
    -}
    -void CBaseObject::SetLowerStatReq( SI16 newValue )
    -{
    -	lowerStatReq = newValue;
    -
    -	if( CanBeObjType( OT_ITEM ))
    -	{
    -		( static_cast( this ))->UpdateRegion();
    -	}
    -}
    -
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CBaseObject::GetDir()
     //|					CBaseObject::SetDir()
    diff --git a/source/cBaseObject.h b/source/cBaseObject.h
    index 84c38ee70..638e826f7 100644
    --- a/source/cBaseObject.h
    +++ b/source/cBaseObject.h
    @@ -69,7 +69,6 @@ class CBaseObject
     	SI16				dexterity;
     	SI16				intelligence;
     	SI16				hitpoints;
    -	SI16				lowerStatReq;
     	VisibleTypes		visible;
     	SI16				hiDamage;
     	SI16				loDamage;
    @@ -257,9 +256,6 @@ class CBaseObject
     	void					IncDexterity( SI16 toInc = 1 );
     	void					IncIntelligence( SI16 toInc = 1 );
     
    -	virtual SI16			GetLowerStatReq( void ) const;
    -	virtual void			SetLowerStatReq( SI16 newValue );
    -
     	virtual void			PostLoadProcessing( void );
     	virtual bool			LoadRemnants( void ) = 0;
     
    diff --git a/source/cItem.cpp b/source/cItem.cpp
    index 2303fc7e1..7f12f11d2 100644
    --- a/source/cItem.cpp
    +++ b/source/cItem.cpp
    @@ -94,6 +94,7 @@ const UI16			DEFITEM_REGIONNUM 		= 255;
     const UI16			DEFITEM_TEMPLASTTRADED	= 0;
     const SI08			DEFITEM_STEALABLE	 	= 1;
     const SI16			DEFITEM_ARTIFACTRARITY = 0;
    +const SI16			DEFITEM_LOWERSTATREQ	= 0;
     
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CItem()
    @@ -108,7 +109,7 @@ spd( DEFITEM_SPEED ), maxHp( DEFITEM_MAXHP ), amount( DEFITEM_AMOUNT ),
     layer( DEFITEM_LAYER ), type( DEFITEM_TYPE ), offspell( DEFITEM_OFFSPELL ), entryMadeFrom( DEFITEM_ENTRYMADEFROM ),
     creator( DEFITEM_CREATOR ), gridLoc( DEFITEM_GRIDLOC ), weightMax( DEFITEM_WEIGHTMAX ), baseWeight( DEFITEM_BASEWEIGHT ), maxItems( DEFITEM_MAXITEMS ),
     maxRange( DEFITEM_MAXRANGE ), baseRange( DEFITEM_BASERANGE ), maxUses( DEFITEM_MAXUSES ), usesLeft( DEFITEM_USESLEFT ), regionNum( DEFITEM_REGIONNUM ), 
    -tempLastTraded( DEFITEM_TEMPLASTTRADED ), stealable( DEFITEM_STEALABLE ), artifactRarity(DEFITEM_ARTIFACTRARITY)
    +tempLastTraded( DEFITEM_TEMPLASTTRADED ), stealable( DEFITEM_STEALABLE ), artifactRarity( DEFITEM_ARTIFACTRARITY ), lowerStatReq( DEFITEM_LOWERSTATREQ )
     {
     	spells[0]	= spells[1] = spells[2] = 0;
     	value[0]	= value[1] = value[2] = 0;
    @@ -560,6 +561,23 @@ void CItem::SetArtifactRarity( SI16 newValue )
     	UpdateRegion();
     }
     
    +//o------------------------------------------------------------------------------------------------o
    +//|	Function	-	CItem::GetLowerStatReq()
    +//|					CItem::GetLowerStatReq()
    +//|	Date		-	30 April, 2024
    +//o------------------------------------------------------------------------------------------------o
    +//|	Purpose		-	Gets/Sets the Stat Requirements of the object
    +//o------------------------------------------------------------------------------------------------o
    +SI16 CItem::GetLowerStatReq( void ) const
    +{
    +	return lowerStatReq;
    +}
    +void CItem::SetLowerStatReq( SI16 newValue )
    +{
    +	lowerStatReq = newValue;
    +	UpdateRegion();
    +}
    +
     //o------------------------------------------------------------------------------------------------o
     //|	Function	-	CItem::GetName2()
     //|					CItem::SetName2()
    diff --git a/source/cItem.h b/source/cItem.h
    index 4b220999e..62c7cb13a 100644
    --- a/source/cItem.h
    +++ b/source/cItem.h
    @@ -49,6 +49,7 @@ class CItem : public CBaseObject
     	SERIAL			creator;		// Store the serial of the player made this item
     	SI08			gridLoc;
     	SI16			artifactRarity;
    +	SI16			lowerStatReq;
     	SI32			weightMax;		// Maximum weight a container can hold
     	SI32			baseWeight;		// Base weight of item. Applied when item is created for the first time, based on weight. Primarily used to determine base weight of containers
     	UI16			maxItems;		// Maximum amount of items a container can hold
    @@ -114,6 +115,9 @@ class CItem : public CBaseObject
     	virtual SI16	GetArtifactRarity(void) const;
     	virtual void	SetArtifactRarity(SI16 newValue);
     
    +	SI16			GetLowerStatReq( void ) const;
    +	void			SetLowerStatReq( SI16 newValue );
    +
     	auto			GetStealable() const -> UI08;
     	auto			SetStealable( UI08 newValue ) -> void;
     
    
    From b2906b41d885db51a4f5c0449e80d85e861ef289 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Thu, 16 Jan 2025 23:59:28 -0600
    Subject: [PATCH 095/147] Update spawners.dfn
    
    ---
     data/dfndata/items/gmmenu/spawners.dfn | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/data/dfndata/items/gmmenu/spawners.dfn b/data/dfndata/items/gmmenu/spawners.dfn
    index 46b622016..a5fc82e11 100644
    --- a/data/dfndata/items/gmmenu/spawners.dfn
    +++ b/data/dfndata/items/gmmenu/spawners.dfn
    @@ -7,7 +7,7 @@ interval=1 5
     visible=1
     decay=0
     movable=2
    -script=2204
    +script=2205
     }
     
     [orcspawn]
    
    From 127da5ccb8d4936e2c49a234e8a7b4160a4517da Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Sat, 18 Jan 2025 13:25:57 -0600
    Subject: [PATCH 096/147] fix
    
    ---
     source/cChar.cpp | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/source/cChar.cpp b/source/cChar.cpp
    index 3ae819d15..eb70922f6 100644
    --- a/source/cChar.cpp
    +++ b/source/cChar.cpp
    @@ -4383,7 +4383,7 @@ bool CChar::HandleLine( std::string &UTag, std::string &data )
     					SetDead(( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )) == 1 ));
     					rValue = true;
     				}
    -				else if( UTag == "DEFENSECHANCE" )
    +				else if( UTag == "DEFCHANCE" )
     				{
     					SetDefenseChance( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )));
     					rValue = true;
    
    From f7f42efb76fd718ff3c104640481cbbdf963ea4d Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Sat, 18 Jan 2025 13:27:19 -0600
    Subject: [PATCH 097/147] fix
    
    ---
     source/cChar.cpp | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/source/cChar.cpp b/source/cChar.cpp
    index 9092667c1..d98359c8b 100644
    --- a/source/cChar.cpp
    +++ b/source/cChar.cpp
    @@ -4824,7 +4824,7 @@ bool CChar::HandleLine( std::string &UTag, std::string &data )
     					SetEmoteColour( static_cast( std::stoul (oldstrutil::trim( oldstrutil::removeTrailing( csecs[1], "//" )), nullptr, 0 )));
     					rValue = true;
     				}
    -				else if( UTag == "SWINGSPEEDINCREASE" )
    +				else if( UTag == "SWINGSPEEDINC" )
     				{
     					SetSwingSpeedIncrease( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )));
     					rValue = true;
    
    From 492ef70fcb4360c70e7932558df7e47c96808fde Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Tue, 21 Jan 2025 13:58:04 -0600
    Subject: [PATCH 098/147] Fix for Defense
    
    Neg Damage Does not take into account the attacker skill no longer. Only the Armor perc
    ---
     source/combat.cpp | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/source/combat.cpp b/source/combat.cpp
    index 8817d7b3d..4c56399c9 100644
    --- a/source/combat.cpp
    +++ b/source/combat.cpp
    @@ -2645,7 +2645,7 @@ SI16 CHandleCombat::ApplyDefenseModifiers( WeatherType damageType, CChar *mChar,
     
     	if( getDef > 0 )
     	{
    -		damage -= static_cast(( static_cast( getDef ) * static_cast( attSkill )) / 750 );
    +		damage -= static_cast( getDef );
     	}
     
     	return static_cast( std::round( damage ));
    
    From 544327d441c16b85c136d3d0ddb21e77da6ad600 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Tue, 21 Jan 2025 21:54:13 -0600
    Subject: [PATCH 099/147] changelog
    
    ---
     source/Changelog.txt | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/source/Changelog.txt b/source/Changelog.txt
    index b0801d426..36abce5fe 100644
    --- a/source/Changelog.txt
    +++ b/source/Changelog.txt
    @@ -1,3 +1,6 @@
    +21/01/2025 - Dragon Slayer
    +	Removed the skill check for damage being adjusted at the end. (combat.cpp)
    +
     13/05/2024 - Dragon Slayer
     	Added New Shield Type 107 so shield ID's no longer have to be in hard code for shields to work properly
     
    
    From df556d9d7bf0a2a8decefd61a872689f6ec557bb Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Tue, 21 Jan 2025 22:03:04 -0600
    Subject: [PATCH 100/147] Fixed
    
    Fixed swingspeed to set all settings in base object because works in items and chars.
    ---
     source/cBaseObject.cpp | 8 +++++++-
     source/cChar.cpp       | 7 -------
     source/cItem.cpp       | 7 -------
     3 files changed, 7 insertions(+), 15 deletions(-)
    
    diff --git a/source/cBaseObject.cpp b/source/cBaseObject.cpp
    index 1fccdb2e5..1a05618ee 100644
    --- a/source/cBaseObject.cpp
    +++ b/source/cBaseObject.cpp
    @@ -795,6 +795,7 @@ bool CBaseObject::DumpBody( std::ostream &outStream ) const
     	outStream << "Intelligence=" + std::to_string( intelligence ) + "," + std::to_string( temp_in2 ) + newLine;
     	outStream << "Strength=" + std::to_string( strength ) + "," + std::to_string( temp_st2 ) + newLine;
     	outStream << "HitPoints=" + std::to_string( hitpoints ) + newLine;
    +	outStream << "SwingSpeedInc=" + std::to_string( GetSwingSpeedIncrease() ) + newLine;
     	outStream << "Race=" + std::to_string( race ) + newLine;
     	outStream << "Visible=" + std::to_string( visible ) + newLine;
     	outStream << "Disabled=" << ( IsDisabled() ? "1" : "0" ) << newLine;
    @@ -2055,6 +2056,11 @@ bool CBaseObject::HandleLine( std::string &UTag, std::string &data )
     			{
     				st2	= oldstrutil::value( data );
     			}
    +			else if( UTag == "SWINGSPEEDINC" )
    +			{
    +				SetSwingSpeedIncrease( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )));
    +				rValue = true;
    +			}
     			else if( UTag == "SCPTRIG" )
     			{
     				//scriptTrig	= oldstrutil::value(data);
    @@ -2577,7 +2583,7 @@ void CBaseObject::CopyData( CBaseObject *target )
     	target->SetIntelligence2( GetIntelligence2() );
     	target->SetPoisoned( GetPoisoned() );
     	target->SetWeight( GetWeight() );
    -
    +	target->SetSwingSpeedIncrease( GetSwingSpeedIncrease() );
     	target->SetKarma( karma );
     	target->SetFame( fame );
     	target->SetKills( kills );
    diff --git a/source/cChar.cpp b/source/cChar.cpp
    index d98359c8b..182409af1 100644
    --- a/source/cChar.cpp
    +++ b/source/cChar.cpp
    @@ -2398,7 +2398,6 @@ void CChar::CopyData( CChar *target )
     	target->SetDisabled( IsDisabled() );
     	target->SetCanHire( CanBeHired() );
     	target->SetCanTrain( CanTrain() );
    -	target->SetSwingSpeedIncrease( GetSwingSpeedIncrease() );
     	target->SetLastOn( GetLastOn() );
     	target->SetLastOnSecs( GetLastOnSecs() );
     	target->SetPlayTime( GetPlayTime() );
    @@ -3140,7 +3139,6 @@ bool CChar::DumpBody( std::ostream &outStream ) const
     	//-------------------------------------------------------------------------------------------
     	outStream << "CanRun=" + std::to_string((( CanRun() && IsNpc() ) ? 1 : 0 )) + newLine;
     	outStream << "CanAttack=" + std::to_string(( GetCanAttack() ? 1 : 0 )) + newLine;
    -	outStream << "SwingSpeedInc=" + std::to_string( GetSwingSpeedIncrease() ) + newLine;
     	outStream << "AllMove=" + std::to_string(( AllMove() ? 1 : 0 )) + newLine;
     	outStream << "IsNpc=" + std::to_string(( IsNpc() ? 1 : 0 )) + newLine;
     	outStream << "IsShop=" + std::to_string(( IsShop() ? 1 : 0 )) + newLine;
    @@ -4824,11 +4822,6 @@ bool CChar::HandleLine( std::string &UTag, std::string &data )
     					SetEmoteColour( static_cast( std::stoul (oldstrutil::trim( oldstrutil::removeTrailing( csecs[1], "//" )), nullptr, 0 )));
     					rValue = true;
     				}
    -				else if( UTag == "SWINGSPEEDINC" )
    -				{
    -					SetSwingSpeedIncrease( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )));
    -					rValue = true;
    -				}
     				else if( UTag == "STABLED" )
     				{
     					SetStabled( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )) == 1 );
    diff --git a/source/cItem.cpp b/source/cItem.cpp
    index a1ff0d832..3a2acd106 100644
    --- a/source/cItem.cpp
    +++ b/source/cItem.cpp
    @@ -1661,7 +1661,6 @@ auto CItem::CopyData( CItem *target ) -> void
     	target->SetStamina( GetStamina() );
     	target->SetStrength( GetStrength() );
     	target->SetStrength2( GetStrength2() );
    -	target->SetSwingSpeedIncrease( GetSwingSpeedIncrease() );
     	target->SetTitle( GetTitle() );
     	target->SetType( GetType() );
     	target->SetBuyValue( GetBuyValue() );
    @@ -1762,7 +1761,6 @@ bool CItem::DumpBody( std::ostream &outStream ) const
     	outStream << "Restock=" + std::to_string( GetRestock() ) + newLine;
     	outStream << "AC=" + std::to_string( GetArmourClass() ) + newLine;
     	outStream << "Rank=" + std::to_string( GetRank() ) + newLine;
    -	outStream << "SwingSpeedInc=" + std::to_string( GetSwingSpeedIncrease() ) + newLine;
     	outStream << "Sk_Made=" + std::to_string( GetMadeWith() ) + newLine;
     	outStream << "Bools=" + std::to_string(( bools.to_ulong() )) + newLine;
     	outStream << "Good=" + std::to_string( GetGood() ) + newLine;
    @@ -2152,11 +2150,6 @@ bool CItem::HandleLine( std::string &UTag, std::string &data )
     					SetStealable( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )));
     					rValue = true;
     				}
    -				else if( UTag == "SWINGSPEEDINCREASE" )
    -				{
    -					SetSwingSpeedIncrease( static_cast( std::stoul( oldstrutil::trim( oldstrutil::removeTrailing( data, "//" )), nullptr, 0 )));
    -					rValue = true;
    -				}
     				break;
     			case 'T':
     				if( UTag == "TYPE" )
    
    From a5a48bcfaa37d1f9c90cf7269c6bd30222593688 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Wed, 22 Jan 2025 15:04:14 -0600
    Subject: [PATCH 101/147] Update Changelog.txt
    
    ---
     source/Changelog.txt | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/source/Changelog.txt b/source/Changelog.txt
    index b0801d426..d88c459ec 100644
    --- a/source/Changelog.txt
    +++ b/source/Changelog.txt
    @@ -1,3 +1,6 @@
    +15/12/2024 - Dragon Slayer
    +	Added Ressurrect Penalty Script that controls any type penalty you want on the char after resurrecting.
    +
     13/05/2024 - Dragon Slayer
     	Added New Shield Type 107 so shield ID's no longer have to be in hard code for shields to work properly
     
    
    From 41f18573df36b92b04ded82dde3f3fc9ce4dc087 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Wed, 22 Jan 2025 19:43:54 -0600
    Subject: [PATCH 102/147] Update Changelog.txt
    
    ---
     source/Changelog.txt | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/source/Changelog.txt b/source/Changelog.txt
    index b0801d426..b952eead1 100644
    --- a/source/Changelog.txt
    +++ b/source/Changelog.txt
    @@ -1,3 +1,6 @@
    +12/10/2024 - Dragon Slayer
    +	Added Mini-House Addons from ML Expansion.
    +
     13/05/2024 - Dragon Slayer
     	Added New Shield Type 107 so shield ID's no longer have to be in hard code for shields to work properly
     
    
    From 9c4ed84c30911d9779d8fa8191218e8b895735e1 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Wed, 22 Jan 2025 19:45:36 -0600
    Subject: [PATCH 103/147] Update Changelog.txt
    
    ---
     source/Changelog.txt | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/source/Changelog.txt b/source/Changelog.txt
    index b0801d426..38c2385cc 100644
    --- a/source/Changelog.txt
    +++ b/source/Changelog.txt
    @@ -1,3 +1,6 @@
    +11/10/2024 - Dragon Slayer
    +	Added ML House Addons.
    +
     13/05/2024 - Dragon Slayer
     	Added New Shield Type 107 so shield ID's no longer have to be in hard code for shields to work properly
     
    
    From 95fa7a8ee139648e7729c657f9c36a8d8ccaf3b4 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Fri, 24 Jan 2025 10:46:05 -0600
    Subject: [PATCH 104/147] Update Changelog.txt
    
    ---
     source/Changelog.txt | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/source/Changelog.txt b/source/Changelog.txt
    index 36abce5fe..ed820bfda 100644
    --- a/source/Changelog.txt
    +++ b/source/Changelog.txt
    @@ -1,5 +1,5 @@
     21/01/2025 - Dragon Slayer
    -	Removed the skill check for damage being adjusted at the end. (combat.cpp)
    +	Fixed damage dealt in combat was incorrectly modified while applying defense modifiers. (combat.cpp)
     
     13/05/2024 - Dragon Slayer
     	Added New Shield Type 107 so shield ID's no longer have to be in hard code for shields to work properly
    
    From 647cb3e0013dcf0ffb18fa4dbe0f9298359c5dd3 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Fri, 24 Jan 2025 18:21:39 -0600
    Subject: [PATCH 105/147] gm check
    
    ---
     data/js/server/misc/spawnergump.js | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/data/js/server/misc/spawnergump.js b/data/js/server/misc/spawnergump.js
    index 9174ff9e7..0767c3eb7 100644
    --- a/data/js/server/misc/spawnergump.js
    +++ b/data/js/server/misc/spawnergump.js
    @@ -4,7 +4,7 @@ function onUseChecked( pUser, iUsed )
     	socket.tempObj = iUsed;
     	var gumpID = 5037 + 0xffff;
     
    -	if( socket && iUsed && iUsed.isItem )
    +	if( socket && iUsed && iUsed.isItem && pUser.isGM )
     	{
     		socket.CloseGump( gumpID, 0 );
     		spawnerGump( socket, pUser, iUsed );
    
    From 6dbc2357610d47c2e2a945848b7800f48d2ea0a4 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Fri, 24 Jan 2025 18:37:44 -0600
    Subject: [PATCH 106/147] Update cPlayerAction.cpp
    
    ---
     source/cPlayerAction.cpp | 7 +++++--
     1 file changed, 5 insertions(+), 2 deletions(-)
    
    diff --git a/source/cPlayerAction.cpp b/source/cPlayerAction.cpp
    index f21845c0a..960bac22a 100644
    --- a/source/cPlayerAction.cpp
    +++ b/source/cPlayerAction.cpp
    @@ -699,15 +699,18 @@ bool CPIEquipItem::Handle( void )
     	{
     		bool canWear = false;
     		const SI16 scaledStrength = ( i->GetStrength() * ( 100 - i->GetLowerStatReq() )) / 100;
    +		const SI16 scaledDexterity = (i->GetDexterity() * (100 - i->GetLowerStatReq())) / 100;
    +		const SI16 scaledIntelligence = (i->GetIntelligence() * (100 - i->GetLowerStatReq())) / 100;
    +
     		if( scaledStrength > k->GetStrength() )
     		{
     			tSock->SysMessage( 1188 ); // You are not strong enough to use that. (NOTE: Should these messages use color 0x096a to stand out and replicate hard coded client message?)
     		}
    -		else if( i->GetDexterity() > k->GetDexterity() )
    +		else if( scaledDexterity > k->GetDexterity() )
     		{
     			tSock->SysMessage( 1189 ); // You are not agile enough to use that.
     		}
    -		else if( i->GetIntelligence() > k->GetIntelligence() )
    +		else if( scaledIntelligence > k->GetIntelligence() )
     		{
     			tSock->SysMessage( 1190 ); // You are not smart enough to use that.
     		}
    
    From e44fbef0da0f3c9b37f33c35657e0803a3243e10 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Fri, 24 Jan 2025 18:38:49 -0600
    Subject: [PATCH 107/147] Update cPlayerAction.cpp
    
    ---
     source/cPlayerAction.cpp | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/source/cPlayerAction.cpp b/source/cPlayerAction.cpp
    index 960bac22a..cf4b217c2 100644
    --- a/source/cPlayerAction.cpp
    +++ b/source/cPlayerAction.cpp
    @@ -699,8 +699,8 @@ bool CPIEquipItem::Handle( void )
     	{
     		bool canWear = false;
     		const SI16 scaledStrength = ( i->GetStrength() * ( 100 - i->GetLowerStatReq() )) / 100;
    -		const SI16 scaledDexterity = (i->GetDexterity() * (100 - i->GetLowerStatReq())) / 100;
    -		const SI16 scaledIntelligence = (i->GetIntelligence() * (100 - i->GetLowerStatReq())) / 100;
    +		const SI16 scaledDexterity = ( i->GetDexterity() * ( 100 - i->GetLowerStatReq() )) / 100;
    +		const SI16 scaledIntelligence = ( i->GetIntelligence() * ( 100 - i->GetLowerStatReq() )) / 100;
     
     		if( scaledStrength > k->GetStrength() )
     		{
    
    From 0bf54f87db7d21a189e1f8a4094cb1fcb5223cce Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Fri, 24 Jan 2025 18:50:38 -0600
    Subject: [PATCH 108/147] Update Changelog.txt
    
    ---
     source/Changelog.txt | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/source/Changelog.txt b/source/Changelog.txt
    index b0801d426..fb3168ad2 100644
    --- a/source/Changelog.txt
    +++ b/source/Changelog.txt
    @@ -1,6 +1,10 @@
     13/05/2024 - Dragon Slayer
     	Added New Shield Type 107 so shield ID's no longer have to be in hard code for shields to work properly
     
    +11/05/2024 - Dragon Slayer
    +	Fixed items handling correct target for resists.
    +	Added Getting the resists on chars.
    +
     09/05/2024 - Dragon Slayer
     	Added ArtifactRarity AOS Property for items
     	-ARTIFACTRARITY=#
    
    From 493d237163e6672e11b6640c3b78bf81782d65ef Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Fri, 24 Jan 2025 18:56:21 -0600
    Subject: [PATCH 109/147] small change
    
    ---
     source/Changelog.txt | 4 ++--
     source/combat.cpp    | 2 +-
     2 files changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/source/Changelog.txt b/source/Changelog.txt
    index f487f8433..75e646e18 100644
    --- a/source/Changelog.txt
    +++ b/source/Changelog.txt
    @@ -1,6 +1,6 @@
     16/06/2024 - Dragon Slayer/Xuri
    -	Added new DFN tags for Items:
    -		SPEEDINCREASE=# 		// item property that increases base weapon swing speed by the specified percentage
    +	Added new DFN tags for Items and Chars:
    +		SPEEDINCREASE=# 		// item and char property that increases base weapon swing speed by the specified percentage
     	These are also available as JS Engine object properties: .speedIncrease
     	Added INI Settings:
     		SWINGSPEEDINCREASECAP=#  	// Max cap for for swing speed increase a char can have.
    diff --git a/source/combat.cpp b/source/combat.cpp
    index 9d0627316..611fd9295 100644
    --- a/source/combat.cpp
    +++ b/source/combat.cpp
    @@ -3486,7 +3486,7 @@ R32 CHandleCombat::GetCombatTimeout( CChar *mChar )
     	if( cwmWorldState->ServerData()->ExpansionCoreShardEra() <= ER_LBR )
     	{
     		// Weapon swing delay in LBR and earlier
    -		getDelay = baseValue / ( getDelay * getOffset * speedFactor ) / globalAttackSpeed;
    +		getDelay = baseValue / ( getDelay * getOffset * speedBonus ) / globalAttackSpeed;
     	}
     	else if( cwmWorldState->ServerData()->ExpansionCoreShardEra() < ER_ML )
     	{
    
    From 43994ae32fcd1d3042b32861e81ffd93aaa01503 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Fri, 24 Jan 2025 18:58:22 -0600
    Subject: [PATCH 110/147] Update Changelog.txt
    
    ---
     source/Changelog.txt | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/source/Changelog.txt b/source/Changelog.txt
    index 9dd5101eb..e7e495b9e 100644
    --- a/source/Changelog.txt
    +++ b/source/Changelog.txt
    @@ -1,6 +1,6 @@
     
     7/07/2024 - Dragon Slayer
    -	Added Required Free Hand (js potion).
    +	Added Requirement to drink potion hand has to be free, This can be disabled within the potion.js file by switching the reqfreehand to false. (js potion).
       
     13/05/2024 - Dragon Slayer
     	Added New Shield Type 107 so shield ID's no longer have to be in hard code for shields to work properly
    
    From 40df40bc22d6361856bfaa632085d81d9a0032bb Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Fri, 24 Jan 2025 19:03:15 -0600
    Subject: [PATCH 111/147] tab fix
    
    ---
     source/gumps.cpp | 28 ++++++++++++++--------------
     1 file changed, 14 insertions(+), 14 deletions(-)
    
    diff --git a/source/gumps.cpp b/source/gumps.cpp
    index 2218a6828..3b2d56cb0 100644
    --- a/source/gumps.cpp
    +++ b/source/gumps.cpp
    @@ -670,20 +670,20 @@ void BuildAddMenuGump( CSocket *s, UI16 m )
     			{
     				// Draw a frame for the item to make it stand out a touch more.
     				if( s->ClientVerShort() <= CVS_70160 )
    -                {
    -                    // Fallback for older clients that don't support buttontileart
    -                    toSend.addCommand( oldstrutil::format("resizepic %u %u %u %u %u", xOffset, yOffset, 0x53, 65, 100 ));
    -                    toSend.addCommand( oldstrutil::format("checkertrans %u %u %u %u", xOffset + 7, yOffset + 9, 52, 82 ));
    -                    toSend.addCommand( oldstrutil::format("tilepic %u %u %i", xOffset + 5, yOffset + 10, std::stoi(tag, nullptr, 0) ));
    -                    toSend.addCommand( oldstrutil::format("croppedtext %u %u %u %u %u %u", xOffset, yOffset + 65, 65, 20, 55, linenum++ ));
    -                }
    -                else
    -                {
    -                    toSend.addCommand( oldstrutil::format( "checkertrans %u %u %u %u", xOffset + 7, yOffset + 9, 110, 110 ));
    -                    toSend.addCommand( oldstrutil::format( "buttontileart %u %u 0x0a9f 0x0aa1 %u %u %u %u %u %u %u", xOffset, yOffset, 1, 0, buttonnum, std::stoi( tag, nullptr, 0 ), 0, 25, 25 ));
    -                    toSend.addCommand( oldstrutil::format( "tooltip 1042971 @%s@", data.c_str() ));
    -                    toSend.addCommand( oldstrutil::format( "croppedtext %u %u %u %u %u %u", xOffset + 15, yOffset + 85, 100, 20, 50, linenum++ ));
    -                }
    +				{
    +					// Fallback for older clients that don't support buttontileart
    +					toSend.addCommand( oldstrutil::format("resizepic %u %u %u %u %u", xOffset, yOffset, 0x53, 65, 100 ));
    +					toSend.addCommand( oldstrutil::format("checkertrans %u %u %u %u", xOffset + 7, yOffset + 9, 52, 82 ));
    +					toSend.addCommand( oldstrutil::format("tilepic %u %u %i", xOffset + 5, yOffset + 10, std::stoi(tag, nullptr, 0) ));
    +					toSend.addCommand( oldstrutil::format("croppedtext %u %u %u %u %u %u", xOffset, yOffset + 65, 65, 20, 55, linenum++ ));
    +				}
    +				else
    +				{
    +					toSend.addCommand( oldstrutil::format( "checkertrans %u %u %u %u", xOffset + 7, yOffset + 9, 110, 110 ));
    +					toSend.addCommand( oldstrutil::format( "buttontileart %u %u 0x0a9f 0x0aa1 %u %u %u %u %u %u %u", xOffset, yOffset, 1, 0, buttonnum, std::stoi( tag, nullptr, 0 ), 0, 25, 25 ));
    +					toSend.addCommand( oldstrutil::format( "tooltip 1042971 @%s@", data.c_str() ));
    +					toSend.addCommand( oldstrutil::format( "croppedtext %u %u %u %u %u %u", xOffset + 15, yOffset + 85, 100, 20, 50, linenum++ ));
    +				}
     				toSend.addText( data );
     				xOffset += XOFFSET;
     				if( xOffset > 640 )
    
    From 9e7321b930477d99c6387d737bb00aebf31ebeb9 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Fri, 24 Jan 2025 19:04:52 -0600
    Subject: [PATCH 112/147] tab fix
    
    ---
     source/magic.cpp | 8 ++++----
     1 file changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/source/magic.cpp b/source/magic.cpp
    index 11918c522..7d49c6461 100644
    --- a/source/magic.cpp
    +++ b/source/magic.cpp
    @@ -4500,10 +4500,10 @@ void CMagic::CastSpell( CSocket *s, CChar *caster )
     		return;
     	}
     	else if( caster->IsNpc() )
    -    {
    -        // Run a skillcheck for NPC to give them a chance to gain skill - if that option is enabled in ini
    -        Skills->CheckSkill( caster, MAGERY, lowSkill, highSkill );
    -    }
    +	{
    +		// Run a skillcheck for NPC to give them a chance to gain skill - if that option is enabled in ini
    +		Skills->CheckSkill( caster, MAGERY, lowSkill, highSkill );
    +	}
     
     	if( curSpell > 63 && static_cast(curSpell) <= spellCount && spellCount <= 70 )
     	{
    
    From 7b553d852d41a95d3261c24ee52d030e0fa97e21 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Fri, 24 Jan 2025 19:07:35 -0600
    Subject: [PATCH 113/147] Update Changelog.txt
    
    ---
     source/Changelog.txt | 5 +++++
     1 file changed, 5 insertions(+)
    
    diff --git a/source/Changelog.txt b/source/Changelog.txt
    index b0801d426..4757a4bea 100644
    --- a/source/Changelog.txt
    +++ b/source/Changelog.txt
    @@ -1,3 +1,8 @@
    +05/08/2024 - Dragon Slayer Update
    +	Resolved an issue with cooking functionality.
    +	Fixed a duplicated dictionary number.
    +	Corrected the required items for crafting sweet dough and regular dough.
    +
     13/05/2024 - Dragon Slayer
     	Added New Shield Type 107 so shield ID's no longer have to be in hard code for shields to work properly
     
    
    From e11e2d62c4dab4f0194d417e7785b9007ab61e7b Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Fri, 24 Jan 2025 19:14:57 -0600
    Subject: [PATCH 114/147] fix tabs
    
    ---
     source/cScript.cpp | 36 ++++++++++++++++++------------------
     source/cScript.h   |  4 ++--
     source/combat.cpp  | 32 ++++++++++++++++----------------
     3 files changed, 36 insertions(+), 36 deletions(-)
    
    diff --git a/source/cScript.cpp b/source/cScript.cpp
    index 456dce5d3..b046d90fa 100644
    --- a/source/cScript.cpp
    +++ b/source/cScript.cpp
    @@ -1010,28 +1010,28 @@ bool cScript::OnAttack( CChar *attacker, CChar *defender, bool hitStatus, SI08 h
     //o------------------------------------------------------------------------------------------------o
     bool cScript::OnDefense( CChar *attacker, CChar *defender, bool hitStatus, SI08 hitLoc, UI16 damageReceived )
     {
    -    if( !ValidateObject( attacker ) || !ValidateObject( defender ))
    -        return false;
    +	if( !ValidateObject( attacker ) || !ValidateObject( defender ))
    +		return false;
     
    -    if( !ExistAndVerify( seOnDefense, "onDefense" ))
    -        return false;
    +	if( !ExistAndVerify( seOnDefense, "onDefense" ))
    +		return false;
     
    -    jsval rval, params[5];
    -    JSObject *attObj = JSEngine->AcquireObject( IUE_CHAR, attacker, runTime );
    -    JSObject *defObj = JSEngine->AcquireObject( IUE_CHAR, defender, runTime );
    +	jsval rval, params[5];
    +	JSObject *attObj = JSEngine->AcquireObject( IUE_CHAR, attacker, runTime );
    +	JSObject *defObj = JSEngine->AcquireObject( IUE_CHAR, defender, runTime );
     
    -    params[0] = OBJECT_TO_JSVAL( attObj );
    -    params[1] = OBJECT_TO_JSVAL( defObj );
    -    params[2] = BOOLEAN_TO_JSVAL( hitStatus );
    -    params[3] = INT_TO_JSVAL( hitLoc );
    -    params[4] = INT_TO_JSVAL( damageReceived );
    -    JSBool retVal = JS_CallFunctionName( targContext, targObject, "onDefense", 5, params, &rval );
    -    if( retVal == JS_FALSE )
    -    {
    -        SetEventExists( seOnDefense, false );
    -    }
    +	params[0] = OBJECT_TO_JSVAL( attObj );
    +	params[1] = OBJECT_TO_JSVAL( defObj );
    +	params[2] = BOOLEAN_TO_JSVAL( hitStatus );
    +	params[3] = INT_TO_JSVAL( hitLoc );
    +	params[4] = INT_TO_JSVAL( damageReceived );
    +	JSBool retVal = JS_CallFunctionName( targContext, targObject, "onDefense", 5, params, &rval );
    +	if( retVal == JS_FALSE )
    +	{
    +		SetEventExists( seOnDefense, false );
    +	}
     
    -    return ( retVal == JS_TRUE );
    +	return ( retVal == JS_TRUE );
     }
     
     //o------------------------------------------------------------------------------------------------o
    diff --git a/source/cScript.h b/source/cScript.h
    index b36053234..c83df63e7 100644
    --- a/source/cScript.h
    +++ b/source/cScript.h
    @@ -199,8 +199,8 @@ class cScript
     	bool		OnStat( void );
     	std::string		OnTooltip( CBaseObject *myObj, CSocket *pSocket );
     	std::string		OnNameRequest( CBaseObject *myObj, CChar *nameRequester, UI08 requestSource );
    -    bool        OnAttack( CChar *attacker, CChar *defender, bool hitStatus, SI08 hitLoc, UI16 damageDealt );
    -    bool        OnDefense( CChar *attacker, CChar *defender, bool hitStatus, SI08 hitLoc, UI16 damageReceived );
    +	bool        OnAttack( CChar *attacker, CChar *defender, bool hitStatus, SI08 hitLoc, UI16 damageDealt );
    +	bool        OnDefense( CChar *attacker, CChar *defender, bool hitStatus, SI08 hitLoc, UI16 damageReceived );
     	SI08		OnSkillGain( CChar *player, SI08 skill, UI32 skillAmtGained );
     	SI08		OnSkillLoss( CChar *player, SI08 skill, UI32 skillAmtLost );
     	bool		OnSkillChange( CChar *player, SI08 skill, SI32 skillAmtChanged );
    diff --git a/source/combat.cpp b/source/combat.cpp
    index fba9afa93..46c3308e4 100644
    --- a/source/combat.cpp
    +++ b/source/combat.cpp
    @@ -2918,23 +2918,23 @@ bool CHandleCombat::HandleCombat( CSocket *mSock, CChar& mChar, CChar *ourTarg )
     			PlayMissedSoundEffect( &mChar );
     
     			for( auto scriptTrig : scriptTriggers )
    -            {
    -                cScript *toExecute = JSMapping->GetScript( scriptTrig );
    -                if( toExecute != nullptr )
    -                {
    -                    toExecute->OnAttack( &mChar, ourTarg, skillPassed, -1, 0 );
    -                }
    -            }
    -
    -            std::vector defScriptTriggers = ourTarg->GetScriptTriggers();
    -            for( auto scriptTrig : defScriptTriggers )
    -            {
    +			{
    +				cScript *toExecute = JSMapping->GetScript( scriptTrig );
    +				if( toExecute != nullptr )
    +				{
    +					toExecute->OnAttack( &mChar, ourTarg, skillPassed, -1, 0 );
    +				}
    +			}
    +
    +			std::vector defScriptTriggers = ourTarg->GetScriptTriggers();
    +			for( auto scriptTrig : defScriptTriggers )
    +			{
                     cScript *toExecute = JSMapping->GetScript( scriptTrig );
    -                if( toExecute != nullptr )
    -                {
    -                    toExecute->OnDefense( &mChar, ourTarg, skillPassed, -1, 0 );
    -                }
    -            }
    +				if( toExecute != nullptr )
    +				{
    +					toExecute->OnDefense( &mChar, ourTarg, skillPassed, -1, 0 );
    +				}
    +			}
     		}
     		else
     		{
    
    From 528035c35f19e6a88968f3e141f896fce57ac8ff Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Fri, 24 Jan 2025 19:23:22 -0600
    Subject: [PATCH 115/147] Update Changelog.txt
    
    ---
     source/Changelog.txt | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/source/Changelog.txt b/source/Changelog.txt
    index f64afbc32..aeae1ccf5 100644
    --- a/source/Changelog.txt
    +++ b/source/Changelog.txt
    @@ -1,3 +1,6 @@
    +31/10/2024 - Dragon Slayer
    +	Fixed Height Check for clicking on dynamic items. (Thanks Xuri)
    +
     1/05/2024 - Dragon Slayer/Xuri
     	Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode.
     	Fixed createfood to check for reagents on cast.
    
    From dfd702083e4472e6571e9142d986758f52b9f880 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Fri, 24 Jan 2025 19:27:34 -0600
    Subject: [PATCH 116/147] tab fixes
    
    ---
     source/boats.cpp   | 24 ++++++++++++------------
     source/cScript.cpp | 34 +++++++++++++++++-----------------
     source/cScript.h   |  2 +-
     3 files changed, 30 insertions(+), 30 deletions(-)
    
    diff --git a/source/boats.cpp b/source/boats.cpp
    index 60f57cd58..0f5df3743 100644
    --- a/source/boats.cpp
    +++ b/source/boats.cpp
    @@ -903,18 +903,18 @@ void TurnBoat( CBoatObj *b, bool rightTurn, bool disableChecks )
     	}
     
     	auto scriptTriggers = b->GetScriptTriggers();
    -    for( auto scriptTrig : scriptTriggers )
    -    {
    -        auto toExecute = JSMapping->GetScript( scriptTrig );
    -        if( toExecute )
    -        {
    -            if( toExecute->OnBoatTurn( b, olddir, b->GetDir() ) == 1 )
    -            {
    -                // A script with the event returned true; prevent other scripts from running
    -                break;
    -            }
    -        }
    -    }
    +	for( auto scriptTrig : scriptTriggers )
    +	{
    +		auto toExecute = JSMapping->GetScript( scriptTrig );
    +		if( toExecute )
    +		{
    +			if( toExecute->OnBoatTurn( b, olddir, b->GetDir() ) == 1 )
    +			{
    +				// A script with the event returned true; prevent other scripts from running
    +				break;
    +			}
    +		}
    +	}
     }
     
     void TurnBoat( CSocket *mSock, CBoatObj *myBoat, CItem *tiller, UI08 dir, bool rightTurn )
    diff --git a/source/cScript.cpp b/source/cScript.cpp
    index 3c6e66c10..533e7cae3 100644
    --- a/source/cScript.cpp
    +++ b/source/cScript.cpp
    @@ -1631,29 +1631,29 @@ SI08 cScript::OnMultiLogout( CMultiObj *iMulti, CChar *cPlayer )
     //o------------------------------------------------------------------------------------------------o
     SI08 cScript::OnBoatTurn( CBoatObj *iBoat, UI08 oldDir, UI08 newDir )
     {
    -    const SI08 RV_NOFUNC = -1;
    -    if( !ValidateObject( iBoat ))
    -        return RV_NOFUNC;
    +	const SI08 RV_NOFUNC = -1;
    +	if( !ValidateObject( iBoat ))
    +		return RV_NOFUNC;
     
    -    if( !ExistAndVerify( seOnBoatTurn, "onBoatTurn" ))
    -        return RV_NOFUNC;
    +	if( !ExistAndVerify( seOnBoatTurn, "onBoatTurn" ))
    +		return RV_NOFUNC;
     
    -    jsval params[3], rval;
    -    JSObject *myBoat = JSEngine->AcquireObject( IUE_ITEM, iBoat, runTime );
    +	jsval params[3], rval;
    +	JSObject *myBoat = JSEngine->AcquireObject( IUE_ITEM, iBoat, runTime );
         
     
    -    params[0] = OBJECT_TO_JSVAL( myBoat );
    -    params[1] = INT_TO_JSVAL( oldDir );
    -    params[2] = INT_TO_JSVAL( newDir );
    +	params[0] = OBJECT_TO_JSVAL( myBoat );
    +	params[1] = INT_TO_JSVAL( oldDir );
    +	params[2] = INT_TO_JSVAL( newDir );
     
    -    JSBool retVal = JS_CallFunctionName( targContext, targObject, "onBoatTurn", 3, params, &rval );
    -    if( retVal == JS_FALSE )
    -    {
    -        SetEventExists( seOnBoatTurn, false );
    -        return RV_NOFUNC;
    -    }
    +	JSBool retVal = JS_CallFunctionName( targContext, targObject, "onBoatTurn", 3, params, &rval );
    +	if( retVal == JS_FALSE )
    +	{
    +		SetEventExists( seOnBoatTurn, false );
    +		return RV_NOFUNC;
    +	}
     
    -    return TryParseJSVal( rval );
    +	return TryParseJSVal( rval );
     }
     
     //o------------------------------------------------------------------------------------------------o
    diff --git a/source/cScript.h b/source/cScript.h
    index 1c168e137..07e6270b4 100644
    --- a/source/cScript.h
    +++ b/source/cScript.h
    @@ -217,7 +217,7 @@ class cScript
     	SI08		OnEntrance( CMultiObj *left, CBaseObject *leaving );
     	SI08		OnLeaving( CMultiObj *left, CBaseObject *leaving );
     	SI08		OnMultiLogout( CMultiObj* iMulti, CChar* cPlayer );
    -	SI08        OnBoatTurn( CBoatObj* iMulti, UI08 oldDir, UI08 newDir );
    +	SI08		OnBoatTurn( CBoatObj* iMulti, UI08 oldDir, UI08 newDir );
     	SI08		OnEquipAttempt( CChar *equipper, CItem *equipping );
     	SI08		OnEquip( CChar *equipper, CItem *equipping );
     	SI08		OnUnequipAttempt( CChar *equipper, CItem *equipping );
    
    From b749d7bc5885c6626e5974e729707f7f27511e7e Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Fri, 24 Jan 2025 19:30:38 -0600
    Subject: [PATCH 117/147] Update Changelog.txt
    
    ---
     source/Changelog.txt | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/source/Changelog.txt b/source/Changelog.txt
    index f64afbc32..9120e9edf 100644
    --- a/source/Changelog.txt
    +++ b/source/Changelog.txt
    @@ -1,3 +1,7 @@
    +27/10/2024 -Dragon Slayer
    +	Corrected a misspelling of IsBoat in magic.js.
    +	Added additional checks for boats in various functions.
    +
     1/05/2024 - Dragon Slayer/Xuri
     	Fixed AutoUnequipAttempt function in clumsy.js, createfood.js level1target.js, will no longer fail on casting and return to hardcode.
     	Fixed createfood to check for reagents on cast.
    
    From 39b389d5af14c2a79db15ee903e8140442cf5b8f Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Fri, 24 Jan 2025 19:31:46 -0600
    Subject: [PATCH 118/147] Update Changelog.txt
    
    ---
     source/Changelog.txt | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/source/Changelog.txt b/source/Changelog.txt
    index b952eead1..833910bd3 100644
    --- a/source/Changelog.txt
    +++ b/source/Changelog.txt
    @@ -1,5 +1,5 @@
     12/10/2024 - Dragon Slayer
    -	Added Mini-House Addons from ML Expansion.
    +	Added Mini-House Addons from AOS Expansion.
     
     13/05/2024 - Dragon Slayer
     	Added New Shield Type 107 so shield ID's no longer have to be in hard code for shields to work properly
    
    From 826f632c73ed043aee0f56c2a120dca4c82dd26f Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Fri, 24 Jan 2025 19:34:37 -0600
    Subject: [PATCH 119/147] Update UOXJSMethods.cpp
    
    ---
     source/UOXJSMethods.cpp | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/source/UOXJSMethods.cpp b/source/UOXJSMethods.cpp
    index 5fc566cf1..73cb6c5be 100644
    --- a/source/UOXJSMethods.cpp
    +++ b/source/UOXJSMethods.cpp
    @@ -7955,7 +7955,7 @@ JSBool CBase_SetRandomName( JSContext *cx, JSObject *obj, uintN argc, jsval *arg
     		return JS_FALSE;
     	}
     
    -	CBaseObject *mObj			= static_cast( JS_GetPrivate( cx, obj ));
    +	CBaseObject *mObj		= static_cast( JS_GetPrivate( cx, obj ));
     	std::string namelist	= JS_GetStringBytes( JS_ValueToString( cx, argv[0] ));
     
     	if( !namelist.empty() )
    
    From 2ca6b335c7abc88ff1db84576bfdbc3a584d60aa Mon Sep 17 00:00:00 2001
    From: Geir Ove Alnes 
    Date: Sat, 25 Jan 2025 15:29:21 +0800
    Subject: [PATCH 120/147] Update Changelog.txt
    
    ---
     source/Changelog.txt | 3 +--
     1 file changed, 1 insertion(+), 2 deletions(-)
    
    diff --git a/source/Changelog.txt b/source/Changelog.txt
    index fb3168ad2..f62b29102 100644
    --- a/source/Changelog.txt
    +++ b/source/Changelog.txt
    @@ -2,8 +2,7 @@
     	Added New Shield Type 107 so shield ID's no longer have to be in hard code for shields to work properly
     
     11/05/2024 - Dragon Slayer
    -	Fixed items handling correct target for resists.
    -	Added Getting the resists on chars.
    +	Updated 'get command (js/commands/targeting/get.js) to use correct object reference when getting resist values for items, and added support for getting resist values for chars
     
     09/05/2024 - Dragon Slayer
     	Added ArtifactRarity AOS Property for items
    
    From f9b3a33723507f982780a9f4ff5393daaab5677c Mon Sep 17 00:00:00 2001
    From: Geir Ove Alnes 
    Date: Sat, 25 Jan 2025 17:03:25 +0800
    Subject: [PATCH 121/147] Update Changelog.txt
    
    ---
     source/Changelog.txt | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/source/Changelog.txt b/source/Changelog.txt
    index b21847d8b..02b53eb87 100644
    --- a/source/Changelog.txt
    +++ b/source/Changelog.txt
    @@ -1,5 +1,5 @@
     12/08/2024 - Dragon Slayer
    -	Flipped Imbuing and Mysticism Skill around.
    +	Fixed an issue where Imbuing and Mysticism skills were listed in wrong order in skills.dfn and enums.h
     
     4/07/2024 - Dragon Slayer
     	Fixed Cleaver ID missing in the jse_objectassociations.scp for carving corpses
    
    From 1ef451f7168b2ffea8a32932ee2a797a46a3bf34 Mon Sep 17 00:00:00 2001
    From: Geir Ove Alnes 
    Date: Sat, 25 Jan 2025 17:16:46 +0800
    Subject: [PATCH 122/147] Update Changelog.txt
    
    ---
     source/Changelog.txt | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/source/Changelog.txt b/source/Changelog.txt
    index 4cb968502..c9dea30cf 100644
    --- a/source/Changelog.txt
    +++ b/source/Changelog.txt
    @@ -1,5 +1,5 @@
     07/12/2024 - Dragon Slayer
    -Updated the packet 0xf1 to reflect the current CUO Web Ping while maintaining backward compatibility with older ping statuses. (0xf1_freeshardServerPoll.js) (Thanks Karasho and Xuri)
    +	Updated the packet 0xf1 to reflect the current CUO Web Ping while maintaining backward compatibility with older ping statuses. (0xf1_freeshardServerPoll.js) (Thanks Karasho and Xuri)
     
     12/08/2024 - Dragon Slayer
     	Fixed an issue where Imbuing and Mysticism skills were listed in wrong order in skills.dfn and enums.h
    
    From 7115b64d448e47feae4b6df10496a3c8f729131d Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Sat, 25 Jan 2025 08:05:47 -0600
    Subject: [PATCH 123/147] fixed
    
    ---
     data/js/server/misc/spawnergump.js | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/data/js/server/misc/spawnergump.js b/data/js/server/misc/spawnergump.js
    index 0767c3eb7..449f219a7 100644
    --- a/data/js/server/misc/spawnergump.js
    +++ b/data/js/server/misc/spawnergump.js
    @@ -1,11 +1,11 @@
     function onUseChecked( pUser, iUsed )
     {
     	var socket = pUser.socket;
    -	socket.tempObj = iUsed;
     	var gumpID = 5037 + 0xffff;
     
     	if( socket && iUsed && iUsed.isItem && pUser.isGM )
     	{
    +		socket.tempObj = iUsed;
     		socket.CloseGump( gumpID, 0 );
     		spawnerGump( socket, pUser, iUsed );
     	}
    
    From d45a00e3ae30e0a1a6e47c0ce40a3496590f1359 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Sat, 25 Jan 2025 08:13:53 -0600
    Subject: [PATCH 124/147] Update combat.cpp
    
    ---
     source/combat.cpp | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/source/combat.cpp b/source/combat.cpp
    index 611fd9295..9d0627316 100644
    --- a/source/combat.cpp
    +++ b/source/combat.cpp
    @@ -3486,7 +3486,7 @@ R32 CHandleCombat::GetCombatTimeout( CChar *mChar )
     	if( cwmWorldState->ServerData()->ExpansionCoreShardEra() <= ER_LBR )
     	{
     		// Weapon swing delay in LBR and earlier
    -		getDelay = baseValue / ( getDelay * getOffset * speedBonus ) / globalAttackSpeed;
    +		getDelay = baseValue / ( getDelay * getOffset * speedFactor ) / globalAttackSpeed;
     	}
     	else if( cwmWorldState->ServerData()->ExpansionCoreShardEra() < ER_ML )
     	{
    
    From 38f1ee598f2445a4815fa313de5d76350815214b Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Sat, 25 Jan 2025 09:33:08 -0600
    Subject: [PATCH 125/147] Update cServerData.cpp
    
    ---
     source/cServerData.cpp | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/source/cServerData.cpp b/source/cServerData.cpp
    index 178453137..baebacaf7 100644
    --- a/source/cServerData.cpp
    +++ b/source/cServerData.cpp
    @@ -724,6 +724,7 @@ auto CServerData::ResetDefaults() -> void
     	PetCombatTraining( true );
     	HirelingCombatTraining( true );
     	NpcCombatTraining( false );
    +	SwingSpeedIncreaseCap( 60 );
     	WeaponDamageBonusType( 2 );
     
     	CheckPetControlDifficulty( true );
    
    From f8d35ab0c2a1690d3865bb6c4a1111b8c4469c2e Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Sat, 25 Jan 2025 10:06:59 -0600
    Subject: [PATCH 126/147] tab update
    
    ---
     data/js/combat/special_moves.js | 70 ++++++++++++++++-----------------
     1 file changed, 35 insertions(+), 35 deletions(-)
    
    diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js
    index 1742e5993..a141907f3 100644
    --- a/data/js/combat/special_moves.js
    +++ b/data/js/combat/special_moves.js
    @@ -22,7 +22,7 @@ function onSpecialMove( pUser, abilityID )
     	if( abilityID >= 1 )
     		pUser.SetTempTag( "abilityID", abilityID );
     
    -    return true;
    +	return true;
     }
     
     function checkSkillRequirement( pUser, requiredSkillLevel, requiredSkill, skillMessage, abilityID ) 
    @@ -323,35 +323,35 @@ function DeductMana(  pUser, abilityID )
     function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc )
     {
     	var abilityID = pAttacker.GetTempTag( "abilityID" );
    -    var baseDamage = pAttacker.attack;
    +	var baseDamage = pAttacker.attack;
     
    -    if( baseDamage == -1 )  // No damage if weapon breaks
    -        return 0;
    +	if( baseDamage == -1 )  // No damage if weapon breaks
    +		return 0;
     
    -    var damage = ApplyDamageBonuses( 1, pAttacker, pDefender, fightSkill, hitLoc, baseDamage );
    +	var damage = ApplyDamageBonuses( 1, pAttacker, pDefender, fightSkill, hitLoc, baseDamage );
     
    -    if( damage < 1 )
    -        return 0;
    +	if( damage < 1 )
    +		return 0;
     
    -    // Check if attacker has armor ignore enabled
    +	// Check if attacker has armor ignore enabled
     	if( abilityID == 1 ) // armorignore
    -    {
    -        // Armor Ignore ignores defense modifiers, but deals only 90% of potential damage
    -        damage *= 0.9;
    -
    -        if( fightSkill == 31 ) // Archery
    -        {
    -            // Cap damage from Armor Strike attack at 30 for archery weapons
    -            if( damage > 30 )
    -                damage = 30;
    -        }
    -        else
    -		{
    -            // For all othe rfighting skills, cap damage from Armor Strike at 35
    -            if( damage > 35 )
    -                damage = 35;
    -        }
    -    }
    +	{
    +		// Armor Ignore ignores defense modifiers, but deals only 90% of potential damage
    +		damage *= 0.9;
    +
    +		if( fightSkill == 31 ) // Archery
    +		{
    +			// Cap damage from Armor Strike attack at 30 for archery weapons
    +			if( damage > 30 )
    +				damage = 30;
    +		}
    +		else
    +		{
    +			// For all othe rfighting skills, cap damage from Armor Strike at 35
    +			if( damage > 35 )
    +				damage = 35;
    +		}
    +	}
     	else if( abilityID == 12 )// shadowstrike
     	{
     		damage *= 1.25;
    @@ -366,7 +366,7 @@ function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc )
     		{
     			var hitsPercent = ( pDefender.hp / pDefender.maxhp ) * 100.0;
     
    -            var manaPercent = 0;
    +			var manaPercent = 0;
     
     			if( pDefender.maxmana > 0 )
     				manaPercent = ( pDefender.mana / pDefender.maxmana ) * 100.0;
    @@ -374,21 +374,21 @@ function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc )
     			damage += Math.min(Math.floor(Math.abs(hitsPercent - manaPercent) / 4), 20);
     		}
     	}
    -    else
    +	else
     	{
    -        // Otherwise, apply normal defense modifiers
    -        damage = ApplyDefenseModifiers( 1, pAttacker, pDefender, fightSkill, hitLoc, damage, true );
    -    }
    +		// Otherwise, apply normal defense modifiers
    +		damage = ApplyDefenseModifiers( 1, pAttacker, pDefender, fightSkill, hitLoc, damage, true );
    +	}
     
    -    // If damage after defense modifiers is below 0, do a small random amount of damage still
    -    if( damage <= 0 )
    -        damage = RandomNumber( 0, 4 );
    +	// If damage after defense modifiers is below 0, do a small random amount of damage still
    +	if( damage <= 0 )
    +		damage = RandomNumber( 0, 4 );
     
    -    // If defender is a player, damage is divided by this modifier from uox.ini
    +	// If defender is a player, damage is divided by this modifier from uox.ini
     	if( pAttacker.npc && !pDefender.npc )
     		damage /= GetServerSetting( "NPCDAMAGERATE" );
     
    -    return damage;
    +	return damage;
     }
     
     function onCombatHit( pAttacker, pDefender )
    
    From 0070ce2deb947fbfdf458ea28632e0bfa4a3b556 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Sat, 25 Jan 2025 10:24:37 -0600
    Subject: [PATCH 127/147] Added Int & Dex
    
    Added Int and Dex Tooltips
    ---
     source/CPacketSend.cpp | 18 +++++++++++++++++-
     1 file changed, 17 insertions(+), 1 deletion(-)
    
    diff --git a/source/CPacketSend.cpp b/source/CPacketSend.cpp
    index 4f7ae8872..7abc58253 100644
    --- a/source/CPacketSend.cpp
    +++ b/source/CPacketSend.cpp
    @@ -7665,7 +7665,9 @@ void CPToolTip::CopyItemData( CItem& cItem, size_t &totalStringLen, bool addAmou
     				FinalizeData( tempEntry, totalStringLen );
     			}
     
    -			const SI16 strReq = (cItem.GetStrength() * (100 - cItem.GetLowerStatReq())) / 100;
    +			const SI16 strReq = ( cItem.GetStrength() * ( 100 - cItem.GetLowerStatReq() )) / 100;
    +			const SI16 dexReq = ( cItem.GetDexterity() * ( 100 - cItem.GetLowerStatReq() )) / 100;
    +			const SI16 intReq = ( cItem.GetIntelligence() * ( 100 - cItem.GetLowerStatReq() )) / 100;
     
     			if( strReq > 0 )
     			{
    @@ -7674,6 +7676,20 @@ void CPToolTip::CopyItemData( CItem& cItem, size_t &totalStringLen, bool addAmou
     				FinalizeData( tempEntry, totalStringLen );
     			}
     
    +			if( dexReq > 0 )
    +			{
    +				tempEntry.stringNum = 1042971; // ~1_NOTHING~
    +				tempEntry.ourText = oldstrutil::format( "dexterity requirement %s", oldstrutil::number( cItem.GetDexterity()).c_str() );
    +				FinalizeData( tempEntry, totalStringLen );
    +			}
    +
    +			if( intReq > 0 )
    +			{
    +				tempEntry.stringNum = 1042971; // ~1_NOTHING~
    +				tempEntry.ourText = oldstrutil::format( "intelligence requirement %s", oldstrutil::number( cItem.GetIntelligence()).c_str() );
    +				FinalizeData( tempEntry, totalStringLen );
    +			}
    +
     			if( cItem.GetLowerStatReq() > 0 )
     			{
     				tempEntry.stringNum = 1060435; // lower requirements ~1_val~%
    
    From 4c31ee700bd84111d6c8a91d0a397634beb54ec3 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Sat, 25 Jan 2025 11:43:20 -0600
    Subject: [PATCH 128/147] Update CPacketSend.cpp
    
    ---
     source/CPacketSend.cpp | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/source/CPacketSend.cpp b/source/CPacketSend.cpp
    index 7abc58253..95fe21701 100644
    --- a/source/CPacketSend.cpp
    +++ b/source/CPacketSend.cpp
    @@ -7672,21 +7672,21 @@ void CPToolTip::CopyItemData( CItem& cItem, size_t &totalStringLen, bool addAmou
     			if( strReq > 0 )
     			{
     				tempEntry.stringNum = 1061170; // strength requirement ~1_val~
    -				tempEntry.ourText = oldstrutil::number( cItem.GetStrength() );
    +				tempEntry.ourText = oldstrutil::number( strReq );
     				FinalizeData( tempEntry, totalStringLen );
     			}
     
     			if( dexReq > 0 )
     			{
     				tempEntry.stringNum = 1042971; // ~1_NOTHING~
    -				tempEntry.ourText = oldstrutil::format( "dexterity requirement %s", oldstrutil::number( cItem.GetDexterity()).c_str() );
    +				tempEntry.ourText = oldstrutil::format( "dexterity requirement %s", oldstrutil::number( dexReq ).c_str() );
     				FinalizeData( tempEntry, totalStringLen );
     			}
     
     			if( intReq > 0 )
     			{
     				tempEntry.stringNum = 1042971; // ~1_NOTHING~
    -				tempEntry.ourText = oldstrutil::format( "intelligence requirement %s", oldstrutil::number( cItem.GetIntelligence()).c_str() );
    +				tempEntry.ourText = oldstrutil::format( "intelligence requirement %s", oldstrutil::number( intReq ).c_str() );
     				FinalizeData( tempEntry, totalStringLen );
     			}
     
    
    From 0c9dd2d29950ee0d19bf2b9de2d591744b91eabf Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Sat, 25 Jan 2025 11:55:51 -0600
    Subject: [PATCH 129/147] Update CPacketSend.cpp
    
    ---
     source/CPacketSend.cpp | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/source/CPacketSend.cpp b/source/CPacketSend.cpp
    index e1e1520be..448966e33 100644
    --- a/source/CPacketSend.cpp
    +++ b/source/CPacketSend.cpp
    @@ -7702,7 +7702,7 @@ void CPToolTip::CopyItemData( CItem& cItem, size_t &totalStringLen, bool addAmou
     				FinalizeData( tempEntry, totalStringLen );
     			}
     
    -      if( cItem.GetHitChance() > 0 )
    +			if( cItem.GetHitChance() > 0 )
     			{
     				tempEntry.stringNum = 1060415; // hit chance increase ~1_val~%
     				tempEntry.ourText = oldstrutil::number( cItem.GetHitChance() );
    
    From 7d49d36150e8ddc3ab3973e51db646833115a058 Mon Sep 17 00:00:00 2001
    From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com>
    Date: Sat, 25 Jan 2025 22:20:28 -0600
    Subject: [PATCH 130/147] tabs
    
    ---
     docs/jsdocs.html | 70 ++++++++++++++++++++++++------------------------
     1 file changed, 35 insertions(+), 35 deletions(-)
    
    diff --git a/docs/jsdocs.html b/docs/jsdocs.html
    index 98d42d786..1f518d527 100644
    --- a/docs/jsdocs.html
    +++ b/docs/jsdocs.html
    @@ -6372,50 +6372,50 @@ 

    January 9th, 2022

    -
    - - -
    -
    -

    Prototype

    -

    PARTY CreateParty( partyleader );

    -
    -
    -

    Purpose

    -

    Create a new party/group with the specified character as leader

    -
    -
    -

    Example of usage

    -
    // Create a new party (myParty) with pUser as the leader
    +						
    + + +
    +
    +

    Prototype

    +

    PARTY CreateParty( partyleader );

    +
    +
    +

    Purpose

    +

    Create a new party/group with the specified character as leader

    +
    +
    +

    Example of usage

    +
    // Create a new party (myParty) with pUser as the leader
     var myParty = CreateParty( pUser );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    JSBool CheckInstaLog( x, y, world, instanceID );

    -
    -
    -

    Purpose

    -

    Checks if a specific location ( x, y, world, instanceID ) is within an instant logout zone.

    -
    -
    -

    Example of usage

    -
    // Check if the player is in an instant logout zone
    +						
    + + +
    +
    +

    Prototype

    +

    JSBool CheckInstaLog( x, y, world, instanceID );

    +
    +
    +

    Purpose

    +

    Checks if a specific location ( x, y, world, instanceID ) is within an instant logout zone.

    +
    +
    +

    Example of usage

    +
    // Check if the player is in an instant logout zone
     var isInstaLog = CheckInstaLog(targX, targY, worldNumber, instanceID);
     
     if( isInstaLog )
     {
    -    // Handle instant logout
    +	// Handle instant logout
     }
     else
     {
    -    // Handle other logout scenarios
    +	// Handle other logout scenarios
     }
    From 6c33200e9c8359db05a3e7a2ed42e31c5c328b27 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 25 Jan 2025 22:25:17 -0600 Subject: [PATCH 131/147] Update Changelog.txt --- source/Changelog.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/Changelog.txt b/source/Changelog.txt index 02b53eb87..79ec4f3b6 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,7 @@ +10/09/2024 - Dragon Slayer + Added Puzzle Chest These are the same as the type of traps purchased from the Oddities Trader at the Lycaeum. The more lockpicking skill that you have the better 'hints' you receive. Opening the puzzle lock will unhide you. Answering incorrectly will damage you. These chests can only be unlocked by solving a puzzle. + + 12/08/2024 - Dragon Slayer Fixed an issue where Imbuing and Mysticism skills were listed in wrong order in skills.dfn and enums.h From a0e6ed0b4d707b075688c26bea5fa8022cb46cb2 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 25 Jan 2025 23:26:40 -0600 Subject: [PATCH 132/147] Update global.js --- data/js/server/global.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/data/js/server/global.js b/data/js/server/global.js index aab7de6a4..3e6df7fac 100644 --- a/data/js/server/global.js +++ b/data/js/server/global.js @@ -2,6 +2,8 @@ // Supported Events trigger for every character/item, use with care function onLogin( socket, pChar ) { + const coreShardEra = EraStringToNum( GetServerSetting( "CoreShardEra" )); + // Display Admin Welcome Gump for characters on admin account, until a choice has been made if( pChar.accountNum == 0 ) { @@ -37,12 +39,11 @@ function onLogin( socket, pChar ) TriggerEvent( 8001, "CheckYoungStatus", socket, pChar, true ); } - //Attach the special moves Book - if( !pChar.npc && !pChar.HasScriptTrigger( 7001 )) + if( coreShardEra >= EraStringToNum( "aos" ) && ( !pChar.npc && !pChar.HasScriptTrigger( 7001 ))) { pChar.AddScriptTrigger( 7001 ); - } + } // Re-adds Buff for disguise kit if player still has time left. var currentTime = GetCurrentClock(); From 44f895ca199b38ccd4a475585ca5ee3f79c88bc6 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 25 Jan 2025 23:33:51 -0600 Subject: [PATCH 133/147] Update commit out the mana check for se and up there not even included yet. restrictedAbilities so if they are double clicked in the bookl they will get a msg this move isnt active on server --- data/js/combat/special_moves.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index a141907f3..798a931d7 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -1,7 +1,7 @@ function onSpecialMove( pUser, abilityID ) { // Define the array of restricted ability IDs - var restrictedAbilities = [7, 10, 13, 14, 15, 16, 17,18,19,20,21,22,23,24,25,29]; + var restrictedAbilities = [14, 15, 16, 17,18,19,20,21,22,23,24,25,29]; // Check if the abilityID is in the array of restricted abilities if( restrictedAbilities.indexOf( abilityID ) != -1 ) @@ -245,7 +245,8 @@ function getAbilityManaTable() 10: { manaAmount: 20 }, // Moving Shot 11: { manaAmount: 35 }, // Paralyzing Blow 12: { manaAmount: 25 }, // Shadow Strike - 13: { manaAmount: 25 }, // Whirlwind Attack // End AOS abilities + 13: { manaAmount: 25 } // Whirlwind Attack // End AOS abilities + /* 14-29 are not available 14: { manaAmount: 30 }, // Riding Swipe // Start SE abiltiies 15: { manaAmount: 30 }, // Frenzied Whirlwind 16: { manaAmount: 30 }, // Block @@ -261,7 +262,7 @@ function getAbilityManaTable() 26: { manaAmount: 15 }, // Lightning Arrow 27: { manaAmount: 25 }, // Psychic Attack 28: { manaAmount: 35 }, // Serpent Arrow - 29: { manaAmount: 35 } // Force of Nature // End ML abilities + 29: { manaAmount: 35 } // Force of Nature // End ML abilities*/ }; } From a0cee722464368211ed32af7bce4410d39e92a25 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 26 Jan 2025 10:46:02 -0600 Subject: [PATCH 134/147] Update global.js --- data/js/server/global.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/js/server/global.js b/data/js/server/global.js index 3e6df7fac..4a16b9e8e 100644 --- a/data/js/server/global.js +++ b/data/js/server/global.js @@ -39,8 +39,7 @@ function onLogin( socket, pChar ) TriggerEvent( 8001, "CheckYoungStatus", socket, pChar, true ); } - //Attach the special moves Book - if( coreShardEra >= EraStringToNum( "aos" ) && ( !pChar.npc && !pChar.HasScriptTrigger( 7001 ))) + if( coreShardEra >= EraStringToNum( "aos" ) && ( !pChar.npc && !pChar.HasScriptTrigger( 7001 )))// Attach the special moves Book { pChar.AddScriptTrigger( 7001 ); } From 93b8fb5f9dc15fe3f1fd6f26a1be83aa1e9f613b Mon Sep 17 00:00:00 2001 From: Geir Ove Alnes Date: Mon, 27 Jan 2025 00:47:25 +0800 Subject: [PATCH 135/147] Update resurrectpenalty.js --- data/js/player/death/resurrectpenalty.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/data/js/player/death/resurrectpenalty.js b/data/js/player/death/resurrectpenalty.js index 600957f73..33301b094 100644 --- a/data/js/player/death/resurrectpenalty.js +++ b/data/js/player/death/resurrectpenalty.js @@ -8,6 +8,8 @@ function ResurrectFamePenalty( pUser ) } } +// Penalty to karma is disabled by default, but can be enabled +// via a TriggerEvent call in js/item/shrines.js (onGumpPress) function ResurrectKarmaPenalty( pUser ) { if( pUser.karma > 0 ) @@ -49,9 +51,14 @@ function ResurrectMurderPenalty( pUser ) { pUser.dexterity = RandomNumber( 10, pUser.dexterity * loss ); } + + // ResurrectSkillPenalty( pUser ); } } +// Penalty to skills is disabled by default, but can be enabled +// by uncommenting call in ResurrectMurderPenalty (for murderers) or +// for all players via a TriggerEvent call in js/item/shrines.js (onGumpPress) function ResurrectSkillPenalty( pUser ) { // Define the reduction range (89% to 91%) @@ -79,7 +86,7 @@ function ResurrectSkillPenalty( pUser ) pUser.SetTag( "recoveryCount", 0 ); // Track recovery intervals } -// Recovery handler triggered by StartTimer +// Skill Recovery handler triggered by StartTimer function onTimer( timerObj, timerID ) { if( timerID == 0 ) @@ -124,4 +131,4 @@ function onTimer( timerObj, timerID ) } } -function _restorecontext_() {} \ No newline at end of file +function _restorecontext_() {} From 1b5d0e5a2eeb26dc21d6867585d2dd2a512a98ef Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 26 Jan 2025 11:07:47 -0600 Subject: [PATCH 136/147] Update global.js --- data/js/server/global.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/js/server/global.js b/data/js/server/global.js index 4a16b9e8e..aebb80ae4 100644 --- a/data/js/server/global.js +++ b/data/js/server/global.js @@ -77,6 +77,8 @@ function onLogout( pSock, pChar ) function onCreatePlayer( pChar ) { + const coreShardEra = EraStringToNum( GetServerSetting( "CoreShardEra" )); + // If player character is created on a Young account, give them Young-specific items if( pChar.account.isYoung ) { @@ -90,7 +92,7 @@ function onCreatePlayer( pChar ) } //Attach the special moves Book - if( !pChar.npc && !pChar.HasScriptTrigger( 7001 )) + if( coreShardEra >= EraStringToNum( "aos" ) && ( !pChar.npc && !pChar.HasScriptTrigger( 7001 ))) { pChar.AddScriptTrigger( 7001 ); } From f809b4cd68003b58d34a89cd2995301cb1012be6 Mon Sep 17 00:00:00 2001 From: Geir Ove Alnes Date: Mon, 27 Jan 2025 02:36:47 +0800 Subject: [PATCH 137/147] Update special_moves.js script ID 2205 was already in use by something else, so changed it to 2206 in special_moves.js and in jse_fileassociations.scp --- data/js/combat/special_moves.js | 74 ++++++++++++++++----------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 798a931d7..49dd46e2b 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -7,7 +7,7 @@ function onSpecialMove( pUser, abilityID ) if( restrictedAbilities.indexOf( abilityID ) != -1 ) { pUser.SysMessage( "This ability is not yet available." ); - TriggerEvent( 2205, "DeactivateSpecialMove", pUser, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pUser, abilityID ); return false; } @@ -32,7 +32,7 @@ function checkSkillRequirement( pUser, requiredSkillLevel, requiredSkill, skillM { pSock.SysMessage( GetDictionaryEntry( 19201, pSock.language), skillMessage); // You need %i weapon skill to perform that attack - TriggerEvent( 2205, "DeactivateSpecialMove", pUser, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pUser, abilityID ); return false; } return true; @@ -289,7 +289,7 @@ function CheckMana( pUser, abilityID ) if( pUser.mana < requiredMana ) { pSock.SysMessage( GetDictionaryEntry( 19202, pSock.language), requiredMana); // You need %i mana to perform that attack - TriggerEvent( 2205, "DeactivateSpecialMove", pUser, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pUser, abilityID ); return false; } else @@ -415,7 +415,7 @@ function onAbility( pAttacker, pDefender, abilityID ) { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 1 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -430,13 +430,13 @@ function onAbility( pAttacker, pDefender, abilityID ) pDefender.SoundEffect( 0x0056, true ); pDefender.StaticEffect( 0x3728, 0x09, 0x06 ); - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 2 ) // bleedattack { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 2 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -462,13 +462,13 @@ function onAbility( pAttacker, pDefender, abilityID ) pAttacker.SoundEffect( 0x133, true ); pDefender.StaticEffect( 0x377A, 0x09, 0x32 ); - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 3 ) // ConcussionBlow { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 3 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -484,14 +484,14 @@ function onAbility( pAttacker, pDefender, abilityID ) pAttacker.SoundEffect( 0x213, true ); pDefender.StaticEffect( 0x377A, 0x09, 0x32 ); - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 4 ) // crushingblow { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 4 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -504,7 +504,7 @@ function onAbility( pAttacker, pDefender, abilityID ) pSockDefender.SysMessage( GetDictionaryEntry( 19212, pSockDefender.language ));// You take extra damage from the crushing attack! pAttacker.SoundEffect( 0x1E1, true ); - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 5 ) // Disarm { @@ -514,20 +514,20 @@ function onAbility( pAttacker, pDefender, abilityID ) if( pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2 ) { pSockAttacker.SysMessage( GetDictionaryEntry( 19213, pSockAttacker.language ));// You cannot disarm your opponent. - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); return false; } if( itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9 ) { pSockAttacker.SysMessage( GetDictionaryEntry( 19214, pSockAttacker.language ));// Your target is already unarmed! - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); return false; } // Clear out any current ability the player is doing when he switches abilities if( abilityID != 5 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -558,7 +558,7 @@ function onAbility( pAttacker, pDefender, abilityID ) TriggerEvent(50104, "AddBuff", pDefender, 0x3ea, 1075637, 0, 5, " " ); - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 6 ) // Dismount { @@ -566,7 +566,7 @@ function onAbility( pAttacker, pDefender, abilityID ) if( pAttacker.isonhorse || pAttacker.isflying ) { pSockAttacker.SysMessage( GetDictionaryEntry( 19217, pSockAttacker.language ));// You cannot perform that attack while mounted or flying! - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); return true; } @@ -574,13 +574,13 @@ function onAbility( pAttacker, pDefender, abilityID ) if( !pDefender.isonhorse || !pDefender.isflying ) { pSockAttacker.SysMessage( GetDictionaryEntry( 19218, pSockAttacker.language ));// This attack only works on mounted or flying targets - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); return true; } // Clear out any current ability the player is doing when he switches abilities if( abilityID != 6 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -599,13 +599,13 @@ function onAbility( pAttacker, pDefender, abilityID ) if( pSockDefender != null ) pSockDefender.SysMessage( GetDictionaryEntry( 19220, pSockDefender.language ), pAttacker.name );// You have been knocked off of your mount by %i ! - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 7 ) // Double Strike { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 7 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -613,7 +613,7 @@ function onAbility( pAttacker, pDefender, abilityID ) DeductMana( pAttacker, abilityID ); } - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 8 ) // Infectious Strike { @@ -623,13 +623,13 @@ function onAbility( pAttacker, pDefender, abilityID ) if( itemLHand != null && itemLHand.poison <= 0 || itemRHand != null && itemRHand.poison <= 0 ) { pSockAttacker.SysMessage( GetDictionaryEntry( 19221, pSockAttacker.language ));// Your weapon must have a dose of poison to perform an infectious strike! - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); return; } // Clear out any current ability the player is doing when he switches abilities if( abilityID != 8 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -681,14 +681,14 @@ function onAbility( pAttacker, pDefender, abilityID ) pAttacker.SoundEffect( 0xDD, true ); pDefender.StaticEffect( 0x3728, 0x09, 0x32 ); - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 9 ) // Mortal Strike { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 9 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -716,13 +716,13 @@ function onAbility( pAttacker, pDefender, abilityID ) if( pDefender.socket ) TriggerEvent( 50104, "AddBuff", pDefender, 1027, 1075810, 1075811, 6, " " ); - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 10 ) // Moving Shot { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 10 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -730,13 +730,13 @@ function onAbility( pAttacker, pDefender, abilityID ) DeductMana( pAttacker, abilityID ); } - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 11 ) // ParalyzingBlow { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 11 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -775,20 +775,20 @@ function onAbility( pAttacker, pDefender, abilityID ) { pSockAttacker.SysMessage( GetDictionaryEntry( 17702, pAttacker.socket.language), false, 0x3b2, 0, pAttacker.serial );// You deliver a paralyzing blow! } - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 12 ) // shadowstrike { if( pAttacker.skills[47] < 800 ) // Stealth { pSockAttacker.SysMessage( GetDictionaryEntry( 19231, pSockAttacker.language ));// "You lack the required stealth to perform that attack - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); return true; } // Clear out any current ability the player is doing when he switches abilities if( abilityID != 12 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -809,13 +809,13 @@ function onAbility( pAttacker, pDefender, abilityID ) pDefender.atWar = false; pAttacker.visible = 1; - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID ); } else if( abilityID == 13 ) // Whirlwind Attack { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 13 ) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + TriggerEvent(2206, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana if( CheckMana(pAttacker, abilityID )) @@ -823,7 +823,7 @@ function onAbility( pAttacker, pDefender, abilityID ) DeductMana( pAttacker, abilityID ); } - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } } @@ -842,7 +842,7 @@ function onTimer( timerObj, timerID ) timerObj.SetTempTag( "blockHeal", null ); timerObj.KillJSTimer( 9400, 7001 ); timerObj.SetTempTag( "doBleed", null ); - TriggerEvent( 2205, "ClearSpecialMove", timerObj, abilityID ); + TriggerEvent( 2206, "ClearSpecialMove", timerObj, abilityID ); return; } else if( timerID == 8000 ) @@ -880,4 +880,4 @@ function onTimer( timerObj, timerID ) if( socket != null ) socket.SysMessage( GetDictionaryEntry( 19236, socket.language ));// The bleeding wounds have healed, you are no longer bleeding! } -} \ No newline at end of file +} From ce6ed1d0e57710695221cf25eb34b84bfbbd2e67 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 26 Jan 2025 17:41:35 -0600 Subject: [PATCH 138/147] Added puzzle chest to addmenu --- data/dfndata/items/ItemMenu.bulk.dfn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/dfndata/items/ItemMenu.bulk.dfn b/data/dfndata/items/ItemMenu.bulk.dfn index 0da06b87d..440a8d197 100644 --- a/data/dfndata/items/ItemMenu.bulk.dfn +++ b/data/dfndata/items/ItemMenu.bulk.dfn @@ -9097,6 +9097,8 @@ ADDITEM=0x0e7c ADDITEM=0x0e40 0x0e41=metal chest ADDITEM=0x0e41 +0x0e41=Puzzle Chest +ADDITEM=puzzlechest <=Previous Menu ITEMMENU=3 } From 19ba341b89fe4cc495d76fdcaa7123a729228a0b Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 26 Jan 2025 20:06:11 -0600 Subject: [PATCH 139/147] update added to addmneu added origin tag --- .../{house_ml.dfn => house_addons_ml.dfn} | 0 data/dfndata/items/ItemMenu.bulk.dfn | 55 +++++++++++++++++++ data/dfndata/items/ItemMenu.dfn | 2 + .../items/deeds/houseaddon_deeds_ml.dfn | 24 ++++++++ 4 files changed, 81 insertions(+) rename data/dfndata/house/{house_ml.dfn => house_addons_ml.dfn} (100%) diff --git a/data/dfndata/house/house_ml.dfn b/data/dfndata/house/house_addons_ml.dfn similarity index 100% rename from data/dfndata/house/house_ml.dfn rename to data/dfndata/house/house_addons_ml.dfn diff --git a/data/dfndata/items/ItemMenu.bulk.dfn b/data/dfndata/items/ItemMenu.bulk.dfn index 0da06b87d..9f314dd23 100644 --- a/data/dfndata/items/ItemMenu.bulk.dfn +++ b/data/dfndata/items/ItemMenu.bulk.dfn @@ -14253,3 +14253,58 @@ ADDITEM=mapmakerspen <=Previous Menu ITEMMENU=127 } + +[ITEMMENU 260] +{ +Houseaddon_ML_Deeds.dfn +0x14F0=Elven Bed (East) +ADDITEM=elvenbedeastdeed +0x14F0=Elven Bed (South) +ADDITEM=elvenbedsouthdeed +0x14F0=Alchemist Table (East) +ADDITEM=alchemisttabledeedeast +0x14F0=Alchemist Table (South) +ADDITEM=alchemisttablesouthdeed +0x14F0=Elven Loveseat (East) +ADDITEM=elvenloveseateastdeed +0x14F0=Elven Loveseat (South) +ADDITEM=elvenloveseatsouthdeed +0x14F0=Elven Wash Basin (East) +ADDITEM=elvenwashbasineastdeed +0x14F0=Elven Wash Basin (South) +ADDITEM=elvenwashbasinsouthdeed +0x14F0=Fancy Couch (East) +ADDITEM=fancycoucheastdeed +0x14F0=Fancy Couch (North) +ADDITEM=fancycouchnorthdeed +0x14F0=Fancy Couch (South) +ADDITEM=fancycouchsouthdeed +0x14F0=Fancy Couch (West) +ADDITEM=fancycouchwestdeed +0x14F0=Hardwood Table (East) +ADDITEM=hardwoodtableeastdeed +0x14F0=Hardwood Table (South) +ADDITEM=hardwoodtablesouthdeed +0x14F0=Fancy Loveseat (East) +ADDITEM=fancyloveseateastdeed +0x14F0=Fancy Loveseat (North) +ADDITEM=fancyloveseatnorthdeed +0x14F0=Fancy Loveseat (South) +ADDITEM=fancyloveseatsouthdeed +0x14F0=Fancy Loveseat (West) +ADDITEM=fancyloveseatwestdeed +0x14F0=Ornate Table (East) +ADDITEM=ornatetableeastdeed +0x14F0=Ornate Table (South) +ADDITEM=ornatetablesouthdeed +0x14F0=Plush Loveseat (East) +ADDITEM=plushloveseateastdeed +0x14F0=Plush Loveseat (South) +ADDITEM=plushloveseatsouthdeed +0x14F0=Tall Elven Bed (East) +ADDITEM=tallelvenbedeastdeed +0x14F0=Tall Elven Bed (South) +ADDITEM=tallelvenbedsouthdeed +<=Previous Menu +ITEMMENU=4 +} diff --git a/data/dfndata/items/ItemMenu.dfn b/data/dfndata/items/ItemMenu.dfn index 7815ab7f7..4709bd0a3 100644 --- a/data/dfndata/items/ItemMenu.dfn +++ b/data/dfndata/items/ItemMenu.dfn @@ -303,6 +303,8 @@ ITEMMENU=68 ITEMMENU=69 <=Houseaddon Deeds ITEMMENU=71 +<=Houseaddon ML Deeds +ITEMMENU=260 <=Misc Deeds ITEMMENU=70 <=Previous Menu diff --git a/data/dfndata/items/deeds/houseaddon_deeds_ml.dfn b/data/dfndata/items/deeds/houseaddon_deeds_ml.dfn index c366542f4..59ffb2c8e 100644 --- a/data/dfndata/items/deeds/houseaddon_deeds_ml.dfn +++ b/data/dfndata/items/deeds/houseaddon_deeds_ml.dfn @@ -4,6 +4,7 @@ name=Elven Bed (East) id=0x14F0 morex=300 +origin=ml } // Elven Bed (South) Deed @@ -12,6 +13,7 @@ morex=300 name=Elven Bed (South) id=0x14F0 morex=301 +origin=ml } // Alchemist Table (East) Deed @@ -20,6 +22,7 @@ morex=301 name=Alchemist Table (East) id=0x14F0 morex=300 +origin=ml } // Alchemist Table (South) Deed @@ -28,6 +31,7 @@ morex=300 name=Alchemist Table (South) id=0x14F0 morex=301 +origin=ml } // Elven Loveseat (East) Deed @@ -36,6 +40,7 @@ morex=301 name=Elven Loveseat (East) id=0x14F0 morex=304 +origin=ml } // Elven Loveseat (South) Deed @@ -44,6 +49,7 @@ morex=304 name=Elven Loveseat (South) id=0x14F0 morex=305 +origin=ml } // Elven Wash Basin (East) Deed @@ -52,6 +58,7 @@ morex=305 name=Elven Wash Basin (East) id=0x14F0 morex=306 +origin=ml } // Elven Wash Basin (South) Deed @@ -60,6 +67,7 @@ morex=306 name=Elven Wash Basin (South) id=0x14F0 morex=307 +origin=ml } // Fancy Couch (East) Deed @@ -68,6 +76,7 @@ morex=307 name=Fancy Couch (East) id=0x14F0 morex=308 +origin=ml } // Fancy Couch (North) Deed @@ -76,6 +85,7 @@ morex=308 name=Fancy Couch (North) id=0x14F0 morex=309 +origin=ml } // Fancy Couch (South) Deed @@ -84,6 +94,7 @@ morex=309 name=Fancy Couch (South) id=0x14F0 morex=310 +origin=ml } // Fancy Couch (West) Deed @@ -92,6 +103,7 @@ morex=310 name=Fancy Couch (West) id=0x14F0 morex=311 +origin=ml } // Hardwood Table (East) Deed @@ -100,6 +112,7 @@ morex=311 name=Hardwood Table (East) id=0x14F0 morex=312 +origin=ml } // Hardwood Table (South) Deed @@ -108,6 +121,7 @@ morex=312 name=Hardwood Table (South) id=0x14F0 morex=313 +origin=ml } // Fancy Loveseat (East) Deed @@ -116,6 +130,7 @@ morex=313 name=Fancy Loveseat (East) id=0x14F0 morex=314 +origin=ml } // Fancy Loveseat (North) Deed @@ -124,6 +139,7 @@ morex=314 name=Fancy Loveseat (North) id=0x14F0 morex=315 +origin=ml } // Fancy Loveseat (South) Deed @@ -132,6 +148,7 @@ morex=315 name=Fancy Loveseat (South) id=0x14F0 morex=316 +origin=ml } // Fancy Loveseat (West) Deed @@ -140,6 +157,7 @@ morex=316 name=Fancy Loveseat (West) id=0x14F0 morex=317 +origin=ml } // Ornate Table (East) Deed @@ -148,6 +166,7 @@ morex=317 name=Ornate Table (East) id=0x14F0 morex=318 +origin=ml } // Ornate Table (South) Deed @@ -156,6 +175,7 @@ morex=318 name=Ornate Table (South) id=0x14F0 morex=319 +origin=ml } // Plush Loveseat (East) Deed @@ -164,6 +184,7 @@ morex=319 name=Plush Loveseat (East) id=0x14F0 morex=320 +origin=ml } // Plush Loveseat (South) Deed @@ -172,6 +193,7 @@ morex=320 name=Plush Loveseat (South) id=0x14F0 morex=321 +origin=ml } // Tall Elven Bed (East) Deed @@ -180,6 +202,7 @@ morex=321 name=Tall Elven Bed (East) id=0x14F0 morex=322 +origin=ml } // Tall Elven Bed (South) Deed @@ -188,4 +211,5 @@ morex=322 name=Tall Elven Bed (South) id=0x14F0 morex=323 +origin=ml } \ No newline at end of file From 5ef75a2564906f769208aa34a5e0c3770a95af25 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 27 Jan 2025 14:00:15 -0600 Subject: [PATCH 140/147] update added to addmenu added origin tag to the deeds. --- data/dfndata/items/ItemMenu.bulk.dfn | 27 +++++++++++++++++++ data/dfndata/items/ItemMenu.dfn | 2 ++ .../items/deeds/minihouseaddon_deeds.dfn | 10 +++++++ 3 files changed, 39 insertions(+) diff --git a/data/dfndata/items/ItemMenu.bulk.dfn b/data/dfndata/items/ItemMenu.bulk.dfn index 0da06b87d..5dd66821c 100644 --- a/data/dfndata/items/ItemMenu.bulk.dfn +++ b/data/dfndata/items/ItemMenu.bulk.dfn @@ -14253,3 +14253,30 @@ ADDITEM=mapmakerspen <=Previous Menu ITEMMENU=127 } + +[ITEMMENU 261] +{ +minihouseaddon_deeds.dfn +0x14F0=Mini House: Stone and Plaster +ADDITEM=stoneandplastermini +0x14F0=Mini House: Field Stone +ADDITEM=fieldstonemini +0x14F0=Mini House: Small Brick +ADDITEM=smallbrickmini +0x14F0=Mini House: Wooden +ADDITEM=woodenmini +0x14F0=Mini House: Wood and Plaster +ADDITEM=woodandplastermini +0x14F0=Mini House: Thatched-Roof Cottage +ADDITEM=thatchedroofcottage +0x14F0=Mini House: Brick +ADDITEM=brickmini +0x14F0=Mini House: Two-Story Wood and Plaster +ADDITEM=twostorywoodandplastermini +0x14F0=Mini House: Malas Mountain Pass +ADDITEM=malasmountainpassmini +0x14F0=Mini House: Church at Night +ADDITEM=churchatnightmini +<=Previous Menu +ITEMMENU=4 +} diff --git a/data/dfndata/items/ItemMenu.dfn b/data/dfndata/items/ItemMenu.dfn index 7815ab7f7..3c5863682 100644 --- a/data/dfndata/items/ItemMenu.dfn +++ b/data/dfndata/items/ItemMenu.dfn @@ -303,6 +303,8 @@ ITEMMENU=68 ITEMMENU=69 <=Houseaddon Deeds ITEMMENU=71 +<=Mini Houseaddon Deeds +ITEMMENU=261 <=Misc Deeds ITEMMENU=70 <=Previous Menu diff --git a/data/dfndata/items/deeds/minihouseaddon_deeds.dfn b/data/dfndata/items/deeds/minihouseaddon_deeds.dfn index 0e516c52f..e9fa79f11 100644 --- a/data/dfndata/items/deeds/minihouseaddon_deeds.dfn +++ b/data/dfndata/items/deeds/minihouseaddon_deeds.dfn @@ -4,6 +4,7 @@ name=Mini House: Stone and Plaster id=0x14F0 morex=500 +origin=aos } // Deed for Field Stone Mini House @@ -12,6 +13,7 @@ morex=500 name=Mini House: Field Stone id=0x14F0 morex=501 +origin=aos } // Deed for Small Brick Mini House @@ -20,6 +22,7 @@ morex=501 name=Mini House: Small Brick id=0x14F0 morex=502 +origin=aos } // Deed for Wooden Mini House @@ -28,6 +31,7 @@ morex=502 name=Mini House: Wooden id=0x14F0 morex=503 +origin=aos } // Deed for Wood and Plaster Mini House @@ -36,6 +40,7 @@ morex=503 name=Mini House: Wood and Plaster id=0x14F0 morex=504 +origin=aos } // Deed for Thatched-Roof Cottage Mini House @@ -44,6 +49,7 @@ morex=504 name=Mini House: Thatched-Roof Cottage id=0x14F0 morex=505 +origin=aos } // Deed for Brick Mini House @@ -52,6 +58,7 @@ morex=505 name=Mini House: Brick id=0x14F0 morex=506 +origin=aos } // Deed for Two-Story Wood and Plaster Mini House @@ -60,6 +67,7 @@ morex=506 name=Mini House: Two-Story Wood and Plaster id=0x14F0 morex=507 +origin=aos } // Deed for Malas Mountain Pass Mini House @@ -68,6 +76,7 @@ morex=507 name=Mini House: Malas Mountain Pass id=0x14F0 morex=508 +origin=aos } // Deed for Church at Night Mini House @@ -76,4 +85,5 @@ morex=508 name=Mini House: Church at Night id=0x14F0 morex=509 +origin=aos } \ No newline at end of file From 1a2676865495248a8337b73360dfdc6f0694f8a0 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 27 Jan 2025 21:12:23 -0600 Subject: [PATCH 141/147] Update jsdocs.html --- docs/jsdocs.html | 3213 +++++++++++++++++++++++----------------------- 1 file changed, 1575 insertions(+), 1638 deletions(-) diff --git a/docs/jsdocs.html b/docs/jsdocs.html index 7cbee5bb1..17aff972f 100644 --- a/docs/jsdocs.html +++ b/docs/jsdocs.html @@ -8563,366 +8563,356 @@

    January 9th, 2022

  • Character Methods
    -
    +
    -
    - - -
    -
    -

    Prototype

    -

    void AddAggressorFlag( otherChar )

    -
    -
    -

    Purpose

    -

    Adds aggressor flag for character towards target character

    -
    -
    -

    Example of usage

    -
    pUser.AddAggressorFlag( otherChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void AddAggressorFlag( otherChar )

    +
    +
    +

    Purpose

    +

    Adds aggressor flag for character towards target character

    +
    +
    +

    Example of usage

    +
    pUser.AddAggressorFlag( otherChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void AddFriend( pChar )

    -
    -
    -

    Purpose

    -

    Adds a player to an NPC pet/follower's friend list

    -
    -
    -

    Example of usage

    -
    myPet.AddFriend( pChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void AddFriend( pChar )

    +
    +
    +

    Purpose

    +

    Adds a player to an NPC pet/follower's friend list

    +
    +
    +

    Example of usage

    +
    myPet.AddFriend( pChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void AddPermaGreyFlag( otherChar )

    -
    -
    -

    Purpose

    -

    Adds permagrey flag for character towards target character

    -
    -
    -

    Example of usage

    -
    pUser.AddPermaGreyFlag( otherChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void AddPermaGreyFlag( otherChar )

    +
    +
    +

    Purpose

    +

    Adds permagrey flag for character towards target character

    +
    +
    +

    Example of usage

    +
    pUser.AddPermaGreyFlag( otherChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void AddSpell( spellNum )

    -
    -
    -

    Purpose

    -

    Adds specified spell to the first spellbook in character's pack

    -
    -
    -

    Example of usage

    -
    myChar.AddSpell( 3 ); //adds Feeblemind spell to myChar's spellbook (if he has one)
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void AddSpell( spellNum )

    +
    +
    +

    Purpose

    +

    Adds specified spell to the first spellbook in character's pack

    +
    +
    +

    Example of usage

    +
    myChar.AddSpell( 3 ); //adds Feeblemind spell to myChar's spellbook (if he has one)
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void BoltEffect()

    -
    -
    -

    Purpose

    -

    Plays the lightning bolt effect on specified character to all nearby players

    -
    -
    -

    Example of usage

    -
    myChar.BoltEffect();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void BoltEffect()

    +
    +
    +

    Purpose

    +

    Plays the lightning bolt effect on specified character to all nearby players

    +
    +
    +

    Example of usage

    +
    myChar.BoltEffect();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    - - void BreakConcentration()
    - void BreakConcentration( socket ) -
    -

    -
    -
    -

    Purpose

    -

    Break a caster's concentration

    -
    -
    -

    Example of usage

    -
    myNPC.BreakConcentration(); //for NPCs, who have no sockets
    +						
    + + +
    +
    +

    Prototype

    +

    void BreakConcentration()
    + void BreakConcentration( socket )

    +
    +
    +

    Purpose

    +

    Break a caster's concentration

    +
    +
    +

    Example of usage

    +
    myNPC.BreakConcentration(); //for NPCs, who have no sockets
     myPlayer.BreakConcentration( mSocket ); //for players, who DO have sockets
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void BuyFrom( targNPC )

    -
    -
    -

    Purpose

    -

    Brings up targNPC's shopkeeper gump or player vendor backpack for buying

    -
    -
    -

    Example of usage

    -
    myChar.BuyFrom( myNPC );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void BuyFrom( targNPC )

    +
    +
    +

    Purpose

    +

    Brings up targNPC's shopkeeper gump or player vendor backpack for buying

    +
    +
    +

    Example of usage

    +
    myChar.BuyFrom( myNPC );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int CalculateControlChance( pChar );

    -
    -
    -

    Purpose

    -

    Returns chance (in values ranging from 0 to 1000) of pChar (player) successfully controlling a pet

    -
    -
    -

    Example of usage

    -
    var controlChance = myPet.CalculateControlChance( pChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    int CalculateControlChance( pChar );

    +
    +
    +

    Purpose

    +

    Returns chance (in values ranging from 0 to 1000) of pChar (player) successfully controlling a pet

    +
    +
    +

    Example of usage

    +
    var controlChance = myPet.CalculateControlChance( pChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    - - bool CanSee( object );
    - bool CanSee( x, y, z ); -
    -

    -
    -
    -

    Purpose

    -

    LineOfSight-checking; check if character/socket can see a specified object/target location

    -
    -
    -

    Example of usage

    -
    if( !myChar.CanSee( targetChar ))
    +						
    + + +
    +
    +

    Prototype

    +

    bool CanSee( object );
    + bool CanSee( x, y, z );

    +
    +
    +

    Purpose

    +

    LineOfSight-checking; check if character/socket can see a specified object/target location

    +
    +
    +

    Example of usage

    +
    if( !myChar.CanSee( targetChar ))
     return;
     
     if( myChar.CanSee( targetChar.x, targetChar.y, targetChar.z )
     {
     	// ...Do stuff here
     }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void CastSpell( spellNum [, directCast])

    -
    -
    -

    Purpose

    -

    Causes character to cast spellNum. Character can be an NPC or PC, and spellNum can be any valid spell number from 0 to 65. The optional boolean parameter directCast can be used to make the character automatically cast the spell at their current target (if spell is targeted)

    -
    -
    -

    Example of usage

    -
    // Player casts recall spell
    +						
    + + +
    +
    +

    Prototype

    +

    void CastSpell( spellNum [, directCast])

    +
    +
    +

    Purpose

    +

    Causes character to cast spellNum. Character can be an NPC or PC, and spellNum can be any valid spell number from 0 to 65. The optional boolean parameter directCast can be used to make the character automatically cast the spell at their current target (if spell is targeted)

    +
    +
    +

    Example of usage

    +
    // Player casts recall spell
     pUser.CastSpell( 32 );
     
     // NPC casts lightning bolt at their current target
     myNPC.CastSpell( 30, true );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void CheckAggressorFlag( otherChar )

    -
    -
    -

    Purpose

    -

    Check if character has an aggressor flag towards target character

    -
    -
    -

    Example of usage

    -
    if( pUser.CheckAggressorFlag( otherChar ))
    +						
    + + +
    +
    +

    Prototype

    +

    void CheckAggressorFlag( otherChar )

    +
    +
    +

    Purpose

    +

    Check if character has an aggressor flag towards target character

    +
    +
    +

    Example of usage

    +
    if( pUser.CheckAggressorFlag( otherChar ))
     {
     	// ... do something
     }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void CheckPermaGreyFlag( otherChar )

    -
    -
    -

    Purpose

    -

    Check if character has an active permagrey flag towards target character

    -
    -
    -

    Example of usage

    -
    if( pUser.CheckPermaGreyFlag( otherChar ))
    +						
    + + +
    +
    +

    Prototype

    +

    void CheckPermaGreyFlag( otherChar )

    +
    +
    +

    Purpose

    +

    Check if character has an active permagrey flag towards target character

    +
    +
    +

    Example of usage

    +
    if( pUser.CheckPermaGreyFlag( otherChar ))
     {
     	// ... do something
     }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool CheckSkill( skillNum, minSkill, maxSkill )

    -

    bool CheckSkill( skillNum, minSkill, maxSkill, isCraftSkill )

    -
    -
    -

    Purpose

    -

    Returns true if the result of a skillcheck for skill skillNum is between minSkill and maxSkill

    -
    -
    -

    Notes

    -

    If the optional parameter isCraftSkill is set to true, UOX3 uses an alternate skill check formula that provides a minimum 50% chance of success if player at least meets minimum requirements for crafting an item

    -
    -
    -

    Example of usage

    -
    // If result of skill check for myChar's skill #1 (alchemy) is between 20.0 and 100.0
    +						
    + + +
    +
    +

    Prototype

    +

    bool CheckSkill( skillNum, minSkill, maxSkill )

    +

    bool CheckSkill( skillNum, minSkill, maxSkill, isCraftSkill )

    +
    +
    +

    Purpose

    +

    Returns true if the result of a skillcheck for skill skillNum is between minSkill and maxSkill

    +
    +
    +

    Notes

    +

    If the optional parameter isCraftSkill is set to true, UOX3 uses an alternate skill check formula that provides a minimum 50% chance of success if player at least meets minimum requirements for crafting an item

    +
    +
    +

    Example of usage

    +
    // If result of skill check for myChar's skill #1 (alchemy) is between 20.0 and 100.0
     if( myChar.CheckSkill( 1, 200, 1000 ))
     {
     	...
     }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void ClearAggressorFlags()

    -
    -
    -

    Purpose

    -

    Clears all the character's aggressor flags towards other characters

    -
    -
    -

    Example of usage

    -
    pUser.ClearAggressorFlags();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void ClearAggressorFlags()

    +
    +
    +

    Purpose

    +

    Clears all the character's aggressor flags towards other characters

    +
    +
    +

    Example of usage

    +
    pUser.ClearAggressorFlags();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void ClearPermaGreyFlags()

    -
    -
    -

    Purpose

    -

    Clears all the character's aggressor flags towards other characters

    -
    -
    -

    Example of usage

    -
    pUser.ClearPermaGreyFlags();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void ClearPermaGreyFlags()

    +
    +
    +

    Purpose

    +

    Clears all the character's aggressor flags towards other characters

    +
    +
    +

    Example of usage

    +
    pUser.ClearPermaGreyFlags();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void ClearFriendList();

    -
    -
    -

    Purpose

    -

    Clears an NPC pet/follower's friend list

    -
    -
    -

    Example of usage

    -
    myPet.ClearFriendList();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void ClearFriendList();

    +
    +
    +

    Purpose

    +

    Clears an NPC pet/follower's friend list

    +
    +
    +

    Example of usage

    +
    myPet.ClearFriendList();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void CustomTarget( targetNum, toSay )

    -
    -
    -

    Purpose

    -

    - Very similar to PopUpTarget. It's a callback situation instead. targetNum must be between 0 and 255. Character says toSay, and is shown a cursor. Re-enters the script associated with the socket's player (i.e. player who gets the cursor). Enters function name based on the value of tNum. if tNum is 0, then the function would be onCallback0. Prototype of callback is:
    - function onCallback0( pSock, myTarget ) -

    -
    -
    -

    Example of usage

    -
    // User double-clicks an item, which brings up a custom target cursor
    +						
    + + +
    +
    +

    Prototype

    +

    void CustomTarget( targetNum, toSay )

    +
    +
    +

    Purpose

    +

    Very similar to PopUpTarget. It's a callback situation instead. targetNum must be between 0 and 255. Character says toSay, and is shown a cursor. Re-enters the script associated with the socket's player (i.e. player who gets the cursor). Enters function name based on the value of tNum. if tNum is 0, then the function would be onCallback0. Prototype of callback is:
    + function onCallback0( pSock, myTarget )

    +
    +
    +

    Example of usage

    +
    // User double-clicks an item, which brings up a custom target cursor
     function onUseChecked( pUser, iUsed )
     {
     	pUser.CustomTarget( 0, "Select your custom target:" );
    @@ -8933,390 +8923,370 @@ 

    January 9th, 2022

    { // ... do something with target here }
    -
    -
    -
    - -
    - - -
    -
    -

    Prototype

    -

    - - void Damage( amount )
    - void Damage( amount, damageType )
    - void Damage( amount, damageType, attacker )
    - void Damage( amount, damageType, attacker, doRepSys ) -
    -

    -
    -
    -

    Purpose

    -

    Cause damage to a character.

    -
    -
    -

    Notes

    -

    damageType represents the type of damage done (1 = Physical, 2 = Light, 3 = Rain, 4 = Cold, 5 = Heat, 6 = Lightning/Energy, 7 = Poison, 8 = Snow). doRepSys true/false defines whether a criminal check should be done for attacker

    -
    -
    -

    Example of usage

    -
    // Deal 15 damage to myChar (defaults to Physical damage)
    -myChar.Damage( 15 );
    -
    -// Deal 15 Heat/Fire damage to myChar, with attackerChar as source
    -myChar.Damage( 15, 5, attackerChar );
    -
    -// Deal 15 Lightning damage to myChar, with attackerChar as source, and flag set to do rep check for criminal flag
    -myChar.Damage( 15, 6, attackerChar, true );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int Defense( hitLoc, damageType, doArmorDamage )

    -
    -
    -

    Purpose

    -

    Returns the defense value against damageType of the armor item at the location hitLoc and does armor damage if needed

    -
    -
    -

    Notes

    -

    - hit locations:0 = whole char, 1 = body, 2 = arms, 3 = head, 4 = legs, 5 = neck, 6 = the rest
    - damage types: 0 = None, 1 = Physical, 2 = Light, 3 = Rain, 4 = Cold, 5 = Heat, 6 = Lightning, 7 = Poison, 8 = Snow, 9 = Storm -

    -
    -
    -

    Example of usage

    -
    // Get the defense value of the head armor against Physical damage and damage the armor:
    -value = mChar.Defense( 3, 1, true);
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void Damage( amount )
    + void Damage( amount, damageType )
    + void Damage( amount, damageType, attacker )
    + void Damage( amount, damageType, attacker, doRepSys )

    +
    +
    +

    Purpose

    +

    Cause damage to a character.

    +
    +
    +

    Notes

    +

    damageType represents the type of damage done (1 = Physical, 2 = Light, 3 = Rain, 4 = Cold, 5 = Heat, 6 = Lightning/Energy, 7 = Poison, 8 = Snow). doRepSys true/false defines whether a criminal check should be done for attacker

    +
    +
    +

    Example of usage

    +
    // Deal 15 damage to myChar (defaults to Physical damage)
    +myChar.Damage( 15 );
    +
    +// Deal 15 Heat/Fire damage to myChar, with attackerChar as source
    +myChar.Damage( 15, 5, attackerChar );
    +
    +// Deal 15 Lightning damage to myChar, with attackerChar as source, and flag set to do rep check for criminal flag
    +myChar.Damage( 15, 6, attackerChar, true );
    +
    +
    +
    + +
    + + +
    +
    +

    Prototype

    +

    int Defense( hitLoc, damageType, doArmorDamage )

    +
    +
    +

    Purpose

    +

    Returns the defense value against damageType of the armor item at the location hitLoc and does armor damage if needed

    +
    +
    +

    Notes

    +

    hit locations:0 = whole char, 1 = body, 2 = arms, 3 = head, 4 = legs, 5 = neck, 6 = the rest
    + damage types: 0 = None, 1 = Physical, 2 = Light, 3 = Rain, 4 = Cold, 5 = Heat, 6 = Lightning, 7 = Poison, 8 = Snow, 9 = Storm

    +
    +
    +

    Example of usage

    +
    // Get the defense value of the head armor against Physical damage and damage the armor:
    +value = mChar.Defense( 3, 1, true);
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    - - int DirectionTo( trgObj )
    - int DirectionTo( x, y ); -
    -

    -
    -
    -

    Purpose

    -

    Returns the direction (0 = North, 1 = North-East, 2 = East, 3 = South-East, 4 = South, 5 = South-West, 6 = West, 7 = North-West) from character to trgObj/location

    -
    -
    -

    Example of usage

    -
    var dir = myChar.DirectionTo( trgChar );
    +						
    + + +
    +
    +

    Prototype

    +

    int DirectionTo( trgObj )
    + int DirectionTo( x, y );

    +
    +
    +

    Purpose

    +

    Returns the direction (0 = North, 1 = North-East, 2 = East, 3 = South-East, 4 = South, 5 = South-West, 6 = West, 7 = North-West) from character to trgObj/location

    +
    +
    +

    Example of usage

    +
    var dir = myChar.DirectionTo( trgChar );
     var dir = myChar.DirectionTo( trgChar.x, trgChar.y );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Dismount()

    -
    -
    -

    Purpose

    -

    Dismounts character

    -
    -
    -

    Example of usage

    -
    myChar.Dismount()
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void Dismount()

    +
    +
    +

    Purpose

    +

    Dismounts character

    +
    +
    +

    Example of usage

    +
    myChar.Dismount()
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void DoAction( trgAction subAction )

    -
    -
    -

    Purpose

    -

    Makes character play the action trgAction. If subAction is specified, will play action using the "new" animation packet 0xE2, which supports subActions. This is also required for any gargoyle-specific animations.

    -
    -
    -

    Notes

    -

    - Pre-v7.0.0.0:
    - Human/Elf actions range from 0x01 to 0x22.
    - Animals have animations in 0x00 to 0x0c range.
    - Monsters have animations in 0x00 to 0x15 range, though not all monsters support all these animations. -

    -

    - v7.0.0.0+:
    - All character actions range from 0x00 to 0x0f, with some animations registered as sub-actions -

    -
    -
    -

    Example of usage

    -
    myChar.DoAction( 0x0B );
    +						
    + + +
    +
    +

    Prototype

    +

    void DoAction( trgAction subAction )

    +
    +
    +

    Purpose

    +

    Makes character play the action trgAction. If subAction is specified, will play action using the "new" animation packet 0xE2, which supports subActions. This is also required for any gargoyle-specific animations.

    +
    +
    +

    Notes

    +

    Pre-v7.0.0.0:
    + Human/Elf actions range from 0x01 to 0x22.
    + Animals have animations in 0x00 to 0x0c range.
    + Monsters have animations in 0x00 to 0x15 range, though not all monsters support all these animations.

    +

    v7.0.0.0+:
    + All character actions range from 0x00 to 0x0f, with some animations registered as sub-actions

    +
    +
    +

    Example of usage

    +
    myChar.DoAction( 0x0B );
     // or a gargoyle action & subAction
     myChar.DoAction( 0x00, 0x03 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    CHARACTER Dupe();

    -
    -
    -

    Purpose

    -

    Dupes specified character

    -
    -
    -

    Notes

    -

    Location of duped character must be manually set

    -
    -
    -

    Example of usage

    -
    // Create a duplicate of myChar
    +						
    + + +
    +
    +

    Prototype

    +

    CHARACTER Dupe();

    +
    +
    +

    Purpose

    +

    Dupes specified character

    +
    +
    +

    Notes

    +

    Location of duped character must be manually set

    +
    +
    +

    Example of usage

    +
    // Create a duplicate of myChar
     var dupedChar = myChar.Dupe();
     
     // Teleport the duped character to the same location as myChar
     dupedChar.Teleport( myChar );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void EmoteMessage( message )

    -
    -
    -

    Purpose

    -

    Causes the Char to emote message. You have to put the start and end * manually in!

    -
    -
    -

    Example of usage

    -
    myChar.EmoteMessage( "*looks around*" );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void EmoteMessage( message )

    +
    +
    +

    Purpose

    +

    Causes the Char to emote message. You have to put the start and end * manually in!

    +
    +
    +

    Example of usage

    +
    myChar.EmoteMessage( "*looks around*" );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void ExecuteCommand( cmdString )

    -
    -
    -

    Purpose

    -

    Executes the command cmdString (should include any params)

    -
    -
    -

    Example of usage

    -
    myChar.ExecuteCommand( "add 0x04a9" );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void ExecuteCommand( cmdString )

    +
    +
    +

    Purpose

    +

    Executes the command cmdString (should include any params)

    +
    +
    +

    Example of usage

    +
    myChar.ExecuteCommand( "add 0x04a9" );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void ExplodeItem( myItem, damage, damageType, explodeNearby )

    -
    -
    -

    Purpose

    -

    Deletes specified item by exploding it, dealing damage to the character and potentially nearby characters

    -
    -
    -

    Example of usage

    -
    // Explode item and deal damage only to myChar
    +						
    + + +
    +
    +

    Prototype

    +

    void ExplodeItem( myItem, damage, damageType, explodeNearby )

    +
    +
    +

    Purpose

    +

    Deletes specified item by exploding it, dealing damage to the character and potentially nearby characters

    +
    +
    +

    Example of usage

    +
    // Explode item and deal damage only to myChar
     myChar.ExplodeItem( myItem, 25, 5, false );
     
     // Explode item and deal damage to all characters within a radius of 2 tiles (hardcoded range)
     myChar.ExplodeItem( myItem, 25, 5, true );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    Item FindItemLayer( layer )

    -
    -
    -

    Purpose

    -

    A return value of -1 indicates there was no item at that particular layer. A common list of layers follow:

    -

    - 0x01 - Single-Hand item/weapon
    - 0x02 - Two-Hand item/weapon (including Shield)
    - 0x03 - Foot Covering/Armor
    - 0x04 - Leg Covering (including Pants, Shorts, Bone/Chain/Ring legs)
    - 0x05 - Chest Clothing/Female Chest Armor
    - 0x06 - Head Covering/Armor
    - 0x07 - Hand Covering/Armor
    - 0x08 - Ring
    - 0x09 - N/A (not used)
    - 0x0A - Neck Covering/Armor
    - 0x0B - Hair
    - 0x0C - Waist (Half-Apron)
    - 0x0D - Torso (inner)(Chest Armor)
    - 0x0E - Bracelet
    - 0x0F - N/A (no info)
    - 0x10 - Facial Hair
    - 0x11 - Torso (Middle)(Surcoat, Tunic, Full Apron, Sash)
    - 0x12 - Earrings
    - 0x13 - Arm Covering/Armor
    - 0x14 - Back (Cloak)
    - 0x15 - BackPack
    - 0x16 - Torso (outer)(Robe)
    - 0x17 - Legs (outer)(Skirt/Kilt)
    - 0x18 - Legs (inner)(Leg Armor)
    - 0x19 - Mount (Horse, Ostard, etc.)
    - 0x1A - NPC Buy Restock Container
    - 0x1B - NPC Buy No Restock Container
    - 0x1C - NPC Sell Container
    - 0x1D - Bank Box -

    -
    -
    -

    Example of usage

    -
    var leftHand = myChar.FindItemLayer( 1 );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    Item FindItemLayer( layer )

    +
    +
    +

    Purpose

    +

    A return value of -1 indicates there was no item at that particular layer. A common list of layers follow:

    +

    0x01 - Single-Hand item/weapon
    + 0x02 - Two-Hand item/weapon (including Shield)
    + 0x03 - Foot Covering/Armor
    + 0x04 - Leg Covering (including Pants, Shorts, Bone/Chain/Ring legs)
    + 0x05 - Chest Clothing/Female Chest Armor
    + 0x06 - Head Covering/Armor
    + 0x07 - Hand Covering/Armor
    + 0x08 - Ring
    + 0x09 - N/A (not used)
    + 0x0A - Neck Covering/Armor
    + 0x0B - Hair
    + 0x0C - Waist (Half-Apron)
    + 0x0D - Torso (inner)(Chest Armor)
    + 0x0E - Bracelet
    + 0x0F - N/A (no info)
    + 0x10 - Facial Hair
    + 0x11 - Torso (Middle)(Surcoat, Tunic, Full Apron, Sash)
    + 0x12 - Earrings
    + 0x13 - Arm Covering/Armor
    + 0x14 - Back (Cloak)
    + 0x15 - BackPack
    + 0x16 - Torso (outer)(Robe)
    + 0x17 - Legs (outer)(Skirt/Kilt)
    + 0x18 - Legs (inner)(Leg Armor)
    + 0x19 - Mount (Horse, Ostard, etc.)
    + 0x1A - NPC Buy Restock Container
    + 0x1B - NPC Buy No Restock Container
    + 0x1C - NPC Sell Container
    + 0x1D - Bank Box

    +
    +
    +

    Example of usage

    +
    var leftHand = myChar.FindItemLayer( 1 );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    Item FindItemSection( sectionID )

    -
    -
    -

    Purpose

    -

    Looks for item with specific sectionID in character's backpack

    -
    -
    -

    Example of usage

    -
    var runebook = myPlayer.FindItemSection( "runebook" ); // does the player have a runebook?
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    Item FindItemSection( sectionID )

    +
    +
    +

    Purpose

    +

    Looks for item with specific sectionID in character's backpack

    +
    +
    +

    Example of usage

    +
    var runebook = myPlayer.FindItemSection( "runebook" ); // does the player have a runebook?
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    Item FindItemType( itemType )

    -
    -
    -

    Purpose

    -

    Look for items of a certain type in character's pack

    -
    -
    -

    Example of usage

    -
    var spellBook = myPlayer.FindItemType( 9 ); //does the player have a spellbook?
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    Item FindItemType( itemType )

    +
    +
    +

    Purpose

    +

    Look for items of a certain type in character's pack

    +
    +
    +

    Example of usage

    +
    var spellBook = myPlayer.FindItemType( 9 ); //does the player have a spellbook?
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Follow( followTarget )

    -
    -
    -

    Purpose

    -

    Forces NPC to follow specified target

    -
    -
    -

    Example of usage

    -
    myNPC.Follow( followTarget );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void Follow( followTarget )

    +
    +
    +

    Purpose

    +

    Forces NPC to follow specified target

    +
    +
    +

    Example of usage

    +
    myNPC.Follow( followTarget );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    - - void Gate( item )
    - void Gate( x, y, z, world ) -
    -

    -
    -
    -

    Purpose

    -

    Opens a gate to the location marked on an item, or to a specific set of coordinates

    -
    -
    -

    Example of usage

    -
    // Opens a gate to coordinates from a recall rune (targItem)
    +						
    + + +
    +
    +

    Prototype

    +

    void Gate( item )
    + void Gate( x, y, z, world )

    +
    +
    +

    Purpose

    +

    Opens a gate to the location marked on an item, or to a specific set of coordinates

    +
    +
    +

    Example of usage

    +
    // Opens a gate to coordinates from a recall rune (targItem)
     myChar.Gate( targItem );
     
     // Opens a gate to Lord British's throne room
     myChar.Gate( 1329, 1624, 50 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    FRIENDLIST GetFriendList();

    -
    -
    -

    Purpose

    -

    Gets an NPC pet/follower's friend list

    -
    -
    -

    Example of usage

    -
    // Get pet's friend list
    +						
    + + +
    +
    +

    Prototype

    +

    FRIENDLIST GetFriendList();

    +
    +
    +

    Purpose

    +

    Gets an NPC pet/follower's friend list

    +
    +
    +

    Example of usage

    +
    // Get pet's friend list
     var friendList = myPet.GetFriendList();
     for( var i = 0; i < friendList.length; i++ )
     {
    @@ -9325,25 +9295,25 @@ 

    January 9th, 2022

    myPet.TextMessage( friendList[i].name + " is my friend!" ); } }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    PETLIST GetPetList();

    -
    -
    -

    Purpose

    -

    Gets list of character's pets/followers

    -
    -
    -

    Example of usage

    -
    // Get myChar's pet/follower list
    +						
    + + +
    +
    +

    Prototype

    +

    PETLIST GetPetList();

    +
    +
    +

    Purpose

    +

    Gets list of character's pets/followers

    +
    +
    +

    Example of usage

    +
    // Get myChar's pet/follower list
     var petList = myChar.GetPetList();
     for( var i = 0; i < petList.length; i++ )
     {
    @@ -9352,28 +9322,27 @@ 

    January 9th, 2022

    myChar.TextMessage( petList[i].name + " is my pet and/or follower!" ); } }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int GetTimer( timerID )

    -

    int SetTimer( timerID, numMilliSeconds )

    -
    -
    -

    Purpose

    -

    Get a timestamp for when timer will run out, or set the time in milliseconds until specified timer expires for a Character object

    -
    -
    -

    Notes

    -

    - Supported timerIDs for Characters -

    Timer.TIMEOUT 		// Time until next attack can be done in combat
    +						
    + + +
    +
    +

    Prototype

    +

    int GetTimer( timerID )

    +

    int SetTimer( timerID, numMilliSeconds )

    +
    +
    +

    Purpose

    +

    Get a timestamp for when timer will run out, or set the time in milliseconds until specified timer expires for a Character object

    +
    +
    +

    Notes

    +

    Supported timerIDs for Characters +

    Timer.TIMEOUT 		// Time until next attack can be done in combat
     Timer.INVIS			// Time until invisible character becomes visible
     Timer.HUNGER		// Time until character grows more hungry
     Timer.THIRST		// Time until character grows more thirsty
    @@ -9398,551 +9367,539 @@ 

    January 9th, 2022

    Timer.IDLEANIMTIME // Time until next time character plays idle animation Timer.LOGOUT // Time it takes for a player char to vanish after logout Timer.YOUNGHEAL // Time until next time Young player can be healed by NPC healer -Timer.YOUNGMESSAGE // Time until next time Young player is warned about dangerous looking monsters in overworld
    -

    -

    See also: GetTimer()/SetTimer() Socket Methods.

    -
    -
    -

    Example of usage

    -
    // Get a timestamp for when criminal flag expires, and spit out milliseconds left
    +Timer.YOUNGMESSAGE 	// Time until next time Young player is warned about dangerous looking monsters in overworld

    +

    See also: GetTimer()/SetTimer() Socket Methods.

    +
    +
    +

    Example of usage

    +
    // Get a timestamp for when criminal flag expires, and spit out milliseconds left
     var criminalTimestamp = myChar.GetTimer( Timer.CRIMFLAG );
     myChar.TextMessage(( myTarget.GetTimer( Timer.CRIMFLAG ) - GetCurrentClock() ).toString() );
     
     // Set time from now in milliseconds that criminal flag will last, after making character a criminal
     myChar.criminal = true;
     myChar.SetTimer( timer.CRIMFLAG, 3000 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool HasBeenOwner( pChar );

    -
    -
    -

    Purpose

    -

    Returns whether character pChar has previously owned the pet (is on pet's owner list)

    -
    -
    -

    Example of usage

    -
    // Get myChar's pet/follower list
    +						
    + + +
    +
    +

    Prototype

    +

    bool HasBeenOwner( pChar );

    +
    +
    +

    Purpose

    +

    Returns whether character pChar has previously owned the pet (is on pet's owner list)

    +
    +
    +

    Example of usage

    +
    // Get myChar's pet/follower list
     if( myPet.HasBeenOwner( pChar ))
     {
     	myPet.TextMessage( "Hey, you owned me earlier, I'll let you tame me easier this time around!" );
     }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    - - void Heal( amount ); - void Heal( amount, pHealer ); - -

    -
    -
    -

    Purpose

    -

    Heals a character for specified amount, with optional argument to provide character who healed

    -
    -
    -

    Example of usage

    -
    myChar.Heal( 15 );
    +						
    + + +
    +
    +

    Prototype

    +

    void Heal( amount ); + void Heal( amount, pHealer );

    +
    +
    +

    Purpose

    +

    Heals a character for specified amount, with optional argument to provide character who healed

    +
    +
    +

    Example of usage

    +
    myChar.Heal( 15 );
     myChar.Heal( 15, healerChar );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool InitiateCombat( targetChar );

    -
    -
    -

    Purpose

    -

    Attempts to initiate combat with target character

    -
    -
    -

    Example of usage

    -
    if( myNPC.InitiateCombat( otherChar ))
    +						
    + + +
    +
    +

    Prototype

    +

    bool InitiateCombat( targetChar );

    +
    +
    +

    Purpose

    +

    Attempts to initiate combat with target character

    +
    +
    +

    Example of usage

    +
    if( myNPC.InitiateCombat( otherChar ))
     {
     	myNPC.TextMessage( "Yes! I managed to initiate combat with " + otherChar.name + "!" );
     }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void InvalidateAttacker();

    -
    -
    -

    Purpose

    -

    Resets the attacker attack so that it cancels attack setup.

    -
    -
    -

    Example of usage

    -
    myNPC.InvalidateAttacker();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void InvalidateAttacker();

    +
    +
    +

    Purpose

    +

    Resets the attacker attack so that it cancels attack setup.

    +
    +
    +

    Example of usage

    +
    myNPC.InvalidateAttacker();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void InitWanderArea()

    -
    -
    -

    Purpose

    -

    Initialize a WanderArea (10x10 box, or 10 radius circle) for the specified NPC. Will only work if their wander-mode is already set to box or circle.

    -
    -
    -

    Example of usage

    -
    myNPC.InitWanderArea();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void InitWanderArea()

    +
    +
    +

    Purpose

    +

    Initialize a WanderArea (10x10 box, or 10 radius circle) for the specified NPC. Will only work if their wander-mode is already set to box or circle.

    +
    +
    +

    Example of usage

    +
    myNPC.InitWanderArea();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void IsAggressor()

    -

    void IsAggressor( [bool]checkForPlayerOnly)

    -
    -
    -

    Purpose

    -

    Returns true/false depending on whether character has any active aggressor flags

    -
    -
    -

    Notes

    -

    If checkForPlayerOnly flag is true, any aggressor flags towards NPCs are ignored

    -
    -
    -

    Example of usage

    -
    var isAggressor = pUser.IsAggressor();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void IsAggressor()

    +

    void IsAggressor( [bool]checkForPlayerOnly)

    +
    +
    +

    Purpose

    +

    Returns true/false depending on whether character has any active aggressor flags

    +
    +
    +

    Notes

    +

    If checkForPlayerOnly flag is true, any aggressor flags towards NPCs are ignored

    +
    +
    +

    Example of usage

    +
    var isAggressor = pUser.IsAggressor();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void IsPermaGrey( otherChar )

    -

    void IsPermaGrey( [bool]checkForPlayerOnly)

    -
    -
    -

    Purpose

    -

    Returns true/false depending on whether character has any active permagrey flags

    -
    -
    -

    Notes

    -

    If checkForPlayerOnly flag is true, any permagrey flags towards NPCs are ignored

    -
    -
    -

    Example of usage

    -
    var isPermaGrey = pUser.IsPermaGrey();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void IsPermaGrey( otherChar )

    +

    void IsPermaGrey( [bool]checkForPlayerOnly)

    +
    +
    +

    Purpose

    +

    Returns true/false depending on whether character has any active permagrey flags

    +
    +
    +

    Notes

    +

    If checkForPlayerOnly flag is true, any permagrey flags towards NPCs are ignored

    +
    +
    +

    Example of usage

    +
    var isPermaGrey = pUser.IsPermaGrey();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    - - void Jail()
    - void Jail( numSecsToJail ) -
    -

    -
    -
    -

    Purpose

    -

    Jails character for n seconds if specified. If no duration is specified, defaults to 24 hours.

    -
    -
    -

    Example of usage

    -
    myChar.Jail( 1000 );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void Jail()
    + void Jail( numSecsToJail )

    +
    +
    +

    Purpose

    +

    Jails character for n seconds if specified. If no duration is specified, defaults to 24 hours.

    +
    +
    +

    Example of usage

    +
    myChar.Jail( 1000 );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Kill()

    -
    -
    -

    Purpose

    -

    Kills the character. If onDeathBlow JS event is present for character's script, it triggers

    -
    -
    -

    Example of usage

    -
    myChar.Kill();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void Kill()

    +
    +
    +

    Purpose

    +

    Kills the character. If onDeathBlow JS event is present for character's script, it triggers

    +
    +
    +

    Example of usage

    +
    myChar.Kill();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void MagicEffect( spellID )

    -
    -
    -

    Purpose

    -

    Applies spell effects of specified spell to character

    -
    -
    -

    Example of usage

    -
    myChar.MagicEffect( 43 );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void MagicEffect( spellID )

    +
    +
    +

    Purpose

    +

    Applies spell effects of specified spell to character

    +
    +
    +

    Example of usage

    +
    myChar.MagicEffect( 43 );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void MakeMenu( menu )

    -
    -
    -

    Purpose

    -

    Opens up make menu menu and sends it to character's socket

    -
    -
    -

    Example of usage

    -
    // Can be used with a character
    +						
    + + +
    +
    +

    Prototype

    +

    void MakeMenu( menu )

    +
    +
    +

    Purpose

    +

    Opens up make menu menu and sends it to character's socket

    +
    +
    +

    Example of usage

    +
    // Can be used with a character
     myChar.MakeMenu( 1 );
     
     // Or with a socket
     mySocket.MakeMenu( 1 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Mark( item )

    -
    -
    -

    Purpose

    -

    Marks an item with the characters current location to be used later for recall or gate

    -
    -
    -

    Example of usage

    -
    myChar.Mark( targItem );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void Mark( item )

    +
    +
    +

    Purpose

    +

    Marks an item with the characters current location to be used later for recall or gate

    +
    +
    +

    Example of usage

    +
    myChar.Mark( targItem );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void OpenBank( trgSock )

    -
    -
    -

    Purpose

    -

    Opens character's bank, sending it to trgSock

    -
    -
    -

    Example of usage

    -
    myPlayer.OpenBank( trgSock );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void OpenBank( trgSock )

    +
    +
    +

    Purpose

    +

    Opens character's bank, sending it to trgSock

    +
    +
    +

    Example of usage

    +
    myPlayer.OpenBank( trgSock );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void OpenLayer( socket, layerToOpen )

    -
    -
    -

    Purpose

    -

    Opens the specified layer of the character for the specified socket

    -
    -
    -

    Example of usage

    -
    myChar.OpenLayer( socket, 0x15 );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void OpenLayer( socket, layerToOpen )

    +
    +
    +

    Purpose

    +

    Opens the specified layer of the character for the specified socket

    +
    +
    +

    Example of usage

    +
    myChar.OpenLayer( socket, 0x15 );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void PopUpTarget( tNum, toSay )

    -
    -
    -

    Purpose

    -

    Provides a call to hard-coded targeting cursors.

    -
    -
    -

    Notes

    -

    tNum must be between 0 and 255 inclusive. Says toSay, and shows a cursor. Note that some of these might depend on factors in code to actually work, and might not have much effect when ran through a script - or could grant access to functionality that a player would normally not have access to.

    -
    -
    -

    Example of usage

    +
    + + +
    +
    +

    Prototype

    +

    void PopUpTarget( tNum, toSay )

    +
    +
    +

    Purpose

    +

    Provides a call to hard-coded targeting cursors.

    +
    +
    +

    Notes

    +

    tNum must be between 0 and 255 inclusive. Says toSay, and shows a cursor. Note that some of these might depend on factors in code to actually work, and might not have much effect when ran through a script - or could grant access to functionality that a player would normally not have access to.

    +
    +
    +

    Example of usage

    // Can be used with a character object
     myChar.PopUpTarget( 1, "Where do you wish to teleport to?" );
    -
    - - -
    -

    - 1 - TELEPORT (teleports character to target location)
    - 2 - DYE (will reset targeted item to default colour)
    - 4 - REPAIRMETAL (Targeted metal item will be repaired. Checks Blacksmithing skill)
    - 5 - DYEALL (used to give color to dyetubs)
    - 6 - DVAT (Used for dying objects with the colour of the used dye tub)
    - 9 - ITEMID (Select item to identify. Checks Item Identification skill)
    - 10 - FISH (Select fishing location. Checks Fishing skill)
    - 11 - INFO (Get info on targeted tile)
    - 13 - SMITH (Blacksmithing skill usage via tools)
    - 14 - MINE (Mining skill usage via tools)
    - 15 - SMELTORE (Ore smelting targeting cursor)
    - 16 - WSTATS (Show wander/movement details for targeted NPC)
    - 17 - NPCRESURRECT (Used by NPC healers to resurrect dead players. In this context only works if target is identical to popuptarget user. Self-resurrection item?)
    - (To be continued) -

    -
    -
    -
    +
    + + +
    +

    1 - TELEPORT (teleports character to target location)
    + 2 - DYE (will reset targeted item to default colour)
    + 4 - REPAIRMETAL (Targeted metal item will be repaired. Checks Blacksmithing skill)
    + 5 - DYEALL (used to give color to dyetubs)
    + 6 - DVAT (Used for dying objects with the colour of the used dye tub)
    + 9 - ITEMID (Select item to identify. Checks Item Identification skill)
    + 10 - FISH (Select fishing location. Checks Fishing skill)
    + 11 - INFO (Get info on targeted tile)
    + 13 - SMITH (Blacksmithing skill usage via tools)
    + 14 - MINE (Mining skill usage via tools)
    + 15 - SMELTORE (Ore smelting targeting cursor)
    + 16 - WSTATS (Show wander/movement details for targeted NPC)
    + 17 - NPCRESURRECT (Used by NPC healers to resurrect dead players. In this context only works if target is identical to popuptarget user. Self-resurrection item?)
    + (To be continued) +

    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void ReactOnDamage( damageType, attackerChar );

    -
    -
    -

    Purpose

    -

    Lets a character react to damage by an attacker

    -
    -
    -

    Notes

    -

    - In practical terms, this is what happens when a character reacts to damage: -

      -
    • attackerChar's attackFirst property is set to true
    • -
    • Character's attacker property is set to attackerChar
    • -
    • Character's attackFirst property is set to false
    • -
    • If character is an NPC, and was hidden upon taking damage, they're exposed to view
    • -
    • If character is an NPC, and was not already in combat mode, they enter combat mode with attackerChar as target
    • -
    • If character is a Player, their concentration is broken (i.e. any active Meditation effect is cancelled)
    • -
    -

    -
    -
    -

    Example of usage

    -
    myChar.ReactOnDamage( 2, attackerChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void ReactOnDamage( damageType, attackerChar );

    +
    +
    +

    Purpose

    +

    Lets a character react to damage by an attacker

    +
    +
    +

    Notes

    +

    In practical terms, this is what happens when a character reacts to damage: +

      +
    • attackerChar's attackFirst property is set to true
    • +
    • Character's attacker property is set to attackerChar
    • +
    • Character's attackFirst property is set to false
    • +
    • If character is an NPC, and was hidden upon taking damage, they're exposed to view
    • +
    • If character is an NPC, and was not already in combat mode, they enter combat mode with attackerChar as target
    • +
    • If character is a Player, their concentration is broken (i.e. any active Meditation effect is cancelled)
    • +
    +

    +
    +
    +

    Example of usage

    +
    myChar.ReactOnDamage( 2, attackerChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Recall( item )

    -
    -
    -

    Purpose

    -

    Recalls character to the location marked on specified item (if any).

    -
    -
    -

    Example of usage

    -
    myChar.Recall( targItem );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void Recall( item )

    +
    +
    +

    Purpose

    +

    Recalls character to the location marked on specified item (if any).

    +
    +
    +

    Example of usage

    +
    myChar.Recall( targItem );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Release()

    -
    -
    -

    Purpose

    -

    Releases character from jail.

    -
    -
    -

    Example of usage

    -
    myChar.Release();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void Release()

    +
    +
    +

    Purpose

    +

    Releases character from jail.

    +
    +
    +

    Example of usage

    +
    myChar.Release();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void RemoveAggressorFlag( otherChar )

    -
    -
    -

    Purpose

    -

    Removes character's aggressor flag towards target character

    -
    -
    -

    Example of usage

    -
    pUser.RemoveAggressorFlag( otherChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void RemoveAggressorFlag( otherChar )

    +
    +
    +

    Purpose

    +

    Removes character's aggressor flag towards target character

    +
    +
    +

    Example of usage

    +
    pUser.RemoveAggressorFlag( otherChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void RemoveFriend( pChar )

    -
    -
    -

    Purpose

    -

    Removes a player from an NPC pet/follower's friend list

    -
    -
    -

    Example of usage

    -
    myPet.RemoveFriend( pChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void RemoveFriend( pChar )

    +
    +
    +

    Purpose

    +

    Removes a player from an NPC pet/follower's friend list

    +
    +
    +

    Example of usage

    +
    myPet.RemoveFriend( pChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void RemovePermaGreyFlag( otherChar )

    -
    -
    -

    Purpose

    -

    Removes character's permagrey flag towards target character

    -
    -
    -

    Example of usage

    -
    pUser.RemovePermaGreyFlag( otherChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void RemovePermaGreyFlag( otherChar )

    +
    +
    +

    Purpose

    +

    Removes character's permagrey flag towards target character

    +
    +
    +

    Example of usage

    +
    pUser.RemovePermaGreyFlag( otherChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int Resist( resistanceType );

    -

    void Resist( resistanceType, amount );

    -
    -
    -

    Purpose

    -

    Used to get/set the resistance type and amount of a character

    -
    -
    -

    Notes

    -

    - Supported resistanceTypes:
    -

      -
    • 1 - Armor
    • -
    • 2 - Light
    • -
    • 3 - Water
    • -
    • 4 - Cold
    • -
    • 5 - Heat
    • -
    • 6 - Energy
    • -
    • 7 - Poison
    • -
    -

    -
    -
    -

    Example of usage

    -
    pUser.Resist( 1, 20 );
    +						
    + + +
    +
    +

    Prototype

    +

    int Resist( resistanceType );

    +

    void Resist( resistanceType, amount );

    +
    +
    +

    Purpose

    +

    Used to get/set the resistance type and amount of a character

    +
    +
    +

    Notes

    +

    Supported resistanceTypes:
    +

      +
    • 1 - Armor
    • +
    • 2 - Light
    • +
    • 3 - Water
    • +
    • 4 - Cold
    • +
    • 5 - Heat
    • +
    • 6 - Energy
    • +
    • 7 - Poison
    • +
    +

    +
    +
    +

    Example of usage

    +
    pUser.Resist( 1, 20 );
     //or...
     var coldResist = pUser.Resist( 4 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int ResourceCount( realItemID );

    -

    int ResourceCount( realItemID, colour );

    -

    int ResourceCount( realItemID, colour, moreVal );

    -
    -
    -

    Purpose

    -

    Returns the amount of items with specified ID realItemID, colour (optional) and MORE value (optional) from character's backpack

    -
    -
    -

    Notes

    -

    A colour value of -1 will make UOX3 count ANY item of the specified realItemID regardless of colour. If moreVal is specified, UOX3 will only count items with a matching MORE value.

    -
    -
    -

    Example of usage

    -
    // Count all items in character's backpack with specified ID (0x1bf2) and colour (0)
    +						
    + + +
    +
    +

    Prototype

    +

    int ResourceCount( realItemID );

    +

    int ResourceCount( realItemID, colour );

    +

    int ResourceCount( realItemID, colour, moreVal );

    +
    +
    +

    Purpose

    +

    Returns the amount of items with specified ID realItemID, colour (optional) and MORE value (optional) from character's backpack

    +
    +
    +

    Notes

    +

    A colour value of -1 will make UOX3 count ANY item of the specified realItemID regardless of colour. If moreVal is specified, UOX3 will only count items with a matching MORE value.

    +
    +
    +

    Example of usage

    +
    // Count all items in character's backpack with specified ID (0x1bf2) and colour (0)
     var iCount = myChar.ResourceCount( 0x1bf2, 0 );
     
     // Count all items in character's backpack with specified ID (0x1bf2), of ANY colour
    @@ -9950,200 +9907,180 @@ 

    January 9th, 2022

    // Count all items in character's backpack with specified ID (0x1bf2), colour (0x0482) and MORE value (1) var iCount = myChar.ResourceCount( 0x1bf2, 0x0482, 1 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Resurrect()

    -
    -
    -

    Purpose

    -

    Resurrects the deceased character.

    -
    -
    -

    Example of usage

    -
    myChar.Resurrect();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void Resurrect()

    +
    +
    +

    Purpose

    +

    Resurrects the deceased character.

    +
    +
    +

    Example of usage

    +
    myChar.Resurrect();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void RunTo( object, maxSteps );

    -

    void RunTo( x, y, maxSteps );

    -
    -
    -

    Purpose

    -

    Makes the (NPC only) character run to a specific object/location, halting if it takes too many steps.

    -
    -
    -

    Example of usage

    -
    myNPC.RunTo( pUser, 10 );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void RunTo( object, maxSteps );

    +

    void RunTo( x, y, maxSteps );

    +
    +
    +

    Purpose

    +

    Makes the (NPC only) character run to a specific object/location, halting if it takes too many steps.

    +
    +
    +

    Example of usage

    +
    myNPC.RunTo( pUser, 10 );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SellTo( myNPC );

    -
    -
    -

    Purpose

    -

    Brings up the shopkeeper gump for selling to vendor myNPC.

    -
    -
    -

    Example of usage

    -
    myChar.SellTo( myNPC );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void SellTo( myNPC );

    +
    +
    +

    Purpose

    +

    Brings up the shopkeeper gump for selling to vendor myNPC.

    +
    +
    +

    Example of usage

    +
    myChar.SellTo( myNPC );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SetInvisible( visibility, timeLength );

    -
    -
    -

    Purpose

    -

    Sets character to the specified visibility level for the specified amount of time (in milliseconds).

    -
    -
    -

    Notes

    -

    - Supported visibility levels: -

      -
    • 0 - Visible to all
    • -
    • 1 - Temporarily hidden (Hiding skill)
    • -
    • 2 - Magically hidden
    • -
    • 3 - Permanently hidden (GM hidden)
    • -
    • 4 - Ghost hidden (normal state of ghost players)
    • -
    -

    -
    -
    -

    Example of usage

    -
    myChar.SetInvisible( 1, 1000 );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void SetInvisible( visibility, timeLength );

    +
    +
    +

    Purpose

    +

    Sets character to the specified visibility level for the specified amount of time (in milliseconds).

    +
    +
    +

    Notes

    +

    Supported visibility levels: +

      +
    • 0 - Visible to all
    • +
    • 1 - Temporarily hidden (Hiding skill)
    • +
    • 2 - Magically hidden
    • +
    • 3 - Permanently hidden (GM hidden)
    • +
    • 4 - Ghost hidden (normal state of ghost players)
    • +
    +

    +
    +
    +

    Example of usage

    +
    myChar.SetInvisible( 1, 1000 );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SetPoisoned( poisonLevel, duration )

    -
    -
    -

    Purpose

    -

    Applies a specified level of poison to a character for a specified amount of time (in milliseconds).

    -
    -
    -

    Example of usage

    -
    // Gives myChar a level 2 poison for 10 seconds.
    +						
    + + +
    +
    +

    Prototype

    +

    void SetPoisoned( poisonLevel, duration )

    +
    +
    +

    Purpose

    +

    Applies a specified level of poison to a character for a specified amount of time (in milliseconds).

    +
    +
    +

    Example of usage

    +
    // Gives myChar a level 2 poison for 10 seconds.
     myChar.SetPoisoned( 2, 10000 );
    -
    -
    -
    - -
    - - -
    -
    -

    Prototype

    -

    void SetRandomName( nameListID );

    -
    -
    -

    Purpose

    -

    Applies a random name from a specified namelist to character/item.

    -
    -
    -

    Notes

    -

    Trivia: Int values were originally used for namelist IDs in dfndata/npc/namelists.dfn or dfndata/items/namelists.dfn, and those still persist, but they are actually strings, and any string can be used as a namelist ID. Doesn't have to be a number!

    -
    -
    -

    Example of usage

    -
    myChar/myItem.SetRandomName( "19" ); // Apply random name from Savage Warriors namelist or can get random name from items namelist depending on how its used.
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SetRandomColor( colorListID );

    -
    -
    -

    Purpose

    -

    Applies a random color from a specified colorlist to character/item.

    -
    -
    -

    Example of usage

    -
    myChar/myItem.SetRandomColor( "1" ); // Apply random color from Savage Warriors skin or can get random color from items colorlist depending on how its used.
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void SetRandomName( nameListID );

    +
    +
    +

    Purpose

    +

    Applies a random name from a specified namelist to character/item.

    +
    +
    +

    Notes

    +

    Trivia: Int values were originally used for namelist IDs in dfndata/npc/namelists.dfn or dfndata/items/namelists.dfn, and those still persist, but they are actually strings, and any string can be used as a namelist ID. Doesn't have to be a number!

    +
    +
    +

    Example of usage

    +
    myChar/myItem.SetRandomName( "19" ); // Apply random name from Savage Warriors namelist or can get random name from items namelist depending on how its used.
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SetSkillByName( "skillName", value );

    -
    -
    -

    Purpose

    -

    Sets the skill specified by name to the specified value.

    -
    -
    -

    Notes

    -

    Name must be the same as in skills.dfn, or "ALLSKILLS" to set all skills at once.

    -
    -
    -

    Example of usage

    -
    myChar.SetSkillByName( "alchemy", 1000 );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void SetSkillByName( "skillName", value );

    +
    +
    +

    Purpose

    +

    Sets the skill specified by name to the specified value.

    +
    +
    +

    Notes

    +

    Name must be the same as in skills.dfn, or "ALLSKILLS" to set all skills at once.

    +
    +
    +

    Example of usage

    +
    myChar.SetSkillByName( "alchemy", 1000 );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SpeechInput( speechID [, speechItem] );

    -
    -
    -

    Purpose

    -

    Calls up the onSpeechInput event using specified ID, with the text the user types. Also supports an optional speechItem parameter, which allows passing along an object to the onSPeechInput event.

    -
    -
    -

    Example of usage

    -
    // Example 1, in some function, we call upon user to enter some text:
    +						
    + + +
    +
    +

    Prototype

    +

    void SpeechInput( speechID [, speechItem] );

    +
    +
    +

    Purpose

    +

    Calls up the onSpeechInput event using specified ID, with the text the user types. Also supports an optional speechItem parameter, which allows passing along an object to the onSPeechInput event.

    +
    +
    +

    Example of usage

    +
    // Example 1, in some function, we call upon user to enter some text:
     myChar.SpeechInput( 1 );
     
     // When user enters their text, the onSpeechInput() event gets triggered
    @@ -10163,48 +10100,48 @@ 

    January 9th, 2022

    iUsed.name = pSpeech; } }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SpellFail();

    -
    -
    -

    Purpose

    -

    Does the actions associated in code with spell failure. Use after character fails to cast a spell, will play fail-effect, sound and give player default fail-message

    -
    -
    -

    Notes

    -

    SoundID is the ID of the sound to play. If bAllHear is true, then everyone nearby hears it. If it's false, then only the Character hears it.

    -
    -
    -

    Example of usage

    -
    myChar.SpellFail();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void SpellFail();

    +
    +
    +

    Purpose

    +

    Does the actions associated in code with spell failure. Use after character fails to cast a spell, will play fail-effect, sound and give player default fail-message

    +
    +
    +

    Notes

    +

    SoundID is the ID of the sound to play. If bAllHear is true, then everyone nearby hears it. If it's false, then only the Character hears it.

    +
    +
    +

    Example of usage

    +
    myChar.SpellFail();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SpellMoveEffect( targetChar, mSpell );

    -
    -
    -

    Purpose

    -

    Plays the MOVEFX effect of the specified spell in SPELLS.DFN, going from the character to the target

    -
    -
    -

    Example of usage

    -
    // Get ID of spell being cast
    +						
    + + +
    +
    +

    Prototype

    +

    void SpellMoveEffect( targetChar, mSpell );

    +
    +
    +

    Purpose

    +

    Plays the MOVEFX effect of the specified spell in SPELLS.DFN, going from the character to the target

    +
    +
    +

    Example of usage

    +
    // Get ID of spell being cast
     var spellNum	= mChar.spellCast;
     
     // Get Spell object based on ID
    @@ -10212,25 +10149,25 @@ 

    January 9th, 2022

    // Play mSpell's MOVEFX from mChar to targetChar mChar.SpellMoveEffect( targetChar, mSpell );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SpellStaticEffect( mSpell );

    -
    -
    -

    Purpose

    -

    Play the STATFX effect specified for the specified spell in SPELLS.DFN, on the character

    -
    -
    -

    Example of usage

    -
    // Get ID of spell being cast
    +						
    + + +
    +
    +

    Prototype

    +

    void SpellStaticEffect( mSpell );

    +
    +
    +

    Purpose

    +

    Play the STATFX effect specified for the specified spell in SPELLS.DFN, on the character

    +
    +
    +

    Example of usage

    +
    // Get ID of spell being cast
     var spellNum	= mChar.spellCast;
     
     // Get Spell object based on ID
    @@ -10238,111 +10175,111 @@ 

    January 9th, 2022

    // Play mSpell's MOVEFX from mChar to targetChar targetChar.SpellStaticEffect( mSpell );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void SysMessage( [msgColor,] string message, ... );

    -
    -
    -

    Purpose

    -

    Sends a string as a system message. Accepts up to 10 additional arguments which can be injected into the string as needed. Text colour can also be provided as an optional parameter prior to the string itself

    -
    -
    -

    Example of usage

    -
    myChar.SysMessage( "Isn't the world great?" );
    +						
    + + +
    +
    +

    Prototype

    +

    void SysMessage( [msgColor,] string message, ... );

    +
    +
    +

    Purpose

    +

    Sends a string as a system message. Accepts up to 10 additional arguments which can be injected into the string as needed. Text colour can also be provided as an optional parameter prior to the string itself

    +
    +
    +

    Example of usage

    +
    myChar.SysMessage( "Isn't the world great?" );
     myChar.SysMessage( GetDictionaryEntry(388), myNPC.name ); // Hello sir! My name is %s and I will be working for you.
     myChar.SysMessage( 0x42, "This message has a different color!" );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void TurnToward( trgObj );

    -

    void TurnToward( x, y );

    -
    -
    -

    Purpose

    -

    Turn Character towards trgObj/specified location

    -
    -
    -

    Example of usage

    -
    myNPC.TurnToward( myObject );
    +						
    + + +
    +
    +

    Prototype

    +

    void TurnToward( trgObj );

    +

    void TurnToward( x, y );

    +
    +
    +

    Purpose

    +

    Turn Character towards trgObj/specified location

    +
    +
    +

    Example of usage

    +
    myNPC.TurnToward( myObject );
     myNPC.TurnToward( myObject.x, myObject.y );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void UpdateAggressorFlagTimestamp( otherChar )

    -
    -
    -

    Purpose

    -

    Updates the expiry timestamp of character's aggressor flag towards target character

    -
    -
    -

    Example of usage

    -
    pUser.UpdateAggressorFlagTimestamp( otherChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void UpdateAggressorFlagTimestamp( otherChar )

    +
    +
    +

    Purpose

    +

    Updates the expiry timestamp of character's aggressor flag towards target character

    +
    +
    +

    Example of usage

    +
    pUser.UpdateAggressorFlagTimestamp( otherChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void UpdatePermaGreyFlagTimestamp( otherChar )

    -
    -
    -

    Purpose

    -

    Updates the expiry timestamp of character's permagrey flag towards target character

    -
    -
    -

    Example of usage

    -
    pUser.UpdatePermaGreyFlagTimestamp( otherChar );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void UpdatePermaGreyFlagTimestamp( otherChar )

    +
    +
    +

    Purpose

    +

    Updates the expiry timestamp of character's permagrey flag towards target character

    +
    +
    +

    Example of usage

    +
    pUser.UpdatePermaGreyFlagTimestamp( otherChar );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int UseResource( amount, itemID );

    -

    int UseResource( amount, itemID, colour );

    -

    int UseResource( amount, itemID, colour, moreVal );

    -
    -
    -

    Purpose

    -

    Removes amount of items with specified itemID, colour (optional) and MORE value (optional) from character's backpack, and returns amount deleted

    -
    -
    -

    Notes

    -

    If an item of the specified resource is found with .usesLeft property higher than 1, the appropriate amount of uses is extracted from said item before eventually deleting the resource item itself.

    -
    -
    -

    Example of usage

    -
    // Use resource of specific ID, with specific color (0)
    +						
    + + +
    +
    +

    Prototype

    +

    int UseResource( amount, itemID );

    +

    int UseResource( amount, itemID, colour );

    +

    int UseResource( amount, itemID, colour, moreVal );

    +
    +
    +

    Purpose

    +

    Removes amount of items with specified itemID, colour (optional) and MORE value (optional) from character's backpack, and returns amount deleted

    +
    +
    +

    Notes

    +

    If an item of the specified resource is found with .usesLeft property higher than 1, the appropriate amount of uses is extracted from said item before eventually deleting the resource item itself.

    +
    +
    +

    Example of usage

    +
    // Use resource of specific ID, with specific color (0)
     myChar.UseResource( 5, 0x1bf2, 0 );
     
     // Use resource of specific ID, and colour
    @@ -10350,97 +10287,97 @@ 

    January 9th, 2022

    // Use resource of specific ID, colour and MORE value myChar.UseResource( 5, 0x1bf2, 0x0482, 1 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void WalkTo( object, maxSteps );

    -

    void WalkTo( x, y, maxSteps );

    -
    -
    -

    Purpose

    -

    Makes the (NPC only) character walk to a specific object/location, halting if it takes too many steps.

    -
    -
    -

    Example of usage

    -
    myNPC.WalkTo( pUser, 10 );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void WalkTo( object, maxSteps );

    +

    void WalkTo( x, y, maxSteps );

    +
    +
    +

    Purpose

    +

    Makes the (NPC only) character walk to a specific object/location, halting if it takes too many steps.

    +
    +
    +

    Example of usage

    +
    myNPC.WalkTo( pUser, 10 );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Wander( x1, y1, x2, y2 );

    -

    void Wander( x1, y1, radius );

    -
    -
    -

    Purpose

    -

    Specifies a wander area for an NPC, as either a box or a circle

    -
    -
    -

    Notes

    -

    NPCs will return to their wander area if they reset after combat, or if they wander too far off

    -
    -
    -

    Example of usage

    -
    // Specify a box set of coordinates as the NPC's wander area
    +						
    + + +
    +
    +

    Prototype

    +

    void Wander( x1, y1, x2, y2 );

    +

    void Wander( x1, y1, radius );

    +
    +
    +

    Purpose

    +

    Specifies a wander area for an NPC, as either a box or a circle

    +
    +
    +

    Notes

    +

    NPCs will return to their wander area if they reset after combat, or if they wander too far off

    +
    +
    +

    Example of usage

    +
    // Specify a box set of coordinates as the NPC's wander area
     myNPC.Wander( 5593, 1203, 5608, 1206 );
     
     // Specify a circle with radius of 10 as the NPC's wander area
     myNPC.Wander( 5600, 1204, 10 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void WhisperMessage( message );

    -
    -
    -

    Purpose

    -

    Causes the Character to whisper a message that can be seen only by nearby players (within 1 tile)

    -
    -
    -

    Example of usage

    -
    myChar.WhisperMessage( "Shhhhh, we're hunting wabbits!" );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void WhisperMessage( message );

    +
    +
    +

    Purpose

    +

    Causes the Character to whisper a message that can be seen only by nearby players (within 1 tile)

    +
    +
    +

    Example of usage

    +
    myChar.WhisperMessage( "Shhhhh, we're hunting wabbits!" );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void YellMessage( message );

    -
    -
    -

    Purpose

    -

    Causes the Character to yell a message to all players within range (36 tiles)

    -
    -
    -

    Example of usage

    -
    myChar.YellMessage( "YARGH!" );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    void YellMessage( message );

    +
    +
    +

    Purpose

    +

    Causes the Character to yell a message to all players within range (36 tiles)

    +
    +
    +

    Example of usage

    +
    myChar.YellMessage( "YARGH!" );
    +
    +
    +
    -
    +
  • From 4b6dea301943effd11b636105fbee53fb658844a Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 27 Jan 2025 21:15:34 -0600 Subject: [PATCH 142/147] Update jsdocs.html --- docs/jsdocs.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/jsdocs.html b/docs/jsdocs.html index 17aff972f..6e5a9d53a 100644 --- a/docs/jsdocs.html +++ b/docs/jsdocs.html @@ -10042,6 +10042,25 @@

    January 9th, 2022

    + +
    + + +
    +
    +

    Prototype

    +

    void SetRandomColor( colorListID );

    +
    +
    +

    Purpose

    +

    Applies a random color from a specified colorlist to character/item.

    +
    +
    +

    Example of usage

    +
    myChar/myItem.SetRandomColor( "1" ); // Apply random color from Savage Warriors skin or can get random color from items colorlist depending on how its used.
    +
    +
    +
    From 3211f67bbf77fdb8d2914b47d7126ed590051492 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 27 Jan 2025 21:28:05 -0600 Subject: [PATCH 143/147] Update jsdocs.html --- docs/jsdocs.html | 1113 ++++++++++++++++++++++------------------------ 1 file changed, 538 insertions(+), 575 deletions(-) diff --git a/docs/jsdocs.html b/docs/jsdocs.html index b3b18a7e1..17aff972f 100644 --- a/docs/jsdocs.html +++ b/docs/jsdocs.html @@ -6351,41 +6351,39 @@

    January 9th, 2022

  • Miscellaneous Functions
    -
    +
    -
    - - -
    -
    -

    Prototype

    -

    int BASEITEMSERIAL();

    -

    int INVALIDSERIAL();

    -

    int INVALIDID();

    -

    int INVALIDCOLOUR();

    -
    -
    -

    Purpose

    -

    - BASEITEMSERIAL() - Gets the constant that defines the base value used as starting point for item serials. If an object serial is lower than this, it probably belongs to a character. If it's higher, it belongs to an item.
    - INVALIDSERIAL() - Gets the constant defining an invalid serial. If an object serial matches this, it's invalid!
    - INVALIDID() - Gets the constant defining an invalid ID. If an object's ID matches this, it's probably not a valid ID!
    - INVALIDCOLOUR() - Gets the constant defining an invalid colour. If an object's colour is equal or higher than this, it's probably not a valid colour! -

    -
    -
    -

    Example of usage

    -
    var baseItemSerial = BASEITEMSERIAL();
    +						
    + + +
    +
    +

    Prototype

    +

    int BASEITEMSERIAL();

    +

    int INVALIDSERIAL();

    +

    int INVALIDID();

    +

    int INVALIDCOLOUR();

    +
    +
    +

    Purpose

    +

    BASEITEMSERIAL() - Gets the constant that defines the base value used as starting point for item serials. If an object serial is lower than this, it probably belongs to a character. If it's higher, it belongs to an item.
    + INVALIDSERIAL() - Gets the constant defining an invalid serial. If an object serial matches this, it's invalid!
    + INVALIDID() - Gets the constant defining an invalid ID. If an object's ID matches this, it's probably not a valid ID!
    + INVALIDCOLOUR() - Gets the constant defining an invalid colour. If an object's colour is equal or higher than this, it's probably not a valid colour!

    +
    +
    +

    Example of usage

    +
    var baseItemSerial = BASEITEMSERIAL();
     var invalidSerial = INVALIDSERIAL();
     var invalidID = INVALIDID();
     var invalidColour = INVALIDCOLOUR();
     									
    -
    -
    -
    +
    +
    +
    - +
    @@ -6405,59 +6403,28 @@

    January 9th, 2022

    - - + +

    Prototype

    -

    JSBool CheckInstaLog( x, y, world, instanceID );

    +

    int DistanceBetween( x1, y1, x2, y2 );

    +

    int DistanceBetween( x1, y1, z1, x2, y2, z2 );

    +

    int DistanceBetween( objA, objB );

    +

    int DistanceBetween( objA, objB, checkZ );

    Purpose

    -

    Checks if a specific location ( x, y, world, instanceID ) is within an instant logout zone.

    +

    Get the distance between two sets of coordinates or objects on either 2D or 3D plane

    +
    +
    +

    Notes

    +

    Parameters: x1, y1, z1, x2, y2, z2 = coordinates
    + checkZ = true if distance between two objects should take into account Z axis

    Example of usage

    -
    // Check if the player is in an instant logout zone
    -var isInstaLog = CheckInstaLog(targX, targY, worldNumber, instanceID);
    -
    -if( isInstaLog )
    -{
    -	// Handle instant logout
    -}
    -else
    -{
    -	// Handle other logout scenarios
    -}
    -
    -
    -
    - -
    - - -
    -
    -

    Prototype

    -

    int DistanceBetween( x1, y1, x2, y2 );

    -

    int DistanceBetween( x1, y1, z1, x2, y2, z2 );

    -

    int DistanceBetween( objA, objB );

    -

    int DistanceBetween( objA, objB, checkZ );

    -
    -
    -

    Purpose

    -

    Get the distance between two sets of coordinates or objects on either 2D or 3D plane

    -
    -
    -

    Notes

    -

    - Parameters: x1, y1, z1, x2, y2, z2 = coordinates
    - checkZ = true if distance between two objects should take into account Z axis -

    -
    -
    -

    Example of usage

    -
    // Get distance between two sets of x, y coordinates
    +									
    // Get distance between two sets of x, y coordinates
     var distance1 = DistanceBetween( pUser.x, pUser.y, iUsed.x, iUsed.y );
     
     // Get distance between two sets of x, y, z coordinates
    @@ -6468,159 +6435,157 @@ 

    January 9th, 2022

    // Get distance between pUser and iUsed using 3D coordinates var distance2 = DistanceBetween( pUser, iUsed, true );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool DoesEventExist( scriptID, eventToCheck );

    -
    -
    -

    Purpose

    -

    Check for existence of a named JS event/function in another script

    -
    -
    -

    Notes

    -

    - Parameters: scriptID = ID of the script to check
    - eventToCheck = name of event/function to look for -

    -
    -
    -

    Example of usage

    -
    // Check if a custom function exists in a specific script (0), and trigger it with TriggerEvent() if it does:
    +						
    + + +
    +
    +

    Prototype

    +

    bool DoesEventExist( scriptID, eventToCheck );

    +
    +
    +

    Purpose

    +

    Check for existence of a named JS event/function in another script

    +
    +
    +

    Notes

    +

    Parameters: scriptID = ID of the script to check
    + eventToCheck = name of event/function to look for

    +
    +
    +

    Example of usage

    +
    // Check if a custom function exists in a specific script (0), and trigger it with TriggerEvent() if it does:
     if( DoesEventExist( 0, "MyCustomFunction" ))
     {
     	TriggerEvent( 0, "MyCustomFunction", [additional parameters] );
     }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int GetAccountCount();

    -
    -
    -

    Purpose

    -

    Gets the total amount of accounts on the server

    -
    -
    -

    Example of usage

    -
    var totalAccounts = GetAccountCount();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    int GetAccountCount();

    +
    +
    +

    Purpose

    +

    Gets the total amount of accounts on the server

    +
    +
    +

    Example of usage

    +
    var totalAccounts = GetAccountCount();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool GetClientFeature( ClientFeaturesBitNum );

    -
    -
    -

    Purpose

    -

    Check if a specific client features is enabled. For a list of features that can be checked this way, see [settings]->clientFeatures List in the UOX.INI Settings section of the UOX3 Documentation.

    -
    -
    -

    Example of usage

    -
    // AoS bit from list of client features
    +						
    + + +
    +
    +

    Prototype

    +

    bool GetClientFeature( ClientFeaturesBitNum );

    +
    +
    +

    Purpose

    +

    Check if a specific client features is enabled. For a list of features that can be checked this way, see [settings]->clientFeatures List in the UOX.INI Settings section of the UOX3 Documentation.

    +
    +
    +

    Example of usage

    +
    // AoS bit from list of client features
     var aosFeaturesEnabled = GetClientFeature( 0x10 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    string GetDictionaryEntry( entryNum [, language ] );

    -
    -
    -

    Purpose

    -

    Pulls entry from the dictionary file based on language (or server default, if no language parameter is ).

    -
    -
    -

    Example of usage

    -
    var textString = GetDictionaryEntry( 1, socket.language );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    string GetDictionaryEntry( entryNum [, language ] );

    +
    +
    +

    Purpose

    +

    Pulls entry from the dictionary file based on language (or server default, if no language parameter is ).

    +
    +
    +

    Example of usage

    +
    var textString = GetDictionaryEntry( 1, socket.language );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int GetMurderThreshold();

    -
    -
    -

    Purpose

    -

    Returns the number of kills needed to be branded as a murderer and turn red.

    -
    -
    -

    Notes

    -

    See also: Character .murderCount and .murderer properties

    -
    -
    -

    Example of usage

    -
    if( GetMurderThreshold() > pTalking.murderCount )
    +						
    + + +
    +
    +

    Prototype

    +

    int GetMurderThreshold();

    +
    +
    +

    Purpose

    +

    Returns the number of kills needed to be branded as a murderer and turn red.

    +
    +
    +

    Notes

    +

    See also: Character .murderCount and .murderer properties

    +
    +
    +

    Example of usage

    +
    if( GetMurderThreshold() > pTalking.murderCount )
     {
     	TextMessage( pTalkingTo, "Surely sir, you must be a murderer.  I bid you adieu" );
     	EmoteMessage( pTalkingTo, "*scampers off*" );
     }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int GetPlayerCount();

    -
    -
    -

    Purpose

    -

    Gets the total amount of players online on the server

    -
    -
    -

    Example of usage

    -
    var totalOnlinePlayers = GetPlayerCount();
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    int GetPlayerCount();

    +
    +
    +

    Purpose

    +

    Gets the total amount of players online on the server

    +
    +
    +

    Example of usage

    +
    var totalOnlinePlayers = GetPlayerCount();
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    SOSObject GetRandomSOSArea( worldNum, instanceID );

    -
    -
    -

    Purpose

    -

    Gets a random SOS area from list of such areas loaded from [SOSAREAS] section of regions.dfn

    -
    -
    -

    Example of usage

    -
    // Fetch reference to a random SOS area
    +						
    + + +
    +
    +

    Prototype

    +

    SOSObject GetRandomSOSArea( worldNum, instanceID );

    +
    +
    +

    Purpose

    +

    Gets a random SOS area from list of such areas loaded from [SOSAREAS] section of regions.dfn

    +
    +
    +

    Example of usage

    +
    // Fetch reference to a random SOS area
     var sosArea = GetRandomSOSArea( pUser.worldNum, pUser.instanceID );
     
     // Pick a random location within the selected sosArea
    @@ -6634,112 +6599,112 @@ 

    January 9th, 2022

    sosMsg.more = sosMsg.instanceID; // See UOX3/js/item/waterstainedsos.js for full example, including validation for whether the chosen location is suitable, and not blocked by dynamic items, static items or map tiles
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool GetServerFeature( ServerFeaturesBitNum );

    -
    -
    -

    Purpose

    -

    Check if a specific server features is enabled. For a list of features that can be checked this way, see [settings]->serverFeatures List in the UOX.INI Settings section of the UOX3 Documentation.

    -
    -
    -

    Example of usage

    -
    // ContextMenus bit from list of server features
    +						
    + + +
    +
    +

    Prototype

    +

    bool GetServerFeature( ServerFeaturesBitNum );

    +
    +
    +

    Purpose

    +

    Check if a specific server features is enabled. For a list of features that can be checked this way, see [settings]->serverFeatures List in the UOX.INI Settings section of the UOX3 Documentation.

    +
    +
    +

    Example of usage

    +
    // ContextMenus bit from list of server features
     var contextMenusEnabled = GetServerFeature( 0x08 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    string GetServerSetting( serverSettingString );

    -
    -
    -

    Purpose

    -

    Fetches the value of a specified server setting and returns it as a string. Wrap in parseInt() if expected value returned is an int.

    -
    -
    -

    Example of usage

    -
    // Returns 1 if GUARDSACTIVE is set to 1 in UOX.INI, or 0 if set to 0.
    +						
    + + +
    +
    +

    Prototype

    +

    string GetServerSetting( serverSettingString );

    +
    +
    +

    Purpose

    +

    Fetches the value of a specified server setting and returns it as a string. Wrap in parseInt() if expected value returned is an int.

    +
    +
    +

    Example of usage

    +
    // Returns 1 if GUARDSACTIVE is set to 1 in UOX.INI, or 0 if set to 0.
     var guardsActive = GetServerSetting( "GUARDSACTIVE" );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    SOCKET GetSocketFromIndex( socketIndex );

    -
    -
    -

    Purpose

    -

    Create a socket-object based on the specified socketIndex

    -
    -
    -

    Example of usage

    -
    // Fetch whichever socket is connected to the server as socket/connection 0
    +						
    + + +
    +
    +

    Prototype

    +

    SOCKET GetSocketFromIndex( socketIndex );

    +
    +
    +

    Purpose

    +

    Create a socket-object based on the specified socketIndex

    +
    +
    +

    Example of usage

    +
    // Fetch whichever socket is connected to the server as socket/connection 0
     var socket = GetSocketFromIndex( 0 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool IsInBuilding( x, y, z, world, instance, checkHeight );

    -
    -
    -

    Purpose

    -

    Returns true if specified location is inside a static building (underneath static items), or if player is inside a multi.

    -
    -
    -

    Notes

    -

    If checkHeight argument is true, player is only deemed inside a multi if there are multi-items above the player's head. If player is in a courtyard/on a rooftop, they will be deemed to be NOT in the building. checkHeight is not used for the static part of the function, only for multis.

    -
    -
    -

    Example of usage

    -
    var isCharInBuilding = IsInBuilding( myChar.x, myChar.y, myChar.z, myChar.worldnumber, myChar.instanceID, true );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    bool IsInBuilding( x, y, z, world, instance, checkHeight );

    +
    +
    +

    Purpose

    +

    Returns true if specified location is inside a static building (underneath static items), or if player is inside a multi.

    +
    +
    +

    Notes

    +

    If checkHeight argument is true, player is only deemed inside a multi if there are multi-items above the player's head. If player is in a courtyard/on a rooftop, they will be deemed to be NOT in the building. checkHeight is not used for the static part of the function, only for multis.

    +
    +
    +

    Example of usage

    +
    var isCharInBuilding = IsInBuilding( myChar.x, myChar.y, myChar.z, myChar.worldnumber, myChar.instanceID, true );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int IterateOver( objectType );

    -
    -
    -

    Purpose

    -

    Iterates over all objects of specified type in the world.

    -
    -
    -

    Notes

    -

    For every object it comes across, the iterator will call a function onIterate( object ) in the same script. Supported object types: "BASEOBJ", "CHARACTER", "ITEM", "SPAWNER", "MULTI", "BOAT"

    -
    -
    -

    Example of usage

    -
    var itemCount = IterateOver( "ITEM" );
    +						
    + + +
    +
    +

    Prototype

    +

    int IterateOver( objectType );

    +
    +
    +

    Purpose

    +

    Iterates over all objects of specified type in the world.

    +
    +
    +

    Notes

    +

    For every object it comes across, the iterator will call a function onIterate( object ) in the same script. Supported object types: "BASEOBJ", "CHARACTER", "ITEM", "SPAWNER", "MULTI", "BOAT"

    +
    +
    +

    Example of usage

    +
    var itemCount = IterateOver( "ITEM" );
     Console.log( itemCount + " items found!" );
     ...
     function onIterate( myObject )
    @@ -6748,113 +6713,111 @@ 

    January 9th, 2022

    // ... optionally do something here return true; }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int Moon( moonNum );

    -

    void Moon( moonNum, newVal );

    -
    -
    -

    Purpose

    -

    Get and set the server moon values for the two moons Felucca (0) and Trammel (1)

    -
    -
    -

    Example of usage

    -
    var feluccaMoonphase = Moon( 0 );
    +						
    + + +
    +
    +

    Prototype

    +

    int Moon( moonNum );

    +

    void Moon( moonNum, newVal );

    +
    +
    +

    Purpose

    +

    Get and set the server moon values for the two moons Felucca (0) and Trammel (1)

    +
    +
    +

    Example of usage

    +
    var feluccaMoonphase = Moon( 0 );
     var TrammelMoonphase = Moon( 1 );
     Moon( 0, 7 ); //Set the moon Felucca to moonphase 7
     Moon( 1, 3 ); //Set the moon Trammel to moonphase 3
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int RandomNumber( loNum, hiNum );

    -
    -
    -

    Purpose

    -

    Returns a random number between loNum (inclusive) and hiNum (inclusive)

    -
    -
    -

    Example of usage

    -
    var iNum = RandomNumber( 0, 10 );
    -
    -
    -
    +
    + + +
    +
    +

    Prototype

    +

    int RandomNumber( loNum, hiNum );

    +
    +
    +

    Purpose

    +

    Returns a random number between loNum (inclusive) and hiNum (inclusive)

    +
    +
    +

    Example of usage

    +
    var iNum = RandomNumber( 0, 10 );
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void Reload( subSystemID );

    -
    -
    -

    Purpose

    -

    Dynamically reloads one (or all) of UOX3's subsystems without having to restart UOX3

    -
    -
    -

    Notes

    -

    - Supported subSystemIDs: -

      -
    • 0 - Regions/TeleportLocations
    • -
    • 1 - Spawn Regions
    • -
    • 2 - Spells
    • -
    • 3 - Commands
    • -
    • 4 - DFNs/Skills
    • -
    • 5 - JScripts
    • -
    • 6 - HTML Templates
    • -
    • 7 - INI
    • -
    • 8 - Everything
    • -
    • 9 - Accounts
    • -
    • 10 - Dictionaries
    • -
    -

    -
    -
    -

    Example of usage

    -
    // Reload all DFNs (and Skill system)
    +						
    + + +
    +
    +

    Prototype

    +

    void Reload( subSystemID );

    +
    +
    +

    Purpose

    +

    Dynamically reloads one (or all) of UOX3's subsystems without having to restart UOX3

    +
    +
    +

    Notes

    +

    Supported subSystemIDs: +

      +
    • 0 - Regions/TeleportLocations
    • +
    • 1 - Spawn Regions
    • +
    • 2 - Spells
    • +
    • 3 - Commands
    • +
    • 4 - DFNs/Skills
    • +
    • 5 - JScripts
    • +
    • 6 - HTML Templates
    • +
    • 7 - INI
    • +
    • 8 - Everything
    • +
    • 9 - Accounts
    • +
    • 10 - Dictionaries
    • +

    +
    +
    +

    Example of usage

    +
    // Reload all DFNs (and Skill system)
     Reload( 4 );
     
     // Reload INI file
     Reload( 7 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void ReloadJSFile( scriptID );

    -
    -
    -

    Purpose

    -

    Dynamically reloads script with specified scriptID from jse_fileassociations.scp without having to restart UOX3

    -
    -
    -

    Notes

    -

    Cannot be used to validate sockets

    -
    -
    -

    Example of usage

    -
    // Example of how this is used by 'reloadjsfile command
    +						
    + + +
    +
    +

    Prototype

    +

    void ReloadJSFile( scriptID );

    +
    +
    +

    Purpose

    +

    Dynamically reloads script with specified scriptID from jse_fileassociations.scp without having to restart UOX3

    +
    +
    +

    Notes

    +

    Cannot be used to validate sockets

    +
    +
    +

    Example of usage

    +
    // Example of how this is used by 'reloadjsfile command
     function CommandRegistration()
     {
     	RegisterCommand( "reloadjsfile", 3, true ); //Reload JavaScript file
    @@ -6867,70 +6830,70 @@ 

    January 9th, 2022

    ReloadJSFile( scriptID ); }
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    int RollDice( numDie, faces, addition );

    -
    -
    -

    Purpose

    -

    Rolls a faces sided die numDie times and adds addition. The example is for a DnD style dice like: 2d3+1

    -
    -
    -

    Example of usage

    -
    // Roll a DnD style dice of type 2d3+1 (2 dice with 3 faces, add 1 to result)
    +						
    + + +
    +
    +

    Prototype

    +

    int RollDice( numDie, faces, addition );

    +
    +
    +

    Purpose

    +

    Rolls a faces sided die numDie times and adds addition. The example is for a DnD style dice like: 2d3+1

    +
    +
    +

    Example of usage

    +
    // Roll a DnD style dice of type 2d3+1 (2 dice with 3 faces, add 1 to result)
     var mDie = RollDice( 2, 3, 1 );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool/int/string/object TriggerEvent( scriptID, "functionName", argument1, argument2 );

    -
    -
    -

    Purpose

    -

    Calls script with specified scriptID, runs function in said script that matches "functionName", with the defined function arguments. The called upon script can return a value in the form of a boolean, int, string or an object

    -
    -
    -

    Example of usage

    -
    // Calls script with ID 8000 and runs function "onUseChecked" with function parameters pUser and iUsed
    +						
    + + +
    +
    +

    Prototype

    +

    bool/int/string/object TriggerEvent( scriptID, "functionName", argument1, argument2 );

    +
    +
    +

    Purpose

    +

    Calls script with specified scriptID, runs function in said script that matches "functionName", with the defined function arguments. The called upon script can return a value in the form of a boolean, int, string or an object

    +
    +
    +

    Example of usage

    +
    // Calls script with ID 8000 and runs function "onUseChecked" with function parameters pUser and iUsed
     var returnVal = TriggerEvent( 8000, "onUseChecked", pUser, iUsed );
     
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    TriggerTrap( pChar/pSock, iTrap );

    -
    -
    -

    Purpose

    -

    pChar/pSock triggers trap on iTrap object (if any trap is present on object)

    -
    -
    -

    Notes

    -

    Trap will only trigger if both first two parts of MOREZ value is set on object; first part needs to be set to 1 to indicate object is trapped, second part needs to specify damage amount to apply.

    -
    -
    -

    Example of usage

    -
    // Setup trap on iTrap object
    +						
    + + +
    +
    +

    Prototype

    +

    TriggerTrap( pChar/pSock, iTrap );

    +
    +
    +

    Purpose

    +

    pChar/pSock triggers trap on iTrap object (if any trap is present on object)

    +
    +
    +

    Notes

    +

    Trap will only trigger if both first two parts of MOREZ value is set on object; first part needs to be set to 1 to indicate object is trapped, second part needs to specify damage amount to apply.

    +
    +
    +

    Example of usage

    +
    // Setup trap on iTrap object
     // First part of value (01) indicates object is trapped
     // Second part of value (32) defines damage dealt (32 = 0x32 = 50 damage)
     // Third (00) and Fourth (00) parts, unused here, normally indicate the min/max skill required to disarm trap
    @@ -6939,148 +6902,148 @@ 

    January 9th, 2022

    // Trigger the trap TriggerTrap( pChar, iTrap );
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    void UseItem( pSock/mChar, iToUse );

    -
    -
    -

    Purpose

    -

    To allow characters (and NPCs in particular) to trigger item-use functionality of items

    -
    -
    -

    Notes

    -

    Either a socket or a character can be passed in as a parameter of the UseItem function. If a socket is passed in, UOX3 will derive the character using the item from said socket.

    -
    -
    -

    Example of usage

    -
    // If an item has type 12, make NPC use the door to open it
    +						
    + + +
    +
    +

    Prototype

    +

    void UseItem( pSock/mChar, iToUse );

    +
    +
    +

    Purpose

    +

    To allow characters (and NPCs in particular) to trigger item-use functionality of items

    +
    +
    +

    Notes

    +

    Either a socket or a character can be passed in as a parameter of the UseItem function. If a socket is passed in, UOX3 will derive the character using the item from said socket.

    +
    +
    +

    Example of usage

    +
    // If an item has type 12, make NPC use the door to open it
     if( myItem.type == 12 )
     {
     	mChar.TextMessage( "A door! What's on the other side?" );
     	UseItem( mChar, iToUse );
     }
     
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    bool ValidateObject( object );

    -
    -
    -

    Purpose

    -

    Returns true if argument is a valid object (Item, Character, Multi, Boat, Spawner)

    -
    -
    -

    Notes

    -

    Cannot be used to validate sockets

    -
    -
    -

    Example of usage

    -
    if( !ValidateObject( iUsed ))
    +						
    + + +
    +
    +

    Prototype

    +

    bool ValidateObject( object );

    +
    +
    +

    Purpose

    +

    Returns true if argument is a valid object (Item, Character, Multi, Boat, Spawner)

    +
    +
    +

    Notes

    +

    Cannot be used to validate sockets

    +
    +
    +

    Example of usage

    +
    if( !ValidateObject( iUsed ))
     	return;
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    [int] WorldBrightLevel( [lightlevel] );

    -
    -
    -

    Purpose

    -

    Get/Set the "maximum brightness" light-level for daytime across the entire world

    -
    -
    -

    Notes

    -

    If no parameter is provided, function will return current "maximum brightness" light-level for daytime instead.

    -
    -
    -

    Example of usage

    -
    // Set maximum world brightness level to 1
    +						
    + + +
    +
    +

    Prototype

    +

    [int] WorldBrightLevel( [lightlevel] );

    +
    +
    +

    Purpose

    +

    Get/Set the "maximum brightness" light-level for daytime across the entire world

    +
    +
    +

    Notes

    +

    If no parameter is provided, function will return current "maximum brightness" light-level for daytime instead.

    +
    +
    +

    Example of usage

    +
    // Set maximum world brightness level to 1
     WorldBrightLevel( 1 );
     
     // Get current maximum world brightness level
     var lightLevel = WorldBrightLevel();
     
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    [int] WorldDarkLevel( [lightlevel] );

    -
    -
    -

    Purpose

    -

    Get/Set the "minimum brightness" light-level for night-time across the entire world

    -
    -
    -

    Notes

    -

    If no parameter is provided, function will return current "minimum brightness" light-level for night-time instead.

    -
    -
    -

    Example of usage

    -
    // Set minimum world brightness level to 15
    +						
    + + +
    +
    +

    Prototype

    +

    [int] WorldDarkLevel( [lightlevel] );

    +
    +
    +

    Purpose

    +

    Get/Set the "minimum brightness" light-level for night-time across the entire world

    +
    +
    +

    Notes

    +

    If no parameter is provided, function will return current "minimum brightness" light-level for night-time instead.

    +
    +
    +

    Example of usage

    +
    // Set minimum world brightness level to 15
     WorldDarkLevel( 15 );
     
     // Get current maximum world brightness level
     var lightLevel = WorldDarkLevel();
     
    -
    -
    -
    +
    +
    +
    -
    - - -
    -
    -

    Prototype

    -

    [int] WorldDungeonLevel( [lightlevel] );

    -
    -
    -

    Purpose

    -

    Get/Set the fixed light-level for any regions marked as dungeons

    -
    -
    -

    Notes

    -

    If no parameter is provided, function will return current fixed light-level for dungeons instead.

    -
    -
    -

    Example of usage

    -
    // Set fixed dungeon light level to 12
    +						
    + + +
    +
    +

    Prototype

    +

    [int] WorldDungeonLevel( [lightlevel] );

    +
    +
    +

    Purpose

    +

    Get/Set the fixed light-level for any regions marked as dungeons

    +
    +
    +

    Notes

    +

    If no parameter is provided, function will return current fixed light-level for dungeons instead.

    +
    +
    +

    Example of usage

    +
    // Set fixed dungeon light level to 12
     WorldDungeonLevel( 12 );
     
     // Get current fixed light level of dungeons
     var lightLevel = WorldDungeonLevel();
     
    -
    -
    -
    +
    +
    +
    -
    +
  • From 3058c01a30242c7037714dbece1baf094ab1d6c6 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 27 Jan 2025 21:29:31 -0600 Subject: [PATCH 144/147] Update jsdocs.html --- docs/jsdocs.html | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/jsdocs.html b/docs/jsdocs.html index 17aff972f..5cb3e2c3b 100644 --- a/docs/jsdocs.html +++ b/docs/jsdocs.html @@ -5564,6 +5564,35 @@

    January 9th, 2022

    +
    + + +
    +
    +

    Prototype

    +

    JSBool CheckInstaLog( x, y, world, instanceID );

    +
    +
    +

    Purpose

    +

    Checks if a specific location ( x, y, world, instanceID ) is within an instant logout zone.

    +
    +
    +

    Example of usage

    +
    // Check if the player is in an instant logout zone
    +var isInstaLog = CheckInstaLog(targX, targY, worldNumber, instanceID);
    +
    +if( isInstaLog )
    +{
    +	// Handle instant logout
    +}
    +else
    +{
    +	// Handle other logout scenarios
    +}
    +
    +
    +
    +
    From 5eb3134bd40564d374d7e6c1fc045fccdeaeddd3 Mon Sep 17 00:00:00 2001 From: Geir Ove Alnes Date: Tue, 28 Jan 2025 15:36:34 +0800 Subject: [PATCH 145/147] Update metal.dfn --- data/dfndata/items/containers/metal.dfn | 1 + 1 file changed, 1 insertion(+) diff --git a/data/dfndata/items/containers/metal.dfn b/data/dfndata/items/containers/metal.dfn index 5b6875213..e4309af33 100644 --- a/data/dfndata/items/containers/metal.dfn +++ b/data/dfndata/items/containers/metal.dfn @@ -142,4 +142,5 @@ name=metal chest id=0x0e41 movable=2 script=5061 +origin=uor } From c63670d51fb5e3a05cdb421e71f909b44d3b151c Mon Sep 17 00:00:00 2001 From: Geir Ove Alnes Date: Tue, 28 Jan 2025 16:32:35 +0800 Subject: [PATCH 146/147] Update Changelog.txt --- source/Changelog.txt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source/Changelog.txt b/source/Changelog.txt index 95b1d815c..cd419a108 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,8 +1,3 @@ -14/10/2024 - Dragon Slayer -    Added the CheckInstaLog function to check if a specific location is within an instant logout zone (SEFunctions.cpp). (thanks, Xuri) - -1/05/2024 - Dragon Slayer/Xuri - 21/01/2025 - Dragon Slayer Fixed damage dealt in combat was incorrectly modified while applying defense modifiers. (combat.cpp) @@ -19,6 +14,9 @@ Corrected a misspelling of IsBoat in magic.js. Added support for iterating through items in boats using FirstItem(), NextItem() and FinishedItems() methods +14/10/2024 - Dragon Slayer +    Added the CheckInstaLog JS function to allow checking if a specific location is within an instant logout zone (SEFunctions.cpp). (thanks, Xuri) + 12/10/2024 - Dragon Slayer Added Mini-House Addons from AOS Expansion. From 62ea84e13929dbf2f09211fe8d3db15bbe60671d Mon Sep 17 00:00:00 2001 From: Geir Ove Alnes Date: Tue, 28 Jan 2025 16:58:26 +0800 Subject: [PATCH 147/147] Update Changelog.txt --- source/Changelog.txt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source/Changelog.txt b/source/Changelog.txt index c5a785ad5..bb086c7e4 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,8 +1,3 @@ -20/10/2024 - Dragon Slayer - Added SetRandomColor("#") to js functions. (Thanks, Xuri) - -1/05/2024 - Dragon Slayer/Xuri - 21/01/2025 - Dragon Slayer Fixed damage dealt in combat was incorrectly modified while applying defense modifiers. (combat.cpp) @@ -19,6 +14,9 @@ Corrected a misspelling of IsBoat in magic.js. Added support for iterating through items in boats using FirstItem(), NextItem() and FinishedItems() methods +20/10/2024 - Dragon Slayer + Added SetRandomColor("#") to js functions. (Thanks, Xuri) + 14/10/2024 - Dragon Slayer     Added the CheckInstaLog JS function to allow checking if a specific location is within an instant logout zone (SEFunctions.cpp). (thanks, Xuri)