|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Join Date: Jul 2003
Posts: 192
|
Useing This......
Code:
public override void OnBeforeDeath( Mobile = FindMostTotalDamager )
{
base.OnBeforeDeath( FindMostTotalDamager );
if ( Mobile = FindMostTotalDamager )
from.AddToBackpack( new Token( 50 ) );
}
Code:
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings) - Error: Scripts\Mobiles\Special\Rikktor.cs: CS1001: (line 54, column 44) Ident ifier expected Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. |
|
|
|
|
|
#2 (permalink) | |
|
Forum Novice
Join Date: Sep 2002
Posts: 238
|
Quote:
if ( Mobile == FindMostTotalDamager ) and this OnBeforeDeath( Mobile = FindMostTotalDamager ) to this OnBeforeDeath( Mobile FindMostTotalDamager ) |
|
|
|
|
|
|
#3 (permalink) |
|
Join Date: Jul 2003
Posts: 192
|
I Changed It To This
Code:
public override void OnBeforeDeath( Mobile FindMostTotalDamager )
{
base.OnBeforeDeath( FindMostTotalDamager );
if ( Mobile == FindMostTotalDamager )
from.AddToBackpack( new Token( 50 ) );
}
Code:
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings) - Error: Scripts\Mobiles\Special\Rikktor.cs: CS0115: (line 54, column 22) 'Serv er.Mobiles.Rikktor.OnBeforeDeath(Server.Mobile)': no suitable method found to ov erride Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. |
|
|
|
|
|
#4 (permalink) |
|
Join Date: Jul 2003
Posts: 192
|
Heres The Hole Script Iam Useing, Maby Its Bcuz I Put It In Wrong or Something.....
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;
PackGold( 4000, 5000 );
PackWeapon( 3, 5 );
PackWeapon( 5, 5 );
}
public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
public override void OnBeforeDeath( Mobile FindMostTotalDamager )
{
base.OnBeforeDeath( FindMostTotalDamager );
if ( Mobile == FindMostTotalDamager )
from.AddToBackpack( new Token( 50 ) );
}
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();
}
}
}
|
|
|
|
|
|
#7 (permalink) |
|
Moderate
Join Date: Nov 2002
Location: USA
Posts: 6,598
|
Code:
public override void OnBeforeDeath( Mobile FindMostTotalDamager )
{
base.OnBeforeDeath( FindMostTotalDamager );
if ( Mobile == FindMostTotalDamager )
from.AddToBackpack( new Token( 50 ) );
}
You are also making this comparison if ( Mobile == FindMostTotalDamager ) which would be incorrect whatever you are trying to do.
__________________
David Forum Moderator The RunUO.com Forum Moderator Team Forum Rules and Guidelines RunUO Forum Search Engine Download RunUO 2.0 RC2 |
|
|
|
|
|
#8 (permalink) |
|
Join Date: Oct 2002
Age: 23
Posts: 4,689
|
Also, OnBeforeDeath has no parameters. By changing it, it believes its a different method, and hence there is no reason to need it to be overwritten.
FindMostTotalDamager(false) would return the mobile btw. Also there is no from.. I dont know where you got the idea of where from exists in that method. |
|
|
|
|
|
#9 (permalink) |
|
Join Date: Jul 2003
Posts: 192
|
Ok, Iam totaly cunfused.....really bad.....i have no idea what iam doing at this point, i thought i had a good idea on it, but apparently I'am way off let me try to explain what it is iam doing. Alright....I have a tokens script and i use champions for players to kill to get them....now i used to have it so whoever killed the champ with last hit got them....witch i used this......
Code:
public override void OnDamage( int amount, Mobile from, bool willKill )
{
base.OnDamage(amount, from, willKill);
if (willKill)
from.AddToBackpack( new Token( 50 ) );
}
![]() |
|
|
|
|
|
#12 (permalink) | |
|
Join Date: Jul 2003
Posts: 192
|
Quote:
Code:
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings) - Error: Scripts\Mobiles\Special\Rikktor.cs: CS0508: (line 54, column 22) 'Serv er.Mobiles.Rikktor.OnBeforeDeath()': cannot change return type when overriding i nherited member 'Server.Mobiles.BaseChampion.OnBeforeDeath()' Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. |
|
|
|
|
|
|
#13 (permalink) | |
|
Forum Expert
Join Date: May 2003
Location: Milwaukee, WI
Age: 28
Posts: 765
|
Quote:
Code:
public override bool OnBeforeDeath()
{
Mobile rewardmob = FindMostTotalDamager;
rewardmob.AddToBackpack( new Token( 50 ) );
return base.OnBeforeDeath();
}
|
|
|
|
|
|
|
#14 (permalink) |
|
Join Date: Jul 2003
Posts: 192
|
Code:
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings) - Error: Scripts\Mobiles\Special\Rikktor.cs: CS0508: (line 54, column 22) 'Serv er.Mobiles.Rikktor.OnBeforeDeath()': cannot change return type when overriding i nherited member 'Server.Mobiles.BaseChampion.OnBeforeDeath()' Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. r Scripts: Compiling C# scripts...failed (1 errors, 6 warnings) - Warning: Scripts\Misc\CharacterCreation.cs: CS1522: (line 353, column 4) Empt y switch block - Warning: Scripts\Misc\CharacterCreation.cs: CS1522: (line 370, column 5) Empt y switch block - Warning: Scripts\Misc\CharacterCreation.cs: CS1522: (line 722, column 9) Empt y switch block - Warning: Scripts\Misc\CharacterCreation.cs: CS1522: (line 753, column 4) Empt y switch block - Warning: Scripts\Misc\CharacterCreation.cs: CS1522: (line 813, column 6) Empt y switch block - Warning: Scripts\Spells\Base\Spell.cs: CS0162: (line 143, column 4) Unreachab le code detected - Error: Scripts\Mobiles\Special\Rikktor.cs: CS0103: (line 56, column 21) The n ame 'FindMostTotalDamager' does not exist in the class or namespace 'Server.Mobi les.Rikktor' Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. |
|
|
|
|
|
#15 (permalink) |
|
Forum Expert
Join Date: May 2003
Location: Milwaukee, WI
Age: 28
Posts: 765
|
My mistake again. Sorry, I forgot about the bool parameter in FindMostTotalDamager. The correct code would be:
Code:
public override bool OnBeforeDeath()
{
Mobile rewardmob = FindMostTotalDamager( false );
rewardmob.AddToBackpack( new Token( 50 ) );
return base.OnBeforeDeath();
}
|
|
|
|
|
|
#16 (permalink) |
|
Join Date: Jul 2003
Posts: 192
|
You wouldent belive this but..................
Code:
Scripts: Compiling C# scripts...failed (1 errors, 6 warnings) - Warning: Scripts\Misc\CharacterCreation.cs: CS1522: (line 353, column 4) Empt y switch block - Warning: Scripts\Misc\CharacterCreation.cs: CS1522: (line 370, column 5) Empt y switch block - Warning: Scripts\Misc\CharacterCreation.cs: CS1522: (line 722, column 9) Empt y switch block - Warning: Scripts\Misc\CharacterCreation.cs: CS1522: (line 753, column 4) Empt y switch block - Warning: Scripts\Misc\CharacterCreation.cs: CS1522: (line 813, column 6) Empt y switch block - Warning: Scripts\Spells\Base\Spell.cs: CS0162: (line 143, column 4) Unreachab le code detected - Error: Scripts\Mobiles\Special\Rikktor.cs: CS0103: (line 56, column 21) The n ame 'FindMostTotalDamager' does not exist in the class or namespace 'Server.Mobi les.Rikktor' Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. |
|
|
|
|
|
#17 (permalink) |
|
Forum Expert
Join Date: May 2003
Location: Milwaukee, WI
Age: 28
Posts: 765
|
Hmm... well try converting to Mobile. That's where that method exists. So you would want to do this:
Code:
Mobile rewardmob = ( (Mobile) this ).FindMostTotalDamager( false ); |
|
|
|
|
|
#18 (permalink) |
|
Join Date: Jul 2003
Posts: 192
|
Hey i dont want u to get stressed but i got errors again i made it look like this
Code:
public override bool OnBeforeDeath()
{
Mobile rewardmob = ( (Mobile) this ).FindMostTotalDamager( false );
rewardmob.AddToBackpack( new Tokens( 50 ) );
return base.OnBeforeDeath();
}
Code:
Scripts: Compiling C# scripts...failed (1 errors, 6 warnings) - Warning: Scripts\Misc\CharacterCreation.cs: CS1522: (line 353, column 4) Empt y switch block - Warning: Scripts\Misc\CharacterCreation.cs: CS1522: (line 370, column 5) Empt y switch block - Warning: Scripts\Misc\CharacterCreation.cs: CS1522: (line 722, column 9) Empt y switch block - Warning: Scripts\Misc\CharacterCreation.cs: CS1522: (line 753, column 4) Empt y switch block - Warning: Scripts\Misc\CharacterCreation.cs: CS1522: (line 813, column 6) Empt y switch block - Warning: Scripts\Spells\Base\Spell.cs: CS0162: (line 143, column 4) Unreachab le code detected - Error: Scripts\Mobiles\Special\Rikktor.cs: CS0117: (line 56, column 21) 'Serv er.Mobile' does not contain a definition for 'FindMostTotalDamager' Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. 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;
PackGold( 4000, 5000 );
PackWeapon( 3, 5 );
PackWeapon( 5, 5 );
}
public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
public override bool OnBeforeDeath()
{
Mobile rewardmob = ( (Mobile) this ).FindMostTotalDamager( false );
rewardmob.AddToBackpack( new Tokens( 50 ) );
return base.OnBeforeDeath();
}
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();
}
}
}
![]() |
|
|
|
|
|
#19 (permalink) |
|
Forum Expert
Join Date: May 2003
Location: Milwaukee, WI
Age: 28
Posts: 765
|
Ahh no wonder it's not working. You don't need the whole ( this (Mobile) ) crap.. delete that.. this is pulled directly from RunUO docs:
Code:
Mobile FindMostTotalDamger( bool allowSelf ) Code:
Mobile rewardmob = FindMostTotalDamger( false ); |
|
|
|
|
|
#20 (permalink) | |
|
Join Date: Jul 2003
Posts: 192
|
Quote:
MORXETON UR A FUCKIN GENUSE !! lol dude.........thank you so much yo......u are the man dude lol thanks a million.....words itself cannot describe how thankfull i am lmao THANKS!! |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|