本文整理汇总了C#中Server.Items.Spellbook.InvalidateProperties方法的典型用法代码示例。如果您正苦于以下问题:C# Spellbook.InvalidateProperties方法的具体用法?C# Spellbook.InvalidateProperties怎么用?C# Spellbook.InvalidateProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Items.Spellbook
的用法示例。
在下文中一共展示了Spellbook.InvalidateProperties方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillBook
public void FillBook(Spellbook spb, Mobile from, bool gump)
{
if (spb is BookOfChivalry || spb is BookOfBushido || spb is BookOfNinjitsu)//NOTE:tookout druid cause dont have:ENDNOTE || spb is DruidSpellbook)
{
from.SendMessage("That spellbook is not supported.");
return;
}
if (al_GlobalEntry == null)
InitArray();
int numSpellMissing = 0;
int numSpellFilled = 0;
for (int sid = spb.BookOffset; sid < spb.BookOffset + spb.BookCount; sid++)
{
int tid = sid;
if (spb.HasSpell(sid))
continue;
if (tid >= 100 && tid <= 115)
tid -= 36;
else if (tid > 64)
continue;
if (((ScrollEntry)al_GlobalEntry[tid]).Amount <= 0)
{
numSpellMissing++;
continue;
}
((ScrollEntry)al_GlobalEntry[tid]).Amount --;
int val = sid - spb.BookOffset;
if ( val >= 0 && val < spb.BookCount ) // double check
{
spb.Content |= (ulong)1 << val;
numSpellFilled++;
spb.InvalidateProperties();
}
}
from.SendMessage(numSpellFilled.ToString() + " spells are added to the book. ");
if (numSpellMissing > 0)
from.SendMessage("There are still " + numSpellMissing.ToString() + " spells missing.");
else
from.SendMessage("Now the spell book is complete.");
if (gump)
from.SendGump(new ResourceStorageKeyScribersTomeGump(from, this));
}