本文整理汇总了C#中GameNPC.SaveIntoDatabase方法的典型用法代码示例。如果您正苦于以下问题:C# GameNPC.SaveIntoDatabase方法的具体用法?C# GameNPC.SaveIntoDatabase怎么用?C# GameNPC.SaveIntoDatabase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameNPC
的用法示例。
在下文中一共展示了GameNPC.SaveIntoDatabase方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ScriptLoaded
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
{
if (!ServerProperties.Properties.LOAD_QUESTS)
return;
if (log.IsInfoEnabled)
log.Info("Quest \"" + questTitle + "\" initializing ...");
/* First thing we do in here is to search for the NPCs inside
* the world who comes from the certain Realm. If we find a the players,
* this means we don't have to create a new one.
*
* NOTE: You can do anything you want in this method, you don't have
* to search for NPC's ... you could create a custom item, place it
* on the ground and if a player picks it up, he will get the quest!
* Just examples, do anything you like and feel comfortable with :)
*/
#region defineNPCS
GameNPC[] npcs = WorldMgr.GetNPCsByName("Kealan", eRealm.Albion);
/* Whops, if the npcs array length is 0 then no Sir Quait exists in
* this users Mob Database, so we simply create one ;-)
* else we take the existing one. And if more than one exist, we take
* the first ...
*/
if (npcs.Length == 0)
{
kealan = new GameNPC();
kealan.Model = 281;
kealan.Name = "Kealan";
if (log.IsWarnEnabled)
log.Warn("Could not find " + kealan.Name + ", creating him ...");
kealan.GuildName = "Part of " + questTitle + " Quest";
kealan.Realm = eRealm.Albion;
kealan.CurrentRegionID = 1;
kealan.Size = 48;
kealan.Level = 32;
kealan.X = 493414;
kealan.Y = 593089;
kealan.Z = 1797;
kealan.Heading = 830;
kealan.EquipmentTemplateID = "11704675";
//You don't have to store the created mob in the db if you don't want,
//it will be recreated each time it is not found, just comment the following
//line if you rather not modify your database
if (SAVE_INTO_DATABASE)
kealan.SaveIntoDatabase();
kealan.AddToWorld();
}
else
kealan = npcs[0];
npcs = WorldMgr.GetNPCsByName("Arachneida", eRealm.None);
if (npcs.Length == 0)
{
arachneida = new GameNPC();
arachneida.Model = 72;
arachneida.Name = "Arachneida";
if (log.IsWarnEnabled)
log.Warn("Could not find " + arachneida.Name + ", creating her ...");
arachneida.GuildName = "Part of " + questTitle + " Quest";
arachneida.Realm = eRealm.None;
arachneida.CurrentRegionID = 1;
arachneida.Size = 90;
arachneida.Level = 12;
arachneida.X = 534851;
arachneida.Y = 609656;
arachneida.Z = 2456;
arachneida.Heading = 2080;
arachneida.EquipmentTemplateID = "2";
//You don't have to store the created mob in the db if you don't want,
//it will be recreated each time it is not found, just comment the following
//line if you rather not modify your database
if (SAVE_INTO_DATABASE)
arachneida.SaveIntoDatabase();
arachneida.AddToWorld();
}
else
arachneida = npcs[0];
#endregion defineNPCS
#region defineItems
spiderSilkenRobe = GameServer.Database.FindObjectByKey<ItemTemplate>("spider_silken_robe");
if (spiderSilkenRobe == null)
{
spiderSilkenRobe = new ItemTemplate();
spiderSilkenRobe.Name = "Spider Silken Robe";
if (log.IsWarnEnabled)
log.Warn("Could not find " + spiderSilkenRobe.Name + ", creating it ...");
//.........这里部分代码省略.........
示例2: ScriptLoaded
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
{
if (!ServerProperties.Properties.LOAD_QUESTS)
return;
if (log.IsInfoEnabled)
log.Info("Quest \"" + questTitle + "\" initializing ...");
/* First thing we do in here is to search for the NPCs inside
* the world who comes from the certain Realm. If we find a the players,
* this means we don't have to create a new one.
*
* NOTE: You can do anything you want in this method, you don't have
* to search for NPC's ... you could create a custom item, place it
* on the ground and if a player picks it up, he will get the quest!
* Just examples, do anything you like and feel comfortable with :)
*/
#region defineNPCS
GameNPC[] npcs = WorldMgr.GetNPCsByName("Godeleva Dowden", eRealm.Albion);
/* Whops, if the npcs array length is 0 then no npc exists in
* this users Mob Database, so we simply create one ;-)
* else we take the existing one. And if more than one exist, we take
* the first ...
*/
if (npcs.Length == 0)
{
godelevaDowden = new GameNPC();
godelevaDowden.Model = 7;
godelevaDowden.Name = "Godeleva Dowden";
if (log.IsWarnEnabled)
log.Warn("Could not find " + godelevaDowden.Name + ", creating him ...");
godelevaDowden.GuildName = "Part of " + questTitle + " Quest";
godelevaDowden.Realm = eRealm.Albion;
godelevaDowden.CurrentRegionID = 1;
GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
template.AddNPCEquipment(eInventorySlot.FeetArmor, 138);
template.AddNPCEquipment(eInventorySlot.TorsoArmor, 134);
template.AddNPCEquipment(eInventorySlot.LegsArmor, 135);
godelevaDowden.Inventory = template.CloseTemplate();
godelevaDowden.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);
godelevaDowden.Size = 48;
godelevaDowden.Level = 40;
godelevaDowden.X = 559528;
godelevaDowden.Y = 510953;
godelevaDowden.Z = 2488;
godelevaDowden.Heading = 1217;
//You don't have to store the created mob in the db if you don't want,
//it will be recreated each time it is not found, just comment the following
//line if you rather not modify your database
if (SAVE_INTO_DATABASE)
godelevaDowden.SaveIntoDatabase();
godelevaDowden.AddToWorld();
}
else
godelevaDowden = npcs[0];
#endregion
#region defineItems
// item db check
woodenBucket = GameServer.Database.FindObjectByKey<ItemTemplate>("wooden_bucket");
if (woodenBucket == null)
{
if (log.IsWarnEnabled)
log.Warn("Could not find Wooden Bucket, creating it ...");
woodenBucket = new ItemTemplate();
woodenBucket.Name = "Wooden Bucket";
woodenBucket.Level = 1;
woodenBucket.Weight = 10;
woodenBucket.Model = 1610;
woodenBucket.Object_Type = (int)eObjectType.GenericItem;
woodenBucket.Id_nb = "wooden_bucket";
woodenBucket.Price = 0;
woodenBucket.IsPickable = false;
woodenBucket.IsDropable = false;
woodenBucket.Quality = 100;
woodenBucket.Condition = 1000;
woodenBucket.MaxCondition = 1000;
woodenBucket.Durability = 1000;
woodenBucket.MaxDurability = 1000;
//You don't have to store the created item in the db if you don't want,
//it will be recreated each time it is not found, just comment the following
//line if you rather not modify your database
GameServer.Database.AddObject(woodenBucket);
}
// item db check
fullWoodenBucket = GameServer.Database.FindObjectByKey<ItemTemplate>("full_wooden_bucket");
if (fullWoodenBucket == null)
//.........这里部分代码省略.........
示例3: ScriptLoaded
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
{
if (!ServerProperties.Properties.LOAD_QUESTS)
return;
if (log.IsInfoEnabled)
log.Info("Quest \"" + questTitle + "\" initializing ...");
#region defineNPCS
GameNPC[] npcs = WorldMgr.GetNPCsByName("Blercyn", eRealm.Hibernia);
/* Whops, if the npcs array length is 0 then no npc exists in
* this users Mob Database, so we simply create one ;-)
* else we take the existing one. And if more than one exist, we take
* the first ...
*/
if (npcs.Length == 0)
{
Blercyn = new GameNPC();
Blercyn.Model = 700;
Blercyn.Name = "Blercyn";
if (log.IsWarnEnabled)
log.Warn("Could not find " + Blercyn.Name + ", creating him ...");
//Blercyn.GuildName = "Part of " + questTitle + " Quest";
Blercyn.Realm = eRealm.Hibernia;
Blercyn.CurrentRegionID = 200;
GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58);
Blercyn.Inventory = template.CloseTemplate();
Blercyn.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);
Blercyn.Size = 50;
Blercyn.Level = 50;
Blercyn.X = 348614;
Blercyn.Y = 492141;
Blercyn.Z = 5199;
Blercyn.Heading = 1539;
//You don't have to store the created mob in the db if you don't want,
//it will be recreated each time it is not found, just comment the following
//line if you rather not modify your database
if (SAVE_INTO_DATABASE)
Blercyn.SaveIntoDatabase();
Blercyn.AddToWorld();
}
else
Blercyn = npcs[0];
//Pompin The Crier
npcs = WorldMgr.GetNPCsByName("Epona", eRealm.Hibernia);
if (npcs.Length == 0)
{
Epona = new GameNPC();
Epona.Model = 10;
Epona.Name = "Epona";
if (log.IsWarnEnabled)
log.Warn("Could not find " + Epona.Name + ", creating him ...");
//Blercyn.GuildName = "Part of " + questTitle + " Quest";
Epona.Realm = eRealm.Hibernia;
Epona.CurrentRegionID = 200;
GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58);
Epona.Inventory = template.CloseTemplate();
Epona.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);
Epona.Size = 50;
Epona.Level = 50;
Epona.X = 347606;
Epona.Y = 490658;
Epona.Z = 5227;
Epona.Heading = 1342;
//You don't have to store the created mob in the db if you don't want,
//it will be recreated each time it is not found, just comment the following
//line if you rather not modify your database
if (SAVE_INTO_DATABASE)
Epona.SaveIntoDatabase();
Epona.AddToWorld();
}
else
Epona = npcs[0];
#endregion defineNPCS
GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));
GameEventMgr.AddHandler(Blercyn, GameLivingEvent.Interact, new DOLEventHandler(TalkToBlercyn));
GameEventMgr.AddHandler(Blercyn, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToBlercyn));
GameEventMgr.AddHandler(Epona, GameLivingEvent.Interact, new DOLEventHandler(TalkToEpona));
GameEventMgr.AddHandler(Epona, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToEpona));
Blercyn.AddQuestToGive(typeof(SearchForKnowledge));
//.........这里部分代码省略.........
示例4: ScriptLoaded
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
{
if (!ServerProperties.Properties.LOAD_QUESTS)
return;
if (log.IsInfoEnabled)
log.Info("Quest \"" + questTitle + "\" initializing ...");
/* First thing we do in here is to search for the NPCs inside
* the world who comes from the certain Realm. If we find a the players,
* this means we don't have to create a new one.
*
* NOTE: You can do anything you want in this method, you don't have
* to search for NPC's ... you could create a custom item, place it
* on the ground and if a player picks it up, he will get the quest!
* Just examples, do anything you like and feel comfortable with :)
*/
#region defineNPCs
masterFrederick = GetMasterFrederick();
GameNPC[] npcs = WorldMgr.GetNPCsByName("Queen Tatiana", eRealm.None);
if (npcs.Length == 0)
{
if (log.IsWarnEnabled)
log.Warn("Could not find Queen Tatiana, creating ...");
queenTatiana = new GameNPC();
queenTatiana.Name = "Queen Tatiana";
queenTatiana.X = 558500;
queenTatiana.Y = 533042;
queenTatiana.Z = 2573;
queenTatiana.Heading = 174;
queenTatiana.Model = 603;
queenTatiana.GuildName = "Part of " + questTitle + " Quest";
queenTatiana.Realm = eRealm.None;
queenTatiana.CurrentRegionID = 1;
queenTatiana.Size = 49;
queenTatiana.Level = 5;
StandardMobBrain brain = new StandardMobBrain();
brain.AggroLevel = 30;
brain.AggroRange = 600;
queenTatiana.SetOwnBrain(brain);
if (SAVE_INTO_DATABASE)
queenTatiana.SaveIntoDatabase();
queenTatiana.AddToWorld();
}
else
{
queenTatiana = (GameNPC) npcs[0];
}
int counter = 0;
foreach (GameNPC npc in queenTatiana.GetNPCsInRadius(500))
{
if (npc.Name == "ire fairy sorceress")
{
fairySorceress[counter] = (GameNPC) npc;
counter++;
}
if (counter == fairySorceress.Length)
break;
}
for (int i = 0; i < fairySorceress.Length; i++)
{
if (fairySorceress[i] == null)
{
if (log.IsWarnEnabled)
log.Warn("Could not find ire fairy sorceress, creating ...");
fairySorceress[i] = new GameNPC();
fairySorceress[i].Model = 603; // //819;
fairySorceress[i].Name = "ire fairy sorceress";
fairySorceress[i].GuildName = "Part of " + questTitle + " Quest";
fairySorceress[i].Realm = eRealm.None;
fairySorceress[i].CurrentRegionID = 1;
fairySorceress[i].Size = 35;
fairySorceress[i].Level = 5;
fairySorceress[i].X = queenTatiana.X + Util.Random(30, 150);
fairySorceress[i].Y = queenTatiana.Y + Util.Random(30, 150);
fairySorceress[i].Z = queenTatiana.Z;
StandardMobBrain brain = new StandardMobBrain();
brain.AggroLevel = 30;
brain.AggroRange = 600;
fairySorceress[i].SetOwnBrain(brain);
fairySorceress[i].Heading = 93;
//fairySorceress[i].EquipmentTemplateID = 200276;
//You don't have to store the created mob in the db if you don't want,
//it will be recreated each time it is not found, just comment the following
//line if you rather not modify your database
if (SAVE_INTO_DATABASE)
fairySorceress[i].SaveIntoDatabase();
fairySorceress[i].AddToWorld();
}
}
//.........这里部分代码省略.........
示例5: ScriptLoaded
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
{
if (!ServerProperties.Properties.LOAD_QUESTS)
return;
if (log.IsInfoEnabled)
log.Info("Quest \"" + questTitle + "\" initializing ...");
/* First thing we do in here is to search for the NPCs inside
* the world who comes from the certain Realm. If we find the npc
* this means we don't have to create a new one.
*
* NOTE: You can do anything you want in this method, you don't have
* to search for NPC's ... you could create a custom item, place it
* on the ground and if a player picks it up, he will get the quest!
* Just examples, do anything you like and feel comfortable with :)
*/
#region defineNPCS
GameNPC[] npcs = WorldMgr.GetNPCsByName("Baeth", eRealm.Hibernia);
/* If the npcs array length is 0 then no npc exists in
* this users Mob Database, so we simply create one ;-)
* else we take the existing one. And if more than one exist, we take
* the first ...
*/
if (npcs.Length == 0)
{
npcBaeth = new GameNPC();
npcBaeth.Model = 361;
npcBaeth.Name = "Baeth";
if (log.IsWarnEnabled)
{
log.Warn("Could not find " + npcBaeth.Name + ", creating him ...");
}
npcBaeth.GuildName = "Part of " + questTitle + " Quest";
npcBaeth.Realm = eRealm.Hibernia;
npcBaeth.CurrentRegionID = 27;
npcBaeth.Size = 52;
npcBaeth.Level = 30;
npcBaeth.X = 356650;
npcBaeth.Y = 355078;
npcBaeth.Z = 5015;
npcBaeth.Heading = 2959;
if (SAVE_INTO_DATABASE)
{
npcBaeth.SaveIntoDatabase();
}
npcBaeth.AddToWorld();
}
else
{
npcBaeth = npcs[0];
}
npcs = WorldMgr.GetNPCsByName("Jessica", eRealm.Hibernia);
if (npcs.Length == 0)
{
npcJessica = new GameNPC();
npcJessica.Model = 366;
npcJessica.Name = "Jessica";
if (log.IsWarnEnabled)
{
log.Warn("Could not find " + npcJessica.Name + ", creating him ...");
}
npcJessica.GuildName = "Part of " + questTitle + " Quest";
npcJessica.Realm = eRealm.Hibernia;
npcJessica.CurrentRegionID = 27;
npcJessica.Size = 38;
npcJessica.Level = 1;
npcJessica.X = 358068;
npcJessica.Y = 347553;
npcJessica.Z = 5491;
npcJessica.Heading = 49;
if (SAVE_INTO_DATABASE)
{
npcJessica.SaveIntoDatabase();
}
npcJessica.AddToWorld();
}
else
{
npcJessica = npcs[0];
}
#endregion
#region defineItems
// item db check
reedFlute = GameServer.Database.FindObjectByKey<ItemTemplate>("quest_reed_flute");
//.........这里部分代码省略.........
示例6: ScriptLoaded
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
{
if (!ServerProperties.Properties.LOAD_QUESTS)
return;
if (log.IsInfoEnabled)
log.Info("Quest \"" + questTitle + "\" initializing ...");
#region defineNPCS
GameNPC[] npcs = WorldMgr.GetNPCsByName("Lady Grynoch", eRealm.Albion);
if (npcs.Length == 0)
{
LadyGrynoch = new GameNPC();
LadyGrynoch.Model = 5;
LadyGrynoch.Name = "Lady Grynoch";
if (log.IsWarnEnabled)
log.Warn("Could not find " + LadyGrynoch.Name + ", creating her ...");
//k109: My preference, no guildname for quest NPCs. Uncomment if you like that...
//LadyGrynoch.GuildName = "Part of " + questTitle + " Quest";
LadyGrynoch.Realm = eRealm.Albion;
LadyGrynoch.CurrentRegionID = 1;
GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58); //Slot 25
LadyGrynoch.Inventory = template.CloseTemplate();
LadyGrynoch.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);
LadyGrynoch.Size = 51;
LadyGrynoch.Level = 38;
LadyGrynoch.X = 559698;
LadyGrynoch.Y = 513578;
LadyGrynoch.Z = 2428;
LadyGrynoch.Heading = 2742;
if (SAVE_INTO_DATABASE)
LadyGrynoch.SaveIntoDatabase();
LadyGrynoch.AddToWorld();
}
else
LadyGrynoch = npcs[0];
#endregion
#region defineAreas
Demons_Breach_Area = WorldMgr.GetRegion(Demons_Breach.RegionID).AddArea(new Area.Circle("", Demons_Breach.X, Demons_Breach.Y, Demons_Breach.Z, 200));
Demons_Breach_Area.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterDemonBreachArea));
#endregion
GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));
GameEventMgr.AddHandler(LadyGrynoch, GameLivingEvent.Interact, new DOLEventHandler(TalkToLadyGrynoch));
GameEventMgr.AddHandler(LadyGrynoch, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToLadyGrynoch));
LadyGrynoch.AddQuestToGive(typeof(ToReachTheBreach));
if (log.IsInfoEnabled)
log.Info("Quest \"" + questTitle + "\" initialized");
}
示例7: ScriptLoaded
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
{
if (!ServerProperties.Properties.LOAD_QUESTS)
return;
if (log.IsInfoEnabled)
log.Info("Quest \"" + questTitle + "\" initializing ...");
#region NPC Declarations
GameNPC[] npcs = WorldMgr.GetNPCsByName("Brigit", eRealm.Hibernia);
if (npcs.Length == 0)
{
if (log.IsWarnEnabled)
log.Warn("Could not find Brigit , creating it ...");
Brigit = new GameNPC();
Brigit.Model = 384;
Brigit.Name = "Brigit";
Brigit.GuildName = "";
Brigit.Realm = eRealm.Hibernia;
Brigit.CurrentRegionID = 201;
Brigit.Size = 51;
Brigit.Level = 50;
Brigit.X = 33131;
Brigit.Y = 32922;
Brigit.Z = 8008;
Brigit.Heading = 3254;
Brigit.AddToWorld();
if (SAVE_INTO_DATABASE)
{
Brigit.SaveIntoDatabase();
}
}
else
Brigit = npcs[0];
// end npc
npcs = WorldMgr.GetNPCsByName("Caithor", eRealm.None);
if (npcs.Length == 0)
{
if (log.IsWarnEnabled)
log.Warn("Could not find Caithor , creating it ...");
Caithor = new GameNPC();
Caithor.Model = 339;
Caithor.Name = "Caithor";
Caithor.GuildName = "";
Caithor.Realm = eRealm.None;
Caithor.CurrentRegionID = 200;
Caithor.Size = 60;
Caithor.Level = 65;
Caithor.X = 470547;
Caithor.Y = 531497;
Caithor.Z = 4984;
Caithor.Heading = 3319;
Caithor.AddToWorld();
if (SAVE_INTO_DATABASE)
{
Caithor.SaveIntoDatabase();
}
}
else
Caithor = npcs[0];
// end npc
#endregion
#region Item Declarations
Moonstone = GameServer.Database.FindObjectByKey<ItemTemplate>("Moonstone");
if (Moonstone == null)
{
if (log.IsWarnEnabled)
log.Warn("Could not find Moonstone , creating it ...");
Moonstone = new ItemTemplate();
Moonstone.Id_nb = "Moonstone";
Moonstone.Name = "Moonstone";
Moonstone.Level = 8;
Moonstone.Item_Type = 29;
Moonstone.Model = 514;
Moonstone.IsDropable = false;
Moonstone.IsPickable = false;
Moonstone.DPS_AF = 0;
Moonstone.SPD_ABS = 0;
Moonstone.Object_Type = 41;
Moonstone.Hand = 0;
Moonstone.Type_Damage = 0;
Moonstone.Quality = 100;
Moonstone.Weight = 12;
if (SAVE_INTO_DATABASE)
{
GameServer.Database.AddObject(Moonstone);
}
}
// end item
BardEpicBoots = GameServer.Database.FindObjectByKey<ItemTemplate>("BardEpicBoots");
if (BardEpicBoots == null)
//.........这里部分代码省略.........
示例8: ScriptLoaded
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
{
if (!ServerProperties.Properties.LOAD_QUESTS)
return;
if (log.IsInfoEnabled)
log.Info("Quest \"" + questTitle + "\" initializing ...");
#region defineNPCs
GameNPC[] npcs;
npcs = WorldMgr.GetNPCsByName("Lycla",(eRealm) 2);
if (npcs.Length == 0)
{
Lycla = new DOL.GS.GameNPC();
Lycla.Model = 178;
Lycla.Name = "Lycla";
if (log.IsWarnEnabled)
log.Warn("Could not find " + Lycla.Name + ", creating ...");
Lycla.GuildName = "Part of " + questTitle + " Quest";
Lycla.Realm = eRealm.Midgard;
Lycla.CurrentRegionID = 100;
Lycla.Size = 48;
Lycla.Level = 50;
Lycla.MaxSpeedBase = 191;
Lycla.Faction = FactionMgr.GetFactionByID(0);
Lycla.X = 749032;
Lycla.Y = 814613;
Lycla.Z = 4408;
Lycla.Heading = 170;
Lycla.RespawnInterval = -1;
Lycla.BodyType = 0;
StandardMobBrain brain = new StandardMobBrain();
brain.AggroLevel = 0;
brain.AggroRange = 500;
Lycla.SetOwnBrain(brain);
//You don't have to store the created mob in the db if you don't want,
//it will be recreated each time it is not found, just comment the following
//line if you rather not modify your database
if (SAVE_INTO_DATABASE)
Lycla.SaveIntoDatabase();
Lycla.AddToWorld();
}
else
{
Lycla = npcs[0];
}
npcs = WorldMgr.GetNPCsByName("Amora",(eRealm) 2);
if (npcs.Length == 0)
{
Amora = new DOL.GS.GameNPC();
Amora.Model = 216;
Amora.Name = "Amora";
if (log.IsWarnEnabled)
log.Warn("Could not find " + Amora.Name + ", creating ...");
Amora.GuildName = "Part of " + questTitle + " Quest";
Amora.Realm = eRealm.Midgard;
Amora.CurrentRegionID = 100;
Amora.Size = 49;
Amora.Level = 28;
Amora.MaxSpeedBase = 191;
Amora.Faction = FactionMgr.GetFactionByID(0);
Amora.X = 747714;
Amora.Y = 814910;
Amora.Z = 4636;
Amora.Heading = 3456;
Amora.RespawnInterval = -1;
Amora.BodyType = 0;
StandardMobBrain brain = new StandardMobBrain();
brain.AggroLevel = 0;
brain.AggroRange = 500;
Amora.SetOwnBrain(brain);
//You don't have to store the created mob in the db if you don't want,
//it will be recreated each time it is not found, just comment the following
//line if you rather not modify your database
if (SAVE_INTO_DATABASE)
Amora.SaveIntoDatabase();
Amora.AddToWorld();
}
else
{
Amora = npcs[0];
}
npcs = WorldMgr.GetNPCsByName("Kari",(eRealm) 2);
if (npcs.Length == 0)
{
Kari = new GameHealer();
Kari.Model = 216;
Kari.Name = "Kari";
if (log.IsWarnEnabled)
log.Warn("Could not find " + Kari.Name + ", creating ...");
//.........这里部分代码省略.........
示例9: ScriptLoaded
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
{
if (!ServerProperties.Properties.LOAD_QUESTS)
return;
if (log.IsInfoEnabled)
log.Info("Quest \"" + questTitle + "\" initializing ...");
#region defineNPCs
GameNPC[] npcs;
npcs = WorldMgr.GetNPCsByName("Aegan",(eRealm) 2);
if (npcs.Length == 0)
{
Aegan = new DOL.GS.GameNPC();
Aegan.Model = 232;
Aegan.Name = "Aegan";
if (log.IsWarnEnabled)
log.Warn("Could not find " + Aegan.Name + ", creating ...");
Aegan.GuildName = "Part of " + questTitle + " Quest";
Aegan.Realm = eRealm.Midgard;
Aegan.CurrentRegionID = 100;
Aegan.Size = 51;
Aegan.Level = 41;
Aegan.MaxSpeedBase = 191;
Aegan.Faction = FactionMgr.GetFactionByID(0);
Aegan.X = 805398;
Aegan.Y = 725829;
Aegan.Z = 4700;
Aegan.Heading = 3595;
Aegan.RespawnInterval = -1;
Aegan.BodyType = 0;
StandardMobBrain brain = new StandardMobBrain();
brain.AggroLevel = 0;
brain.AggroRange = 500;
Aegan.SetOwnBrain(brain);
//You don't have to store the created mob in the db if you don't want,
//it will be recreated each time it is not found, just comment the following
//line if you rather not modify your database
if (SAVE_INTO_DATABASE)
Aegan.SaveIntoDatabase();
Aegan.AddToWorld();
}
else
{
Aegan = npcs[0];
}
#endregion
#region defineItems
clawofblackmauler = GameServer.Database.FindObjectByKey<ItemTemplate>("clawofblackmauler");
if (clawofblackmauler == null)
{
clawofblackmauler = new ItemTemplate();
clawofblackmauler.Name = "Claw of Black Mauler";
if (log.IsWarnEnabled)
log.Warn("Could not find " + clawofblackmauler.Name + ", creating it ...");
clawofblackmauler.Level = 50;
clawofblackmauler.Weight = 5;
clawofblackmauler.Model = 1;
clawofblackmauler.Object_Type = 0;
clawofblackmauler.Item_Type = 40;
clawofblackmauler.Id_nb = "clawofblackmauler";
clawofblackmauler.Hand = 0;
clawofblackmauler.Price = 0;
clawofblackmauler.IsPickable = true;
clawofblackmauler.IsDropable = true;
clawofblackmauler.IsTradable = true;
clawofblackmauler.CanDropAsLoot = false;
clawofblackmauler.Color = 0;
clawofblackmauler.Bonus = 35; // default bonus
clawofblackmauler.Bonus1 = 0;
clawofblackmauler.Bonus1Type = (int) 0;
clawofblackmauler.Bonus2 = 0;
clawofblackmauler.Bonus2Type = (int) 0;
clawofblackmauler.Bonus3 = 0;
clawofblackmauler.Bonus3Type = (int) 0;
clawofblackmauler.Bonus4 = 0;
clawofblackmauler.Bonus4Type = (int) 0;
clawofblackmauler.Bonus5 = 0;
clawofblackmauler.Bonus5Type = (int) 0;
clawofblackmauler.Bonus6 = 0;
clawofblackmauler.Bonus6Type = (int) 0;
clawofblackmauler.Bonus7 = 0;
clawofblackmauler.Bonus7Type = (int) 0;
clawofblackmauler.Bonus8 = 0;
clawofblackmauler.Bonus8Type = (int) 0;
clawofblackmauler.Bonus9 = 0;
clawofblackmauler.Bonus9Type = (int) 0;
clawofblackmauler.Bonus10 = 0;
clawofblackmauler.Bonus10Type = (int) 0;
clawofblackmauler.ExtraBonus = 0;
clawofblackmauler.ExtraBonusType = (int) 0;
clawofblackmauler.Effect = 0;
clawofblackmauler.Emblem = 0;
//.........这里部分代码省略.........
示例10: GetAddrir
public static GameNPC GetAddrir()
{
GameNPC[] npcs = WorldMgr.GetNPCsByName("Addrir", eRealm.Hibernia);
GameNPC addrir = null;
if (npcs.Length == 0)
{
addrir = new GameNPC();
addrir.Model = 335;
addrir.Name = "Addrir";
if (log.IsWarnEnabled)
log.Warn("Could not find " + addrir.Name + ", creating him ...");
addrir.GuildName = "Part of Addrir Quests";
addrir.Realm = eRealm.Hibernia;
addrir.CurrentRegionID = 200;
GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58, 35);
template.AddNPCEquipment(eInventorySlot.Cloak, 57, 32);
template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 1173);
addrir.Inventory = template.CloseTemplate();
addrir.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);
// addrir.AddNPCEquipment((byte) eVisibleItems.TORSO, 58, 35, 0, 0);
// addrir.AddNPCEquipment((byte) eVisibleItems.CLOAK, 57, 32, 0, 0);
// addrir.AddNPCEquipment((byte) eVisibleItems.RIGHT_HAND, 1173, 0, 0, 0);
addrir.Size = 50;
addrir.Level = 50;
addrir.X = GameLocation.ConvertLocalXToGlobalX(26955, 200);
addrir.Y = GameLocation.ConvertLocalYToGlobalY(7789, 200);
addrir.Z = 5196;
addrir.Heading = 22;
StandardMobBrain brain = new StandardMobBrain();
brain.AggroLevel = 0;
brain.AggroRange = 0;
addrir.SetOwnBrain(brain);
//You don't have to store the created mob in the db if you don't want,
//it will be recreated each time it is not found, just comment the following
//line if you rather not modify your database
if (SAVE_INTO_DATABASE)
addrir.SaveIntoDatabase();
addrir.AddToWorld();
}
else
addrir = npcs[0];
return addrir;
}
示例11: ScriptLoaded
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
{
if (!ServerProperties.Properties.LOAD_QUESTS)
return;
if (log.IsInfoEnabled)
log.Info("Quest \"" + questTitle + "\" initializing ...");
/* First thing we do in here is to search for the NPCs inside
* the world who comes from the certain Realm. If we find a the players,
* this means we don't have to create a new one.
*
* NOTE: You can do anything you want in this method, you don't have
* to search for NPC's ... you could create a custom item, place it
* on the ground and if a player picks it up, he will get the quest!
* Just examples, do anything you like and feel comfortable with :)
*/
#region defineNPCs
GameNPC[] npcs = WorldMgr.GetNPCsByName("Brice Yarley", eRealm.Albion);
if (npcs.Length == 0)
{
briceYarley = new GameNPC();
briceYarley.Model = 10;
briceYarley.Name = "Brice Yarley";
if (log.IsWarnEnabled)
log.Warn("Could not find " + briceYarley.Name + ", creating him ...");
briceYarley.Realm = eRealm.Albion;
briceYarley.CurrentRegionID = 1;
briceYarley.Size = 51;
briceYarley.Level = 43;
briceYarley.X = 370236;
briceYarley.Y = 679755;
briceYarley.Z = 5558;
briceYarley.Heading = 2468;
briceYarley.MaxSpeedBase = 191;
//You don't have to store the created mob in the db if you don't want,
//it will be recreated each time it is not found, just comment the following
//line if you rather not modify your database
if (SAVE_INTO_DATABASE)
briceYarley.SaveIntoDatabase();
briceYarley.AddToWorld();
}
else
briceYarley = npcs[0];
npcs = WorldMgr.GetNPCsByName("Patrick Yarley", eRealm.Albion);
if (npcs.Length == 0)
{
patrickYarley = new GameNPC();
patrickYarley.Model = 9;
patrickYarley.Name = "Patrick Yarley";
if (log.IsWarnEnabled)
log.Warn("Could not find " + patrickYarley.Name + ", creating him ...");
patrickYarley.Realm = eRealm.Albion;
patrickYarley.CurrentRegionID = 1;
patrickYarley.Size = 51;
patrickYarley.Level = 43;
patrickYarley.X = 371752;
patrickYarley.Y = 680486;
patrickYarley.Z = 5595;
patrickYarley.Heading = 0;
patrickYarley.MaxSpeedBase = 200;
//You don't have to store the created mob in the db if you don't want,
//it will be recreated each time it is not found, just comment the following
//line if you rather not modify your database
if (SAVE_INTO_DATABASE)
patrickYarley.SaveIntoDatabase();
patrickYarley.AddToWorld();
}
else
patrickYarley = npcs[0];
#endregion
#region defineItems
elderWood = GameServer.Database.FindObjectByKey<ItemTemplate>("elder_wood");
if (elderWood == null)
{
if (log.IsWarnEnabled)
log.Warn("Could not find Elder Wood, creating it ...");
elderWood = new ItemTemplate();
elderWood.Object_Type = 0;
elderWood.Id_nb = "elder_wood";
elderWood.Name = "Elder Wood";
elderWood.Level = 1;
elderWood.Model = 520;
elderWood.IsDropable = false;
elderWood.IsPickable = false;
elderWood.Weight = 5;
GameServer.Database.AddObject(elderWood);
}
boogeyTeeth = GameServer.Database.FindObjectByKey<ItemTemplate>("boogey_teeth");
if (boogeyTeeth == null)
{
//.........这里部分代码省略.........
示例12: ScriptLoaded
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
{
if (!ServerProperties.Properties.LOAD_QUESTS)
return;
if (log.IsInfoEnabled)
log.Info("Quest \"" + questTitle + "\" initializing ...");
#region defineNPCs
GameNPC[] npcs;
npcs = WorldMgr.GetNPCsByName("Ambient Rat Statua",(eRealm) 0);
if (npcs.Length == 0)
{
AmbientRatStatua = new DOL.GS.GameNPC();
AmbientRatStatua.Model = 1673;
AmbientRatStatua.Name = "Ambient Rat Statua";
if (log.IsWarnEnabled)
log.Warn("Could not find " + AmbientRatStatua.Name + ", creating ...");
AmbientRatStatua.GuildName = "Part of " + questTitle + " Quest";
AmbientRatStatua.Realm = eRealm.None;
AmbientRatStatua.CurrentRegionID = 229;
AmbientRatStatua.Size = 1;
AmbientRatStatua.Level = 1;
AmbientRatStatua.MaxSpeedBase = 0;
AmbientRatStatua.X = 40887;
AmbientRatStatua.Y = 39276;
AmbientRatStatua.Z = 17040;
AmbientRatStatua.Heading = 0;
AmbientRatStatua.RespawnInterval = -1;
AmbientRatStatua.BodyType = 0;
StandardMobBrain brain = new StandardMobBrain();
brain.AggroLevel = 0;
brain.AggroRange = 0;
AmbientRatStatua.SetOwnBrain(brain);
//You don't have to store the created mob in the db if you don't want,
//it will be recreated each time it is not found, just comment the following
//line if you rather not modify your database
if (SAVE_INTO_DATABASE)
AmbientRatStatua.SaveIntoDatabase();
AmbientRatStatua.AddToWorld();
}
else
{
AmbientRatStatua = npcs[0];
}
npcs = WorldMgr.GetNPCsByName("Ballach",(eRealm) 2);
if (npcs.Length == 0)
{
Ballach = new DOL.GS.GameNPC();
Ballach.Model = 225;
Ballach.Name = "Ballach";
if (log.IsWarnEnabled)
log.Warn("Could not find " + Ballach.Name + ", creating ...");
Ballach.GuildName = "Part of " + questTitle + " Quest";
Ballach.Realm = eRealm.Midgard;
Ballach.CurrentRegionID = 243;
Ballach.Size = 48;
Ballach.Level = 20;
Ballach.MaxSpeedBase = 0;
Ballach.Faction = FactionMgr.GetFactionByID(0);
Ballach.X = 27723;
Ballach.Y = 39184;
Ballach.Z = 20156;
Ballach.Heading = 2070;
Ballach.RespawnInterval = -1;
Ballach.BodyType = 0;
StandardMobBrain brain = new StandardMobBrain();
brain.AggroLevel = 0;
brain.AggroRange = 500;
Ballach.SetOwnBrain(brain);
//You don't have to store the created mob in the db if you don't want,
//it will be recreated each time it is not found, just comment the following
//line if you rather not modify your database
if (SAVE_INTO_DATABASE)
Ballach.SaveIntoDatabase();
Ballach.AddToWorld();
}
else
{
Ballach = npcs[0];
}
#endregion
#region defineItems
enchantedflask = GameServer.Database.FindObjectByKey<ItemTemplate>("enchantedflask");
if (enchantedflask == null)
{
enchantedflask = new ItemTemplate();
enchantedflask.Name = "Enchanted Flask";
//.........这里部分代码省略.........
示例13: ScriptLoaded
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
{
if (!ServerProperties.Properties.LOAD_QUESTS)
return;
if (log.IsInfoEnabled)
log.Info("Quest \"" + questTitle + "\" initializing ...");
/* First thing we do in here is to search for the NPCs inside
* the world who comes from the certain Realm. If we find a the players,
* this means we don't have to create a new one.
*
* NOTE: You can do anything you want in this method, you don't have
* to search for NPC's ... you could create a custom item, place it
* on the ground and if a player picks it up, he will get the quest!
* Just examples, do anything you like and feel comfortable with :)
*/
#region defineNPCs
GameNPC[] npcs = WorldMgr.GetNPCsByName("Brother Maynard", eRealm.Albion);
/* Whops, if the npcs array length is 0 then no Sir Quait exists in
* this users Mob Database, so we simply create one ;-)
* else we take the existing one. And if more than one exist, we take
* the first ...
*/
if (npcs.Length == 0)
{
brotherMaynard = new GameHealer();
brotherMaynard.Model = 34;
brotherMaynard.Name = "Brother Maynard";
if (log.IsWarnEnabled)
log.Warn("Could not find " + brotherMaynard.Name + ", creating him ...");
brotherMaynard.GuildName = "Healer";
brotherMaynard.Realm = eRealm.Albion;
brotherMaynard.CurrentRegionID = 1;
brotherMaynard.Size = 52;
brotherMaynard.Level = 27;
brotherMaynard.X = 574190;
brotherMaynard.Y = 530721;
brotherMaynard.Z = 2896;
brotherMaynard.Heading = 1251;
//You don't have to store the created mob in the db if you don't want,
//it will be recreated each time it is not found, just comment the following
//line if you rather not modify your database
if (SAVE_INTO_DATABASE)
brotherMaynard.SaveIntoDatabase();
brotherMaynard.AddToWorld();
}
else
brotherMaynard = npcs[0];
#endregion defineNPCs
#region defineItems
boulderlingRemains = GameServer.Database.FindObjectByKey<ItemTemplate>("boulderling_remains");
if (boulderlingRemains == null)
{
if (log.IsWarnEnabled)
log.Warn("Could not find Ludlow Magical Wood, creating it ...");
boulderlingRemains = new ItemTemplate();
boulderlingRemains.Object_Type = 0;
boulderlingRemains.Id_nb = "boulderling_remains";
boulderlingRemains.Name = "Boulderling Remains";
boulderlingRemains.Level = 1;
boulderlingRemains.Model = 110;
boulderlingRemains.IsDropable = false;
boulderlingRemains.IsPickable = false;
boulderlingRemains.Weight = 4;
GameServer.Database.AddObject(boulderlingRemains);
}
#endregion defineItems
/* Now we add some hooks to the Sir Quait we found.
* Actually, we want to know when a player interacts with him.
* So, we hook the right-click (interact) and the whisper method
* of Sir Quait and set the callback method to the "TalkToXXX"
* method. This means, the "TalkToXXX" method is called whenever
* a player right clicks on him or when he whispers to him.
*/
GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));
GameEventMgr.AddHandler(brotherMaynard, GameLivingEvent.Interact, new DOLEventHandler(TalkToBrotherMaynard));
GameEventMgr.AddHandler(brotherMaynard, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToBrotherMaynard));
/* Now we bring to brotherMaynard the possibility to give this quest to players */
brotherMaynard.AddQuestToGive(typeof(BoulderlingBalm));
if (log.IsInfoEnabled)
log.Info("Quest \"" + questTitle + "\" initialized");
}
示例14: ScriptLoaded
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
{
if (!ServerProperties.Properties.LOAD_QUESTS)
return;
if (log.IsInfoEnabled)
log.Info("Quest \"" + questTitle + "\" initializing ...");
#region defineNPCs
GameNPC[] npcs;
npcs = WorldMgr.GetNPCsByName("Helen",(eRealm) 2);
if (npcs.Length == 0)
{
Helen = new DOL.GS.GameNPC();
Helen.Model = 193;
Helen.Name = "Helen";
if (log.IsWarnEnabled)
log.Warn("Could not find " + Helen.Name + ", creating ...");
Helen.GuildName = "Part of " + questTitle + " Quest";
Helen.Realm = eRealm.Midgard;
Helen.CurrentRegionID = 100;
Helen.Size = 49;
Helen.Level = 41;
Helen.MaxSpeedBase = 191;
Helen.Faction = FactionMgr.GetFactionByID(0);
Helen.X = 805693;
Helen.Y = 701160;
Helen.Z = 4960;
Helen.Heading = 3470;
Helen.RespawnInterval = -1;
Helen.BodyType = 0;
StandardMobBrain brain = new StandardMobBrain();
brain.AggroLevel = 0;
brain.AggroRange = 500;
Helen.SetOwnBrain(brain);
//You don't have to store the created mob in the db if you don't want,
//it will be recreated each time it is not found, just comment the following
//line if you rather not modify your database
if (SAVE_INTO_DATABASE)
Helen.SaveIntoDatabase();
Helen.AddToWorld();
}
else
{
Helen = npcs[0];
}
#endregion
#region defineItems
smallmaulerskin = GameServer.Database.FindObjectByKey<ItemTemplate>("smallmaulerskin");
if (smallmaulerskin == null)
{
smallmaulerskin = new ItemTemplate();
smallmaulerskin.Name = "Small Mauler Skin";
if (log.IsWarnEnabled)
log.Warn("Could not find " + smallmaulerskin.Name + ", creating it ...");
smallmaulerskin.Level = 1;
smallmaulerskin.Weight = 5;
smallmaulerskin.Model = 100;
smallmaulerskin.Object_Type = 0;
smallmaulerskin.Item_Type = 40;
smallmaulerskin.Id_nb = "smallmaulerskin";
smallmaulerskin.Hand = 0;
smallmaulerskin.Price = 0;
smallmaulerskin.IsPickable = true;
smallmaulerskin.IsDropable = true;
smallmaulerskin.IsTradable = true;
smallmaulerskin.CanDropAsLoot = false;
smallmaulerskin.Color = 0;
smallmaulerskin.Bonus = 35; // default bonus
smallmaulerskin.Bonus1 = 0;
smallmaulerskin.Bonus1Type = (int) 0;
smallmaulerskin.Bonus2 = 0;
smallmaulerskin.Bonus2Type = (int) 0;
smallmaulerskin.Bonus3 = 0;
smallmaulerskin.Bonus3Type = (int) 0;
smallmaulerskin.Bonus4 = 0;
smallmaulerskin.Bonus4Type = (int) 0;
smallmaulerskin.Bonus5 = 0;
smallmaulerskin.Bonus5Type = (int) 0;
smallmaulerskin.Bonus6 = 0;
smallmaulerskin.Bonus6Type = (int) 0;
smallmaulerskin.Bonus7 = 0;
smallmaulerskin.Bonus7Type = (int) 0;
smallmaulerskin.Bonus8 = 0;
smallmaulerskin.Bonus8Type = (int) 0;
smallmaulerskin.Bonus9 = 0;
smallmaulerskin.Bonus9Type = (int) 0;
smallmaulerskin.Bonus10 = 0;
smallmaulerskin.Bonus10Type = (int) 0;
smallmaulerskin.ExtraBonus = 0;
smallmaulerskin.ExtraBonusType = (int) 0;
smallmaulerskin.Effect = 0;
smallmaulerskin.Emblem = 0;
//.........这里部分代码省略.........
示例15: ScriptLoaded
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
{
if (!ServerProperties.Properties.LOAD_QUESTS)
return;
if (log.IsInfoEnabled)
log.Info("Quest \"" + questTitle + "\" initializing ...");
#region defineNPCS
GameNPC[] npcs = WorldMgr.GetNPCsByName(questGiverName, eRealm.Hibernia);
if (npcs.Length == 0)
{
questGiver = new GameNPC();
questGiver.Model = 386;
questGiver.Name = questGiverName;
if (log.IsWarnEnabled)
log.Warn("Could not find " + questGiver.Name + ", creating her ...");
questGiver.Realm = eRealm.Hibernia;
questGiver.CurrentRegionID = 27;
GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
template.AddNPCEquipment(eInventorySlot.HandsArmor, 813, 0); //Slot 22
template.AddNPCEquipment(eInventorySlot.FeetArmor, 814, 0); //Slot 23
template.AddNPCEquipment(eInventorySlot.TorsoArmor, 810, 0); //Slot 25
template.AddNPCEquipment(eInventorySlot.Cloak, 678, 0); //Slot 26
template.AddNPCEquipment(eInventorySlot.LegsArmor, 811, 0); //Slot 27
template.AddNPCEquipment(eInventorySlot.ArmsArmor, 812, 0); //Slot 28
questGiver.Inventory = template.CloseTemplate();
questGiver.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);
questGiver.Size = 50;
questGiver.Level = 70;
questGiver.X = 357695;
questGiver.Y = 363457;
questGiver.Z = 5340;
questGiver.Heading = 3117;
if (SAVE_INTO_DATABASE)
questGiver.SaveIntoDatabase();
questGiver.AddToWorld();
}
else
questGiver = npcs[0];
npcs = WorldMgr.GetNPCsByName(questTargetName, eRealm.Hibernia);
if (npcs.Length == 0)
{
questTarget = new GameNPC();
questTarget.Model = 350;
questTarget.Name = questTargetName;
if (log.IsWarnEnabled)
log.Warn("Could not find " + questTarget.Name + ", creating him ...");
questTarget.Realm = eRealm.Hibernia;
questTarget.CurrentRegionID = 27;
GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
template.AddNPCEquipment(eInventorySlot.HandsArmor, 391, 0); //Slot 22
template.AddNPCEquipment(eInventorySlot.FeetArmor, 392, 0); //Slot 23
template.AddNPCEquipment(eInventorySlot.TorsoArmor, 667, 0); //Slot 25
template.AddNPCEquipment(eInventorySlot.Cloak, 678, 0); //Slot 26
template.AddNPCEquipment(eInventorySlot.LegsArmor, 389, 0); //Slot 27
template.AddNPCEquipment(eInventorySlot.ArmsArmor, 390, 0); //Slot 28
questTarget.Inventory = template.CloseTemplate();
questTarget.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);
questTarget.Size = 50;
questTarget.Level = 65;
questTarget.X = 356932;
questTarget.Y = 363575;
questTarget.Z = 5248;
questTarget.Heading = 2912;
if (SAVE_INTO_DATABASE)
questTarget.SaveIntoDatabase();
questTarget.AddToWorld();
}
else
questTarget = npcs[0];
#endregion defineNPCS
#region defineAreas
targetArea = WorldMgr.GetRegion(targetLocation.RegionID).AddArea(new Area.Circle("", targetLocation.X, targetLocation.Y, targetLocation.Z, 200));
#endregion defineAreas
#region defineBehaviours
QuestBuilder builder = QuestMgr.getBuilder(typeof(MovementAndInteraction));
QuestBehaviour a = null;
string message1 = "Welcome to " + zoneName + ", <Class>. Here you will learn the basic skills needed to defend yourself as you explore our realm and grow in power and wisdom. Now, without further delay, let's get you started on your [training].";
string message2 = "If you exit through the doors behind me, you will enter the courtyard. In the courtyard, you will find Master Gethin, who will be your training instructor. Go now and speak to Master Gethin.";
a = builder.CreateBehaviour(questGiver, -1);
//.........这里部分代码省略.........