Loading...   


 cazicthule/a_sickly_mosquito.lua         |  2 +-
 chambersc/encounters/mpg_foresight.lua   |  7 +++---
 chardokb/a_leprous_chokidai.lua          |  2 +-
 draniksscar/player.lua                   |  2 +-
 droga/a_bloated_drogan_spider.lua        |  2 +-
 feerrott/#druid_epic_trap.pl             |  2 +-
 global/items/CHRMFewContainers.pl        | 10 ++++++++-
 lua_modules/client_ext.lua               | 38 ++++++++++++++++++++++----------
 northkarana/Xanuusus.lua                 |  6 ++---
 plugins/check_hasitem.pl                 | 30 +++++++++++++------------
 pojustice/player.lua                     |  2 +-
 sebilis/encounters/berserkerepic_1_5.lua | 16 +++++++-------
 sirens/a_twitching_swordfish.lua         |  2 +-
 tox/38139.pl                             |  2 +-
 uqua/player.pl                           |  4 ++--
 15 files changed, 76 insertions(+), 51 deletions(-)

diff --git a/cazicthule/a_sickly_mosquito.lua b/cazicthule/a_sickly_mosquito.lua
index 1f509e66..81d147bc 100644
--- a/cazicthule/a_sickly_mosquito.lua
+++ b/cazicthule/a_sickly_mosquito.lua
@@ -12,7 +12,7 @@ function event_timer(e)
 					if(ent:IsClient()) then
 						if(ent:CastToMob():GetClass()==4 and damage > 0) then
 							local currclient=ent:CastToClient();
-							if(currclient:GetItemIDAt(13)==62646) then
+							if(currclient:GetItemIDAt(Slot.Primary)==62646) then
 								currclient:SummonItem(62642);
 								eq.depop_with_timer();
 							end
diff --git a/chambersc/encounters/mpg_foresight.lua b/chambersc/encounters/mpg_foresight.lua
index 64ab30de..61c4d0d7 100644
--- a/chambersc/encounters/mpg_foresight.lua
+++ b/chambersc/encounters/mpg_foresight.lua
@@ -274,13 +274,13 @@ function Hazard_Timer(e)
 end
 
 function check_rings(mob, client)
-  if ( client:GetItemIDAt(15) ~= -1 ) then
+  if ( client:GetItemIDAt(Slot.Finger1) ~= -1 ) then
     client:Message(14, "Your rings clamp down, breaking fingers and disabling your manual dexterity.");
     mob:CastSpell(5695, client:GetID());
   else
     client:Message(14, "Your regain the use of your fingers.");
   end
-  if ( client:GetItemIDAt(16) ~= -1 ) then
+  if ( client:GetItemIDAt(Slot.Finger2) ~= -1 ) then
     client:Message(14, "Your rings clamp down, breaking fingers and disabling your manual dexterity.");
     mob:CastSpell(5695, client:GetID());
   else
@@ -289,7 +289,8 @@ function check_rings(mob, client)
 end
 
 function check_weapon(mob, client)
-  if ( client:GetItemIDAt(14) ~= -1 ) then
+  --offhand only?
+  if ( client:GetItemIDAt(Slot.Secondary) ~= -1 ) then
     client:Message(14, "Your weaponry becomes incredibly hot, searing your hands!");
     mob:CastSpell(2315, client:GetID());
   else
diff --git a/chardokb/a_leprous_chokidai.lua b/chardokb/a_leprous_chokidai.lua
index fb691012..491e89bb 100644
--- a/chardokb/a_leprous_chokidai.lua
+++ b/chardokb/a_leprous_chokidai.lua
@@ -12,7 +12,7 @@ function event_timer(e)
 					if(ent:IsClient()) then
 						if(ent:CastToMob():GetClass()==4 and damage > 0) then
 							local currclient=ent:CastToClient();
-							if(currclient:GetItemIDAt(13)==62648) then
+							if(currclient:GetItemIDAt(Slot.Primary)==62648) then
 								currclient:SummonItem(62645);
 								eq.depop_with_timer();
 							end
