|
||
|
|||||||
| Server Support on Windows Get (and give) support on general questions related to the RunUO server itself. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#2 (permalink) | |
|
Master of the Internet
Join Date: Aug 2003
Posts: 5,688
|
Quote:
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. " For questions, information, and support for XmlSpawner and its addons, visit the XmlSpawner Support Forum |
|
|
|
|
|
|
#3 (permalink) |
|
Forum Expert
Join Date: May 2005
Age: 23
Posts: 274
|
here is the script from this one i get 300k in champ i want it to 100k i am not shure where to change it would anyone know?
Code:
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Engines.CannedEvil;
namespace Server.Mobiles
{
public abstract class BaseChampion : BaseCreature
{
public BaseChampion( AIType aiType ) : this( aiType, FightMode.Closest )
{
}
public BaseChampion( AIType aiType, FightMode mode ) : base( aiType, mode, 18, 1, 0.1, 0.2 )
{
}
public BaseChampion( Serial serial ) : base( serial )
{
}
public abstract ChampionSkullType SkullType{ get; }
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
public void GivePowerScrolls()
{
if ( Map != Map.Felucca )
return;
ArrayList toGive = new ArrayList();
ArrayList rights = BaseCreature.GetLootingRights( this.DamageEntries, this.HitsMax );
for ( int i = rights.Count - 1; i >= 0; --i )
{
DamageStore ds = (DamageStore)rights[i];
if ( ds.m_HasRight )
toGive.Add( ds.m_Mobile );
}
if ( toGive.Count == 0 )
return;
// Randomize
for ( int i = 0; i < toGive.Count; ++i )
{
int rand = Utility.Random( toGive.Count );
object hold = toGive[i];
toGive[i] = toGive[rand];
toGive[rand] = hold;
}
for ( int i = 0; i < 6; ++i )
{
int level;
double random = Utility.RandomDouble();
if ( 0.1 >= random )
level = 20;
else if ( 0.4 >= random )
level = 15;
else
level = 10;
Mobile m = (Mobile)toGive[i % toGive.Count];
PowerScroll ps = PowerScroll.CreateRandomNoCraft( level, level );
m.SendLocalizedMessage( 1049524 ); // You have received a scroll of power!
m.AddToBackpack( ps );
if ( m is PlayerMobile )
{
PlayerMobile pm = (PlayerMobile)m;
for ( int j = 0; j < pm.JusticeProtectors.Count; ++j )
{
Mobile prot = (Mobile)pm.JusticeProtectors[j];
if ( prot.Map != m.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion( m, prot ) )
continue;
int chance = 0;
switch ( VirtueHelper.GetLevel( prot, VirtueName.Justice ) )
{
case VirtueLevel.Seeker: chance = 60; break;
case VirtueLevel.Follower: chance = 80; break;
case VirtueLevel.Knight: chance = 100; break;
}
if ( chance > Utility.Random( 100 ) )
{
prot.SendLocalizedMessage( 1049368 ); // You have been rewarded for your dedication to Justice!
prot.AddToBackpack( new PowerScroll( ps.Skill, ps.Value ) );
}
}
}
}
}
public override bool OnBeforeDeath()
{
if ( !NoKillAwards )
{
GivePowerScrolls();
Map map = this.Map;
if ( map != null )
{
for ( int x = -12; x <= 12; ++x )
{
for ( int y = -12; y <= 12; ++y )
{
double dist = Math.Sqrt(x*x+y*y);
if ( dist <= 12 )
new GoodiesTimer( map, X + x, Y + y ).Start();
}
}
}
}
return base.OnBeforeDeath();
}
public override void OnDeath( Container c )
{
if ( Map == Map.Felucca )
c.DropItem( new ChampionSkull( SkullType ) );
base.OnDeath( c );
}
private class GoodiesTimer : Timer
{
private Map m_Map;
private int m_X, m_Y;
public GoodiesTimer( Map map, int x, int y ) : base( TimeSpan.FromSeconds( Utility.RandomDouble() * 10.0 ) )
{
m_Map = map;
m_X = x;
m_Y = y;
}
protected override void OnTick()
{
int z = m_Map.GetAverageZ( m_X, m_Y );
bool canFit = m_Map.CanFit( m_X, m_Y, z, 6, false, false );
for ( int i = -3; !canFit && i <= 3; ++i )
{
canFit = m_Map.CanFit( m_X, m_Y, z + i, 6, false, false );
if ( canFit )
z += i;
}
if ( !canFit )
return;
Gold g = new Gold( 500, 1000 );
g.MoveToWorld( new Point3D( m_X, m_Y, z ), m_Map );
if ( 0.5 >= Utility.RandomDouble() )
{
switch ( Utility.Random( 3 ) )
{
case 0: // Fire column
{
Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x3709, 10, 30, 5052 );
Effects.PlaySound( g, g.Map, 0x208 );
break;
}
case 1: // Explosion
{
Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x36BD, 20, 10, 5044 );
Effects.PlaySound( g, g.Map, 0x307 );
break;
}
case 2: // Ball of fire
{
Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x36FE, 10, 10, 5052 );
break;
}
}
}
}
}
}
}
|
|
|
|
|
|
#6 (permalink) |
|
Join Date: Jan 2005
Age: 25
Posts: 219
|
The "Heap" is your entire script. He, and pretty much anyone else who is willing to help you, will always want you to put your scripts in code tags. Below is the propper way to put a script in code tags...
[c ode] Enter Script Here. [/code] Do that, except without puttig a space between the o and the c in the first word code, and you'll find help much easier to get. |
|
|
|
|
|
#13 (permalink) | |
|
Quote:
|
||
|
|
|
|
|
#15 (permalink) |
|
Code:
public override void OnDeath( Container c )
{
if ( Map == Map.Felucca )
c.DropItem( new ChampionSkull( SkullType ) );
base.OnDeath( c );
}
private class GoodiesTimer : Timer
{
private Map m_Map;
private int m_X, m_Y;
public GoodiesTimer( Map map, int x, int y ) : base( TimeSpan.FromSeconds( Utility.RandomDouble() * 10.0 ) )
{
m_Map = map;
m_X = x;
m_Y = y;
}
protected override void OnTick()
{
int z = m_Map.GetAverageZ( m_X, m_Y );
bool canFit = m_Map.CanFit( m_X, m_Y, z, 6, false, false );
for ( int i = -3; !canFit && i <= 3; ++i )
{
canFit = m_Map.CanFit( m_X, m_Y, z + i, 6, false, false );
if ( canFit )
z += i;
}
if ( !canFit )
return;
Gold g = new Gold( 500, 1000 ); <---- This is the amount of gold per pile that hits the ground on death. Its saying that its going to drop anywhere from 500 to 1000 gold per pile.
g.MoveToWorld( new Point3D( m_X, m_Y, z ), m_Map );
if ( 0.5 >= Utility.RandomDouble() )
{
switch ( Utility.Random( 3 ) )
{
case 0: // Fire column
{
Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x3709, 10, 30, 5052 );
Effects.PlaySound( g, g.Map, 0x208 );
break;
}
case 1: // Explosion
{
Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x36BD, 20, 10, 5044 );
Effects.PlaySound( g, g.Map, 0x307 );
break;
}
case 2: // Ball of fire
{
Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x36FE, 10, 10, 5052 );
break;
}
}
}
}
}
}
}
Code:
public Barracoon() : base( AIType.AI_Melee )
{
Name = "Barracoon";
Title = "the piper";
Body = 0x190;
Hue = 0x83EC;
SetStr( 305, 425 );
SetDex( 72, 150 );
SetInt( 505, 750 );
SetHits( 4200 );
SetStam( 102, 300 );
SetDamage( 25, 35 );
SetDamageType( ResistanceType.Physical, 100 );
SetResistance( ResistanceType.Physical, 60, 70 );
SetResistance( ResistanceType.Fire, 50, 60 );
SetResistance( ResistanceType.Cold, 50, 60 );
SetResistance( ResistanceType.Poison, 40, 50 );
SetResistance( ResistanceType.Energy, 40, 50 );
SetSkill( SkillName.MagicResist, 100.0 );
SetSkill( SkillName.Tactics, 97.6, 100.0 );
SetSkill( SkillName.Wrestling, 97.6, 100.0 );
Fame = 22500;
Karma = -22500;
VirtualArmor = 70;
AddItem( new FancyShirt( Utility.RandomGreenHue() ) );
AddItem( new LongPants( Utility.RandomYellowHue() ) );
AddItem( new JesterHat( Utility.RandomPinkHue() ) );
AddItem( new Cloak( Utility.RandomPinkHue() ) );
AddItem( new Sandals() );
AddItem( new ShortHair( 148 ) );
}
public override void GenerateLoot() <-----
{
AddLoot( LootPack.UltraRich, 4 ); <-----
AddLoot( LootPack.FilthyRich ); <-----
}
Code:
#region AOS definitions
public static readonly LootPack AosPoor = new LootPack( new LootPackEntry[]// 10+10 = 20
{
new LootPackEntry( true, Gold, 100.00, "1d10+10" ),
new LootPackEntry( false, MagicItems, 0.02, 1, 5, 0, 90 ),
new LootPackEntry( false, Instruments, 0.02, 1 )
} );
public static readonly LootPack AosMeager = new LootPack( new LootPackEntry[]// 30+20 = 50
{
new LootPackEntry( true, Gold, 100.00, "3d10+20" ),
new LootPackEntry( false, MagicItems, 1.00, 1, 2, 0, 10 ),
new LootPackEntry( false, MagicItems, 0.20, 1, 5, 0, 90 ),
new LootPackEntry( false, Instruments, 0.10, 1 )
} );
public static readonly LootPack AosAverage = new LootPack( new LootPackEntry[]// 50+50 = 100
{
new LootPackEntry( true, Gold, 100.00, "5d10+50" ),
new LootPackEntry( false, MagicItems, 5.00, 1, 4, 0, 20 ),
new LootPackEntry( false, MagicItems, 2.00, 1, 3, 0, 50 ),
new LootPackEntry( false, MagicItems, 0.50, 1, 5, 0, 90 ),
new LootPackEntry( false, Instruments, 0.40, 1 )
} );
public static readonly LootPack AosRich = new LootPack( new LootPackEntry[]// 100+150 = 250
{
new LootPackEntry( true, Gold, 100.00, "10d10+150" ),
new LootPackEntry( false, MagicItems, 20.00, 1, 4, 0, 40 ),
new LootPackEntry( false, MagicItems, 10.00, 1, 5, 0, 60 ),
new LootPackEntry( false, MagicItems, 1.00, 1, 5, 0, 90 ),
new LootPackEntry( false, Instruments, 1.00, 1 )
} );
public static readonly LootPack AosFilthyRich = new LootPack( new LootPackEntry[]// 200+200 = 400
{
new LootPackEntry( true, Gold, 100.00, "2d100+200" ),
new LootPackEntry( false, MagicItems, 33.00, 1, 4, 0, 50 ),
new LootPackEntry( false, MagicItems, 33.00, 1, 4, 0, 60 ),
new LootPackEntry( false, MagicItems, 20.00, 1, 5, 0, 75 ),
new LootPackEntry( false, MagicItems, 5.00, 1, 5, 0, 100 ),
new LootPackEntry( false, Instruments, 2.00, 1 )
} );
public static readonly LootPack AosUltraRich = new LootPack( new LootPackEntry[]// 500+500 = 1000
{
new LootPackEntry( true, Gold, 100.00, "5d100+500" ),
new LootPackEntry( false, MagicItems, 100.00, 1, 5, 25, 100 ),
new LootPackEntry( false, MagicItems, 100.00, 1, 5, 25, 100 ),
new LootPackEntry( false, MagicItems, 100.00, 1, 5, 25, 100 ),
new LootPackEntry( false, MagicItems, 100.00, 1, 5, 25, 100 ),
new LootPackEntry( false, MagicItems, 100.00, 1, 5, 25, 100 ),
new LootPackEntry( false, MagicItems, 100.00, 1, 5, 35, 100 ),
new LootPackEntry( false, Instruments, 2.00, 1 )
} );
public static readonly LootPack AosSuperBoss = new LootPack( new LootPackEntry[]// 500+500 = 1000
{
new LootPackEntry( true, Gold, 100.00, "5d100+500" ),
new LootPackEntry( false, MagicItems, 100.00, 1, 5, 25, 100 ),
new LootPackEntry( false, MagicItems, 100.00, 1, 5, 25, 100 ),
new LootPackEntry( false, MagicItems, 100.00, 1, 5, 25, 100 ),
new LootPackEntry( false, MagicItems, 100.00, 1, 5, 25, 100 ),
new LootPackEntry( false, MagicItems, 100.00, 1, 5, 33, 100 ),
new LootPackEntry( false, MagicItems, 100.00, 1, 5, 33, 100 ),
new LootPackEntry( false, MagicItems, 100.00, 1, 5, 33, 100 ),
new LootPackEntry( false, MagicItems, 100.00, 1, 5, 33, 100 ),
new LootPackEntry( false, MagicItems, 100.00, 1, 5, 50, 100 ),
new LootPackEntry( false, MagicItems, 100.00, 1, 5, 50, 100 ),
new LootPackEntry( false, Instruments, 2.00, 1 )
} );
#endregion
![]() |
|
|
|
|
|
|
#18 (permalink) |
|
Forum Expert
Join Date: May 2005
Age: 23
Posts: 274
|
oh so like in that list that last code has those anysettings i wish to change like
public static readonly LootPack AosAverage = new LootPack( new LootPackEntry[]// 50+50 = 100 so for that loot i would type aosaverage in that champ? for 100k |
|
|
|
|
|
#19 (permalink) |
|
Forum Expert
Join Date: May 2005
Age: 23
Posts: 274
|
this i rikktor i understand u put aosaverage and stuff for loot now how do i edit this to change the amount that the champ spits out after he dies?
Code:
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Spells;
using Server.Engines.CannedEvil;
namespace Server.Mobiles
{
public class Rikktor : BaseChampion
{
public override ChampionSkullType SkullType{ get{ return ChampionSkullType.Power; } }
[Constructable]
public Rikktor() : base( AIType.AI_Melee )
{
Body = 172;
Name = "Rikktor";
SetStr( 701, 900 );
SetDex( 201, 350 );
SetInt( 51, 100 );
SetHits( 3000 );
SetStam( 203, 650 );
SetDamage( 28, 55 );
SetDamageType( ResistanceType.Physical, 25 );
SetDamageType( ResistanceType.Fire, 50 );
SetDamageType( ResistanceType.Energy, 25 );
SetResistance( ResistanceType.Physical, 80, 90 );
SetResistance( ResistanceType.Fire, 80, 90 );
SetResistance( ResistanceType.Cold, 30, 40 );
SetResistance( ResistanceType.Poison, 80, 90 );
SetResistance( ResistanceType.Energy, 80, 90 );
SetSkill( SkillName.Anatomy, 100.0 );
SetSkill( SkillName.MagicResist, 140.2, 160.0 );
SetSkill( SkillName.Tactics, 100.0 );
Fame = 22500;
Karma = -22500;
VirtualArmor = 130;
}
public override void GenerateLoot()
{
AddLoot( LootPack.UltraRich, 3 );
}
public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
public override ScaleType ScaleType{ get{ return ScaleType.All; } }
public override int Scales{ get{ return 20; } }
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
if ( 0.1 >= Utility.RandomDouble() )
Earthquake();
}
public void Earthquake()
{
Map map = this.Map;
if ( map == null )
return;
ArrayList targets = new ArrayList();
foreach ( Mobile m in this.GetMobilesInRange( 8 ) )
{
if ( m == this || !CanBeHarmful( m ) )
continue;
if ( m is BaseCreature && (((BaseCreature)m).Controled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team) )
targets.Add( m );
else if ( m.Player )
targets.Add( m );
}
PlaySound( 0x2F3 );
for ( int i = 0; i < targets.Count; ++i )
{
Mobile m = (Mobile)targets[i];
double damage = m.Hits * 0.6;
if ( damage < 10.0 )
damage = 10.0;
else if ( damage > 75.0 )
damage = 75.0;
DoHarmful( m );
AOS.Damage( m, this, (int)damage, 100, 0, 0, 0, 0 );
if ( m.Alive && m.Body.IsHuman && !m.Mounted )
m.Animate( 20, 7, 1, true, false, 0 ); // take hit
}
}
public override int GetAngerSound()
{
return Utility.Random( 0x2CE, 2 );
}
public override int GetIdleSound()
{
return 0x2D2;
}
public override int GetAttackSound()
{
return Utility.Random( 0x2C7, 5 );
}
public override int GetHurtSound()
{
return 0x2D1;
}
public override int GetDeathSound()
{
return 0x2CC;
}
public Rikktor( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
|
|
|
|
|
|
#20 (permalink) |
|
Join Date: Jun 2005
Location: Nebraska
Age: 30
Posts: 181
|
you are referring to the shower of gold he creates after he dies? the piles that appear around him on the ground? that is what this part of code does that Tynsdale posted earlier:
Code:
private class GoodiesTimer : Timer
{
private Map m_Map;
private int m_X, m_Y;
public GoodiesTimer( Map map, int x, int y ) : base( TimeSpan.FromSeconds( Utility.RandomDouble() * 10.0 ) )
{
m_Map = map;
m_X = x;
m_Y = y;
}
protected override void OnTick()
{
int z = m_Map.GetAverageZ( m_X, m_Y );
bool canFit = m_Map.CanFit( m_X, m_Y, z, 6, false, false );
for ( int i = -3; !canFit && i <= 3; ++i )
{
canFit = m_Map.CanFit( m_X, m_Y, z + i, 6, false, false );
if ( canFit )
z += i;
}
if ( !canFit )
return;
Gold g = new Gold( 500, 1000 ); <---- This is the amount of gold per pile that hits the ground on death. Its saying that its going to drop anywhere from 500 to 1000 gold per pile.
g.MoveToWorld( new Point3D( m_X, m_Y, z ), m_Map );
if ( 0.5 >= Utility.RandomDouble() )
{
switch ( Utility.Random( 3 ) )
{
case 0: // Fire column
{
Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x3709, 10, 30, 5052 );
Effects.PlaySound( g, g.Map, 0x208 );
break;
}
case 1: // Explosion
{
Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x36BD, 20, 10, 5044 );
Effects.PlaySound( g, g.Map, 0x307 );
break;
}
case 2: // Ball of fire
{
Effects.SendLocationParticles( EffectItem.Create( g.Location, g.Map, EffectItem.DefaultDuration ), 0x36FE, 10, 10, 5052 );
break;
}
}
}
}
}
}
If you change the amount of gold per pile to say.... 100 to 500 instead of 500 to 1000 then your overall gold count goes down. it is done randomly for a pile it isnt set that 300k gp pops out total... to find out the total you have to do the math, find out how many piles are made each time then take the total amount of gold YOU want to have appear and divide it by the amount of piles, then you will know how much you want per pile and that will give you the numbers to place in there where it says 500, 1000 (500 is the lowest amount it can drop in a single pile and 1000 is the most it can drop in a single pile.) I hope that explaination helped some. |
|
|
|
|
|
#24 (permalink) | |
|
Join Date: Jun 2005
Location: Nebraska
Age: 30
Posts: 181
|
yes you can set it to 300 and 300 but what that does is takes away any variable.... it would be 300 every time (you could also just have it say 300 and not have the second number)
I am unsure how many piles a champ creates when he falls so I cant tell you that 300 would get you the number you are looking for.... but you can always try it and if it doesnt end up being the right number edit it again until it does reach the number you want ![]() I find trial and error works well for me cause I learn the methods best that way ![]() *edit* Quote:
![]() step 1. find out how many piles a champ creates when it falls (2 ways to do this... search long and hard for the line in the script and you will know definitively, or go onto you shard and kill champs and count the piles and get an average to work with ...not as accurate but at least it gives you a starting point) step 2. Decide on the total you want to have drop step 3. take the amount you wish to have drop and divide it by the total piles (the number you got in step 1) the answer is the number you need to input where the 500, 1000 is currently ![]() |
|
|
|
|
|
|
#25 (permalink) |
|
Join Date: Jun 2005
Location: Nebraska
Age: 30
Posts: 181
|
ok I just killed a champ on my shard and counted the piles that popped up as I deleted them to be sure I didnt double count one.... (now as I said before this is not going to be as accurate... but it is a starting point) rikktor showered 442 piles of gold ranging between 500 and 1000 in value
so currently he gives 221k minimum and 442k max (442 x 500 = 221k 442 x 1000 = 442k) so lets say your ideal value is 100k 100,000 / 442 = 226.25 so you would want the 500 to be around 200 and the 1000 to be around 250 that would give you some randomness to your piles and still stay around your target total... did all of that make sense to you? |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|