I came across xxx007xxx's Charm script today that says: You can create charm of FollowersMax,Hunger,Thirst,Int,Str,VirtualArmor. Here's the code where I plugged in the values and the skill. But it won't compile without errors. Just wondering if I could create a NecroCharm if it's doable or not?
Line 29: The type or namespace 'from could not be found <are you missing a using or an assembly reference?>
Line 29: The type or namespace 'from could not be found <are you missing a using or an assembly reference?>
Code:
using System;
using Server.Network;
using Server.Items;
namespace Server.Items
{
public class NecroCharm : Item
{
private int _20;
[Constructable]
public NecroCharm() : this(1)
{
}
[Constructable]
public NecroCharm(int amount) : base( 0xE73 )
{
_20 =amount;
Weight = 1.0;
// LootType = LootType.Blessed;
Name = "<BASEFONT COLOR=#006300> +"+_20+" Necro Charm </b>";
}
public override bool OnDroppedInto( Mobile from, Container target, Point3D p )
{
if( target is from.Backpack|| target.IsChildOf( from.Backpack) )
{
from.Necromancy += _20;
Movable = false;
}
return base.OnDroppedInto(from,target,p);
}
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) && Movable == false )
{
from.Necromancy -= _20;
Movable = true;
}
else
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
}
/*
//remove Movable = false OnDroppedInto
public override void OnItemLifted( Mobile from, Item item )
{
if( item.IsChildOf(from.Backpack) )
{
from.Dex -= _howmany
}
base.OnItemLifted(from,item);
}
*/
public NecroCharm( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int) _20 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
int _20 = reader.ReadInt();
/*
switch( version )
{
case 0:
{
break;
}
} */
}
}
}