本文整理汇总了C#中Server.Items.BaseWeapon类的典型用法代码示例。如果您正苦于以下问题:C# BaseWeapon类的具体用法?C# BaseWeapon怎么用?C# BaseWeapon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseWeapon类属于Server.Items命名空间,在下文中一共展示了BaseWeapon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExpireTimer
public ExpireTimer(BaseWeapon weapon, TimeSpan delay, object state)
: base(delay)
{
m_Caster = (Mobile)state;
this.m_Weapon = weapon;
this.Priority = TimerPriority.OneSecond;
}
示例2: OnWeaponHit
// note that this method will be called when attached to either a mobile or a weapon
// when attached to a weapon, only that weapon will do additional damage
// when attached to a mobile, any weapon the mobile wields will do additional damage
public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
{
// if it is still refractory then return
if (DateTime.UtcNow < m_EndTime)
{
return;
}
int damage = 0;
if (m_Damage > 0)
{
damage = Utility.Random(m_Damage);
}
if (defender != null && attacker != null && damage > 0)
{
defender.BoltEffect(0);
//SpellHelper.Damage( TimeSpan.Zero, defender, attacker, damage, 0, 0, 0, 0, 100 );
SpellHelper.Damage(TimeSpan.FromSeconds(1.0), defender, attacker, damage);
m_EndTime = DateTime.UtcNow + Refractory;
}
}
示例3: Capacitor
public void Capacitor(Mobile attacker, Mobile defender, BaseWeapon weapon)
{
if (Level >= PerkLevel.Fourth)
{
if (!(weapon is Fists) && !(weapon is BaseRanged) && weapon is BaseWeapon && Utility.RandomDouble() <= 0.10)
{
int element = Utility.RandomMinMax(1, 4);
switch (element)
{
case 1:
{
weapon.DoLightning(attacker, defender);
break;
}
case 2:
{
weapon.DoMagicArrow(attacker, defender);
break;
}
case 3:
{
weapon.DoHarm(attacker, defender);
break;
}
case 4:
{
weapon.DoFireball(attacker, defender);
break;
}
}
}
}
}
示例4: OnWeaponHit
// note that this method will be called when attached to either a mobile or a weapon
// when attached to a weapon, only that weapon will do additional damage
// when attached to a mobile, any weapon the mobile wields will do additional damage
public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
{
// if it is still refractory then return
if (DateTime.UtcNow < m_EndTime)
{
return;
}
int drain = 0;
if (m_Drain > 0)
{
drain = Utility.Random(m_Drain);
}
if (defender != null && attacker != null && drain > 0)
{
defender.Stam -= drain;
if (defender.Stam < 0)
{
defender.Stam = 0;
}
attacker.Stam += drain;
if (attacker.Stam < 0)
{
attacker.Stam = 0;
}
m_EndTime = DateTime.UtcNow + Refractory;
}
}
示例5: EnchantSpellGump
public EnchantSpellGump(Mobile caster, Item scroll, BaseWeapon weapon)
: base(20, 20)
{
m_Caster = caster;
m_Scroll = scroll;
m_Weapon = weapon;
int font = 0x7FFF;
AddBackground(0, 0, 170, 200, 9270);
AddAlphaRegion(10, 10, 150, 180);
AddHtmlLocalized(20, 22, 150, 16, 1080133, font, false, false); //Select Enchant
AddButton(20, 50, 9702, 9703, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 50, 200, 16, 1079705, font, false, false); //Hit Lighting
AddButton(20, 75, 9702, 9703, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 75, 200, 16, 1079703, font, false, false); //Hit Fireball
AddButton(20, 100, 9702, 9703, 3, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 100, 200, 16, 1079704, font, false, false); //Hit Harm
AddButton(20, 125, 9702, 9703, 4, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 125, 200, 16, 1079706, font, false, false); //Hit Magic Arrow
AddButton(20, 150, 9702, 9703, 5, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 150, 200, 16, 1079702, font, false, false); //Hit Dispel
}
示例6: IsSpecialWeapon
private bool IsSpecialWeapon( BaseWeapon weapon )
{
// Weapons repairable but not craftable
if ( m_CraftSystem is DefTinkering )
{
return ( weapon is Cleaver )
|| ( weapon is Hatchet )
|| ( weapon is Pickaxe )
|| ( weapon is ButcherKnife )
|| ( weapon is SkinningKnife );
}
else if ( m_CraftSystem is DefCarpentry )
{
return ( weapon is Club )
|| ( weapon is BlackStaff )
|| ( weapon is MagicWand );
}
else if ( m_CraftSystem is DefBlacksmithy )
{
return ( weapon is Pitchfork );
}
return false;
}
示例7: ImmolatingWeaponEntry
public ImmolatingWeaponEntry( int damage, BaseWeapon weapon, TimeSpan duration )
{
Damage = damage;
Timer = new ExpireTimer( weapon, duration );
Timer.Start();
}
示例8: OnWeaponHit
// note that this method will be called when attached to either a mobile or a weapon
// when attached to a weapon, only that weapon will do additional damage
// when attached to a mobile, any weapon the mobile wields will do additional damage
public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
{
// if it is still refractory then return
if (DateTime.UtcNow < m_EndTime)
{
return;
}
int damage = 0;
if (m_Damage > 0)
{
damage = Utility.Random(m_Damage);
}
if (defender != null && attacker != null && damage > 0)
{
attacker.MovingParticles(defender, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
attacker.PlaySound(0x15E);
//SpellHelper.Damage( TimeSpan.Zero, defender, attacker, damage, 0, 100, 0, 0, 0 );
SpellHelper.Damage(TimeSpan.FromSeconds(1.0), defender, attacker, damage);
m_EndTime = DateTime.UtcNow + Refractory;
}
}
示例9: CombatHit
public static int CombatHit(Mobile Attacker, Mobile Defender, BaseWeapon Weapon, bool UseHitscript)
{
bool ApplyDamage = true;
int Damage = 0;
if (Weapon is BaseRanged)
Damage = RangedHit(Attacker, Defender, Weapon, UseHitscript);
else if (Weapon is BaseMeleeWeapon)
Damage = MeleeHit(Attacker, Defender, Weapon);
//(100-weaponType.Speed)/10
//long Ticks = ((100 - Weapon.Speed) / 10) * TimeSpan.TicksPerMillisecond;
if (UseHitscript)
{
ApplyDamage = HitscriptManager.Run(Weapon.Hitscript, Attacker, Defender, Weapon, ref Damage);
}
if (!ApplyDamage)
Damage = 0;
//Timer.DelayCall(new TimeSpan(Ticks), new TimerStateCallback(ApplyCombatDamage), Damage);
if (Damage < 0)
Damage = 0;
Attacker.SendMessage("Returning Damage is {0}", Damage);
return Damage;
}
示例10: SlayerSelectWeaponGump
public SlayerSelectWeaponGump( BaseWeapon item ) : base( 0, 0 )
{
m_Item = item;
this.Closable=true;
this.Disposable=true;
this.Dragable=true;
this.Resizable=false;
AddPage(0);
AddBackground(131, 90, 185, 292, 9200);
AddAlphaRegion(137, 96, 172, 25);
AddAlphaRegion(137, 130, 172, 247);
AddHtml( 137, 96, 172, 25, @"<BASEFONT COLOR=#FFFFFF><CENTER>Select A Slayer</CENTER></BASEFONT>", (bool)false, (bool)false);
AddButton(145, 140, 4023, 4024, 1, GumpButtonType.Reply, 0);
AddLabel(180, 140, 1152, @"Repond Slayer");
AddButton(145, 170, 4023, 4024, 2, GumpButtonType.Reply, 0);
AddLabel(180, 170, 1152, @"Reptile Slayer");
AddButton(145, 200, 4023, 4024, 3, GumpButtonType.Reply, 0);
AddLabel(180, 200, 1152, @"Demon Slayer");
AddButton(145, 230, 4023, 4024, 4, GumpButtonType.Reply, 0);
AddLabel(180, 230, 1152, @"Elemental Slayer");
AddButton(145, 260, 4023, 4024, 5, GumpButtonType.Reply, 0);
AddLabel(180, 260, 1152, @"Undead Slayer");
AddButton(145, 290, 4023, 4024, 6, GumpButtonType.Reply, 0);
AddLabel(180, 290, 1152, @"Arachnid Slayer");
AddButton(145, 320, 4023, 4024, 7, GumpButtonType.Reply, 0);
AddLabel(180, 320, 1152, @"Fey Slayer");
}
示例11: Run
public static bool Run(Mobile Attacker, Mobile Defender, BaseWeapon Weapon, ref int BaseDamage)
{
Effects.SendLocationParticles(EffectItem.Create(Defender.Location, Defender.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);
Effects.PlaySound(Defender, Defender.Map, 0x201);
bool Summoned = false;
if (Defender is BaseCreature)
{
BaseCreature Creature = Defender as BaseCreature;
Summoned = Creature.Summoned;
if (Summoned)
{
if(Attacker.NetState != null)
Attacker.PrivateOverheadMessage(Server.Network.MessageType.Regular, 0x03B2, true,
"Your weapon causes the creature to dissipate on impact!", Attacker.NetState);
Creature.Delete();
return true;
}
}
ZuluUtil.WipeMods(Defender);
Defender.Mana = 0;
if (Weapon.DamageLevel == WeaponDamageLevel.Regular)
BaseDamage += ZuluCombat.GetDamageLevel(WeaponDamageLevel.Devastation);
return true;
}
示例12: ShenStrike
public void ShenStrike(Mobile attacker, Mobile defender, BaseWeapon weapon)
{
if (Level >= PerkLevel.Fifth)
{
if (weapon is Fists && Utility.RandomDouble() <= 0.10)
{
int element = Utility.RandomMinMax(2, 4);
switch (element)
{
case 1:
{
weapon.DoLightning(attacker, defender);
break;
}
case 2:
{
weapon.DoMagicArrow(attacker, defender);
break;
}
case 3:
{
weapon.DoHarm(attacker, defender);
break;
}
case 4:
{
weapon.DoFireball(attacker, defender);
break;
}
}
}
}
}
示例13: OnHit
public override int OnHit( BaseWeapon weapon, int damageTaken )
{
if( weapon is PBWeapon )
HitPoints -= 1;
if( HitPoints == 0 )
Hue = weapon.Hue;
return 0;
}
示例14: GetImmolatingDamage
public static int GetImmolatingDamage( BaseWeapon w )
{
ImmolatingWeaponEntry iEntry = m_Table[w] as ImmolatingWeaponEntry;
if ( iEntry != null )
return iEntry.m_Damage;
return 0;
}
示例15: OnWeaponHit
// note that this method will be called when attached to either a mobile or a weapon
// when attached to a weapon, only that weapon will do additional damage
// when attached to a mobile, any weapon the mobile wields will do additional damage
public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
{
// if it is still refractory then return
if (DateTime.UtcNow < m_EndTime)
{
return;
}
if (m_Chance <= 0 || Utility.Random(100) > m_Chance)
{
return;
}
if (defender != null && attacker != null)
{
// spawn a minion
object o = null;
try
{
o = Activator.CreateInstance(SpawnerType.GetType(m_Minion));
}
catch
{ }
if (o is BaseCreature)
{
BaseCreature b = o as BaseCreature;
b.MoveToWorld(attacker.Location, attacker.Map);
if (attacker is PlayerMobile)
{
b.Controlled = true;
b.ControlMaster = attacker;
}
b.Combatant = defender;
// add it to the list of controlled mobs
MinionList.Add(b);
}
else
{
if (o is Item)
{
((Item)o).Delete();
}
if (o is Mobile)
{
((Mobile)o).Delete();
}
// bad minion specification so delete the attachment
Delete();
}
m_EndTime = DateTime.UtcNow + Refractory;
}
}