diff --git a/draniksscar/player.lua b/draniksscar/player.lua
index b7720ee9..075f895e 100644
--- a/draniksscar/player.lua
+++ b/draniksscar/player.lua
@@ -13,7 +13,7 @@ end
 
 function event_timer(e)
 	if(e.timer == "borer") then
-		if(e.self:GetItemIDAt(30)==60300 and recepactive==false) then --energy receptor on cursor
+		if(e.self:GetItemIDAt(Slot.Cursor)==60300 and recepactive==false) then --energy receptor on cursor
 			e.self:Message(4,"The energy receptor appears to be active");		
 			eq.depop_all(302050);
 			eq.spawn2(302050, 0, 0, 155,-1053,29.5, 152);
diff --git a/droga/a_bloated_drogan_spider.lua b/droga/a_bloated_drogan_spider.lua
index 3f11b9c4..485c33f1 100644
--- a/droga/a_bloated_drogan_spider.lua
+++ b/droga/a_bloated_drogan_spider.lua
@@ -12,7 +12,7 @@ function event_timer(e)
 					if(ent:IsClient()) then
 						if(ent:CastToMob():GetClass()==4 and damage > 0) then
 							local currclient=ent:CastToClient();
-							if(currclient:GetItemIDAt(13)==62648) then
+							if(currclient:GetItemIDAt(Slot.Primary)==62648) then
 								currclient:SummonItem(62644);
 								eq.depop_with_timer();
 							end
