本文整理汇总了C#中Saga.PrimaryTypes.Character类的典型用法代码示例。如果您正苦于以下问题:C# Character类的具体用法?C# Character怎么用?C# Character使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Character类属于Saga.PrimaryTypes命名空间,在下文中一共展示了Character类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetJobSpeciaficSkills
public List<uint> GetJobSpeciaficSkills(MySqlConnection connection, Character target, byte job)
{
List<uint> MyList = new List<uint>();
MySqlDataReader reader = null;
try
{
//LOAD ALL SKILL INFORMATION
MySqlCommand command = new MySqlCommand(_query_65, connection);
command.Parameters.AddWithValue("CharId", target.ModelId);
reader = command.ExecuteReader(CommandBehavior.SequentialAccess);
while (reader.Read())
{
Skill skill = new Skill();
skill.Id = reader.GetUInt32(0);
if (Singleton.SpellManager.TryGetSpell(skill.Id, out skill.info) &&
skill.info.requiredJobs[job - 1] == 1)
MyList.Add(skill.Id);
}
return MyList;
}
catch (Exception e)
{
__dbtracelog.WriteError("Database", e.Message);
return new List<uint>();
}
finally
{
//ALWAYS CLOSE THE READ RESULT
if (reader != null) reader.Close();
}
}
示例2: Create
/// <summary>
/// Create a collection of item drops
/// </summary>
/// <param name="mapobject"></param>
/// <param name="character"></param>
/// <returns></returns>
public static LootCollection Create(MapObject mapobject, Character character)
{
if (MapObject.IsPlayer(mapobject)) throw new SystemException("Cannot create loot for mapobjects");
LootCollection collection = new LootCollection();
PartySession party = character.sessionParty;
if (party == null)
{
collection.LootLeader = character.id;
}
else if (party.LootSettings == 3 && party.ItemLeader.currentzone == mapobject.currentzone &&
mapobject.currentzone.IsInSightRangeBySquare(mapobject.Position, party.ItemLeader.Position))
{
collection.LootLeader = party.ItemLeader.id;
}
else
{
collection.LootLeader = character.id;
}
// Generate loot from base mobs
foreach (Rag2Item c in Singleton.Itemdrops.FindItemDropsById(mapobject.ModelId, character._DropRate))
{
collection.Lootlist.Add(c);
}
//Item drops from quest content
foreach (Rag2Item item in QuestBase.UserQuestLoot(mapobject.ModelId, character))
{
collection.Lootlist.Add(item);
}
return collection;
}
示例3: GetAllLearnedSkills
public IEnumerable<uint> GetAllLearnedSkills(MySqlConnection connection, Character target)
{
MySqlCommand command = new MySqlCommand(_query_61, connection);
command.Parameters.AddWithValue("CharId", target.ModelId);
MySqlDataReader reader = null;
List<uint> Skills = new List<uint>();
try
{
//LOAD ALL SKILL INFORMATION
reader = command.ExecuteReader(CommandBehavior.SequentialAccess);
while (reader.Read())
{
Skills.Add(reader.GetUInt32(0));
}
return Skills;
}
catch (Exception e)
{
__dbtracelog.WriteError("Database", e.Message);
return Skills;
}
finally
{
//ALWAYS CLOSE THE READ RESULT
if (reader != null) reader.Close();
}
}
示例4: OnCheckQuest
protected void OnCheckQuest(Character target)
{
foreach (QuestBase c in target.QuestObjectives)
{
c.CheckQuest(target);
}
}
示例5: OnOpenBook
public void OnOpenBook(Character sender)
{
Rag2Collection items = new Rag2Collection();
foreach (Rag2Item c in Singleton.Itemdrops.FindItemDropsById(this.ModelId, sender._DropRate))
items.Add(c);
this.loottable.Add(sender.id, items);
}
示例6: ClearNpc
public static void ClearNpc(Character character, Match match)
{
ThreadStart AsyncOperation = delegate()
{
//Clear all mobs
foreach (Zone zone in Singleton.Zones.HostedZones())
{
zone.Clear();
}
//Respawns world objects (npc & quests)
Singleton.QuestBoardSpawnManager.Reload();
//Respawn npc
Singleton.NpcSpawnManager.Reload();
//Resend npc to actor
foreach (Character mcharacter in Tasks.LifeCycle.Characters)
{
Regiontree tree = mcharacter.currentzone.Regiontree;
foreach (MapObject regionObject in tree.SearchActors(mcharacter, Saga.Enumarations.SearchFlags.Npcs | Saga.Enumarations.SearchFlags.MapItems | Saga.Enumarations.SearchFlags.StaticObjects))
{
if (Point.IsInSightRangeByRadius(mcharacter.Position, regionObject.Position))
{
regionObject.ShowObject(character);
regionObject.Appears(character);
}
}
}
};
Thread thread = new Thread(AsyncOperation);
thread.Start();
}
示例7: OnAuction
/// <summary>
/// Occurs when the auction button is pressed.
/// </summary>
/// <param name="npc">Npc who calls the function</param>
/// <param name="target">Character who requires interaction</param>
protected virtual void OnAuction(BaseNPC npc, Character target)
{
Common.Actions.OpenSubmenu(target, npc,
_Auction, //Dialog script to show
DialogType.Market, //Button function
21 //Open market
);
}
示例8: SaveCredits
public static bool SaveCredits(Character character, int CreditValue)
{
IQueryProvider provider = Singleton.Database.GetQueryProvider();
provider.CmdText = "UPDATE list_credits SET [email protected] [email protected]";
provider.Parameters.AddWithValue("CharId", character.ModelId);
provider.Parameters.AddWithValue("Credits", CreditValue);
return Singleton.Database.ExecuteNonQuery(provider) > 0;
}
示例9: GetDialogButtons
public DialogType[] GetDialogButtons(Character target)
{
List<DialogType> types = new List<DialogType>();
types.AddRange(this.state.GetDialogButtons(this, target));
DialogType[] typesa = types.ToArray();
return typesa;
}
示例10: Open
public void Open(Character character, BaseNPC basenpc)
{
character.Tag = this;
SMSG_SUPPLYMENU spkt = new SMSG_SUPPLYMENU();
spkt.MenuId = this.TradeMenu;
spkt.SessionId = character.id;
character.client.Send((byte[])spkt);
}
示例11: Appears
/// <summary>
/// Subscribes the monsters moving ai if an
/// character appears.
/// </summary>
/// <param name="character"></param>
public override void Appears(Character character)
{
//ENABLE THE AI
if (!LifespanAI.IsSubscribed(this))
{
Lifespan.lasttick = Environment.TickCount;
LifespanAI.Subscribe(this);
}
}
示例12: ComputeIcon
public override int ComputeIcon(Character target)
{
int dialog = 0;
if (target.client.AvailablePersonalRequests.ContainsKey(this.ModelId))
dialog |= 1;
if (QuestBase.IsTalkToObjective(this.ModelId, target))
dialog |= 2;
return (int)(base.ComputeIcon(target) | dialog);
}
示例13: WideMovement
public void WideMovement(Character character, params WaypointStructure[] waypoints)
{
SMSG_WIDEMOVEMENTSTART spkt = new SMSG_WIDEMOVEMENTSTART();
spkt.SourceActorID = this.id;
spkt.Speed = (ushort)this.Status.WalkingSpeed;
for (int i = 0; i < waypoints.Length; i++)
spkt.AddWaypoint(waypoints[i].point, waypoints[i].rotation);
spkt.SessionId = character.id;
character.client.Send((byte[])spkt);
}
示例14: GetLootList
public Rag2Collection GetLootList(Character target)
{
Rag2Collection items;
if (!loottable.TryGetValue(target.id, out items))
{
items = new Rag2Collection();
}
return items;
}
示例15: OnKaftraService
/// <summary>
/// Occurs after the Kaftra button is pressed.
/// </summary>
/// <param name="npc">Npc who called the event</param>
/// <param name="target">Character who requirs interaction</param>
protected virtual void OnKaftraService(BaseNPC npc, Character target)
{
Common.Actions.OpenSubmenu(
target, npc,
_KaftraService,
DialogType.Kaftra,
10,
11
);
}