|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Newbie
Join Date: Jul 2006
Age: 18
Posts: 17
|
it keeps telling me that i need a type or namespace definition, or end of file on the last line... ive tried adding extra brackets... but more then likely im missing something... anyone have advice?
Code:
using System;
using System.Collections;
using Server.Items;
using Server.Targeting;
using Server.ContextMenus;
using Server.Gumps;
using Server.Misc;
using Server.Network;
using Server.Spells;
using System.Collections.Generic;
namespace Server.Mobiles
{
[CorpseName("Corpse Of HarpySlayer")]
public class HarpySlayer : BaseCreature
{
[Constructable]
public HarpySlayer() : base( AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "Jack";
Title = "the harpy slayer";
Body = 400;
Hue = 1801;
Female = false;
SetStr( 100, 130 );
SetDex( 130, 145 );
SetInt( 170, 190 );
SetHits( 2100, 2300 );
Item hair = new Item( 8260 );
hair.Hue = 44;
hair.Layer = Layer.Hair;
hair.Movable = true;
AddItem( hair );
Sandals feet = new Sandals();
feet.Hue = 1175;
feet.Movable = true;
AddItem(feet);
LeatherNinjaPants legs = new LeatherNinjaPants();
legs.Hue = 0;
legs.Movable = true;
AddItem(legs);
}
public HarpySlayer(Serial serial) : base(serial)
{
}
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
{
base.GetContextMenuEntries(from, list);
list.Add(new IsoldaQuestEntry(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 HarpySlayerQuestEntry : ContextMenuEntry
{
private Mobile m_Mobile;
private Mobile m_Giver;
public override void OnClick()
{
if (!(m_Mobile is PlayerMobile))
return;
PlayerMobile mobile = (PlayerMobile)m_Mobile;
if (!mobile.HasGump(typeof(HarpyQuestGump)))
{
mobile.SendGump(new HarpyQuestGump(mobile));
}
}
}
public override bool OnDragDrop(Mobile from, Item dropped)
{
PlayerMobile m = from as PlayerMobile;
if ( mobile != null)
{
if( dropped is ToadSkin )
{
if(dropped.Amount!=20)
{
mobile.SendGump(new HarpyQuestGump1(m));
mobile.AddToBackpack( new JacksRegards() );
mobile.SendMessage("This is going to turn out nicely!");
dropped.Delete();
return true;
}
return false;
}
else if (dropped is QuestSyrup)
{
Container pack = from.Backpack;
if (pack != null)
{
m.SendGump(new HarpyQuestGump2(m));
m.SendMessage("Excellent!");
dropped.Delete();
return true;
}
return false;
}
else if (dropped is HarpyClaw)
{
Container pack = from.Backpack;
if (pack != null)
{
m.AddToBackpack(new HarpyTalons());
m.SendMessage("I hope you enjoy your new peice of armor!");
dropped.Delete();
return true;
}
return false;
}
else
{
this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Bring me what I asked for!", m.NetState);
}
}
return false;
}
}
}
}
}
|
|
|
|
|
|
#4 (permalink) |
|
ConnectUO Creator
Join Date: Jan 2004
Age: 28
Posts: 4,891
|
Code:
using System;
using System.Collections;
using Server.Items;
using Server.Targeting;
using Server.ContextMenus;
using Server.Gumps;
using Server.Misc;
using Server.Network;
using Server.Spells;
using System.Collections.Generic;
namespace Server.Mobiles
{
[CorpseName("Corpse Of HarpySlayer")]
public class HarpySlayer : BaseCreature
{
[Constructable]
public HarpySlayer()
: base(AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
Name = "Jack";
Title = "the harpy slayer";
Body = 400;
Hue = 1801;
Female = false;
SetStr(100, 130);
SetDex(130, 145);
SetInt(170, 190);
SetHits(2100, 2300);
Item hair = new Item(8260);
hair.Hue = 44;
hair.Layer = Layer.Hair;
hair.Movable = true;
AddItem(hair);
Sandals feet = new Sandals();
feet.Hue = 1175;
feet.Movable = true;
AddItem(feet);
LeatherNinjaPants legs = new LeatherNinjaPants();
legs.Hue = 0;
legs.Movable = true;
AddItem(legs);
}
public HarpySlayer(Serial serial)
: base(serial)
{
}
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
{
base.GetContextMenuEntries(from, list);
list.Add(new IsoldaQuestEntry(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 HarpySlayerQuestEntry : ContextMenuEntry
{
private Mobile m_Mobile;
private Mobile m_Giver;
public override void OnClick()
{
if (!(m_Mobile is PlayerMobile))
return;
PlayerMobile mobile = (PlayerMobile)m_Mobile;
if (!mobile.HasGump(typeof(HarpyQuestGump)))
{
mobile.SendGump(new HarpyQuestGump(mobile));
}
}
}
public override bool OnDragDrop(Mobile from, Item dropped)
{
PlayerMobile m = from as PlayerMobile;
if (mobile != null)
{
if (dropped is ToadSkin)
{
if (dropped.Amount != 20)
{
mobile.SendGump(new HarpyQuestGump1(m));
mobile.AddToBackpack(new JacksRegards());
mobile.SendMessage("This is going to turn out nicely!");
dropped.Delete();
return true;
}
return false;
}
else if (dropped is QuestSyrup)
{
Container pack = from.Backpack;
if (pack != null)
{
m.SendGump(new HarpyQuestGump2(m));
m.SendMessage("Excellent!");
dropped.Delete();
return true;
}
return false;
}
else if (dropped is HarpyClaw)
{
Container pack = from.Backpack;
if (pack != null)
{
m.AddToBackpack(new HarpyTalons());
m.SendMessage("I hope you enjoy your new peice of armor!");
dropped.Delete();
return true;
}
return false;
}
else
{
this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Bring me what I asked for!", m.NetState);
}
}
return false;
}
}
}
__________________
Jeff Boulanger ConnectUO - Core Developer Want to help make ConnectUO better? Click here to submit your ideas/requests Use your talent to compete against other community members in RunUO hosted coding competitions If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team. Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO |
|
|
|
|
|
#5 (permalink) |
|
Newbie
Join Date: Jul 2006
Age: 18
Posts: 17
|
2 errors... line 60, and 75.
line 60: no overload method for HarpyQuestEntry line 75: no overload method for ContextMenuEntry this is one that i messed with a little bit more... but this is the least amount of errors i could get it to... =S Code:
using System;
using System.Collections;
using Server.Items;
using Server.Targeting;
using Server.ContextMenus;
using Server.Gumps;
using Server.Misc;
using Server.Network;
using Server.Spells;
using System.Collections.Generic;
namespace Server.Mobiles
{
[CorpseName("Corpse Of HarpySlayer")]
public class HarpySlayer : BaseCreature
{
[Constructable]
public HarpySlayer()
: base(AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
Name = "Jack";
Title = "the harpy slayer";
Body = 400;
Hue = 1801;
Female = false;
SetStr(100, 130);
SetDex(130, 145);
SetInt(170, 190);
SetHits(2100, 2300);
Item hair = new Item(8260);
hair.Hue = 44;
hair.Layer = Layer.Hair;
hair.Movable = true;
AddItem(hair);
Sandals feet = new Sandals();
feet.Hue = 1175;
feet.Movable = true;
AddItem(feet);
LeatherNinjaPants legs = new LeatherNinjaPants();
legs.Hue = 0;
legs.Movable = true;
AddItem(legs);
}
public HarpySlayer(Serial serial)
: base(serial)
{
}
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
{
base.GetContextMenuEntries(from, list);
list.Add(new HarpyQuestEntry(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 HarpyQuestEntry : ContextMenuEntry
{
private Mobile m_Mobile;
private Mobile m_Giver;
public override void OnClick()
{
if (!(m_Mobile is PlayerMobile))
return;
PlayerMobile mobile = (PlayerMobile)m_Mobile;
if (!mobile.HasGump(typeof(HarpyQuestGump)))
{
mobile.SendGump(new HarpyQuestGump(mobile));
}
}
}
public override bool OnDragDrop(Mobile from, Item dropped)
{
PlayerMobile m = from as PlayerMobile;
if (m != null)
{
if (dropped is ToadSkin)
{
if (dropped.Amount != 20)
{
m.SendGump(new HarpyQuestGump1(m));
m.AddToBackpack(new JacksRegards());
m.SendMessage("This is going to turn out nicely!");
dropped.Delete();
return true;
}
return false;
}
else if (dropped is QuestSyrup)
{
Container pack = from.Backpack;
if (pack != null)
{
m.SendGump(new HarpyQuestGump2(m));
m.SendMessage("Excellent!");
dropped.Delete();
return true;
}
return false;
}
else if (dropped is HarpyClaw)
{
Container pack = from.Backpack;
if (pack != null)
{
m.AddToBackpack(new HarpyTalons());
m.SendMessage("I hope you enjoy your new peice of armor!");
dropped.Delete();
return true;
}
return false;
}
else
{
this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Bring me what I asked for!", m.NetState);
}
}
return false;
}
}
}
Last edited by Joel007; 09-17-2008 at 04:40 PM. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|