|
||
|
|||||||
| Custom Script Releases This forum is where you can release your custom scripts for other users to use. Please note: By releasing your scripts here you are submitting them to the public and as such agree to publish them under the GPL licensing terms. The RunUO Team has made its software GPL for you to use and enjoy you should do the same for anything based off of RunUO. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Expert
Join Date: Nov 2004
Location: Beyond the Gates of Hell
Age: 38
Posts: 3,508
|
~Lucid's Advanced Archery~ Version [3.0.1] (e) Next release #: v[3].0.1 (f) .................................................. .................................................. ........ ........:|| Created by: Lucid Nagual & Rift ||:......... .................................................. .................................................. ........ Installation Instructions: Open AOS.cs and make the following changes: Code:
Special Thanks:
Contents:
How to Set Ammo Type on Bows: Double-click the bow and target the ammo of choice, or bow stringer. Types Of Arrows:
__________________
Leader of the Anti-OSI Movement. Inventing a new game experience in an EA Games-free environment. Don Juan Matus "The basic difference between an ordinary man and a warrior is that a warrior takes everything as a challenge, while an ordinary man takes everything as a blessing or as a curse." My Customs:
Last edited by Lucid Nagual; 04-30-2007 at 10:04 PM. |
|
|
|
|
|
#2 (permalink) |
|
Forum Expert
Join Date: Nov 2004
Location: Beyond the Gates of Hell
Age: 38
Posts: 3,508
|
!Updates: Updated v[1].0.2b:
Updated v[1].0.3:
Updated v[1]0.4:
Updated v[2].0.1:
Updated v[2].0.2:
Updated v[2].0.2b:
Updated v[2].0.2c:
Updated v[2].0.3:
Updated v[2].0.3 (b):
Updated v[3].0.1 (a): Sweet Jesus!!! It's finally done ![]()
__________________
Leader of the Anti-OSI Movement. Inventing a new game experience in an EA Games-free environment. Don Juan Matus "The basic difference between an ordinary man and a warrior is that a warrior takes everything as a challenge, while an ordinary man takes everything as a blessing or as a curse." My Customs:
Last edited by Lucid Nagual; 11-21-2006 at 10:05 PM. |
|
|
|
|
|
#3 (permalink) |
|
Forum Novice
Join Date: May 2004
Location: Canada
Age: 36
Posts: 158
|
hiya love the system, but everytime i use the bow i can't fire, any idea's btw i download the other package that someone had updated it for u and worked great until the crash then redownloaded the CBaseRanged.cs and know can't fire any of the bow
can't wait to use this again |
|
|
|
|
|
#4 (permalink) |
|
Newbie
|
could it be you forgot to include the "newer" arrows and bolts ? they all got these "dupe" lines incompatible to 2.0
i think there is a typo in ElvencompositelongBow - some scripts cant find it.. shouldnt it be Elvencompositelongbow ? and this also happened to me : Code:
Spellbook.cs: CS1502: Line 808: The best oberloaded method match for 'Server.Items.BaseRunicTool.ApplyAttributesTo<Server.Items.Baseweapon, bool, int, int, int, int>' hase some invalid arguments CS1503: Line 808: Argument '1': cannot convert from 'Server.Items.Spellbook to 'Server.Items.Baseweapon' LootPack.cs CS1502: Line 667: The best oberloaded method match for 'Server.Items.BaseRunicTool.ApplyAttributesTo<Server.Items.Baseweapon, bool, int, int, int, int>' hase some invalid arguments CS1503: Line 667: Argument '1': cannot convert from 'Server.Items.Basehat' to 'Server.Items.Baseweapon' ill help you out on testing if you like - Got Runuo2.0 rev 64 http://xmlspawner.15.forumer.com/ind...?showtopic=580 and currently installed scripts is : -Xmlspawner2 latest -Xmlsockets latest -XmlCustomattacks latest - Custom Vehicles got nothin to lose here- started working on this just a few days ago and the world is empty + since i really want your script badly ill do anything ^^*EDIT1 hope you dont mind if i keep posting in this post so i dont uselessly enlarge your thread just keep it comeing ill test whatever you'll throw at us ![]() Last edited by psycomantis; 07-01-2006 at 09:22 AM. |
|
|
|
|
|
#5 (permalink) |
|
Forum Expert
Join Date: Nov 2004
Location: Beyond the Gates of Hell
Age: 38
Posts: 3,508
|
I still have to do some testing. But fixed the quivers and part of the CBaseRanged. And crap how did I skip the new arrows? Guess need to update again.
__________________
Leader of the Anti-OSI Movement. Inventing a new game experience in an EA Games-free environment. Don Juan Matus "The basic difference between an ordinary man and a warrior is that a warrior takes everything as a challenge, while an ordinary man takes everything as a blessing or as a curse." My Customs:
|
|
|
|
|
|
#7 (permalink) |
|
Forum Expert
Join Date: Nov 2004
Location: Beyond the Gates of Hell
Age: 38
Posts: 3,508
|
Gimme sec......
Checking to see if it compiles........... OK try these updates. The quivers might crash when adding an illegal item. But I'm not sure. I gotta get a few hours sleep before I have to goto a family gathering.
__________________
Leader of the Anti-OSI Movement. Inventing a new game experience in an EA Games-free environment. Don Juan Matus "The basic difference between an ordinary man and a warrior is that a warrior takes everything as a challenge, while an ordinary man takes everything as a blessing or as a curse." My Customs:
|
|
|
|
|
|
#8 (permalink) |
|
Newbie
|
okay well.. there was still a load of files with conversion errors but i listed the fixed ones as attachments
yet after fixing them all i get this again : Code:
Spellbook.cs: CS1502: Line 808: The best oberloaded method match for 'Server.Items.BaseRunicTool.ApplyAttributesTo<Server.Items.Baseweapon, bool, int, int, int, int>' hase some invalid arguments CS1503: Line 808: Argument '1': cannot convert from 'Server.Items.Spellbook to 'Server.Items.Baseweapon' LootPack.cs CS1502: Line 667: The best oberloaded method match for 'Server.Items.BaseRunicTool.ApplyAttributesTo<Server.Items.Baseweapon, bool, int, int, int, int>' hase some invalid arguments CS1503: Line 667: Argument '1': cannot convert from 'Server.Items.Basehat' to 'Server.Items.Baseweapon' *EDIT i got around this error by adding : Code:
using System.Collections.Generic Code:
using System.Collections; now i'm stuck with this :Code:
Errors: + Items/Skill Items/Tools/BaseRunicTool.cs: CS0246: Line 202: The type or namcespace name 'BitArray' could not be found (are you missing a using directive or an assembly reference?) Last edited by psycomantis; 07-01-2006 at 02:43 PM. |
|
|
|
|
|
#9 (permalink) |
|
Forum Novice
Join Date: May 2004
Location: Canada
Age: 36
Posts: 158
|
After Installing this i went from this error
RunUO - [www.runuo.com] Version 2.0, Build 2357.32527 Core: Running on .NET Framework Version 2.0.50727 Scripts: Compiling C# scripts...failed (8 errors, 1 warnings) Warnings: + Items/Custom Script/Custom Commands/ShardInfo.cs: CS0105: Line 13: The using directive for 'Server.Network' appeared previousl y in this namespace Errors: + Items/Custom Script/Custom Wepond/ML_Artifacts_and_Weapons/Artifacts/Craftabl e/FaerieFire.cs: CS0246: Line 6: The type or namespace name 'ElvenCompositeLongbow' could not be found (are you missing a using directive or an assembly reference?) + Items/Custom Script/Custom Wepond/ML_Artifacts_and_Weapons/Artifacts/WildFire Bow.cs: CS0246: Line 7: The type or namespace name 'ElvenCompositeLongbow' could not be found (are you missing a using directive or an assembly reference?) + Items/Custom Script/Custom Wepond/ML_Artifacts_and_Weapons/ML Weapons/Ranged/ Longbow/BarbedLongbow.cs: CS0246: Line 8: The type or namespace name 'ElvenCompositeLongbow' could not be found (are you missing a using directive or an assembly reference?) + Items/Custom Script/Custom Wepond/ML_Artifacts_and_Weapons/ML Weapons/Ranged/ Longbow/FrozenLongbow.cs: CS0246: Line 8: The type or namespace name 'ElvenCompositeLongbow' could not be found (are you missing a using directive or an assembly reference?) + Items/Custom Script/Custom Wepond/ML_Artifacts_and_Weapons/ML Weapons/Ranged/ Longbow/LongbowOfMight.cs: CS0246: Line 8: The type or namespace name 'ElvenCompositeLongbow' could not be found (are you missing a using directive or an assembly reference?) + Items/Custom Script/Custom Wepond/ML_Artifacts_and_Weapons/ML Weapons/Ranged/ Longbow/SlayerLongbow.cs: CS0246: Line 8: The type or namespace name 'ElvenCompositeLongbow' could not be found (are you missing a using directive or an assembly reference?) + Items/Weapons/ML Weapons/Artifacts/BlightGrippedLongbow.cs: CS0246: Line 6: The type or namespace name 'ElvenCompositeLongbow' could not be found (are you missing a using directive or an assembly reference?) + Items/Weapons/ML Weapons/Artifacts/SilvanisFeywoodBow.cs: CS0246: Line 7: The type or namespace name 'ElvenCompositeLongbow' could not be found (are you missing a using directive or an assembly reference?) Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. Then Fixing Thoses Error, I also get these error now, also fixed them now im stuck on these error's ![]() RunUO - [www.runuo.com] Version 2.0, Build 2357.32527 Core: Running on .NET Framework Version 2.0.50727 Scripts: Compiling C# scripts...failed (2 errors, 12 warnings) Warnings: + Items/Custom Script/Custom Commands/ShardInfo.cs: CS0105: Line 13: The using directive for 'Server.Network' appeared previousl y in this namespace + Items/Custom Script/Custom Crafting/Publisher/Publisher/Publisher.cs: CS0108: Line 18: 'Server.Mobiles.Publisher.PlaySound' hides inherited member 'Server.Mobile.PlaySound(int)'. Use the new keyword if hiding was intended. + Items/Custom Script/Custom Quest/VampireQuest/VampQuestItems/Drac Required it ems/DraculasTeleporter.cs: CS0114: Line 21: 'Server.Items.DraculasTeleporter.Location' hides inherited member 'Server.Item.Location'. To make the current member override that implemen tation, add the override keyword. Otherwise add the new keyword. CS0108: Line 28: 'Server.Items.DraculasTeleporter.Map' hides inherited membe r 'Server.Item.Map'. Use the new keyword if hiding was intended. + Tamingmoded scripts/BaseCreature.cs: CS1717: Line 3129: Assignment made to same variable; did you mean to assign something else? + Items/Custom Script/Custom Armor/Other/SkelHelml.cs: CS0162: Line 72: Unreachable code detected + Items/Custom Script/Custom Commands/FindhouseSys.cs: CS0168: Line 137: The variable 'online' is declared but never used + Items/Custom Script/Custom Monster/TrainingElemental/TrainingElemental.cs: CS0429: Line 78: Unreachable expression code detected CS0162: Line 79: Unreachable code detected + Items/Custom Script/Custom Quest/ElainQuest/Mobiles/Andora.cs: CS0219: Line 34: The variable 'hairHue' is assigned but its value is never u sed + Items/Custom Script/Custom Quest/ElainQuest/Mobiles/ErikSullivan.cs: CS0219: Line 35: The variable 'hairHue' is assigned but its value is never u sed + Items/Custom Script/Custom Quest/SpellcrafterQuest/SpellcrafterQuest/Balto.cs : CS0219: Line 31: The variable 'hairHue' is assigned but its value is never u sed + Items/Custom Script/Custom Quest/SpellcrafterQuest/SpellcrafterQuest/Gallin.c s: CS0219: Line 31: The variable 'hairHue' is assigned but its value is never u sed + Items/Custom Script/Custom Quest/SpellcrafterQuest/SpellcrafterQuest/SCAppren .cs: CS0219: Line 49: The variable 'hairHue' is assigned but its value is never u sed Errors: + Items/Skill Items/Magical/Spellbook.cs: CS1502: Line 808: The best overloaded method match for 'Server.Items.BaseRun icTool.ApplyAttributesTo(Server.Items.BaseWeapon, bool, int, int, int, int)' has some invalid arguments CS1503: Line 808: Argument '1': cannot convert from 'Server.Items.Spellbook' to 'Server.Items.BaseWeapon' + Misc/LootPack.cs: CS1502: Line 638: The best overloaded method match for 'Server.Items.BaseRun icTool.ApplyAttributesTo(Server.Items.BaseWeapon, bool, int, int, int, int)' has some invalid arguments CS1503: Line 638: Argument '1': cannot convert from 'Server.Items.BaseHat' t o 'Server.Items.BaseWeapon' Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. |
|
|
|
|
|
#10 (permalink) |
|
Forum Expert
Join Date: Nov 2004
Location: Beyond the Gates of Hell
Age: 38
Posts: 3,508
|
Do you two have some kind of update I don't know about? I don't get these errors.
Update: I just opened the BaseRunicTool.cs form the RC1 package and it is the same one that I provided you with. The only thing I changed was: Code:
if ( weapon is BaseRanged ) Code:
if ( weapon is CBaseRanged )
__________________
Leader of the Anti-OSI Movement. Inventing a new game experience in an EA Games-free environment. Don Juan Matus "The basic difference between an ordinary man and a warrior is that a warrior takes everything as a challenge, while an ordinary man takes everything as a blessing or as a curse." My Customs:
Last edited by Lucid Nagual; 07-01-2006 at 04:31 PM. |
|
|
|
|
|
#12 (permalink) |
|
Forum Expert
Join Date: Nov 2004
Location: Beyond the Gates of Hell
Age: 38
Posts: 3,508
|
OK this is do to some modification in spellbook and lootpack that you two have. This has nothing to do with Advanced Archery. If you post the spellbook and lootpack I can try and look into the reasons why this happened. What system has the spellbook modification that you have?
__________________
Leader of the Anti-OSI Movement. Inventing a new game experience in an EA Games-free environment. Don Juan Matus "The basic difference between an ordinary man and a warrior is that a warrior takes everything as a challenge, while an ordinary man takes everything as a blessing or as a curse." My Customs:
|
|
|
|
|
|
#13 (permalink) |
|
Forum Novice
Join Date: May 2004
Location: Canada
Age: 36
Posts: 158
|
only other system i can think of that i placed in was the spell crafter but i dont think that has anything to do with it or the taming bods, other than that my server is clean of any other scripts that r craftable
but here r the script's u ask for anyhow tks for all ur help ![]() |
|
|
|
|
|
#14 (permalink) |
|
Newbie
|
no dragonlady these 2 specific erros you posted are because your Baserunictool.cs doesnt contain:
Code:
using System.Collections.Generic; i fixed this in the version i posted above -> as a result you will get this error Code:
Errors: Items/Skill Items/Tools/BaseRunicTool.cs: CS0246: Line 206: The type or namespace name 'BitArray' could not be found (are you missing a using directive or an assembly reference? but i couldnt get around this in any way yet but here as wanted my baseranged.cs -wich is basicly same as yours lucid just with the change mentioned above Code:
using System;
using System.Collections.Generic;
namespace Server.Items
{
public abstract class BaseRunicTool : BaseTool
{
private CraftResource m_Resource;
[CommandProperty( AccessLevel.GameMaster )]
public CraftResource Resource
{
get{ return m_Resource; }
set{ m_Resource = value; Hue = CraftResources.GetHue( m_Resource ); InvalidateProperties(); }
}
public BaseRunicTool( CraftResource resource, int itemID ) : base( itemID )
{
m_Resource = resource;
}
public BaseRunicTool( CraftResource resource, int uses, int itemID ) : base( uses, itemID )
{
m_Resource = resource;
}
public BaseRunicTool( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int) m_Resource );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
m_Resource = (CraftResource)reader.ReadInt();
break;
}
}
}
private static bool m_IsRunicTool;
private static int m_LuckChance;
private static int Scale( int min, int max, int low, int high )
{
int percent;
if ( m_IsRunicTool )
{
percent = Utility.RandomMinMax( min, max );
}
else
{
// Behold, the worst system ever!
int v = Utility.RandomMinMax( 0, 10000 );
v = (int) Math.Sqrt( v );
v = 100 - v;
if ( LootPack.CheckLuck( m_LuckChance ) )
v += 10; // TODO: is this right? who knows
if ( v < min )
v = min;
else if ( v > max )
v = max;
percent = v;
}
int scaledBy = Math.Abs( high - low ) + 1;
if ( scaledBy != 0 )
scaledBy = 10000 / scaledBy;
percent *= (10000 + scaledBy);
return low + (((high - low) * percent) / 1000001);
}
private static void ApplyAttribute( AosAttributes attrs, int min, int max, AosAttribute attr, int low, int high )
{
ApplyAttribute( attrs, min, max, attr, low, high, 1 );
}
private static void ApplyAttribute( AosAttributes attrs, int min, int max, AosAttribute attr, int low, int high, int scale )
{
if ( attr == AosAttribute.CastSpeed )
attrs[attr] += Scale( min, max, low / scale, high / scale ) * scale;
else
attrs[attr] = Scale( min, max, low / scale, high / scale ) * scale;
if ( attr == AosAttribute.SpellChanneling )
attrs[AosAttribute.CastSpeed] -= 1;
}
private static void ApplyAttribute( AosArmorAttributes attrs, int min, int max, AosArmorAttribute attr, int low, int high )
{
attrs[attr] = Scale( min, max, low, high );
}
private static void ApplyAttribute( AosArmorAttributes attrs, int min, int max, AosArmorAttribute attr, int low, int high, int scale )
{
attrs[attr] = Scale( min, max, low / scale, high / scale ) * scale;
}
private static void ApplyAttribute( AosWeaponAttributes attrs, int min, int max, AosWeaponAttribute attr, int low, int high )
{
attrs[attr] = Scale( min, max, low, high );
}
private static void ApplyAttribute( AosWeaponAttributes attrs, int min, int max, AosWeaponAttribute attr, int low, int high, int scale )
{
attrs[attr] = Scale( min, max, low / scale, high / scale ) * scale;
}
private static void ApplyAttribute( AosElementAttributes attrs, int min, int max, AosElementAttribute attr, int low, int high )
{
attrs[attr] = Scale( min, max, low, high );
}
private static void ApplyAttribute( AosElementAttributes attrs, int min, int max, AosElementAttribute attr, int low, int high, int scale )
{
attrs[attr] = Scale( min, max, low / scale, high / scale ) * scale;
}
private static SkillName[] m_PossibleBonusSkills = new SkillName[]
{
SkillName.Swords,
SkillName.Fencing,
SkillName.Macing,
SkillName.Archery,
SkillName.Wrestling,
SkillName.Parry,
SkillName.Tactics,
SkillName.Anatomy,
SkillName.Healing,
SkillName.Magery,
SkillName.Meditation,
SkillName.EvalInt,
SkillName.MagicResist,
SkillName.AnimalTaming,
SkillName.AnimalLore,
SkillName.Veterinary,
SkillName.Musicianship,
SkillName.Provocation,
SkillName.Discordance,
SkillName.Peacemaking,
SkillName.Chivalry,
SkillName.Focus,
SkillName.Necromancy,
SkillName.Stealing,
SkillName.Stealth,
SkillName.SpiritSpeak
};
private static void ApplySkillBonus( AosSkillBonuses attrs, int min, int max, int index, int low, int high )
{
SkillName sk, check;
double bonus;
bool found;
do
{
found = false;
sk = m_PossibleBonusSkills[Utility.Random( m_PossibleBonusSkills.Length )];
for ( int i = 0; !found && i < 5; ++i )
found = ( attrs.GetValues( i, out check, out bonus ) && check == sk );
} while ( found );
attrs.SetValues( index, sk, Scale( min, max, low, high ) );
}
private static void ApplyResistance( BaseArmor ar, int min, int max, ResistanceType res, int low, int high )
{
switch ( res )
{
case ResistanceType.Physical: ar.PhysicalBonus += Scale( min, max, low, high ); break;
case ResistanceType.Fire: ar.FireBonus += Scale( min, max, low, high ); break;
case ResistanceType.Cold: ar.ColdBonus += Scale( min, max, low, high ); break;
case ResistanceType.Poison: ar.PoisonBonus += Scale( min, max, low, high ); break;
case ResistanceType.Energy: ar.EnergyBonus += Scale( min, max, low, high ); break;
}
}
private const int MaxProperties = 32;
private static BitArray m_Props = new BitArray( MaxProperties );
private static int[] m_Possible = new int[MaxProperties];
public static int GetUniqueRandom( int count )
{
int avail = 0;
for ( int i = 0; i < count; ++i )
{
if ( !m_Props[i] )
m_Possible[avail++] = i;
}
if ( avail == 0 )
return -1;
int v = m_Possible[Utility.Random( avail )];
m_Props.Set( v, true );
return v;
}
public void ApplyAttributesTo( BaseWeapon weapon )
{
CraftResourceInfo resInfo = CraftResources.GetInfo( m_Resource );
if ( resInfo == null )
return;
CraftAttributeInfo attrs = resInfo.AttributeInfo;
if ( attrs == null )
return;
int attributeCount = Utility.RandomMinMax( attrs.RunicMinAttributes, attrs.RunicMaxAttributes );
int min = attrs.RunicMinIntensity;
int max = attrs.RunicMaxIntensity;
ApplyAttributesTo( weapon, true, 0, attributeCount, min, max );
}
public static void ApplyAttributesTo( BaseWeapon weapon, int attributeCount, int min, int max )
{
ApplyAttributesTo( weapon, false, 0, attributeCount, min, max );
}
public static void ApplyAttributesTo( BaseWeapon weapon, bool isRunicTool, int luckChance, int attributeCount, int min, int max )
{
m_IsRunicTool = isRunicTool;
m_LuckChance = luckChance;
AosAttributes primary = weapon.Attributes;
AosWeaponAttributes secondary = weapon.WeaponAttributes;
m_Props.SetAll( false );
if ( weapon is CBaseRanged )
m_Props.Set( 2, true ); // ranged weapons cannot be ubws or mageweapon
for ( int i = 0; i < attributeCount; ++i )
{
int random = GetUniqueRandom( 24 );
if ( random == -1 )
break;
switch ( random )
{
case 0:
{
switch ( Utility.Random( 5 ) )
{
case 0: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitPhysicalArea,2, 50, 2 ); break;
case 1: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitFireArea, 2, 50, 2 ); break;
case 2: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitColdArea, 2, 50, 2 ); break;
case 3: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitPoisonArea, 2, 50, 2 ); break;
case 4: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitEnergyArea, 2, 50, 2 ); break;
}
break;
}
case 1:
{
switch ( Utility.Random( 4 ) )
{
case 0: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitMagicArrow, 2, 50, 2 ); break;
case 1: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitHarm, 2, 50, 2 ); break;
case 2: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitFireball, 2, 50, 2 ); break;
case 3: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitLightning, 2, 50, 2 ); break;
}
break;
}
case 2:
{
switch ( Utility.Random( 2 ) )
{
case 0: ApplyAttribute( secondary, min, max, AosWeaponAttribute.UseBestSkill, 1, 1 ); break;
case 1: ApplyAttribute( secondary, min, max, AosWeaponAttribute.MageWeapon, 1, 10 ); break;
}
break;
}
case 3: ApplyAttribute( primary, min, max, AosAttribute.WeaponDamage, 1, 50 ); break;
case 4: ApplyAttribute( primary, min, max, AosAttribute.DefendChance, 1, 15 ); break;
case 5: ApplyAttribute( primary, min, max, AosAttribute.CastSpeed, 1, 1 ); break;
case 6: ApplyAttribute( primary, min, max, AosAttribute.AttackChance, 1, 15 ); break;
case 7: ApplyAttribute( primary, min, max, AosAttribute.Luck, 1, 100 ); break;
case 8: ApplyAttribute( primary, min, max, AosAttribute.WeaponSpeed, 5, 30, 5 ); break;
case 9: ApplyAttribute( primary, min, max, AosAttribute.SpellChanneling, 1, 1 ); break;
case 10: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitDispel, 2, 50, 2 ); break;
case 11: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitLeechHits, 2, 50, 2 ); break;
case 12: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitLowerAttack, 2, 50, 2 ); break;
case 13: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitLowerDefend, 2, 50, 2 ); break;
case 14: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitLeechMana, 2, 50, 2 ); break;
case 15: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitLeechStam, 2, 50, 2 ); break;
case 16: ApplyAttribute( secondary, min, max, AosWeaponAttribute.LowerStatReq, 10, 100, 10 ); break;
case 17: ApplyAttribute( secondary, min, max, AosWeaponAttribute.ResistPhysicalBonus, 1, 15 ); break;
case 18: ApplyAttribute( secondary, min, max, AosWeaponAttribute.ResistFireBonus, 1, 15 ); break;
case 19: ApplyAttribute( secondary, min, max, AosWeaponAttribute.ResistColdBonus, 1, 15 ); break;
case 20: ApplyAttribute( secondary, min, max, AosWeaponAttribute.ResistPoisonBonus, 1, 15 ); break;
case 21: ApplyAttribute( secondary, min, max, AosWeaponAttribute.ResistEnergyBonus, 1, 15 ); break;
case 22: ApplyAttribute( secondary, min, max, AosWeaponAttribute.DurabilityBonus, 10, 100, 10 ); break;
case 23: weapon.Slayer = GetRandomSlayer(); break;
}
}
}
public static SlayerName GetRandomSlayer()
{
// TODO: Check random algorithm on OSI
SlayerGroup[] groups = SlayerGroup.Groups;
if ( groups.Length == 0 )
return SlayerName.None;
SlayerGroup group = groups[Utility.Random( groups.Length -1 )]; //-1 To Exclude the Fey Slayer which appears ONLY on a certain artifact.
SlayerEntry entry;
if ( 10 > Utility.Random( 100 ) ) // 10% chance to do super slayer
{
entry = group.Super;
}
else
{
SlayerEntry[] entries = group.Entries;
if ( entries.Length == 0 )
return SlayerName.None;
entry = entries[Utility.Random( entries.Length )];
}
return entry.Name;
}
public void ApplyAttributesTo( BaseArmor armor )
{
CraftResourceInfo resInfo = CraftResources.GetInfo( m_Resource );
if ( resInfo == null )
return;
CraftAttributeInfo attrs = resInfo.AttributeInfo;
if ( attrs == null )
return;
int attributeCount = Utility.RandomMinMax( attrs.RunicMinAttributes, attrs.RunicMaxAttributes );
int min = attrs.RunicMinIntensity;
int max = attrs.RunicMaxIntensity;
ApplyAttributesTo( armor, true, 0, attributeCount, min, max );
}
public static void ApplyAttributesTo( BaseArmor armor, int attributeCount, int min, int max )
{
ApplyAttributesTo( armor, false, 0, attributeCount, min, max );
}
public static void ApplyAttributesTo( BaseArmor armor, bool isRunicTool, int luckChance, int attributeCount, int min, int max )
{
m_IsRunicTool = isRunicTool;
m_LuckChance = luckChance;
AosAttributes primary = armor.Attributes;
AosArmorAttributes secondary = armor.ArmorAttributes;
m_Props.SetAll( false );
bool isShield = ( armor is BaseShield );
int baseCount = ( isShield ? 7 : 20 );
int baseOffset = ( isShield ? 0 : 4 );
if ( !isShield && armor.MeditationAllowance == ArmorMeditationAllowance.All )
m_Props.Set( 3, true ); // remove mage armor from possible properties
for ( int i = 0; i < attributeCount; ++i )
{
int random = GetUniqueRandom( baseCount );
if ( random == -1 )
break;
random += baseOffset;
switch ( random )
{
/* Begin Sheilds */
case 0: ApplyAttribute( primary, min, max, AosAttribute.SpellChanneling, 1, 1 ); break;
case 1: ApplyAttribute( primary, min, max, AosAttribute.DefendChance, 1, 15 ); break;
case 2: ApplyAttribute( primary, min, max, AosAttribute.AttackChance, 1, 15 ); break;
case 3: ApplyAttribute( primary, min, max, AosAttribute.CastSpeed, 1, 1 ); break;
/* Begin Armor */
case 4: ApplyAttribute( secondary, min, max, AosArmorAttribute.LowerStatReq, 10, 100, 10 ); break;
case 5: ApplyAttribute( secondary, min, max, AosArmorAttribute.SelfRepair, 1, 5 ); break;
case 6: ApplyAttribute( secondary, min, max, AosArmorAttribute.DurabilityBonus, 10, 100, 10 ); break;
/* End Shields */
case 7: ApplyAttribute( secondary, min, max, AosArmorAttribute.MageArmor, 1, 1 ); break;
case 8: ApplyAttribute( primary, min, max, AosAttribute.RegenHits, 1, 2 ); break;
case 9: ApplyAttribute( primary, min, max, AosAttribute.RegenStam, 1, 3 ); break;
case 10: ApplyAttribute( primary, min, max, AosAttribute.RegenMana, 1, 2 ); break;
case 11: ApplyAttribute( primary, min, max, AosAttribute.NightSight, 1, 1 ); break;
case 12: ApplyAttribute( primary, min, max, AosAttribute.BonusHits, 1, 5 ); break;
case 13: ApplyAttribute( primary, min, max, AosAttribute.BonusStam, 1, 8 ); break;
case 14: ApplyAttribute( primary, min, max, AosAttribute.BonusMana, 1, 8 ); break;
case 15: ApplyAttribute( primary, min, max, AosAttribute.LowerManaCost, 1, 8 ); break;
case 16: ApplyAttribute( primary, min, max, AosAttribute.LowerRegCost, 1, 20 ); break;
case 17: ApplyAttribute( primary, min, max, AosAttribute.Luck, 1, 100 ); break;
case 18: ApplyAttribute( primary, min, max, AosAttribute.ReflectPhysical, 1, 15 ); break;
case 19: ApplyResistance( armor, min, max, ResistanceType.Physical, 1, 15 ); break;
case 20: ApplyResistance( armor, min, max, ResistanceType.Fire, 1, 15 ); break;
case 21: ApplyResistance( armor, min, max, ResistanceType.Cold, 1, 15 ); break;
case 22: ApplyResistance( armor, min, max, ResistanceType.Poison, 1, 15 ); break;
case 23: ApplyResistance( armor, min, max, ResistanceType.Energy, 1, 15 ); break;
/* End Armor */
}
}
}
public void ApplyAttributesTo( BaseJewel jewelry )
{
CraftResourceInfo resInfo = CraftResources.GetInfo( m_Resource );
if ( resInfo == null )
return;
CraftAttributeInfo attrs = resInfo.AttributeInfo;
if ( attrs == null )
return;
int attributeCount = Utility.RandomMinMax( attrs.RunicMinAttributes, attrs.RunicMaxAttributes );
int min = attrs.RunicMinIntensity;
int max = attrs.RunicMaxIntensity;
ApplyAttributesTo( jewelry, true, 0, attributeCount, min, max );
}
public static void ApplyAttributesTo( BaseJewel jewelry, int attributeCount, int min, int max )
{
ApplyAttributesTo( jewelry, false, 0, attributeCount, min, max );
}
public static void ApplyAttributesTo( BaseJewel jewelry, bool isRunicTool, int luckChance, int attributeCount, int min, int max )
{
m_IsRunicTool = isRunicTool;
m_LuckChance = luckChance;
AosAttributes primary = jewelry.Attributes;
AosElementAttributes resists = jewelry.Resistances;
AosSkillBonuses skills = jewelry.SkillBonuses;
m_Props.SetAll( false );
for ( int i = 0; i < attributeCount; ++i )
{
int random = GetUniqueRandom( 24 );
if ( random == -1 )
break;
switch ( random )
{
case 0: ApplyAttribute( resists, min, max, AosElementAttribute.Physical, 1, 15 ); break;
case 1: ApplyAttribute( resists, min, max, AosElementAttribute.Fire, 1, 15 ); break;
case 2: ApplyAttribute( resists, min, max, AosElementAttribute.Cold, 1, 15 ); break;
case 3: ApplyAttribute( resists, min, max, AosElementAttribute.Poison, 1, 15 ); break;
case 4: ApplyAttribute( resists, min, max, AosElementAttribute.Energy, 1, 15 ); break;
case 5: ApplyAttribute( primary, min, max, AosAttribute.WeaponDamage, 1, 25 ); break;
case 6: ApplyAttribute( primary, min, max, AosAttribute.DefendChance, 1, 15 ); break;
case 7: ApplyAttribute( primary, min, max, AosAttribute.AttackChance, 1, 15 ); break;
case 8: ApplyAttribute( primary, min, max, AosAttribute.BonusStr, 1, 8 ); break;
case 9: ApplyAttribute( primary, min, max, AosAttribute.BonusDex, 1, 8 ); break;
case 10: ApplyAttribute( primary, min, max, AosAttribute.BonusInt, 1, 8 ); break;
case 11: ApplyAttribute( primary, min, max, AosAttribute.EnhancePotions, 5, 25, 5 ); break;
case 12: ApplyAttribute( primary, min, max, AosAttribute.CastSpeed, 1, 1 ); break;
case 13: ApplyAttribute( primary, min, max, AosAttribute.CastRecovery, 1, 3 ); break;
case 14: ApplyAttribute( primary, min, max, AosAttribute.LowerManaCost, 1, 8 ); break;
case 15: ApplyAttribute( primary, min, max, AosAttribute.LowerRegCost, 1, 20 ); break;
case 16: ApplyAttribute( primary, min, max, AosAttribute.Luck, 1, 100 ); break;
case 17: ApplyAttribute( primary, min, max, AosAttribute.SpellDamage, 1, 12 ); break;
case 18: ApplyAttribute( primary, min, max, AosAttribute.NightSight, 1, 1 ); break;
case 19: ApplySkillBonus( skills, min, max, 0, 1, 15 ); break;
case 20: ApplySkillBonus( skills, min, max, 1, 1, 15 ); break;
case 21: ApplySkillBonus( skills, min, max, 2, 1, 15 ); break;
case 22: ApplySkillBonus( skills, min, max, 3, 1, 15 ); break;
case 23: ApplySkillBonus( skills, min, max, 4, 1, 15 ); break;
}
}
}
}
}
|
|
|
|
|
|
#15 (permalink) |
|
Forum Novice
Join Date: May 2004
Location: Canada
Age: 36
Posts: 158
|
ohh yeah stupid me, im a retard lol, well everything work ok but only problem im having is i can't fire any Ranged Wepond i tryed alot of them and none of them fire off but here all the script's zipper up again, in case i need to go to bed and sleep, yeha maybe that's what it is lack of sleep lol sorry about that guys, i just wasn't thinking
![]() |
|
|
|
|
|
#16 (permalink) |
|
Newbie
|
okay my set of files combined with your baserunictool.cs did it dragonlady !
i dont know where the difference between the files is (mine/lucids is much smaller) and im really toooo lazy to look now just be glad it works finally ^^ so basicly if you handle to fix errors you get because of other systems of yours this package now should do it for you aswell (since my system is veeeery basic {6 days old}) but its rev64 (absolutely latest) maybe you wanna get this aswell! hmm for now all left to say is thx for this wonderful scripts lucid - ill get back to you with some results as soon as i got them and it was fun to work with you two lets continue it wish everyone was like this! |
|
|
|
|
|
#19 (permalink) | |
|
Forum Expert
Join Date: Nov 2004
Location: Beyond the Gates of Hell
Age: 38
Posts: 3,508
|
Quote:
Code:
using System;
using System.Collections;
namespace Server.Items
{
public abstract class BaseRunicTool : BaseTool
{
private CraftResource m_Resource;
[CommandProperty( AccessLevel.GameMaster )]
public CraftResource Resource
{
get{ return m_Resource; }
set{ m_Resource = value; Hue = CraftResources.GetHue( m_Resource ); InvalidateProperties(); }
}
public BaseRunicTool( CraftResource resource, int itemID ) : base( itemID )
{
m_Resource = resource;
}
public BaseRunicTool( CraftResource resource, int uses, int itemID ) : base( uses, itemID )
{
m_Resource = resource;
}
public BaseRunicTool( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int) m_Resource );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
m_Resource = (CraftResource)reader.ReadInt();
break;
}
}
}
private static bool m_IsRunicTool;
private static int m_LuckChance;
private static int Scale( int min, int max, int low, int high )
{
int percent;
if ( m_IsRunicTool )
{
percent = Utility.RandomMinMax( min, max );
}
else
{
// Behold, the worst system ever!
int v = Utility.RandomMinMax( 0, 10000 );
v = (int) Math.Sqrt( v );
v = 100 - v;
if ( LootPack.CheckLuck( m_LuckChance ) )
v += 10;
if ( v < min )
v = min;
else if ( v > max )
v = max;
percent = v;
}
int scaledBy = Math.Abs( high - low ) + 1;
if ( scaledBy != 0 )
scaledBy = 10000 / scaledBy;
percent *= (10000 + scaledBy);
return low + (((high - low) * percent) / 1000001);
}
private static void ApplyAttribute( AosAttributes attrs, int min, int max, AosAttribute attr, int low, int high )
{
ApplyAttribute( attrs, min, max, attr, low, high, 1 );
}
private static void ApplyAttribute( AosAttributes attrs, int min, int max, AosAttribute attr, int low, int high, int scale )
{
if ( attr == AosAttribute.CastSpeed )
attrs[attr] += Scale( min, max, low / scale, high / scale ) * scale;
else
attrs[attr] = Scale( min, max, low / scale, high / scale ) * scale;
if ( attr == AosAttribute.SpellChanneling )
attrs[AosAttribute.CastSpeed] -= 1;
}
private static void ApplyAttribute( AosArmorAttributes attrs, int min, int max, AosArmorAttribute attr, int low, int high )
{
attrs[attr] = Scale( min, max, low, high );
}
private static void ApplyAttribute( AosArmorAttributes attrs, int min, int max, AosArmorAttribute attr, int low, int high, int scale )
{
attrs[attr] = Scale( min, max, low / scale, high / scale ) * scale;
}
private static void ApplyAttribute( AosWeaponAttributes attrs, int min, int max, AosWeaponAttribute attr, int low, int high )
{
attrs[attr] = Scale( min, max, low, high );
}
private static void ApplyAttribute( AosWeaponAttributes attrs, int min, int max, AosWeaponAttribute attr, int low, int high, int scale )
{
attrs[attr] = Scale( min, max, low / scale, high / scale ) * scale;
}
private static void ApplyAttribute( AosElementAttributes attrs, int min, int max, AosElementAttribute attr, int low, int high )
{
attrs[attr] = Scale( min, max, low, high );
}
private static void ApplyAttribute( AosElementAttributes attrs, int min, int max, AosElementAttribute attr, int low, int high, int scale )
{
attrs[attr] = Scale( min, max, low / scale, high / scale ) * scale;
}
private static SkillName[] m_PossibleBonusSkills = new SkillName[]
{
SkillName.Swords,
SkillName.Fencing,
SkillName.Macing,
SkillName.Archery,
SkillName.Wrestling,
SkillName.Parry,
SkillName.Tactics,
SkillName.Anatomy,
SkillName.Healing,
SkillName.Magery,
SkillName.Meditation,
SkillName.EvalInt,
SkillName.MagicResist,
SkillName.AnimalTaming,
SkillName.AnimalLore,
SkillName.Veterinary,
SkillName.Musicianship,
SkillName.Provocation,
SkillName.Discordance,
SkillName.Peacemaking,
SkillName.Chivalry,
SkillName.Focus,
SkillName.Necromancy,
SkillName.Stealing,
SkillName.Stealth,
SkillName.SpiritSpeak,
SkillName.Bushido,
SkillName.Ninjitsu
};
private static SkillName[] m_PossibleSpellbookSkills = new SkillName[]
{
SkillName.Magery,
SkillName.Meditation,
SkillName.EvalInt,
SkillName.MagicResist
};
private static void ApplySkillBonus( AosSkillBonuses attrs, int min, int max, int index, int low, int high )
{
SkillName[] possibleSkills = ( attrs.Owner is Spellbook ? m_PossibleSpellbookSkills : m_PossibleBonusSkills );
int count = ( Core.SE ? possibleSkills.Length : possibleSkills.Length - 2 );
SkillName sk, check;
double bonus;
bool found;
do
{
found = false;
sk = possibleSkills[Utility.Random( count )];
for ( int i = 0; !found && i < 5; ++i )
found = ( attrs.GetValues( i, out check, out bonus ) && check == sk );
} while ( found );
attrs.SetValues( index, sk, Scale( min, max, low, high ) );
}
private static void ApplyResistance( BaseArmor ar, int min, int max, ResistanceType res, int low, int high )
{
switch ( res )
{
case ResistanceType.Physical: ar.PhysicalBonus += Scale( min, max, low, high ); break;
case ResistanceType.Fire: ar.FireBonus += Scale( min, max, low, high ); break;
case ResistanceType.Cold: ar.ColdBonus += Scale( min, max, low, high ); break;
case ResistanceType.Poison: ar.PoisonBonus += Scale( min, max, low, high ); break;
case ResistanceType.Energy: ar.EnergyBonus += Scale( min, max, low, high ); break;
}
}
private const int MaxProperties = 32;
private static BitArray m_Props = new BitArray( MaxProperties );
private static int[] m_Possible = new int[MaxProperties];
public static int GetUniqueRandom( int count )
{
int avail = 0;
for ( int i = 0; i < count; ++i )
{
if ( !m_Props[i] )
m_Possible[avail++] = i;
}
if ( avail == 0 )
return -1;
int v = m_Possible[Utility.Random( avail )];
m_Props.Set( v, true );
return v;
}
public void ApplyAttributesTo( BaseWeapon weapon )
{
CraftResourceInfo resInfo = CraftResources.GetInfo( m_Resource );
if ( resInfo == null )
return;
CraftAttributeInfo attrs = resInfo.AttributeInfo;
if ( attrs == null )
return;
int attributeCount = Utility.RandomMinMax( attrs.RunicMinAttributes, attrs.RunicMaxAttributes );
int min = attrs.RunicMinIntensity;
int max = attrs.RunicMaxIntensity;
ApplyAttributesTo( weapon, true, 0, attributeCount, min, max );
}
public static void ApplyAttributesTo( BaseWeapon weapon, int attributeCount, int min, int max )
{
ApplyAttributesTo( weapon, false, 0, attributeCount, min, max );
}
public static void ApplyAttributesTo( BaseWeapon weapon, bool isRunicTool, int luckChance, int attributeCount, int min, int max )
{
m_IsRunicTool = isRunicTool;
m_LuckChance = luckChance;
AosAttributes primary = weapon.Attributes;
AosWeaponAttributes secondary = weapon.WeaponAttributes;
m_Props.SetAll( false );
if ( weapon is CBaseRanged )
m_Props.Set( 2, true ); // ranged weapons cannot be ubws or mageweapon
for ( int i = 0; i < attributeCount; ++i )
{
int random = GetUniqueRandom( 25 );
if ( random == -1 )
break;
switch ( random )
{
case 0:
{
switch ( Utility.Random( 5 ) )
{
case 0: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitPhysicalArea,2, 50, 2 ); break;
case 1: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitFireArea, 2, 50, 2 ); break;
case 2: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitColdArea, 2, 50, 2 ); break;
case 3: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitPoisonArea, 2, 50, 2 ); break;
case 4: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitEnergyArea, 2, 50, 2 ); break;
}
break;
}
case 1:
{
switch ( Utility.Random( 4 ) )
{
case 0: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitMagicArrow, 2, 50, 2 ); break;
case 1: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitHarm, 2, 50, 2 ); break;
case 2: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitFireball, 2, 50, 2 ); break;
case 3: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitLightning, 2, 50, 2 ); break;
}
break;
}
case 2:
{
switch ( Utility.Random( 2 ) )
{
case 0: ApplyAttribute( secondary, min, max, AosWeaponAttribute.UseBestSkill, 1, 1 ); break;
case 1: ApplyAttribute( secondary, min, max, AosWeaponAttribute.MageWeapon, 1, 10 ); break;
}
break;
}
case 3: ApplyAttribute( primary, min, max, AosAttribute.WeaponDamage, 1, 50 ); break;
case 4: ApplyAttribute( primary, min, max, AosAttribute.DefendChance, 1, 15 ); break;
case 5: ApplyAttribute( primary, min, max, AosAttribute.CastSpeed, 1, 1 ); break;
case 6: ApplyAttribute( primary, min, max, AosAttribute.AttackChance, 1, 15 ); break;
case 7: ApplyAttribute( primary, min, max, AosAttribute.Luck, 1, 100 ); break;
case 8: ApplyAttribute( primary, min, max, AosAttribute.WeaponSpeed, 5, 30, 5 ); break;
case 9: ApplyAttribute( primary, min, max, AosAttribute.SpellChanneling, 1, 1 ); break;
case 10: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitDispel, 2, 50, 2 ); break;
case 11: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitLeechHits, 2, 50, 2 ); break;
case 12: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitLowerAttack, 2, 50, 2 ); break;
case 13: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitLowerDefend, 2, 50, 2 ); break;
case 14: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitLeechMana, 2, 50, 2 ); break;
case 15: ApplyAttribute( secondary, min, max, AosWeaponAttribute.HitLeechStam, 2, 50, 2 ); break;
case 16: ApplyAttribute( secondary, min, max, AosWeaponAttribute.LowerStatReq, 10, 100, 10 ); break;
case 17: ApplyAttribute( secondary, min, max, AosWeaponAttribute.ResistPhysicalBonus, 1, 15 ); break;
case 18: ApplyAttribute( secondary, min, max, AosWeaponAttribute.ResistFireBonus, 1, 15 ); break;
case 19: ApplyAttribute( secondary, min, max, AosWeaponAttribute.ResistColdBonus, 1, 15 ); break;
case 20: ApplyAttribute( secondary, min, max, AosWeaponAttribute.ResistPoisonBonus, 1, 15 ); break;
case 21: ApplyAttribute( secondary, min, max, AosWeaponAttribute.ResistEnergyBonus, 1, 15 ); break;
case 22: ApplyAttribute( secondary, min, max, AosWeaponAttribute.DurabilityBonus, 10, 100, 10 ); break;
case 23: weapon.Slayer = GetRandomSlayer(); break;
case 24: GetElementalDamages( weapon ); break;
}
}
}
public static void GetElementalDamages( BaseWeapon weapon )
{
GetElementalDamages( weapon, true );
}
public static void GetElementalDamages( BaseWeapon weapon, bool randomizeOrder )
{
int fire, phys, cold, nrgy, pois;
weapon.GetDamageTypes( null, out phys, out fire, out cold, out pois, out nrgy );
int totalDamage = phys;
AosElementAttribute[] attrs = new AosElementAttribute[]
{
AosElementAttribute.Cold,
AosElementAttribute.Energy,
AosElementAttribute.Fire,
AosElementAttribute.Poison
};
if( randomizeOrder )
{
for( int i = 0; i < attrs.Length; i++ )
{
int rand = Utility.Random( attrs.Length );
AosElementAttribute temp = attrs[i];
attrs[i] = attrs[rand];
attrs[rand] = temp;
}
}
/*
totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Cold, totalDamage );
totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Energy, totalDamage );
totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Fire, totalDamage );
totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Poison, totalDamage );
weapon.AosElementDamages[AosElementAttribute.Physical] = 100 - totalDamage;
* */
for( int i = 0; i < attrs.Length; i++ )
totalDamage = AssignElementalDamage( weapon, attrs[i], totalDamage );
//Order is Cold, Energy, Fire, Poison -> Physical left
//Cannot be looped, AoselementAttribute is 'out of order'
weapon.Hue = weapon.GetElementalDamageHue();
}
private static int AssignElementalDamage( BaseWeapon weapon, AosElementAttribute attr, int totalDamage )
{
if( totalDamage <= 0 )
return 0;
int random = Utility.Random( (int)(totalDamage/10) + 1 ) * 10;
weapon.AosElementDamages[attr] = random;
return (totalDamage - random);
}
public static SlayerName GetRandomSlayer()
{
// TODO: Check random algorithm on OSI
SlayerGroup[] groups = SlayerGroup.Groups;
if ( groups.Length == 0 )
return SlayerName.None;
SlayerGroup group = groups[Utility.Random( groups.Length -1 )]; //-1 To Exclude the Fey Slayer which appears ONLY on a certain artifact.
SlayerEntry entry;
if ( 10 > Utility.Random( 100 ) ) // 10% chance to do super slayer
{
entry = group.Super;
}
else
{
SlayerEntry[] entries = group.Entries;
if ( entries.Length == 0 )
return SlayerName.None;
entry = entries[Utility.Random( entries.Length )];
}
return entry.Name;
}
public void ApplyAttributesTo( BaseArmor armor )
{
CraftResourceInfo resInfo = CraftResources.GetInfo( m_Resource );
if ( resInfo == null )
return;
CraftAttributeInfo attrs = resInfo.AttributeInfo;
if ( attrs == null )
return;
int attributeCount = Utility.RandomMinMax( attrs.RunicMinAttributes, attrs.RunicMaxAttributes );
int min = attrs.RunicMinIntensity;
int max = attrs.RunicMaxIntensity;
ApplyAttributesTo( armor, true, 0, attributeCount, min, max );
}
public static void ApplyAttributesTo( BaseArmor armor, int attributeCount, int min, int max )
{
ApplyAttributesTo( armor, false, 0, attributeCount, min, max );
}
public static void ApplyAttributesTo( BaseArmor armor, bool isRunicTool, int luckChance, int attributeCount, int min, int max )
{
m_IsRunicTool = isRunicTool;
m_LuckChance = luckChance;
AosAttributes primary = armor.Attributes;
AosArmorAttributes secondary = armor.ArmorAttributes;
m_Props.SetAll( false );
bool isShield = ( armor is BaseShield );
int baseCount = ( isShield ? 7 : 20 );
int baseOffset = ( isShield ? 0 : 4 );
if ( !isShield && armor.MeditationAllowance == ArmorMeditationAllowance.All )
m_Props.Set( 3, true ); // remove mage armor from possible properties
for ( int i = 0; i < attributeCount; ++i )
{
int random = GetUniqueRandom( baseCount );
if ( random == -1 )
break;
random += baseOffset;
switch ( random )
{
/* Begin Sheilds */
case 0: ApplyAttribute( primary, min, max, AosAttribute.SpellChanneling, 1, 1 ); break;
case 1: ApplyAttribute( primary, min, max, AosAttribute.DefendChance, 1, 15 ); break;
case 2: ApplyAttribute( primary, min, max, AosAttribute.AttackChance, 1, 15 ); break;
case 3: ApplyAttribute( primary, min, max, AosAttribute.CastSpeed, 1, 1 ); break;
/* Begin Armor */
case 4: ApplyAttribute( secondary, min, max, AosArmorAttribute.LowerStatReq, 10, 100, 10 ); break;
case 5: ApplyAttribute( secondary, min, max, AosArmorAttribute.SelfRepair, 1, 5 ); break;
case 6: ApplyAttribute( secondary, min, max, AosArmorAttribute.DurabilityBonus, 10, 100, 10 ); break;
/* End Shields */
case 7: ApplyAttribute( secondary, min, max, AosArmorAttribute.MageArmor, 1, 1 ); break;
case 8: ApplyAttribute( primary, min, max, AosAttribute.RegenHits, 1, 2 ); break;
case 9: ApplyAttribute( primary, min, max, AosAttribute.RegenStam, 1, 3 ); break;
case 10: ApplyAttribute( primary, min, max, AosAttribute.RegenMana, 1, 2 ); break;
case 11: ApplyAttribute( primary, min, max, AosAttribute.NightSight, 1, 1 ); break;
case 12: ApplyAttribute( primary, min, max, AosAttribute.BonusHits, 1, 5 ); break;
case 13: ApplyAttribute( primary, min, max, AosAttribute.BonusStam, 1, 8 ); break;
case 14: ApplyAttribute( primary, min, max, AosAttribute.BonusMana, 1, 8 ); break;
case 15: ApplyAttribute( primary, min, max, AosAttribute.LowerManaCost, 1, 8 ); break;
case 16: ApplyAttribute( primary, min, max, AosAttribute.LowerRegCost, 1, 20 ); break;
case 17: ApplyAttribute( primary, min, max, AosAttribute.Luck, 1, 100 ); break;
case 18: ApplyAttribute( primary, min, max, AosAttribute.ReflectPhysical, 1, 15 ); break;
case 19: ApplyResistance( armor, min, max, ResistanceType.Physical, 1, 15 ); break;
case 20: ApplyResistance( armor, min, max, ResistanceType.Fire, 1, 15 ); break;
case 21: ApplyResistance( armor, min, max, ResistanceType.Cold, 1, 15 ); break;
case 22: ApplyResistance( armor, min, max, ResistanceType.Poison, 1, 15 ); break;
case 23: ApplyResistance( armor, min, max, ResistanceType.Energy, 1, 15 ); break;
/* End Armor */
}
}
}
public static void ApplyAttributesTo( BaseHat hat, int attributeCount, int min, int max )
{
ApplyAttributesTo( hat, false, 0, attributeCount, min, max );
}
public static void ApplyAttributesTo( BaseHat hat, bool isRunicTool, int luckChance, int attributeCount, int min, int max )
{
m_IsRunicTool = isRunicTool;
m_LuckChance = luckChance;
AosAttributes primary = hat.Attributes;
AosArmorAttributes secondary = hat.ClothingAttributes;
AosElementAttributes resists = hat.Resistances;
m_Props.SetAll( false );
for ( int i = 0; i < attributeCount; ++i )
{
int random = GetUniqueRandom( 19 );
if ( random == -1 )
break;
switch ( random )
{
case 0: ApplyAttribute( primary, min, max, AosAttribute.ReflectPhysical, 1, 15 ); break;
case 1: ApplyAttribute( primary, min, max, AosAttribute.RegenHits, 1, 2 ); break;
case 2: ApplyAttribute( primary, min, max, AosAttribute.RegenStam, 1, 3 ); break;
case 3: ApplyAttribute( primary, min, max, AosAttribute.RegenMana, 1, 2 ); break;
case 4: ApplyAttribute( primary, min, max, AosAttribute.NightSight, 1, 1 ); break;
case 5: ApplyAttribute( primary, min, max, AosAttribute.BonusHits, 1, 5 ); break;
case 6: ApplyAttribute( primary, min, max, AosAttribute.BonusStam, 1, 8 ); break;
case 7: ApplyAttribute( primary, min, max, AosAttribute.BonusMana, 1, 8 ); break;
case 8: ApplyAttribute( primary, min, max, AosAttribute.LowerManaCost, 1, 8 ); break;
case 9: ApplyAttribute( primary, min, max, AosAttribute.LowerRegCost, 1, 20 ); break;
case 10: ApplyAttribute( primary, min, max, AosAttribute.Luck, 1, 100 ); break;
case 11: ApplyAttribute( secondary, min, max, AosArmorAttribute.LowerStatReq, 10, 100, 10 ); break;
case 12: ApplyAttribute( secondary, min, max, AosArmorAttribute.SelfRepair, 1, 5 ); break;
case 13: ApplyAttribute( secondary, min, max, AosArmorAttribute.DurabilityBonus, 10, 100, 10 ); break;
case 14: ApplyAttribute( resists, min, max, AosElementAttribute.Physical, 1, 15 ); break;
case 15: ApplyAttribute( resists, min, max, AosElementAttribute.Fire, 1, 15 ); break;
case 16: ApplyAttribute( resists, min, max, AosElementAttribute.Cold, 1, 15 ); break;
case 17: ApplyAttribute( resists, min, max, AosElementAttribute.Poison, 1, 15 ); break;
case 18: ApplyAttribute( resists, min, max, AosElementAttribute.Energy, 1, 15 ); break;
}
}
}
public static void ApplyAttributesTo( BaseJewel jewelry, int attributeCount, int min, int max )
{
ApplyAttributesTo( jewelry, false, 0, attributeCount, min, max );
}
public static void ApplyAttributesTo( BaseJewel jewelry, bool isRunicTool, int luckChance, int attributeCount, int min, int max )
{
m_IsRunicTool = isRunicTool;
m_LuckChance = luckChance;
AosAttributes primary = jewelry.Attributes;
AosElementAttributes resists = jewelry.Resistances;
AosSkillBonuses skills = jewelry.SkillBonuses;
m_Props.SetAll( false );
for ( int i = 0; i < attributeCount; ++i )
{
int random = GetUniqueRandom( 24 );
if ( random == -1 )
break;
switch ( random )
{
case 0: ApplyAttribute( resists, min, max, AosElementAttribute.Physical, 1, 15 ); break;
case 1: ApplyAttribute( resists, min, max, AosElementAttribute.Fire, 1, 15 ); break;
case 2: ApplyAttribute( resists, min, max, AosElementAttribute.Cold, 1, 15 ); break;
case 3: ApplyAttribute( resists, min, max, AosElementAttribute.Poison, 1, 15 ); break;
case 4: ApplyAttribute( resists, min, max, AosElementAttribute.Energy, 1, 15 ); break;
case 5: ApplyAttribute( primary, min, max, AosAttribute.WeaponDamage, 1, 25 ); break;
case 6: ApplyAttribute( primary, min, max, AosAttribute.DefendChance, 1, 15 ); break;
case 7: ApplyAttribute( primary, min, max, AosAttribute.AttackChance, 1, 15 ); break;
case 8: ApplyAttribute( primary, min, max, AosAttribute.BonusStr, 1, 8 ); break;
case 9: ApplyAttribute( primary, min, max, AosAttribute.BonusDex, 1, 8 ); break;
case 10: ApplyAttribute( primary, min, max, AosAttribute.BonusInt, 1, 8 ); break;
case 11: ApplyAttribute( primary, min, max, AosAttribute.EnhancePotions, 5, 25, 5 ); break;
case 12: ApplyAttribute( primary, min, max, AosAttribute.CastSpeed, 1, 1 ); break;
case 13: ApplyAttribute( primary, min, max, AosAttribute.CastRecovery, 1, 3 ); break;
case 14: ApplyAttribute( primary, min, max, AosAttribute.LowerManaCost, 1, 8 ); break;
case 15: ApplyAttribute( primary, min, max, AosAttribute.LowerRegCost, 1, 20 ); break;
case 16: ApplyAttribute( primary, min, max, AosAttribute.Luck, 1, 100 ); break;
case 17: ApplyAttribute( primary, min, max, AosAttribute.SpellDamage, 1, 12 ); break;
case 18: ApplyAttribute( primary, min, max, AosAttribute.NightSight, 1, 1 ); break;
case 19: ApplySkillBonus( skills, min, max, 0, 1, 15 ); break;
case 20: ApplySkillBonus( skills, min, max, 1, 1, 15 ); break;
case 21: ApplySkillBonus( skills, min, max, 2, 1, 15 ); break;
case 22: ApplySkillBonus( skills, min, max, 3, 1, 15 ); break;
case 23: ApplySkillBonus( skills, min, max, 4, 1, 15 ); break;
}
}
}
public static void ApplyAttributesTo( Spellbook spellbook, int attributeCount, int min, int max )
{
ApplyAttributesTo( spellbook, false, 0, attributeCount, min, max );
}
public static void ApplyAttributesTo( Spellbook spellbook, bool isRunicTool, int luckChance, int attributeCount, int min, int max )
{
m_IsRunicTool = isRunicTool;
m_LuckChance = luckChance;
AosAttributes primary = spellbook.Attributes;
AosSkillBonuses skills = spellbook.SkillBonuses;
m_Props.SetAll( false );
for ( int i = 0; i < attributeCount; ++i )
{
int random = GetUniqueRandom( 16 );
if ( random == -1 )
break;
switch ( random )
{
case 0:
case 1:
case 2:
case 3:
{
ApplyAttribute( primary, min, max, AosAttribute.BonusInt, 1, 8 );
for ( int j = 0; j < 4; ++j )
m_Props.Set( j, true );
break;
}
case 4: ApplyAttribute( primary, min, max, AosAttribute.BonusMana, 1, 8 ); break;
case 5: ApplyAttribute( primary, min, max, AosAttribute.CastSpeed, 1, 1 ); break;
case 6: ApplyAttribute( primary, min, max, AosAttribute.CastRecovery, 1, 3 ); break;
case 7: ApplyAttribute( primary, min, max, AosAttribute.SpellDamage, 1, 12 ); break;
case 8: ApplySkillBonus( skills, min, max, 0, 1, 15 ); break;
case 9: ApplySkillBonus( skills, min, max, 1, 1, 15 ); break;
case 10: ApplySkillBonus( skills, min, max, 2, 1, 15 ); break;
case 11: ApplySkillBonus( skills, min, max, 3, 1, 15 ); break;
case 12: ApplyAttribute( primary, min, max, AosAttribute.LowerRegCost, 1, 20 ); break;
case 13: ApplyAttribute( primary, min, max, AosAttribute.LowerManaCost, 1, 8 ); break;
case 14: ApplyAttribute( primary, min, max, AosAttribute.RegenMana, 1, 2 ); break;
case 15: spellbook.Slayer = GetRandomSlayer(); break;
}
}
}
}
}
__________________
Leader of the Anti-OSI Movement. Inventing a new game experience in an EA Games-free environment. Don Juan Matus "The basic difference between an ordinary man and a warrior is that a warrior takes everything as a challenge, while an ordinary man takes everything as a blessing or as a curse." My Customs:
|
|
|
|
|
|
|
#20 (permalink) |
|
Newbie
|
hmm yea the text you quoted from me really diddnt solve anything... still it was dragonladys baserunictool.cs that made it work for me.. compare the one in the 2.0 package to yours -> has like 6k difference in size (wich i honestly do not know where they come from and was too lazy to look yet)
... anyways i am going to change your scripts to actually also hue the fired arrows (atleast gonna try) maybe wanna work on this togehter ? |
|
|
|
|
|
#21 (permalink) |
|
Lurker
Join Date: Jun 2006
Location: Maine,USA
Age: 45
Posts: 18
|
Got my copy working just fine with help from the diptub changes which psycomantis made. For which I was close to fixing but he beat me to it (never thought to change the static to override) that did the trick for me and been tweeking it a little since, with a blowgun and darts for weapon and ammo still working on it, but, so far my son likes it..
btw Lucid awsome job on the script and thnkx to psycomanis for his input |
|
|
|
|
|
#22 (permalink) |
|
Newbie
|
well im just setting up (my first) system.. want it to be Sci Fi thats why i update/help updating a lot recently.. at this point ill give you this link people.. feel free to contribute in any way
![]() my link collection/trading post |
|
|
|
|
|
#23 (permalink) | |
|
Forum Expert
Join Date: Nov 2004
Location: Beyond the Gates of Hell
Age: 38
Posts: 3,508
|
Quote:
__________________
Leader of the Anti-OSI Movement. Inventing a new game experience in an EA Games-free environment. Don Juan Matus "The basic difference between an ordinary man and a warrior is that a warrior takes everything as a challenge, while an ordinary man takes everything as a blessing or as a curse." My Customs:
|
|
|
|
|
|
|
#24 (permalink) | |
|
Forum Expert
Join Date: Nov 2004
Location: Beyond the Gates of Hell
Age: 38
Posts: 3,508
|
Quote:
__________________
Leader of the Anti-OSI Movement. Inventing a new game experience in an EA Games-free environment. Don Juan Matus "The basic difference between an ordinary man and a warrior is that a warrior takes everything as a challenge, while an ordinary man takes everything as a blessing or as a curse." My Customs:
|
|
|
|
|
|
|
#25 (permalink) |
|
Forum Novice
Join Date: May 2004
Location: Canada
Age: 36
Posts: 158
|
i tryed adding bolt's to the quiver and got this crash
Server Crash Report =================== RunUO Version 2.0, Build 2357.32527 Operating System: Microsoft Windows NT 5.1.2600 Service Pack 2 .NET Framework: 2.0.50727.42 Time: 7/1/2006 11:19:27 PM Mobiles: 3120 Items: 107159 Clients: - Count: 2 + 69.195.85.205: (account = xxxx) (mobile = 0x4 'Lara Croft') + 70.54.52.160: (account = xxxx) (mobile = 0xB72 'Ultra Light') Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Server.Items.BaseQuiver.CheckItem(Item item) at Server.Items.BaseQuiver.OnDragDropInto(Mobile from, Item item, Point3D p) at Server.Item.OnDroppedInto(Mobile from, Container target, Point3D p) at Server.Item.DropToItem(Mobile from, Item target, Point3D p) at Server.Mobile.Drop(Item to, Point3D loc) at Server.Network.PacketHandlers.DropReq(NetState state, PacketReader pvSrc) at Server.Network.MessagePump.HandleReceive(NetState ns) at Server.Network.MessagePump.Slice() at Server.Core.Main(String[] args) |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|