本文整理汇总了C#中NpcScript类的典型用法代码示例。如果您正苦于以下问题:C# NpcScript类的具体用法?C# NpcScript怎么用?C# NpcScript使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NpcScript类属于命名空间,在下文中一共展示了NpcScript类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TalkMalcolm
public async Task<HookResult> TalkMalcolm(NpcScript npc, params object[] args)
{
if (npc.QuestActive(this.Id, "talk_malcolm1"))
{
npc.FinishQuest(this.Id, "talk_malcolm1");
npc.Msg("So, you received the quest I sent through the Owl.<br/>Thanks for coming.<br/>I think I lost my ring in Alby Dungeon,<br/>but I can't leave, because I have no one to take care of the General Shop.");
npc.Msg("I know it's a lot to ask, but can you go find the ring for me?<br/>The dungeon is very dangerous so I suggest talking to Trefor first about the Counterattack skill.<br/><br/>Take this pass to enter the dungeon, and please find my ring.");
npc.GiveItem(63181); // Malcolm's Pass
npc.GiveKeyword("skill_counter_attack");
return HookResult.End;
}
else if (npc.QuestActive(this.Id, "talk_malcolm2"))
{
npc.FinishQuest(this.Id, "talk_malcolm2");
npc.GiveKeyword("Clear_Tutorial_Malcolm_Ring");
npc.RemoveItem(75058); // Malcolm's Ring
npc.Msg("You found my Ring!<br/>You have my thanks.");
return HookResult.Break;
}
return HookResult.Continue;
}
示例2: KristellAfterIntro
public async Task<HookResult> KristellAfterIntro(NpcScript npc, params object[] args)
{
if (npc.HasKeyword("g1_25") && npc.HasItem(BookOfRevenge2))
{
npc.RemoveItem(BookOfRevenge2);
npc.SendOwl(this.Id, OwlDelay1);
npc.RemoveKeyword("g1_memo_of_parcelman");
npc.RemoveKeyword("g1_25");
npc.GiveKeyword("g1_26");
npc.Msg(L("So there really was another volume.<br/>I'm impressed. I didn't think you'd be able to find it."));
npc.Msg(L("I'll translate this book, as promised.<br/>I'll let you know as soon as I'm finished."));
return HookResult.Break;
}
else if (npc.QuestActive(this.Id, "get_book"))
{
npc.FinishQuest(this.Id, "get_book");
npc.GiveItem(BookOfRevenge2Translated);
npc.Notice(L("You have received the Book of Revenge, Vol. 2 (Translated) from Kristell."));
npc.Msg(L("You must be here for your translated copy of the book.<br/>Here, I think you should read it yourself.<br/>It's better than having me summarize it for you."));
npc.Msg(L("That said, I can't believe what's written in this book..."));
return HookResult.Break;
}
return HookResult.Continue;
}
示例3: TalkDeian
public async Task<HookResult> TalkDeian(NpcScript npc, params object[] args)
{
if (npc.QuestActive(this.Id, "talk_deian1") || npc.QuestActive(this.Id, "protect_sheep"))
{
// Unofficial
npc.Msg("I'm glad to see you. I've been stuck here all day!<br/>Can you look after my sheep for a few minutes? I got some business to take care of.<br/>It should be easy, as long as the wolves don't show up.");
npc.Msg("Just make sure to keep my sheep safe if wolves show up.<br/>The number of sheep and the time left will display<br/>on the top right corner.");
npc.Msg("I hear you're pretty strong, so this should be pretty simple.<br/>Thanks!<button title='Look After Sheep' keyword='@protect'/><button title='Start Another Topic' keyword='@end'/>");
var response = await npc.Select();
if (response != "@protect")
return HookResult.Break;
npc.Close2();
npc.FinishQuest(this.Id, "talk_deian1");
CreateRegionAndWarp(npc.Player);
return HookResult.End;
}
else if (npc.QuestActive(this.Id, "talk_deian2"))
{
npc.FinishQuest(this.Id, "talk_deian2");
npc.Msg("Wow, good job.<br/>I got everything done thanks to you.<br/>You'll do this again next time, right? Thanks!");
return HookResult.Break;
}
return HookResult.Continue;
}
示例4: AfterIntro
public async Task<HookResult> AfterIntro(NpcScript npc, params object[] args)
{
// Handle delivery of Iron Ore from some of his PTJ quests
int id, itemCount = -1;
if (npc.QuestActive(id = 514602, "ptj2"))
itemCount = 5;
else if (npc.QuestActive(id = 514632, "ptj2"))
itemCount = 7;
else if (npc.QuestActive(id = 514662, "ptj2"))
itemCount = 10;
if (itemCount != -1)
{
if (!npc.Player.Inventory.Has(64002, itemCount)) // Iron Ore
return HookResult.Continue;
npc.FinishQuest(id, "ptj2");
npc.Player.Inventory.Remove(64002, itemCount);
npc.Notice(L("You have given Iron Ore to Sion."));
npc.Msg(string.Format(LN("(Gave Sion {0} Iron Ore)", "(Gave Sion {0} Iron Ore)", itemCount), itemCount));
}
// Call PTJ method after intro if it's time to report
if (npc.DoingPtjForNpc() && npc.ErinnHour(Report, Deadline))
{
await AboutArbeit(npc);
return HookResult.Break;
}
return HookResult.Continue;
}
示例5: ElenKeywords
public async Task<HookResult> ElenKeywords(NpcScript npc, params object[] args)
{
var keyword = args[0] as string;
if (keyword != "about_skill" || npc.HasSkill(SkillId.Refining))
return HookResult.Continue;
if (!npc.QuestActive(this.Id))
{
npc.Msg("Did my grandpa send you over this way?<br/>Hehe.... Oh, nothing.<br/>Here, take this...");
npc.Msg("Are you interested in refining by any chance?<br/>Refining is the first step in becoming a blacksmith...");
npc.Msg("You can use ore in its raw form.<br/>You have to melt it to extract the pure metal from it.<br/>You can simply assume that you can use the ore as it is.");
npc.Msg("We've been looking for more ore anyway,<br/>so why don't you go to Barri Dungeon and mine some ore for us?<br/>Bring some ore and I'll teach you how to refine metal. Tee hee...<br/>Of course, if you are going to mine, you will need at least a pickaxe.");
await npc.Select();
npc.StartQuest(this.Id);
npc.Close();
}
else
{
npc.Msg("Did you forget what I asked you?");
npc.Msg("You can find ore inside Barri Dungeon over there.<br/>Of course, you can't mine with bare hands. You will need a pickaxe for that.");
}
return HookResult.End;
}
示例6: AeiraBeforeKeywords
public async Task<HookResult> AeiraBeforeKeywords(NpcScript npc, params object[] args)
{
var keyword = args[0] as string;
if (keyword != "g1_book1")
return HookResult.Continue;
if (npc.HasKeyword("g1_06"))
{
npc.RemoveKeyword("g1_06");
npc.GiveKeyword("g1_07");
npc.Msg(L("'The Land of Eternity, Tir Na Nog'...?"));
npc.Msg(L("Oh no.<br/>That book wasn't selling at all, so I returned all of them.<br/>Haha! Where did you hear about that book?"));
}
else if (npc.HasKeyword("g1_07"))
{
npc.RemoveKeyword("g1_07");
npc.GiveKeyword("g1_08");
npc.Msg(L("Let's see... I can order one for you,<br/>but it'll take some time to arrive.<br/>I hope that's okay."));
}
else if (npc.HasKeyword("g1_08"))
{
npc.RemoveKeyword("g1_book1");
npc.SendOwl(this.Id, OwlDelay);
npc.Msg(L("I'm sorry!<br/>The book still isn't in stock."));
npc.Msg(L("Hmm, how about this. I'll send you an owl when the book arrives.<br/>That would be better, right?"));
}
return HookResult.Break;
}
示例7: TalkNpc
public async Task<HookResult> TalkNpc(NpcScript npc, params object[] args)
{
if (npc.QuestActive(this.Id, "talk_dilys1"))
{
npc.FinishQuest(this.Id, "talk_dilys1");
npc.Msg("There's been talk recently about how healthy berries are.<br/>Their qualities have peaked my interest, even about the weight!");
npc.Msg("Can you bring me one berry? I'd be very grateful.");
return HookResult.Break;
}
else if (npc.QuestActive(this.Id, "talk_dilys2") && npc.HasItem(50007))
{
npc.FinishQuest(this.Id, "talk_dilys2");
npc.Msg("Oh thank you so much! I can't wait to try it!<br/>Here, as an exchange, take these potions I've been working on.<button title='Continue' keyword='@continue'/>");
await npc.Select();
npc.RemoveItem(50007); // Berry
npc.CompleteQuest(this.Id);
return HookResult.Break;
}
return HookResult.Continue;
}
示例8: TalkNpc
public async Task<HookResult> TalkNpc(NpcScript npc, params object[] args)
{
if (npc.QuestActive(this.Id, "talk_deian1"))
{
npc.FinishQuest(this.Id, "talk_deian1");
npc.Msg("Oh thank you for coming, I was dying from boredom...");
npc.Msg("Did you bring a gathering knife? I don't seem to<br/>have any extra around here. If you didn't you'll need<br/>to go see Ferghus about that!");
npc.Msg("In any case, I could really use your help again shearing all my sheep.<br/>Just hold the knife gently in your one hand and grab a tuft of wool with<br/>the other. Easy right? Hehe, well why do you think I don't want to do it?<br/>Can you gather five bundles of wool for me?");
return HookResult.Break;
}
else if (npc.QuestActive(this.Id, "talk_deian2") && npc.HasItem(60009, 5))
{
npc.FinishQuest(this.Id, "talk_deian2");
npc.Msg("Thank you, thank you! You look like a natural with that knife, I must say.<br/>These bundles of wool will help me out the rest of the day.<br/>Come by again if you ever want to get more wool!");
npc.RemoveItem(60009, 5); // Wool
npc.CompleteQuest(this.Id);
return HookResult.Break;
}
return HookResult.Continue;
}
示例9: TalkRanald
public async Task<HookResult> TalkRanald(NpcScript npc, params object[] args)
{
if(!npc.QuestActive(this.Id))
return HookResult.Continue;
return await LearnDefense(npc);
}
示例10: TalkDuncan
public async Task<HookResult> TalkDuncan(NpcScript npc, params object[] args)
{
if(npc.QuestActive(this.Id, "talk_duncan"))
{
npc.FinishQuest(this.Id, "talk_duncan");
Send.Effect(npc.NPC, Effect.ScreenFlash, 3000, 0);
// Remove Eiry
var eiry = npc.Player.Inventory.Items.FirstOrDefault(item => item.EgoInfo.Race == EgoRace.EirySword);
if(eiry != null)
npc.Player.Inventory.Remove(eiry);
// Give sword
npc.GiveItem(40015);
npc.Notice("Received Fluted Short Sword from Duncan.");
npc.Msg("Welcome to Tir Chonaill.");
npc.Msg("Oh, you are finally here, <username/>.<br/>I've heard a lot about you from the villagers.<br/>You've leveled up quite a lot.");
npc.Msg("This may be a small town,<br/>but Tir Chonaill has long boasted a tradition<br/>of growing resolute and sturdy warriors<br/>that don't have to worry about the kingdom's control.");
npc.Msg("You have now completed all our missions<br/>and have earned the right to join the rank of Tir Chonaill's warriors.<br/>Well done, and congratulations.");
npc.Msg("Wherever you go, don't forget who you are and what you have become.<br/>Since you have become strong enough to survive alone,<br/>your ego guide must have already parted ways with you.<br/>There is no one to look after you now, so befriend as many people as you can.");
npc.Msg("If you have anything else to ask, let me know.");
await npc.Conversation();
npc.Close2();
Cutscene.Play("etc_event_ego_goodbye", npc.Player);
return HookResult.Break;
}
return HookResult.Continue;
}
示例11: TalkDuncan
public async Task<HookResult> TalkDuncan(NpcScript npc, params object[] args)
{
if(npc.QuestActive(this.Id, "talk_duncan"))
{
npc.FinishQuest(this.Id, "talk_duncan");
npc.Msg(Hide.Name, "(You hand Nao's Letter of Introduction to Duncan.)");
npc.Msg("Ah, a letter from Nao.<br/>Hard to believe that little<br/>tomboy's all grown up...");
npc.Msg(Hide.Name, "(Duncan folds the letter in half and puts it in his pocket.)");
npc.Msg("So, you're <username/>.<br/>I'm Duncan, the chief of this town.<br/>Welcome to Tir Chonaill.");
npc.Msg("Would you like to learn how to complete quests?");
npc.Msg(npc.Image("npctalk_questwindow", true, 272, 235), npc.Text("Press the "), npc.Hotkey("QuestView"), npc.Text(" key or<br/>press the Quest button at the bottom of your screen.<br>The quest window will appear and display your current quests."));
while (true)
{
npc.Msg(npc.Text("Press the "), npc.Hotkey("QuestView"), npc.Text(" key or<br/>press the Quest button at the bottom of your screen."), npc.Button("I pressed the Quest button", "@pressed"), npc.Button("$hidden", "@quest_btn_clicked", "autoclick_QuestView"));
if (await npc.Select() != "@pressed")
break;
npc.Msg("Hmm... Are you sure you pressed the Quest button?<br/>It's possible that the Quest Window was already open, so<br/>try pressing it again.");
}
npc.Msg("Well done. See the list of quests?<br/>Clicking on a quest brings up the quest's details.<br/>Quests will show a yellow Complete button<br/>next to their names when you finish them.");
npc.Msg("Try pressing the Complete button now.<br/>As important as it is to complete quests,<br/>it's just as important to press the \"Complete\" button<br/>afterwards to recieve your rewards.");
npc.Msg("(Duncan looks at you with his benevolent hazel eyes.)");
npc.Msg("You've just learned one very basic skill<br/>to survive in Erinn.");
npc.Msg("Soon, you will recieve a quest from an owl.<br/>Then, you will be able to start your training for real.");
return HookResult.Break;
}
return HookResult.Continue;
}
示例12: Start
// Vector3 postBearCubPosition;
// The start function can be used for initiation
void Start()
{
if (charIdentifier == "BearCub")
questReliantScript = questReliantNPC.GetComponent<NpcScript> ();
doesCharHaveItemReq = false;
doesCharHaveItemUnreq = false;
myTransform = GetComponent<Transform> ();
}
示例13: ScriptAttacher
void ScriptAttacher()
{
beaverScript = beaver.GetComponent<NpcScript> ();
motherBearScript = motherBear.GetComponent<NpcScript> ();
foxScript = fox.GetComponent<NpcScript> ();
foxChatScrupt = fox.GetComponent<NewChatScript> ();
bearCubScript = bearCub.GetComponent<NpcScript> ();
bearChatScript = motherBear.GetComponent<NewChatScript> ();
}
示例14: RanaldKeywords
public async Task<HookResult> RanaldKeywords(NpcScript npc, params object[] args)
{
var keyword = args[0] as string;
if(npc.QuestCompleted(this.Id) || keyword != "about_skill")
return HookResult.Continue;
return await LearnDefense(npc);
}
示例15: DuncanBeforeKeywords
public async Task<HookResult> DuncanBeforeKeywords(NpcScript npc, params object[] args)
{
var keyword = args[0] as string;
if (keyword != "g1_goddess")
return HookResult.Continue;
npc.Msg(L("You want to know of the Goddess Morrighan?<br/>If it's about the Goddess, you're better off speaking to Meven..."));
return HookResult.Break;
}