summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-17 15:36:27 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-17 15:36:27 -0300
commitbd9d7c6142986a30f6fcd355efe22704f5bf4be4 (patch)
treeb561b81499c6fede518f577073ab6ac6b38c896d /npc
parentfd12dd9139f6ab04f9bc8efe70a3a1e3d0874906 (diff)
downloadserverdata-bd9d7c6142986a30f6fcd355efe22704f5bf4be4.tar.gz
serverdata-bd9d7c6142986a30f6fcd355efe22704f5bf4be4.tar.bz2
serverdata-bd9d7c6142986a30f6fcd355efe22704f5bf4be4.tar.xz
serverdata-bd9d7c6142986a30f6fcd355efe22704f5bf4be4.zip
Update a bit Sagatha's code
Diffstat (limited to 'npc')
-rw-r--r--npc/013-1/sagatha.txt45
1 files changed, 15 insertions, 30 deletions
diff --git a/npc/013-1/sagatha.txt b/npc/013-1/sagatha.txt
index 12251532..786da773 100644
--- a/npc/013-1/sagatha.txt
+++ b/npc/013-1/sagatha.txt
@@ -1,46 +1,31 @@
function script QuestSagathaHappy {
- @unhappiness = (QUEST_MAGIC & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT;
- if (@unhappiness < @value)
- goto L_zero;
+ .@value = getarg(0, @value);
+ .@unhappiness = (QUEST_MAGIC & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT;
+ if (.@unhappiness < .@value)
+ .@unhappiness = 0;
- @unhappiness = @unhappiness - @value;
- goto L_write;
+ .@unhappiness = .@unhappiness - .@value;
-L_zero:
- @unhappiness = 0;
- goto L_write;
-
-L_write:
- QUEST_MAGIC = (QUEST_MAGIC & ~NIBBLE_3_MASK) | (@unhappiness << NIBBLE_3_SHIFT);
+ QUEST_MAGIC = (QUEST_MAGIC & ~NIBBLE_3_MASK) | (.@unhappiness << NIBBLE_3_SHIFT);
return;
}
function script QuestSagathaAnnoy {
- @unhappiness = (QUEST_MAGIC & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT;
- if ((@unhappiness + @value) > 15)
- goto L_max;
-
- @unhappiness = @unhappiness + @value;
- goto L_write;
+ .@value = getarg(0, @value);
+ .@unhappiness = (QUEST_MAGIC & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT;
+ if ((.@unhappiness + .@value) > 15)
+ .@unhappiness = 15;
-L_max:
- @unhappiness = 15;
- goto L_write;
-
-L_write:
- QUEST_MAGIC = (QUEST_MAGIC & ~NIBBLE_3_MASK) | (@unhappiness << NIBBLE_3_SHIFT);
+ .@unhappiness = .@unhappiness + .@value;
+ QUEST_MAGIC = (QUEST_MAGIC & ~NIBBLE_3_MASK) | (.@unhappiness << NIBBLE_3_SHIFT);
return;
}
function script SagathaStatus {
- if (!isequippedcnt(MoubooHead, FluffyHat))
- goto L_Next;
- @value = 15;
- callfunc "QuestSagathaAnnoy";
- goto L_Next;
+ if (isequippedcnt(MoubooHead, FluffyHat))
+ QuestSagathaAnnoy(15);
-L_Next:
@mexp = MAGIC_EXP;
@has_magic = getskilllv(SKILL_MAGIC);
@evil = 0;
@@ -65,7 +50,7 @@ L_Next:
}
013-1,131,24,0 script Sagatha#_M NPC167,{
- callfunc "SagathaStatus";
+ SagathaStatus();
@Q_MASK = NIBBLE_4_MASK | NIBBLE_5_MASK;
@Q_SHIFT = NIBBLE_4_SHIFT;