如何限制特定的怪物不能被挑拨或压制
2007/9/8 15:06:11

一种方法是修改挑拨技能的目标对象脚本,加入怪物的ID,以便在玩家对此怪物挑拨时直接出错而是技能失败。此方法的缺点是每种怪物都要在挑拨技能的脚本里进行处理,处理量大的话有可能会影响到游戏速度。同理可以修改压制的设定。
\Scripts\Skills\Provocation.cs     
  protected override void OnTarget( Mobile from, object targeted )
  {
    from.RevealingAction();
    if ( targeted is BaseCreature && from.CanBeHarmful( (Mobile)targeted, true ) )
    {
    BaseCreature creature = (BaseCreature)targeted;
    if ( !m_Instrument.IsChildOf( from.Backpack ) )
    {
      from.SendLocalizedMessage( 1062488 ); // The instrument you are trying to play is no longer in your backpack!
    }
    else if ( creature.Controlled )
    {
      from.SendLocalizedMessage( 501590 ); // They are too loyal to their master to be provoked.
    }
    else if ( creature.IsParagon && BaseInstrument.GetBaseDifficulty( creature ) >= 160.0 )
    {
      from.SendLocalizedMessage( 1049446 ); // You have no chance of provoking those creatures.
    }
    else if ( creature is AbysmalHorror || creature is DarknightCreeper || creature is DemonKnight || creature is FleshRenderer || creature is Impaler || creature is ShadowKnight || creature is LadyMelisande || creature is Hydra || creature is Irk || creature is LadySabrix || creature is LadyLissith || creature is Gnaw || creature is Malefic )
    {
      from.SendLocalizedMessage( 1049446 ); // You have no chance of provoking those creatures.
    }
    else
    {
      from.RevealingAction();
      m_Instrument.PlayInstrumentWell( from );
      from.SendLocalizedMessage( 1008085 ); // You play your music and your target becomes angered.  Whom do you wish them to attack?
      from.Target = new InternalSecondTarget( from, m_Instrument, creature );
    }
    }
    else
    {
    from.SendLocalizedMessage( 501589 ); // You can't incite that!
    }
  }
  }\Scripts\Skills\Discordance.cs   
    protected override void OnTarget( Mobile from, object target )
  {
    from.RevealingAction();
    if ( !m_Instrument.IsChildOf( from.Backpack ) )
    {
    from.SendLocalizedMessage( 1062488 ); // The instrument you are trying to play is no longer in your backpack!
    }
    else if ( target is Mobile )
    {
    Mobile targ = (Mobile)target;
    if ( targ == from || (targ is BaseCreature && ( ((BaseCreature)targ).BardImmune || !from.CanBeHarmful( targ, false ) )) )
    {
      from.SendLocalizedMessage( 1049535 ); // A song of discord would have no effect on that.
    }
    else if ( targ is AbysmalHorror || targ is DarknightCreeper || targ is DemonKnight || targ is FleshRenderer || targ is Impaler || targ is ShadowKnight || targ is LadyMelisande || targ is Hydra || targ is Irk || targ is LadySabrix || targ is LadyLissith || targ is Gnaw || targ is Malefic )
    {
      from.SendLocalizedMessage( 1049535 ); // A song of discord would have no effect on that.
    }
   

下一页
返回列表
返回首页
©2024 CHINAUO网
Powered by iwms