summaryrefslogtreecommitdiff
path: root/npc/custom/Lance/Sentry.cpp
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-17 16:54:31 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-17 16:54:31 +0000
commit5f822c24c3a3721c369a3ed5a6ca377ff0ce33f7 (patch)
tree488adef5b1e0171517a66606b7f56f8c45203a55 /npc/custom/Lance/Sentry.cpp
parenta7713388a0ed188a380c51ed3901c8f42cbbce8d (diff)
downloadhercules-5f822c24c3a3721c369a3ed5a6ca377ff0ce33f7.tar.gz
hercules-5f822c24c3a3721c369a3ed5a6ca377ff0ce33f7.tar.bz2
hercules-5f822c24c3a3721c369a3ed5a6ca377ff0ce33f7.tar.xz
hercules-5f822c24c3a3721c369a3ed5a6ca377ff0ce33f7.zip
Enhanced implementation to use Skot's Christmas Present: KARMA. :D
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9246 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'npc/custom/Lance/Sentry.cpp')
-rw-r--r--npc/custom/Lance/Sentry.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/npc/custom/Lance/Sentry.cpp b/npc/custom/Lance/Sentry.cpp
index 5666e1647..f59586eb6 100644
--- a/npc/custom/Lance/Sentry.cpp
+++ b/npc/custom/Lance/Sentry.cpp
@@ -61,7 +61,7 @@
if(.ai_busy[.@tmp] == 0){ // Not busy
switch(.ai_action[AI_ACTION_TAR_TYPE]){ // Check what have we here.
case AI_ACTION_TAR_TYPE_PC: // It's a player
- if(getd("$pkarma_"+.ai_action[AI_ACTION_TAR]) > .karma){ // pkarma is higher?
+ if(Karma > .karma){ // pkarma is higher?
unittalk .ai_action[AI_ACTION_SRC], "Who goes there!";
unitemote .ai_action[AI_ACTION_SRC], e_gasp; // !
unitattack .ai_action[AI_ACTION_SRC],.ai_action[AI_ACTION_TAR];
@@ -86,7 +86,7 @@
break;
case AI_ACTION_TYPE_KILL: // We eliminated the criminal
if(.ai_action[AI_ACTION_TAR_TYPE] == AI_ACTION_TAR_TYPE_PC)
- setd "$pkarma_"+.ai_action[AI_ACTION_TAR], 0;
+ set Karma, 0;
case AI_ACTION_TYPE_UNLOCK: // Target lost :(
if(.@tmp != -1){
set .ai_busy[.@tmp], 0; // Remove him, we're free.
@@ -96,14 +96,20 @@
break;
case AI_ACTION_TYPE_DEAD: // We got killed :(
if(.ai_action[AI_ACTION_TAR_TYPE] == AI_ACTION_TAR_TYPE_PC){ // Attacker is a player?
- setd "$pkarma_"+.ai_action[AI_ACTION_TAR], getd("$pkarma_"+.ai_action[AI_ACTION_TAR]) + 5;
+ if(Karma < 250)
+ set Karma, Karma + 5;
+ else
+ set Karma, 255;
}
sleep 10000; // 10 seconds until reinforcements arrive
spawn_guardian .@tmp;
break;
case AI_ACTION_TYPE_ATTACK: // Someone attacked us
if(.ai_action[AI_ACTION_TAR_TYPE] == AI_ACTION_TAR_TYPE_PC){ // Attacker is a player?
- setd "$pkarma_"+.ai_action[AI_ACTION_TAR], getd("$pkarma_"+.ai_action[AI_ACTION_TAR]) + 1;
+ if(Karma < 250)
+ set Karma, Karma + 1;
+ else
+ set Karma, 255;
}
// The system's AI will auto attack any attackers. So we leave it here.
break;