本文整理汇总了C#中Server.Skill类的典型用法代码示例。如果您正苦于以下问题:C# Skill类的具体用法?C# Skill怎么用?C# Skill使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Skill类属于Server命名空间,在下文中一共展示了Skill类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ForceSkillGain
public static bool ForceSkillGain( Mobile from, Skill skill )
{
if ( from.Player )
{
MobileRateInfo mobileInfo = MobileRateInfo.GetMobileInfo( from );
SkillRateInfo skillInfo = mobileInfo.GetSkillInfo( skill );
int[] table = null;
if ( from.Skills.Total <= 350 )
table = m_Terms350;
else if ( from.Skills.Total <= 500 )
table = m_Terms500;
else
table = m_Terms700;
int index = skill.BaseFixedPoint / 50;
if ( DateTime.Now - skillInfo.LastGainTime < TimeSpan.FromMinutes( table[ index > 23 ? 23 : index ] ) )
return false;
return true;
}
return false;
}
开发者ID:greeduomacro,项目名称:uodarktimes-1,代码行数:26,代码来源:GuaranteedGainSystem.cs
示例2: SkillGainAllowed
public static bool SkillGainAllowed( Mobile from, Skill skill )
{
if ( from.Player )
{
MobileRateInfo mobileInfo = MobileRateInfo.GetMobileInfo( from );
SkillRateInfo skillInfo = mobileInfo.GetSkillInfo( skill );
// SKILL GAIN RESTRICTIONS
// Here you can edit restrictions suitable for your needs
if ( skill.Base >= 100.0 && ( mobileInfo.SkillGainsCount >= 72 || DateTime.Now - skillInfo.LastGainTime < TimeSpan.FromMinutes( 5.0 ) ) )
return false;
if ( skill.Base >= 90.0 && ( mobileInfo.SkillGainsCount >= 30 || DateTime.Now - skillInfo.LastGainTime < TimeSpan.FromMinutes( 10.0 ) ) )
return false;
else if ( skill.Base >= 80.0 && ( mobileInfo.SkillGainsCount >= 60 || DateTime.Now - skillInfo.LastGainTime < TimeSpan.FromMinutes( 5.0 ) ) )
return false;
else if ( skill.Base >= 70.0 && ( mobileInfo.SkillGainsCount >= 100 || DateTime.Now - skillInfo.LastGainTime < TimeSpan.FromMinutes( 3.0 ) ) )
return false;
else if ( skill.Base < 70.0 )
return true;
// End!
mobileInfo.SkillGainsCount++;
skillInfo.LastGainTime = DateTime.Now;
skillInfo.GainsCount++;
}
return true;
}
开发者ID:greeduomacro,项目名称:uodarktimes-1,代码行数:29,代码来源:RateOverTime.cs
示例3: RegisterSkillGain
public static void RegisterSkillGain( Mobile from, Skill skill )
{
if ( from.Player )
{
MobileRateInfo mobileInfo = MobileRateInfo.GetMobileInfo( from );
SkillRateInfo skillInfo = mobileInfo.GetSkillInfo( skill );
skillInfo.LastGainTime = DateTime.Now;
}
}
开发者ID:greeduomacro,项目名称:uodarktimes-1,代码行数:10,代码来源:GuaranteedGainSystem.cs
示例4: Insert
public bool Insert(Skill skill)
{
try
{
_ctx.Skills.Add(skill);
return true;
}
catch
{
return false;
}
}
开发者ID:cometa93,项目名称:SerwerDevilmind,代码行数:12,代码来源:ServerRepository_Skill.cs
示例5: Delete
public bool Delete(Skill skill)
{
try
{
_ctx.Skills.Remove(skill);
return true;
}
catch
{
return false;
}
}
开发者ID:cometa93,项目名称:SerwerDevilmind,代码行数:12,代码来源:ServerRepository_Skill.cs
示例6: Update
public bool Update(Skill oldSkill, Skill newSkill)
{
try
{
_ctx.Entry(oldSkill).CurrentValues.SetValues(newSkill);
return true;
}
catch
{
return false;
}
}
开发者ID:cometa93,项目名称:SerwerDevilmind,代码行数:12,代码来源:ServerRepository_Skill.cs
示例7: CheckSkillUse
// determines whether XmlSpawner, XmlAttachment, or XmlQuest OnSkillUse methods should be invoked.
public static void CheckSkillUse( Mobile m, Skill skill, bool success)
{
if(!(m is PlayerMobile) || skill == null) return;
/*
// first check for any attachments that might support OnSkillUse
ArrayList list = XmlAttach.FindAttachments(m);
if(list != null && list.Count > 0)
{
foreach(XmlAttachment a in list)
{
if(a != null && !a.Deleted && a.HandlesOnSkillUse)
{
a.OnSkillUse(m, skill, success);
}
}
}
*/
// then check for registered skills
ArrayList skilllist = RegisteredSkill.TriggerList(skill.SkillName, m.Map);
if(skilllist == null) return;
// determine whether there are any registered objects for this skill
foreach(RegisteredSkill rs in skilllist)
{
if(rs.sid == skill.SkillName)
{
// if so then invoke their skill handlers
if(rs.target is XmlSpawner)
{
XmlSpawner spawner = (XmlSpawner)rs.target;
if ( spawner.HandlesOnSkillUse )
{
// call the spawner handler
spawner.OnSkillUse(m, skill, success);
}
} else
if(rs.target is IXmlQuest)
{
IXmlQuest quest = (IXmlQuest)rs.target;
if ( quest.HandlesOnSkillUse )
{
// call the xmlquest handler
quest.OnSkillUse(m, skill, success);
}
}
}
}
}
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:53,代码来源:XmlSpawnerSkillCheck.cs
示例8: EditSkillGump
public EditSkillGump( Mobile from, Mobile target, Skill skill, SkillsGumpGroup selected )
: base(GumpOffsetX, GumpOffsetY)
{
m_From = from;
m_Target = target;
m_Skill = skill;
m_Selected = selected;
string initialText = m_Skill.Base.ToString( "F1" );
AddPage( 0 );
AddBackground( 0, 0, BackWidth, BackHeight, BackGumpID );
AddImageTiled( BorderSize, BorderSize, TotalWidth - ( OldStyle ? SetWidth + OffsetSize : 0 ), TotalHeight, OffsetGumpID );
int x = BorderSize + OffsetSize;
int y = BorderSize + OffsetSize;
AddImageTiled( x, y, EntryWidth, EntryHeight, EntryGumpID );
AddLabelCropped( x + TextOffsetX, y, EntryWidth - TextOffsetX, EntryHeight, TextHue, skill.Name );
x += EntryWidth + OffsetSize;
if ( SetGumpID != 0 )
{
AddImageTiled( x, y, SetWidth, EntryHeight, SetGumpID );
}
x = BorderSize + OffsetSize;
y += EntryHeight + OffsetSize;
AddImageTiled( x, y, EntryWidth, EntryHeight, EntryGumpID );
AddTextEntry( x + TextOffsetX, y, EntryWidth - TextOffsetX, EntryHeight, TextHue, 0, initialText );
x += EntryWidth + OffsetSize;
if ( SetGumpID != 0 )
{
AddImageTiled( x, y, SetWidth, EntryHeight, SetGumpID );
}
AddButton( x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 1, GumpButtonType.Reply, 0 );
}
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:41,代码来源:SkillsGump.cs
示例9: eSkillTrabalho
public static bool eSkillTrabalho(Skill skill)
{
SkillName nomeSkill = skill.SkillName;
//Skills de trabalho
if(nomeSkill == SkillName.Alchemy
|| nomeSkill == SkillName.Blacksmith
|| nomeSkill == SkillName.Fletching
|| nomeSkill == SkillName.Carpentry
|| nomeSkill == SkillName.Cartography
|| nomeSkill == SkillName.Cooking
|| nomeSkill == SkillName.Fishing
|| nomeSkill == SkillName.Tailoring
|| nomeSkill == SkillName.Tinkering
|| nomeSkill == SkillName.Lumberjacking
|| nomeSkill == SkillName.Mining) {
return true;
}
return false;
}
开发者ID:evildude807,项目名称:kaltar,代码行数:22,代码来源:SkillUtil.cs
示例10: IsRaceBonus
private bool IsRaceBonus( Mobile m, Skill skill ) {
PlayerMobile pm = m as PlayerMobile;
if( pm.Skills[skill.SkillID].Cap > 100.0 )
return true;
return false;
}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:9,代码来源:SkillCapSelectionGump.cs
示例11: CheckSkill
public static bool CheckSkill( Mobile from, Skill skill, object amObj, double chance )
{
if ( from.Skills.Cap == 0 )
return false;
bool success = ( chance >= Utility.RandomDouble() );
double gc = (double)(from.Skills.Cap - from.Skills.Total) / from.Skills.Cap;
gc += ( skill.Cap - skill.Base ) / skill.Cap;
gc /= 5;
gc += ( 1.0 - chance ) * ( success ? 0.5 : (Core.AOS ? 0.0 : 0.2) );
gc /= 5;
gc *= skill.Info.GainFactor;
if ( gc < 0.001 )
gc = 0.001;
if ( from is BaseCreature && ((BaseCreature)from).Controlled )
gc *= 2;
if ( from.Alive && ( ( gc >= Utility.RandomDouble() && AllowGain( from, skill, amObj ) ) || skill.Base < 10.0 ) )
Gain( from, skill );
// GGS start
else if ( chance <= 0.99 && chance >= 0.1 && skill.Base < skill.Cap && skill.Lock == SkillLock.Up )
{
if ( from.SkillsTotal >= from.SkillsCap )
{
for ( int i = 0; i < from.Skills.Length; ++i )
{
Skill sk = from.Skills[i];
if ( sk.Base == 0 || sk.Lock != SkillLock.Down )
continue;
Gain_GGS( from, skill );
}
}
else
Gain_GGS( from, skill );
}
// GGS end
return success;
}
开发者ID:greeduomacro,项目名称:uodarktimes-1,代码行数:46,代码来源:SkillCheck.cs
示例12: AntiMacroCheck
public bool AntiMacroCheck(Skill skill, object obj)
{
if (obj == null || m_AntiMacroTable == null || this.AccessLevel != AccessLevel.Player)
return true;
Hashtable tbl = (Hashtable)m_AntiMacroTable[skill];
if (tbl == null)
m_AntiMacroTable[skill] = tbl = new Hashtable();
CountAndTimeStamp count = (CountAndTimeStamp)tbl[obj];
if (count != null)
{
if (count.TimeStamp + SkillCheck.AntiMacroExpire <= DateTime.Now)
{
count.Count = 1;
return true;
}
else
{
++count.Count;
if (count.Count <= SkillCheck.Allowance)
return true;
else
return false;
}
}
else
{
tbl[obj] = count = new CountAndTimeStamp();
count.Count = 1;
return true;
}
}
开发者ID:brodock,项目名称:genova-project,代码行数:34,代码来源:PlayerMobile.cs
示例13: OnSkillInvalidated
public override void OnSkillInvalidated(Skill skill)
{
if (Core.AOS && skill.SkillName == SkillName.MagicResist)
UpdateResistances();
}
开发者ID:brodock,项目名称:genova-project,代码行数:5,代码来源:PlayerMobile.cs
示例14: AllowGain
private static bool AllowGain( Mobile from, Skill skill, object obj )
{
if ( Core.AOS && Faction.InSkillLoss( from ) ) //Changed some time between the introduction of AoS and SE.
return false;
if ( AntiMacroCode && from is PlayerMobile && UseAntiMacro[skill.Info.SkillID] )
return ((PlayerMobile)from).AntiMacroCheck( skill, obj );
else
return true;
}
开发者ID:Telm,项目名称:RunUO_EME,代码行数:10,代码来源:SkillCheck.cs
示例15: OnSkillChange
public void OnSkillChange( Skill skill )
{
if ( skill == m_Highest ) // could be downgrading the skill, force a recalc
m_Highest = null;
else if ( m_Highest != null && skill.BaseFixedPoint > m_Highest.BaseFixedPoint )
m_Highest = skill;
m_Owner.OnSkillInvalidated( skill );
NetState ns = m_Owner.NetState;
if ( ns != null )
ns.Send( new SkillChange( skill ) );
}
开发者ID:AlcesAlces,项目名称:UOsmart,代码行数:14,代码来源:Skills.cs
示例16: CheckTriggers
public void CheckTriggers( Mobile m, Skill s, bool hasproximity )
{
// only proximity trigger when no spawns have already been triggered
if( AllowTriggering && !m_proximityActivated )
{
bool needs_item_trigger = false;
bool needs_speech_trigger = false;
bool needs_skill_trigger = false;
bool needs_object_trigger = false;
bool needs_mob_trigger = false;
bool needs_player_trigger = false;
bool needs_noitem_trigger = false;
bool has_object_trigger = false;
bool has_mob_trigger = false;
bool has_player_trigger = false;
bool has_item_trigger = false;
bool has_noitem_trigger = true; // assume the player doesnt have the trigger-blocking item until it is found by search
m_skipped = false;
// test for the various triggering options in the order of increasing computational demand. No point checking a high demand test
// if a low demand one has already failed.
// check for external triggering
if( m_ExternalTriggering && !m_ExternalTrigger ) return;
// if speech triggering is set then test for successful activation
if( m_SpeechTrigger != null && m_SpeechTrigger.Length > 0 )
{
needs_speech_trigger = true;
}
// check to see if we have to continue
if( needs_speech_trigger && !m_speechTriggerActivated ) return;
// if skill triggering is set then test for successful activation
if( m_SkillTrigger != null && m_SkillTrigger.Length > 0 )
{
needs_skill_trigger = true;
}
// check to see if we have to continue
if( needs_skill_trigger && !m_skillTriggerActivated ) return;
// if item property triggering is set then test for the property value
//
if( m_ObjectPropertyName != null && m_ObjectPropertyName.Length > 0 )
{
needs_object_trigger = true;
string status_str;
if( BaseXmlSpawner.TestItemProperty( this, m_ObjectPropertyItem, m_ObjectPropertyName, null, out status_str ) )
{
has_object_trigger = true;
}
else
has_object_trigger = false;
if( status_str != null && status_str.Length > 0 )
{
this.status_str = status_str;
}
}
// check to see if we have to continue
if( needs_object_trigger && !has_object_trigger ) return;
// if player property triggering is set then look for the mob and test properties
if( m_PlayerPropertyName != null && m_PlayerPropertyName.Length > 0 )
{
needs_player_trigger = true;
string status_str;
if( BaseXmlSpawner.TestMobProperty( this, m, m_PlayerPropertyName, null, out status_str ) )
{
has_player_trigger = true;
}
else
has_player_trigger = false;
if( status_str != null && status_str.Length > 0 )
{
this.status_str = status_str;
}
}
// check to see if we have to continue
if( needs_player_trigger && !has_player_trigger ) return;
// if mob property triggering is set then look for the mob and test properties
if( m_MobPropertyName != null && m_MobPropertyName.Length > 0 &&
m_MobTriggerName != null && m_MobTriggerName.Length > 0 )
{
needs_mob_trigger = true;
string status_str;
if( BaseXmlSpawner.TestMobProperty( this, MobTriggerId, m_MobPropertyName, null, out status_str ) )
{
has_mob_trigger = true;
}
else
has_mob_trigger = false;
//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:hubroot,代码行数:101,代码来源:XmlSpawner2.cs
示例17: Gain
public static void Gain( Mobile from, Skill skill )
{
if ( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
return;
if ( from is BaseCreature && ((BaseCreature)from).IsDeadPet )
return;
if ( skill.SkillName == SkillName.Focus && from is BaseCreature )
return;
if ( skill.Base < skill.Cap && skill.Lock == SkillLock.Up )
{
int toGain = 1;
if ( skill.Base <= 10.0 )
toGain = Utility.Random( 4 ) + 1;
Skills skills = from.Skills;
if ( ( skills.Total / skills.Cap ) >= Utility.RandomDouble() )//( skills.Total >= skills.Cap )
{
for ( int i = 0; i < skills.Length; ++i )
{
Skill toLower = skills[i];
if ( toLower != skill && toLower.Lock == SkillLock.Down && toLower.BaseFixedPoint >= toGain )
{
toLower.BaseFixedPoint -= toGain;
break;
}
}
}
#region Mondain's Legacy
if ( from is PlayerMobile )
if ( Server.Engines.Quests.QuestHelper.EnhancedSkill( (PlayerMobile) from, skill ) )
toGain *= Utility.RandomMinMax( 2, 4 );
#endregion
if ( (skills.Total + toGain) <= skills.Cap )
{
skill.BaseFixedPoint += toGain;
}
if(from is PlayerMobile)
{
PlayerMobile pm = (PlayerMobile)from;
pm.SkillGainTimes[skill.SkillID] = DateTime.Now;
}
}
#region Mondain's Legacy
if ( from is PlayerMobile )
Server.Engines.Quests.QuestHelper.CheckSkill( (PlayerMobile) from, skill );
#endregion
if ( skill.Lock == SkillLock.Up )
{
SkillInfo info = skill.Info;
if ( from.StrLock == StatLockType.Up && (info.StrGain / 33.3) > Utility.RandomDouble() )
GainStat( from, Stat.Str );
else if ( from.DexLock == StatLockType.Up && (info.DexGain / 33.3) > Utility.RandomDouble() )
GainStat( from, Stat.Dex );
else if ( from.IntLock == StatLockType.Up && (info.IntGain / 33.3) > Utility.RandomDouble() )
GainStat( from, Stat.Int );
else if ( from.StrLock == StatLockType.Up )
GainStat_GGS( from, Stat.Str );
else if ( from.DexLock == StatLockType.Up )
GainStat_GGS( from, Stat.Dex );
else if ( from.IntLock == StatLockType.Up )
GainStat_GGS( from, Stat.Int );
}
}
开发者ID:greeduomacro,项目名称:uodarktimes-1,代码行数:81,代码来源:SkillCheck.cs
示例18: Gain
public static void Gain( Mobile from, Skill skill )
{
if ( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
return;
if ( from is BaseCreature && ((BaseCreature)from).IsDeadPet )
return;
if ( skill.SkillName == SkillName.Focus && from is BaseCreature )
return;
if ( skill.Base < skill.Cap && skill.Lock == SkillLock.Up )
{
int toGain = 1;
if ( skill.Base <= 10.0 )
toGain = Utility.Random( 4 ) + 1;
Skills skills = from.Skills;
if ( from.Player && ( skills.Total / skills.Cap ) >= Utility.RandomDouble() )//( skills.Total >= skills.Cap )
{
for ( int i = 0; i < skills.Length; ++i )
{
Skill toLower = skills[i];
if ( toLower != skill && toLower.Lock == SkillLock.Down && toLower.BaseFixedPoint >= toGain )
{
toLower.BaseFixedPoint -= toGain;
break;
}
}
}
#region Mondain's Legacy
if (from is PlayerMobile)
if (Server.Engines.Quests.QuestHelper.EnhancedSkill((PlayerMobile)from, skill))
toGain *= Utility.RandomMinMax(2, 4);
#endregion
#region Scroll of Alacrity
PlayerMobile pm = from as PlayerMobile;
if ( from is PlayerMobile )
{
if ( pm != null && skill.SkillName == pm.AcceleratedSkill && pm.AcceleratedStart > DateTime.Now )
{
pm.SendLocalizedMessage(1077956); // You are infused with intense energy. You are under the effects of an accelerated skillgain scroll.
toGain = Utility.RandomMinMax(2, 5);
}
}
#endregion
if ( !from.Player || (skills.Total + toGain) <= skills.Cap )
{
skill.BaseFixedPoint += toGain;
}
}
#region Mondain's Legacy
if ( from is PlayerMobile )
Server.Engines.Quests.QuestHelper.CheckSkill( (PlayerMobile) from, skill );
#endregion
if ( skill.Lock == SkillLock.Up )
{
SkillInfo info = skill.Info;
if ( from.StrLock == StatLockType.Up && (info.StrGain / 33.3) > Utility.RandomDouble() )
GainStat( from, Stat.Str );
else if ( from.DexLock == StatLockType.Up && (info.DexGain / 33.3) > Utility.RandomDouble() )
GainStat( from, Stat.Dex );
else if ( from.IntLock == StatLockType.Up && (info.IntGain / 33.3) > Utility.RandomDouble() )
GainStat( from, Stat.Int );
}
}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:76,代码来源:SkillCheck.cs
示例19: OnSkillUse
public void OnSkillUse(Mobile m, Skill skill, bool success)
{
}
开发者ID:Crome696,项目名称:ServUO,代码行数:3,代码来源:XmlQuestToken.cs
示例20: ConfirmSkillGump
public ConfirmSkillGump( SoulStone stone, Skill skill ) : base( 50, 50 )
{
m_Stone = stone;
m_Skill = skill;
AddBackground( 0, 0, 520, 440, 0x13BE );
AddImageTiled( 10, 10, 500, 20, 0xA40 );
AddImageTiled( 10, 40, 500, 360, 0xA40 );
AddImageTiled( 10, 410, 500, 20, 0xA40 );
AddAlphaRegion( 10, 10, 500, 420 );
AddHtmlLocalized( 10, 12, 500, 20, 1070709, 0x7FFF, false, false ); // <CENTER>Confirm Soulstone Transfer</CENTER>
/* <CENTER>Soulstone</CENTER><BR>
* You are using a Soulstone. This powerful artifact allows you to remove skill points
* from your character and store them in the stone for later retrieval. In order to use
* the stone, you must make sure your Skill Lock for the indicated skill is pointed downward.
* Click the "Skills" button on your Paperdoll to access the Skill List, and double-check
* your skill lock.<BR><BR>
*
* Once you activate the stone, all skill points in the indicated skill will be removed from
* your character. These skill points can later be retrieved. IMPORTANT: When retrieving
* skill points from a Soulstone, the Soulstone WILL REPLACE any existing skill points
* already on your character!<BR><BR>
*
* This is an Account Bound Soulstone. Skill pointsstored inside can be retrieved by any
* character on the same account as the character who placed them into the stone.
*/
AddHtmlLocalized( 10, 42, 500, 110, 1061067, 0x7FFF, false, true );
AddHtmlLocalized( 10, 200, 390, 20, 1062297, 0x7FFF, false, false ); // Skill Chosen:
AddHtmlLocalized(210, 200, 390, 20, AosSkillBonuses.GetLabel(skill.SkillName), 0x7FFF, false, false);
AddHtmlLocalized( 10, 220, 390, 20, 1062298, 0x7FFF, false, false ); // Current Value:
AddLabel( 210, 220, 0x481, skill.Base.ToString( "0.0" ) );
AddHtmlLocalized( 10, 240, 390, 20, 1062299, 0x7FFF, false, false ); // Current Cap:
AddLabel( 210, 240, 0x481, skill.Cap.ToString( "0.0" ) );
AddHtmlLocalized( 10, 260, 390, 20, 1062300, 0x7FFF, false, false ); // New Value:
AddLabel( 210, 260, 0x481, "0.0" );
AddButton( 10, 360, 0xFA5, 0xFA6, 2, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 45, 362, 450, 20, 1070720, 0x7FFF, false, false ); // Activate the stone. I am ready to transfer the skill points to it.
AddButton( 10, 380, 0xFA5, 0xFA6, 1, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 45, 382, 450, 20, 1062279, 0x7FFF, false, false ); // No, let me make another selection.
AddButton( 10, 410, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 45, 412, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL
}
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:53,代码来源:SoulStone.cs
注:本文中的Server.Skill类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论