Vla un debut :
Code: Select all
using System;
using DOL.GS ;
using DOL.Events ;
using DOL.Database ;
using DOL.Database.Attributes;
namespace DOL.Database
{
/// <summary>
/// Database Storage of Tasks
/// </summary>
[DataTable(TableName="MobDrops")]
public class MobDrops : DataObject
{
protected string m_MobName = "";
protected string m_ItemID = "";
protected int m_Chance = 99;
static bool m_autoSave;
static bool m_init ;
public MobDrops()
{
m_autoSave = false;
}
override public bool AutoSave
{
get {return m_autoSave;}
set {m_autoSave = value;}
}
[DataElement(AllowDbNull=false)]
public string MobName
{
get {return m_MobName;}
set
{
Dirty = true;
m_MobName = value;
}
}
[DataElement(AllowDbNull=false)]
public string ItemID
{
get {return m_ItemID;}
set
{
Dirty = true;
m_ItemID = value;
}
}
[DataElement(AllowDbNull=false)]
public int Chance
{
get {return m_Chance;}
set
{
Dirty = true;
m_Chance = value;
}
}
[ScriptLoadedEvent]
public static void OnScriptCompiled(DOLEvent e, object sender, EventArgs args)
{
if ( !m_init && (GameServer.Database != null) )
{
GameServer.Database.RegisterDataObject ( typeof ( MobDrops ) ) ;
GameServer.Database.LoadDatabaseTable ( typeof ( MobDrops ) ) ;
m_init = true ;
}
}
[ScriptUnloadedEvent]
public static void OnScriptUnloaded(DOLEvent e, object sender, EventArgs args)
{
