From 45ca4be7791975f0e008a8fb60aeadabec2a21c7 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 3 Jun 2019 16:16:45 -0300 Subject: Make traps more flexible, bugfix --- npc/015-8-1/campaign.txt | 22 +++++++++++++++++----- npc/015-8-1/puzzle.txt | 5 ++++- 2 files changed, 21 insertions(+), 6 deletions(-) (limited to 'npc/015-8-1') diff --git a/npc/015-8-1/campaign.txt b/npc/015-8-1/campaign.txt index fa3e97b9a..96a943782 100644 --- a/npc/015-8-1/campaign.txt +++ b/npc/015-8-1/campaign.txt @@ -16,6 +16,10 @@ OnBegin: .@m$=getmap(); .@in=getq2(HurnscaldQuest_Sagratha); + //debugmes "Initialized - Inst ID %d", .@in; + //debugmes "Map %s.gat - NPC Name %s", .@m$, .name$; + //debugmes "NPC UUID %s (%s)", instance_npcname(.name$), instance_npcname(.name$, .@in); + setq3 HurnscaldQuest_Sagratha, 1; // We're in an instance, ofc. Here we still have player attached. //npctalk3 l("Open your eyes!"); @@ -28,10 +32,10 @@ OnBegin: monster .@m$, 49, 45, "Real Monster", RedSlime, 1; // max AI id 4. You are in 49,39 - monster .@m$, 49, 41, "AI Tx", RedSlime, 1, instance_npcname(.name$, .@in)+"::OnError", Size_Medium, 2; - monster .@m$, 51, 41, "AI Xt", RedSlime, 1, instance_npcname(.name$, .@in)+"::OnError", Size_Medium, 2; + monster .@m$, 49, 41, "AI Tx", RedSlime, 1, instance_npcname(.name$)+"::OnError", Size_Medium, 2; + monster .@m$, 51, 41, "AI Xt", RedSlime, 1, instance_npcname(.name$)+"::OnError", Size_Medium, 2; - addtimer(5000, instance_npcname(.name$, .@in)+"::OnError"); + addtimer(5000, instance_npcname(.name$)+"::OnError"); end; // Assassin, HoodedNinja, HoodedAssassin (boss) @@ -52,13 +56,21 @@ OnInit: // Dummy NPC to fire #SaggyDungeonCore when you get close to battle scene 015-8-1,49,39,0 script #SaggyDungeonFire NPC_HIDDEN,1,0,{ end; + OnTouch: if (instance_id() < 0) end; - if (!getq3(HurnscaldQuest_Sagratha)) - doevent "#SaggyDungeonCore::OnBegin"; + if (!getq3(HurnscaldQuest_Sagratha)) { + .@in=getq2(HurnscaldQuest_Sagratha); + doevent(instance_npcname("#SaggyDungeonCore", .@in)+"::OnBegin"); + } + end; + +OnInit: + .distance=0; end; + } diff --git a/npc/015-8-1/puzzle.txt b/npc/015-8-1/puzzle.txt index 2cd158e10..f0827c2cf 100644 --- a/npc/015-8-1/puzzle.txt +++ b/npc/015-8-1/puzzle.txt @@ -32,7 +32,10 @@ OnTouch: OnTouchNPC: OnTouch: // instance_id() - SteelTrap(rand2(10, 40), 5, any(0,0,0,1)); + if (instance_id() >= 0) + SteelTrap(rand2(10, 40), 5, any(0,0,0,1), instance_npcname(.name$)); + else + SteelTrap(rand2(10, 40), 5, any(0,0,0,1)); end; OnTimer10000: -- cgit v1.2.3-60-g2f50