本文整理匯總了C#中Server.Items.Spellbook.HasSpell方法的典型用法代碼示例。如果您正苦於以下問題:C# Spellbook.HasSpell方法的具體用法?C# Spellbook.HasSpell怎麽用?C# Spellbook.HasSpell使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Server.Items.Spellbook
的用法示例。
在下文中一共展示了Spellbook.HasSpell方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ValidateSpellbook
public static bool ValidateSpellbook( Spellbook book, int spellID, SpellbookType type )
{
return ( book.SpellbookType == type && ( spellID == -1 || book.HasSpell( spellID ) ) );
}
示例2: 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));
}