diff --git a/feerrott/#druid_epic_trap.pl b/feerrott/#druid_epic_trap.pl
index ce5cfc5a..c5ce7214 100644
--- a/feerrott/#druid_epic_trap.pl
+++ b/feerrott/#druid_epic_trap.pl
@@ -6,7 +6,7 @@ sub EVENT_SPAWN {
 }
 
 sub EVENT_ENTER {
-	my $charmitem = $client->GetItemIDAt(0);
+	my $charmitem = $client->GetItemIDAt(quest:inventory('charm'));
 	if ($charmitem==62815) {
 		if ($client->GetPetID()) {
 		my $PetID = $client->GetPetID();
diff --git a/global/items/CHRMFewContainers.pl b/global/items/CHRMFewContainers.pl
index 2f709984..f259ae56 100644
--- a/global/items/CHRMFewContainers.pl
+++ b/global/items/CHRMFewContainers.pl
@@ -2,7 +2,7 @@ sub EVENT_SCALE_CALC
 {
         my $value = 0;
         my $item = undef;
-        for($for_x = 22; $for_x < 30; $for_x++)
+        for($for_x = quest:inventory('general_begin'); $for_x <= quest:inventory('general_end'); $for_x++)
         {
                 $item = $client->GetItemAt($for_x);
                 if($item)
@@ -51,4 +51,12 @@ sub EVENT_SCALE_CALC
         {
                 $questitem->SetScale(0.0);
         }
+		elsif($value == 9)
+        {
+                $questitem->SetScale(0.0);
+        }
+		elsif($value == 10)
+        {
+                $questitem->SetScale(0.0);
+        }
 }
\ No newline at end of file
diff --git a/lua_modules/client_ext.lua b/lua_modules/client_ext.lua
index 960ca552..a0c684bb 100644
--- a/lua_modules/client_ext.lua
+++ b/lua_modules/client_ext.lua
@@ -130,9 +130,9 @@ end
 function Client:HasItem(itemid)
 
 	--main inventory and cursor
-	for i = 0, 30, 1 do
+	for i = Slot.PossessionsBegin, Slot.PossessionsEnd, 1 do
 		local thisitem = self:GetItemIDAt(i);
-		for a = 0, 5, 1 do
+		for a = Slot.AugSocketBegin, Slot.AugSocketEnd, 1 do
 			local thisaugitem = self:GetAugmentIDAt(i,a);
 			if(thisaugitem == itemid) then
 				return true;
@@ -144,9 +144,9 @@ function Client:HasItem(itemid)
 	end
 
 	--main/cursor containers
-	for i = 251, 340, 1 do
+	for i = Slot.GeneralBagsBegin, Slot.CursorBagEnd, 1 do
 		local thisitem = self:GetItemIDAt(i);
-		for a = 0, 5, 1 do
+		for a = Slot.AugSocketBegin, Slot.AugSocketEnd, 1 do
 			local thisaugitem = self:GetAugmentIDAt(i,a);
 			if(thisaugitem == itemid) then
 				return true;
@@ -158,9 +158,9 @@ function Client:HasItem(itemid)
 	end
 
 	--bank
-	for i = 2000, 2015, 1 do
+	for i = Slot.BankBegin, Slot.BankEnd, 1 do
 		local thisitem = self:GetItemIDAt(i);
-		for a = 0, 5, 1 do
+		for a = Slot.AugSocketBegin, Slot.AugSocketEnd, 1 do
 			local thisaugitem = self:GetAugmentIDAt(i,a);
 			if(thisaugitem == itemid) then
 				return true;
@@ -172,9 +172,9 @@ function Client:HasItem(itemid)
 	end
 
 	--bank containers
-	for i = 2030, 2190, 1 do
+	for i = Slot.BankBagsBegin, Slot.BankBagsEnd, 1 do
 		local thisitem = self:GetItemIDAt(i);
-		for a = 0, 5, 1 do
+		for a = Slot.AugSocketBegin, Slot.AugSocketEnd, 1 do
 			local thisaugitem = self:GetAugmentIDAt(i,a);
 			if(thisaugitem == itemid) then
 				return true;
@@ -186,9 +186,23 @@ function Client:HasItem(itemid)
 	end
 	
 	--shared bank
-	for i = 2531, 2550, 1 do
+	for i = Slot.SharedBankBegin, Slot.SharedBankEnd, 1 do
 		local thisitem = self:GetItemIDAt(i);
-		for a = 0, 5, 1 do
+		for a = Slot.AugSocketBegin, Slot.AugSocketEnd, 1 do
+			local thisaugitem = self:GetAugmentIDAt(i,a);
+			if(thisaugitem == itemid) then
+				return true;
+			end
+		end
+		if(thisitem == itemid) then
+			return true;
+		end
+	end
+	
+	--shared bank containers
+	for i = Slot.SharedBankBagsBegin, Slot.SharedBankBagsEnd, 1 do
+		local thisitem = self:GetItemIDAt(i);
+		for a = Slot.AugSocketBegin, Slot.AugSocketEnd, 1 do
 			local thisaugitem = self:GetAugmentIDAt(i,a);
 			if(thisaugitem == itemid) then
 				return true;
@@ -205,13 +219,13 @@ function Client:HasItem(itemid)
 	if(bodycount > 0) then
 		for b = 0, bodycount, 1 do
 			local bodyid = self:GetCorpseID(b); 
-			for i = 0, 30, 1 do
+			for i = Slot.PossessionsBegin, Slot.PossessionsEnd, 1 do
 				local thisitem = self:GetCorpseItemAt(bodyid, i);
 				if(thisitem == itemid) then
 					return true;
 				end
 			end
-			for i = 251, 340, 1 do
+			for i = Slot.GeneralBagsBegin, Slot.CursorBagEnd, 1 do
 				local thisitem = self:GetCorpseItemAt(bodyid, i);
 				if(thisitem == itemid) then
 					return true;
diff --git a/northkarana/Xanuusus.lua b/northkarana/Xanuusus.lua
index a89712dd..f67b62d7 100644
--- a/northkarana/Xanuusus.lua
+++ b/northkarana/Xanuusus.lua
@@ -30,7 +30,7 @@ function event_say(e)
     if ( e.other:HasItem(62631) and e.other:HasItem(62633) and e.other:HasItem(62603) ) then
       eq.debug(e.other:GetName() .. " has the required items.");
       local client = e.other;
-      if ( client:GetItemIDAt(3) == 62603 and client:GetItemIDAt(13) == 62633 and client:GetItemIDAt(14) == 62631 ) then
+      if ( client:GetItemIDAt(Slot.Face) == 62603 and client:GetItemIDAt(Slot.Primary) == 62633 and client:GetItemIDAt(Slot.Secondary) == 62631 ) then
         eq.debug(e.other:GetName() .. " has the required items equiped.");
         e.self:Say("Stay close or this won't work. It is better that you do this, for trees are not very well structured to withstand lightning.");
         e.self:Emote("The treant releases a sound from his hollows that sounds much like thunder.");
@@ -40,8 +40,8 @@ function event_say(e)
         e.self:CastSpell(5687, e.other:GetID());
         client:Message(14, "As the lightning courses through your body, you feel the stone dissolving. That material flows from your mouth in an unnatural fashion and you see it fade as it rushes away from you across the planes toward something moving in the distance.");
 
-        client:DeleteItemInInventory(14, 1, true);
-        client:DeleteItemInInventory(3, 1, true);
+        client:DeleteItemInInventory(Slot.Secondary, 1, true);
+        client:DeleteItemInInventory(Slot.Face, 1, true);
 
         -- During all this, A Tainted Beast spawns who /cons blue at level 75. He hits for around 200, and dies quickly. However, you MUST aggro him within a minute or he despawns and you lose the Taskmaster's Cutlass and the Polished Blasted Stone. If you fail, you can hail Xanuusus for another stone, but the Taskmaster's Cutlass must be acquired again. A Tainted Beast is a griffon who beelines for Xanuusus from the southeast. Once it's dead, loot the Stone of Winde. Now go talk to Xanusuus again. 
         eq.set_timer("spawn_beast", 45 * 1000);
diff --git a/plugins/check_hasitem.pl b/plugins/check_hasitem.pl
index 4aaff0b9..5bc748ab 100644
--- a/plugins/check_hasitem.pl
+++ b/plugins/check_hasitem.pl
@@ -9,11 +9,13 @@ sub check_hasitem {
     my $i;
     my $body_count = $client->GetCorpseCount();
     my $body_id;
+	my $augsocket_begin = quest::inventory('augsocket_begin');
+	my $augsocket_end = quest::inventory('augsocket_end');
 
 #Check main inventory and cursor
-    for($slot1=0; $slot1<=30; $slot1++) {
+    for($slot1=quest::inventory('possessions_begin'); $slot1<=quest::inventory('possessions_end'); $slot1++) {
         $itemid1=$client->GetItemIDAt($slot1);
-      for($i=0; $i<5; $i++) {
+      for($i=$augsocket_begin; $i<=$augsocket_end; $i++) {
          $augid1=$client->GetAugmentIDAt($slot1, $i);
          if($augid1==$itmchk) {
             return 1;
@@ -24,9 +26,9 @@ sub check_hasitem {
         }
     }
 #Check main inventory's and cursor's containers
-    for($slot1=251; $slot1<=340; $slot1++) {
+    for($slot1=quest::inventory('generalbags_begin'); $slot1<=quest::inventory('cursorbag_end'); $slot1++) {
         $itemid1=$client->GetItemIDAt($slot1);
-      for($i=0; $i<5; $i++) {
+      for($i=$augsocket_begin; $i<=$augsocket_end; $i++) {
          $augid1=$client->GetAugmentIDAt($slot1, $i);
          if($augid1==$itmchk) {
             return 1;
@@ -37,9 +39,9 @@ sub check_hasitem {
         }
     }
 #Check bank slots
-    for($slot1=2000; $slot1<=2015; $slot1++) {
+    for($slot1=quest::inventory('bank_begin'); $slot1<=quest::inventory('bank_end'); $slot1++) {
         $itemid1=$client->GetItemIDAt($slot1);
-      for($i=0; $i<5; $i++) {
+      for($i=$augsocket_begin; $i<=$augsocket_end; $i++) {
          $augid1=$client->GetAugmentIDAt($slot1, $i);
          if($augid1==$itmchk) {
             return 1;
@@ -50,9 +52,9 @@ sub check_hasitem {
         }
     }
 #Check bank's containers
-    for($slot1=2030; $slot1<=2190; $slot1++) {
+    for($slot1=quest::inventory('bankbags_begin'); $slot1<=quest::inventory('bankbags_end'); $slot1++) {
         $itemid1=$client->GetItemIDAt($slot1);
-      for($i=0; $i<5; $i++) {
+      for($i=$augsocket_begin; $i<=$augsocket_end; $i++) {
          $augid1=$client->GetAugmentIDAt($slot1, $i);
          if($augid1==$itmchk) {
             return 1;
@@ -63,9 +65,9 @@ sub check_hasitem {
         }
     }
 #Check shared bank
-    for($slot1=2500; $slot1<=2501; $slot1++) {
+    for($slot1=quest::inventory('sharedbank_begin'); $slot1<=quest::inventory('sharedbank_end'); $slot1++) {
         $itemid1=$client->GetItemIDAt($slot1);
-      for($i=0; $i<5; $i++) {
+      for($i=$augsocket_begin; $i<=$augsocket_end; $i++) {
          $augid1=$client->GetAugmentIDAt($slot1, $i);
          if($augid1==$itmchk) {
             return 1;
@@ -76,9 +78,9 @@ sub check_hasitem {
         }
     }
 #Check shared bank's containers
-    for($slot1=2531; $slot1<=2550; $slot1++) {
+    for($slot1=quest::inventory('sharedbankbags_begin'); $slot1<=quest::inventory('sharedbankbags_end'); $slot1++) {
         $itemid1=$client->GetItemIDAt($slot1);
-      for($i=0; $i<5; $i++) {
+      for($i=$augsocket_begin; $i<=$augsocket_end; $i++) {
          $augid1=$client->GetAugmentIDAt($slot1, $i);
          if($augid1==$itmchk) {
             return 1;
@@ -92,13 +94,13 @@ sub check_hasitem {
   if ($body_count > 0) {
     for ($i=1; $i<=$body_count; $i++) {
       $body_id = $client->GetCorpseID($i);
-      for ($slot1=0; $slot1<=30; $slot1++) {
+      for ($slot1=quest::inventory('possessions_begin'); $slot1<=quest::inventory('possessions_end'); $slot1++) {
         $itemid1 = $client->GetCorpseItemAt($body_id, $slot1);
         if ($itemid1 == $itmchk) {
           return 1;
         }
       }
-      for ($slot1=251; $slot1<=340; $slot1++) {
+      for ($slot1=quest::inventory('generalbags_begin'); $slot1<=quest::inventory('cursorbag_end'); $slot1++) {
         $itemid1 = $client->GetCorpseItemAt($body_id, $slot1);
         if ($itemid1 == $itmchk) {
           return 1;
diff --git a/pojustice/player.lua b/pojustice/player.lua
index 3bda072b..83fc171a 100644
--- a/pojustice/player.lua
+++ b/pojustice/player.lua
@@ -5,7 +5,7 @@ function event_click_door(e)
 	if ( door_id >= 8 and door_id <= 13 ) then 
 		e.self:MovePC(201, 456, 825, 9, 360);
 	elseif ( door_id >= 1 and door_id <= 6 ) then
-		if ( e.self:GetItemIDAt(30) == 31599 ) then 
+		if ( e.self:GetItemIDAt(Slot.Cursor) == 31599 ) then 
  			MoveGroup(e.self:GetGroup(), e.self:GetX(), e.self:GetY(), e.self:GetZ(), 75, 65, 1308, 7, 121);
 			--using this until proximity_say is fixed
 			--monk has to have all trials done to loot Symbol on live so force monk to do the clickup or no triggered spawn
diff --git a/sebilis/encounters/berserkerepic_1_5.lua b/sebilis/encounters/berserkerepic_1_5.lua
index 3029f050..3960014e 100644
--- a/sebilis/encounters/berserkerepic_1_5.lua
+++ b/sebilis/encounters/berserkerepic_1_5.lua
@@ -42,25 +42,25 @@ function Protector_Timer(e)
 						if(ent:CastToMob():GetClass()==16 and damage > 0) then --berserker
 							local currclient=ent:CastToClient();
 							if(math.random(3)==1) then 
-								if(currclient:GetItemIDAt(13)==16779) then
+								if(currclient:GetItemIDAt(Slot.Primary)==16779) then
 									eq.target_global("berserk_epic_test17759", "1", "F", 0,currclient:CharacterID(),0);
 									currclient:Message(15,"After several heavy swings, the axe shatters into many fine pieces. Time for a new axe!");
-									currclient:DeleteItemInInventory(13, 1, true);
+									currclient:DeleteItemInInventory(Slot.Primary, 1, true);
 									currclient:SummonItem(17833);
-								elseif(currclient:GetItemIDAt(13)== 17759 ) then
+								elseif(currclient:GetItemIDAt(Slot.Primary)== 17759 ) then
 									eq.target_global("berserk_epic_test17370", "1", "F", 0,currclient:CharacterID(),0);
 									currclient:Message(15,"After raining down nearly two dozen blows you begin to notice small hairline fractures developing in the axe head. You think testing for this axe has been completed.");
-									currclient:DeleteItemInInventory(13, 1, true);
+									currclient:DeleteItemInInventory(Slot.Primary, 1, true);
 									currclient:SummonItem(17898);
-								elseif(currclient:GetItemIDAt(13)==17700) then
+								elseif(currclient:GetItemIDAt(Slot.Primary)==17700) then
 									eq.target_global("berserk_epic_test17700", "1", "F", 0,currclient:CharacterID(),0);
 									currclient:Message(15,"After many swings you can feel this axe is failing and think that it will fall apart at any moment. You think that testing for this axe has been completed.");
-									currclient:DeleteItemInInventory(13, 1, true);
+									currclient:DeleteItemInInventory(Slot.Primary, 1, true);
 									currclient:SummonItem(17399);
-								elseif(currclient:GetItemIDAt(13)== 17370) then
+								elseif(currclient:GetItemIDAt(Slot.Primary)== 17370) then
 									eq.target_global("berserk_epic_test16779", "1", "F", 0,currclient:CharacterID(),0);
 									currclient:Message(15,"The rigors of battle have had no effect of this axe. Keras should be very pleased with the result of this particular axe.");
-									currclient:DeleteItemInInventory(13, 1, true);
+									currclient:DeleteItemInInventory(Slot.Primary, 1, true);
 									currclient:SummonItem(18976);									
 								end
 							end
diff --git a/sirens/a_twitching_swordfish.lua b/sirens/a_twitching_swordfish.lua
index c6a384fd..76e51bdd 100644
--- a/sirens/a_twitching_swordfish.lua
+++ b/sirens/a_twitching_swordfish.lua
@@ -12,7 +12,7 @@ function event_timer(e)
 					if(ent:IsClient()) then
 						if(ent:CastToMob():GetClass()==4 and damage > 0) then
 							local currclient=ent:CastToClient();
-							if(currclient:GetItemIDAt(13)==62646) then
+							if(currclient:GetItemIDAt(Slot.Primary)==62646) then
 								currclient:SummonItem(62643);
 								eq.depop_with_timer();
 							end
diff --git a/tox/38139.pl b/tox/38139.pl
index aa133abd..943f3d73 100644
--- a/tox/38139.pl
+++ b/tox/38139.pl
@@ -12,7 +12,7 @@ my $eventstart;
 sub EVENT_SAY {
  if ($class eq "Druid") {
   if ($text=~/I am on the job/i && $askresponse==1 && $beenonjob) {
-	if ($client->GetItemIDAt(13) == 62829) {
+	if ($client->GetItemIDAt(quest:inventory('primary')) == 62829) {
 		quest::say("Well I'll be, a druid that wants to be a miner! Alright then, you keep at it. Don't break a nail or strain your delicate sensibilities!");
 		$jobresponse=1;
 	}
diff --git a/uqua/player.pl b/uqua/player.pl
index e9f9ab9c..a53fe8c6 100644
--- a/uqua/player.pl
+++ b/uqua/player.pl
@@ -69,8 +69,8 @@ sub EVENT_CLICKDOOR {
 
 
 sub AURA {
-	$RangedItemID = $client->GetItemIDAt(14);
-	$SecondaryItemID = $client->GetItemIDAt(11);
+	$RangedItemID = $client->GetItemIDAt(quest:inventory('ranged'));
+	$SecondaryItemID = $client->GetItemIDAt(quest:inventory('secondary'));
 	if (defined($qglobals{$instid."_destper"})) {
 		quest::selfcast(5051);
 	} elsif ($RangedItemID == 67736 || $RangedItemID == 67737 || $RangedItemID == 67738 || $RangedItemID == 67739 || $SecondaryItemID == 67736 || $SecondaryItemID == 67737 || $SecondaryItemID == 67738 || $SecondaryItemID == 67739 || $client->FindBuff(756)) {

Raw Paste Data