Full Version : Quest one my simplest quest
xmlspawner >>Scripting Support >>Quest one my simplest quest


<< Prev | Next >>

Rhosyn- 07-20-2006
The gump went in fine it was just an extra entry like the fishing pole, however this one is not going in on line 48. I am going to be such a pain xmlspawner/X.bmp

CODE
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Targeting;
using Server.ContextMenus;
using Server.Gumps;
using Server.Misc;
using Server.Network;
using Server.Spells;
using Server.Mobiles;

namespace Server.Mobiles
{
[CorpseName( "Chakademus' corpse" )]
public class Chakademus : Mobile
{
               public virtual bool IsInvulnerable{ get{ return true; } }
 [Constructable]
 public Chakademus()
 {
  Name = "Chakademus";
  Title = "The Ethereal Conjourer";
  Body = 400;
  CantWalk = true;

  Boots b = new Boots();
                       b.Hue = 1;
                       AddItem( b );

                       LongPants lp = new LongPants();
                       lp.Hue = 292;
                       AddItem( lp );

         FancyShirt fs = new FancyShirt();
                       fs.Hue = 1153;
                       AddItem( fs );

                       AddItem( new LongHair(1150));

 }

 public Chakademus( Serial serial ) : base( serial )
 {
 }

 public override void GetContextMenuEntries( Mobile from, ArrayList list )
        {
                base.GetContextMenuEntries( from, list );
                list.Add( new ChakademusEntry( from, this ) );
        }

 public override void Serialize( GenericWriter writer )
 {
  base.Serialize( writer );
  writer.Write( (int) 0 );
 }

 public override void Deserialize( GenericReader reader )
 {
  base.Deserialize( reader );
  int version = reader.ReadInt();
 }

 public class ChakademusEntry : ContextMenuEntry
 {
  private Mobile m_Mobile;
  private Mobile m_Giver;
 
  public ChakademusEntry( Mobile from, Mobile giver ) : base( 6146, 3 )
  {
   m_Mobile = from;
   m_Giver = giver;
  }

  public override void OnClick()
  {
   

                         if( !( m_Mobile is PlayerMobile ) )
    return;
   
   PlayerMobile mobile = (PlayerMobile) m_Mobile;

   {
    if ( ! mobile.HasGump( typeof( ChakademusGump ) ) )
    {
     mobile.SendGump( new ChakademusGump( mobile ));
     mobile.AddToBackpack( new EtherealBox() );
    }
   }
  }
 }

 public override bool OnDragDrop( Mobile from, Item dropped )
 {            
                 Mobile m = from;
  PlayerMobile mobile = m as PlayerMobile;
                       Account acct=(Account)from.Account;
  bool EtherealMist = Convert.ToBoolean( acct.GetTag("EtherealMistRecieved") );

  if ( mobile != null)
  {
   if( dropped is EtherealMist )
           
          {
           if(dropped.Amount!=1)
           {
    this.PrivateOverheadMessage( MessageType.Regular, 1153, false, "Right, lets see now", mobile.NetState );
            return false;
           }
                               if ( !EtherealMist ) //added account tag check
                 {
    dropped.Delete();
    mobile.AddToBackpack( new EtherealHorse() );
    mobile.SendMessage( "There you go, your ethereal horse, as promised." );
                                       acct.SetTag( "EtherealMistRecieved", "true" );

   
                  }
   else //what to do if account has already been tagged
           {
            mobile.SendMessage("I am sorry, I can only give you one.");
            mobile.AddToBackpack( new EtherealMist( 1 ) );
            dropped.Delete();
           }
          }
          else
          {
    this.PrivateOverheadMessage( MessageType.Regular, 1153, false, "Thx but I dont need that", mobile.NetState );
       }
  }
  return false;
 }
}
}


The server message:

RunUO - [www.runuo.com] Version 2.0, Build 2357.32527
Core: Running on .NET Framework Version 2.0.50727
Scripts: Compiling C# scripts...failed (1 errors, 1 warnings)

Custom/QUESTS/Ethy/Chakademus.cs:
CS0115: Line 48: 'Server.Mobiles.Chakademus.GetContextMenuEntries(Server.Mobile, System.Collections.ArrayList)': no suitable method found to override
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.


ArteGordon- 07-20-2006
under 2.0 you need to change this

public override void GetContextMenuEntries( Mobile from, ArrayList list )

to this

public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)