• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Action] The Shield Nevermourn | Claw of 'The Noxious Spawn'

Ratser

Retired // Making time for yoloswagmod
Joined
Feb 11, 2009
Messages
482
Reaction score
36
Ok, so...I was trying to create a script for The Shield Nevermourn according to its current action in Global but I've been having some errors in console:
Code:
[16/07/2010 11:17:09] [Error - Action Interface] 
[16/07/2010 11:17:09] In a timer event called from: 
[16/07/2010 11:17:09] data/actions/scripts/other/theshieldnevermourn.lua:onUse
[16/07/2010 11:17:09] Description: 
[16/07/2010 11:17:09] data/actions/scripts/other/theshieldnevermourn.lua:11: attempt to index global 'item' (a nil value)
[16/07/2010 11:17:09] stack traceback:
[16/07/2010 11:17:09] 	data/actions/scripts/other/theshieldnevermourn.lua:11: in function <data/actions/scripts/other/theshieldnevermourn.lua:10>
[Explanation]
Since itemid="10318" and itemid="10364" are both the same item I'm trying to transform 10318 to 10364 AFTER 2 seconds (I'm using 2 seconds only to test) [addEvent(onTime, 2000, a)], inmediately after it transforms it has to say a random sound from 'local SOUNDS' (it has to work ONLY if the itemid is 10364). Finally, it inmediately decays back to 10318.

Code:
local SOUNDS = {"Servant! Please call me a coach. - Yes, sir. You are a coach!", "Did your father help you do your homework? No, he did it all by himself.", "If big elephants have big trunks, do small elephants have suitcases?", "Do you want to hear a dirty joke ? A white horse fell in the mud.", "What do you call a deer with no eyes ? - I have no I-Deer!", "My friend said he knew a man with a wooden leg called Sam. So I asked him 'What was the name of his other leg?'", "Did you hear about the Lich who walked into frodo's bar? He ordered a cup of beer and a mup.", "If whistles are made of tin, what are fog horns made of?"}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 10318 then
		addEvent(onTime, 2000, a)
	end
	return true
end

function onTime(a)
	doTransformItem(item.uid, 10364)
	doDecayItem(item.uid)
	if(doTransformItem(item.uid, 10364)) then
		local random = math.random(1, table.maxn(SOUNDS))
		if(fromPosition.x ~= CONTAINER_POSITION) then
			doCreatureSay(cid, SOUNDS[random], TALKTYPE_MONSTER, false, 0, 

fromPosition)
		else
			doCreatureSay(cid, SOUNDS[random], TALKTYPE_MONSTER)
		end
	end
	return true
end
 
Last edited:
*sigh* I've already searched far and low and I think...
  • There's NOT a way to stop the charges even if there's an itemid transformation. (Meh...I though there was something like a 'stopCharges' attribute)
  • Yes...I'm using those itemids correctly (Because there's not any better combination)

About the minor bug: It can be "fixed" (it's not really a fix because there are still some bugs if you take it off) if I remove 'slot="ring"' from these:
Code:
	<movevent type="Equip" itemid="10309" slot="ring" level="100" event="function" value="onEquipItem"/>
	<movevent type="DeEquip" itemid="10309" slot="ring" event="function" value="onDeEquipItem"/>
But I've decided I'll leave it that way because if you get the item "normally" (from the monster's loot) then the bug won't happen.

If somebody has any other solution please post it.
 
Code:
However, it's advisable to take it off and wear again after using it around 60 times, or it will be depleted for 1 day, when it happens you might get Poisoned or Cursed. If it happens you receive around 15 turns of damage, increasing from 1 until the last damage of 460+ (remove the curse eating a Hydra Tongue Salad or asking for healing in a temple).

Ok, so I know this thread is really old lol, but I gave it a try anyway.
If you already solved this then there is no need of it, but what about using it with storage values(The 60 time stuff)
Lua:
local poison = createConditionObject(CONDITION_POISON)
setConditionParam(poison, CONDITION_PARAM_DELAYED, true)
addDamageCondition(poison, 1, 4000, -1)
addDamageCondition(poison, 2, 4000, -2)
addDamageCondition(poison, 1, 4000, -4)
addDamageCondition(poison, 1, 4000, -6)
addDamageCondition(poison, 1, 4000, -9)
addDamageCondition(poison, 1, 4000, -14)
addDamageCondition(poison, 1, 4000, -21)
addDamageCondition(poison, 1, 4000, -21)
addDamageCondition(poison, 1, 4000, -33)
addDamageCondition(poison, 1, 4000, -52)
addDamageCondition(poison, 1, 4000, -80)
addDamageCondition(poison, 1, 4000, -124)
addDamageCondition(poison, 1, 4000, -192)
addDamageCondition(poison, 1, 4000, -298)
addDamageCondition(poison, 1, 4000, -462)

local cursed = createConditionObject(CONDITION_CURSED)
setConditionParam(curse, CONDITION_PARAM_DELAYED, true)
addDamageCondition(curse, 1, 4000, -1)
addDamageCondition(curse, 2, 4000, -2)
addDamageCondition(curse, 1, 4000, -4)
addDamageCondition(curse, 1, 4000, -6)
addDamageCondition(curse, 1, 4000, -9)
addDamageCondition(curse, 1, 4000, -14)
addDamageCondition(curse, 1, 4000, -21)
addDamageCondition(curse, 1, 4000, -21)
addDamageCondition(curse, 1, 4000, -33)
addDamageCondition(curse, 1, 4000, -52)
addDamageCondition(curse, 1, 4000, -80)
addDamageCondition(curse, 1, 4000, -124)
addDamageCondition(curse, 1, 4000, -192)
addDamageCondition(curse, 1, 4000, -298)
addDamageCondition(curse, 1, 4000, -462)

function onUse(cid, item, fromPosition, itemEx, toPosition)
q = getPlayerStorageValue(cid,storage)
if q <= 0 then
 j = 1 
else
j = q
end
if item.itemid >= 5000 and item.itemid < 5001 then
   if getPlayerLevel(cid) >= 100 then
      if getPlayerStorageValue(cid,storage) < 60 then
         doRemoveCondition(cid,poison)
         setPlayerStorageValue(cid,storage,1+j)
      else
          if (math.random(1,600) == 60) then
             if (math.random(1,2) == 1) then
                doAddCondition(cid,poison)
                doTransformItem(item.uid,5002)
             else
                 doAddCondition(cid,cursed)
                 doTransformItem(item.uid,5002)
             end
          end
      end
   else
       doPlayerSendCancel(cid, "You need to be level 100 or more in order to use this item")
end
return true
end
end
Code:
THESE ARE EXAMPLES
5000 -> Noxious spawn wear
5001 -> Noxious spawn un-wear
5002 -> Noxious spawn  as deco

Then creating a movement, so if player has 'x' storage value and you take it off then the storage value gets reseted to 1 again?
 
somehow i feel like you're not going to get help
Pwned

@santigggg: Nope, I haven't finished this YET but I have an idea of how to do it. Storages won't help because if the item is used by another player then the usage count will restart to 0. I was planning to do it with 'doItemSetAttribute(item.uid, "aid", getItemAttribute(item.uid, "aid") + 1)'.
 
Last edited:
Pwned

@santigggg: Nope, I haven't finished this YET but I have an idea of how to do it. Storages won't help because if the item is used by another player then the usage count will restart to 0. I was planning to do it with 'doItemSetAttribute(item.uid, "aid", getItemAttribute(item.uid, "aid") + 1)'.

Yeah, but AIDs cud duplicate too, probably, each time the monster loots it, give a different AID?
Lua:
local poison = createConditionObject(CONDITION_POISON)
setConditionParam(poison, CONDITION_PARAM_DELAYED, true)
addDamageCondition(poison, 1, 4000, -1)
addDamageCondition(poison, 2, 4000, -2)
addDamageCondition(poison, 1, 4000, -4)
addDamageCondition(poison, 1, 4000, -6)
addDamageCondition(poison, 1, 4000, -9)
addDamageCondition(poison, 1, 4000, -14)
addDamageCondition(poison, 1, 4000, -21)
addDamageCondition(poison, 1, 4000, -21)
addDamageCondition(poison, 1, 4000, -33)
addDamageCondition(poison, 1, 4000, -52)
addDamageCondition(poison, 1, 4000, -80)
addDamageCondition(poison, 1, 4000, -124)
addDamageCondition(poison, 1, 4000, -192)
addDamageCondition(poison, 1, 4000, -298)
addDamageCondition(poison, 1, 4000, -462)
 
local cursed = createConditionObject(CONDITION_CURSED)
setConditionParam(curse, CONDITION_PARAM_DELAYED, true)
addDamageCondition(curse, 1, 4000, -1)
addDamageCondition(curse, 2, 4000, -2)
addDamageCondition(curse, 1, 4000, -4)
addDamageCondition(curse, 1, 4000, -6)
addDamageCondition(curse, 1, 4000, -9)
addDamageCondition(curse, 1, 4000, -14)
addDamageCondition(curse, 1, 4000, -21)
addDamageCondition(curse, 1, 4000, -21)
addDamageCondition(curse, 1, 4000, -33)
addDamageCondition(curse, 1, 4000, -52)
addDamageCondition(curse, 1, 4000, -80)
addDamageCondition(curse, 1, 4000, -124)
addDamageCondition(curse, 1, 4000, -192)
addDamageCondition(curse, 1, 4000, -298)
addDamageCondition(curse, 1, 4000, -462)
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
q = geItemAttribute(item.uid, "aid")
if q <= 0 then
 j = 1 
else
j = q
end
if item.itemid >= 5000 and item.itemid < 5001 then
   if getPlayerLevel(cid) >= 100 then
      if getItemAttribute(item.uid, "aid") < 60 then
         doRemoveCondition(cid,poison)
         doItemSetAttribute(getItemAttribute(item.uid, "aid") + 1+j)
      else
          if (math.random(1,600) == 60) then
             if (math.random(1,2) == 1) then
                doAddCondition(cid,poison)
                doTransformItem(item.uid,5002)
             else
                 doAddCondition(cid,cursed)
                 doTransformItem(item.uid,5002)
             end
          end
      end
   else
       doPlayerSendCancel(cid, "You need to be level 100 or more in order to use this item")
end
return true
end
end
 
Hmm...now that I start thinking of it...how could I make the item get the 'aid' after it's looted?
 
This:
Lua:
function onDeath(cid, corpse, deathList)
   if isMonster(cid) then
      local reward = doAddContainerItem(corpse.uid, ID_OF_NOXIOUS_SPAWN, 1)
      doItemSetAttribute(reward, 'uid', 500)
   end
   return true
end

But instead of if isMonster(cid), something like if creaturename == 'Noxious spawn' cant remember at moment.
So I got this idea, first time you kill the monster u get the item with aid 500, next time, you'll get another aid with 621, nex time, 742, and each time +120(cuz 120 will be the max. someone can use the spawn)
So script wud be:
Lua:
local poison = createConditionObject(CONDITION_POISON)
setConditionParam(poison, CONDITION_PARAM_DELAYED, true)
addDamageCondition(poison, 1, 4000, -1)
addDamageCondition(poison, 2, 4000, -2)
addDamageCondition(poison, 1, 4000, -4)
addDamageCondition(poison, 1, 4000, -6)
addDamageCondition(poison, 1, 4000, -9)
addDamageCondition(poison, 1, 4000, -14)
addDamageCondition(poison, 1, 4000, -21)
addDamageCondition(poison, 1, 4000, -21)
addDamageCondition(poison, 1, 4000, -33)
addDamageCondition(poison, 1, 4000, -52)
addDamageCondition(poison, 1, 4000, -80)
addDamageCondition(poison, 1, 4000, -124)
addDamageCondition(poison, 1, 4000, -192)
addDamageCondition(poison, 1, 4000, -298)
addDamageCondition(poison, 1, 4000, -462)
 
local cursed = createConditionObject(CONDITION_CURSED)
setConditionParam(curse, CONDITION_PARAM_DELAYED, true)
addDamageCondition(curse, 1, 4000, -1)
addDamageCondition(curse, 2, 4000, -2)
addDamageCondition(curse, 1, 4000, -4)
addDamageCondition(curse, 1, 4000, -6)
addDamageCondition(curse, 1, 4000, -9)
addDamageCondition(curse, 1, 4000, -14)
addDamageCondition(curse, 1, 4000, -21)
addDamageCondition(curse, 1, 4000, -21)
addDamageCondition(curse, 1, 4000, -33)
addDamageCondition(curse, 1, 4000, -52)
addDamageCondition(curse, 1, 4000, -80)
addDamageCondition(curse, 1, 4000, -124)
addDamageCondition(curse, 1, 4000, -192)
addDamageCondition(curse, 1, 4000, -298)
addDamageCondition(curse, 1, 4000, -462)
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
q = geItemAttribute(item.uid, "aid")
if q <= 0 then
j = 1 
else
j = q
end
if item.itemid >= 5000 and item.itemid < 5001 then
   if getPlayerLevel(cid) >= 100 then
      if getItemAttribute(item.uid, "aid") < 60 then
         doRemoveCondition(cid,poison)
         doItemSetAttribute(getItemAttribute(item.uid, "aid") + 1+j)
      elseif getItemAttribute(item.uid, "aid") >= 60 and getItemAttribute(item.uid, "aid") < 120 then
          if (math.random(1,600) == 60) then
             if (math.random(1,2) == 1) then
                doAddCondition(cid,poison)
                doTransformItem(item.uid,5002)
             else
                 doAddCondition(cid,cursed)
                 doTransformItem(item.uid,5002)
             end
          end
      elseif getItemAttribute(item.uid, "aid") == 120 then
             if (math.random(1,2) == 1) then
                doAddCondition(cid,poison)
                doTransformItem(item.uid,5002)
             else
                 doAddCondition(cid,cursed)
                 doTransformItem(item.uid,5002)
             end
       end
   else
       doPlayerSendCancel(cid, "You need to be level 100 or more in order to use this item")
end
return true
end
end
So in this script, there must be a way (Without making a super long table which will convert this:
Code:
"aid") [COLOR="red"]< 60[/COLOR] then
In another number (depending the aid)
But with a reallllyyyyyy long table, it will be I really mean it a 300 - 500 line table (cuz we dont know the quantity of ppl for the serv that will kill this monster). You get me? :p
 
But instead of if isMonster(cid), something like if creaturename == 'Noxious spawn' cant remember at moment.
So I got this idea, first time you kill the monster u get the item with aid 500, next time, you'll get another aid with 621, nex time, 742, and each time +120(cuz 120 will be the max. someone can use the spawn)

I don't understand why the 'aid's duplicate, but maybe this can be done by using a global storage that increases its value by 1 each time the monster is killed. The 'aid' would then depend on the value of the storage.
 
I don't understand why the 'aid's duplicate, but maybe this can be done by using a global storage that increases its value by 1 each time the monster is killed. The 'aid' would then depend on the value of the storage.

The aids wud duplicate of course, cause, the attribute of the item will have always the same AID? So its the same as using storageValues.
Btw yea, the globalstorageidea is really good, Ill try to make it, and edit this post.

EDIT:
Lua:
local storage = 5000
function onDeath(cid, corpse, deathList)
   if isMonster(cid) then
      if getGlobalStorageValue(cid,storage) == 1 then
         local reward = doAddContainerItem(corpse.uid, ID_OF_NOXIOUS_SPAWN, 1)
         setGlobalStorageValue(cid,storage+1200,1)
         doItemSetAttribute(reward, 'uid', (getGlobalStorageValue(cid,storage)) /10)
      end
   return true
end

The idea is this:
Lua:
[5000] = 500,
[6210] = 621,
[7420] = 742

But, I dont know if it'll work though, cause if it gets the storage as 5000 always then it will always give 500, the storage must be changed each time it checks for the monster dead.
 
Last edited:
But, the spawn cant be wear in 24 hrs because its now a decoration object, so now its just that you cant put it as a ring, but you still can put it at bp and stuff :p
EDIT: It doesnt even need a movement action, since the item does nothing.
Oh and we have to add
Lua:
if getPlayerSlotItem(cid, CONST_SLOT_RING).itemid == xxxx then
It cures your Poisoned state when you click on it while wearing it
 
Last edited:
Yeh, I know. But this is the minor bug:
The minor bug: If I use '/i 10309' and it appears on a slot other than the "ring slot" it stays as 10309 even if I put it on the floor. It only transforms if I put it in the proper slot and then take it out.
About the minor bug: It can be "fixed" (it's not really a fix because there are still some bugs if you take it off) if I remove 'slot="ring"' from these:
XML:
	<movevent type="Equip" itemid="10309" slot="ring" level="100" event="function" value="onEquipItem"/>
	<movevent type="DeEquip" itemid="10309" slot="ring" event="function" value="onDeEquipItem"/>
 
Alright, so this is all we got so far:
Lua:
local poison = createConditionObject(CONDITION_POISON)
setConditionParam(poison, CONDITION_PARAM_DELAYED, true)
addDamageCondition(poison, 1, 4000, -1)
addDamageCondition(poison, 2, 4000, -2)
addDamageCondition(poison, 1, 4000, -4)
addDamageCondition(poison, 1, 4000, -6)
addDamageCondition(poison, 1, 4000, -9)
addDamageCondition(poison, 1, 4000, -14)
addDamageCondition(poison, 1, 4000, -21)
addDamageCondition(poison, 1, 4000, -21)
addDamageCondition(poison, 1, 4000, -33)
addDamageCondition(poison, 1, 4000, -52)
addDamageCondition(poison, 1, 4000, -80)
addDamageCondition(poison, 1, 4000, -124)
addDamageCondition(poison, 1, 4000, -192)
addDamageCondition(poison, 1, 4000, -298)
addDamageCondition(poison, 1, 4000, -462)
 
local cursed = createConditionObject(CONDITION_CURSED)
setConditionParam(curse, CONDITION_PARAM_DELAYED, true)
addDamageCondition(curse, 1, 4000, -1)
addDamageCondition(curse, 2, 4000, -2)
addDamageCondition(curse, 1, 4000, -4)
addDamageCondition(curse, 1, 4000, -6)
addDamageCondition(curse, 1, 4000, -9)
addDamageCondition(curse, 1, 4000, -14)
addDamageCondition(curse, 1, 4000, -21)
addDamageCondition(curse, 1, 4000, -21)
addDamageCondition(curse, 1, 4000, -33)
addDamageCondition(curse, 1, 4000, -52)
addDamageCondition(curse, 1, 4000, -80)
addDamageCondition(curse, 1, 4000, -124)
addDamageCondition(curse, 1, 4000, -192)
addDamageCondition(curse, 1, 4000, -298)
addDamageCondition(curse, 1, 4000, -462)
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
q = geItemAttribute(item.uid, "aid")
if q <= 0 then
j = 1 
else
j = q
end
if item.itemid >= 5000 and item.itemid < 5001 then
   if getPlayerSlotItem(cid, CONST_SLOT_RING).itemid == 5000 then
      if getPlayerLevel(cid) >= 100 then
         if getItemAttribute(item.uid, "aid") < 60 then
            doRemoveCondition(cid,poison)
            doItemSetAttribute(getItemAttribute(item.uid, "aid") + 1+j)
         elseif getItemAttribute(item.uid, "aid") >= 60 and getItemAttribute(item.uid, "aid") < 120 then
                if (math.random(1,600) == 60) then
                   if (math.random(1,2) == 1) then
                      doAddCondition(cid,poison)
                      doTransformItem(item.uid,5002)
                   else
                       doAddCondition(cid,cursed)
                       doTransformItem(item.uid,5002)
                   end
                end
         elseif getItemAttribute(item.uid, "aid") == 120 then
                if (math.random(1,2) == 1) then
                   doAddCondition(cid,poison)
                   doTransformItem(item.uid,5002)
                else
                   doAddCondition(cid,cursed)
                   doTransformItem(item.uid,5002)
                end
         else
             doPlayerSendCancel(cid, "You need to be level 100 or more in order to use this item")
         end
   else
       doPlayerSendCancel(cid, "You can only use this item while wearing it")
   end
end
return true
end
end

And this (which shud be with the creature name + it should change the storagevalue(not always start with 5000))
Lua:
local storage = 5000
function onDeath(cid, corpse, deathList)
   if isMonster(cid) then
      if getGlobalStorageValue(cid,storage) == 1 then
         local reward = doAddContainerItem(corpse.uid, ID_OF_NOXIOUS_SPAWN, 1)
         setGlobalStorageValue(cid,storage+1200,1)
         doItemSetAttribute(reward, 'uid', (getGlobalStorageValue(cid,storage)) /10)
      end
   return true
end

And then the movements.
EDIT: Missing :
Exhaustion time beetween actions (shud be 10 seconds)
That after it gets depleted it will get back to its normal form in 1 day
Fix onDeath script
 
Last edited:
EDIT: Missing :
Exhaustion time beetween actions (shud be 10 seconds)
That after it gets depleted it will get back to its normal form in 1 day
Fix onDeath script

I made it with 'doDecayItem(uid)'.

BTW...shouldn't this be "aid"?
Lua:
doItemSetAttribute(reward, 'uid', (getGlobalStorageValue(cid,storage)) / 10)

EDIT:
This...is a bit strange:
Lua:
local storage = 5000

function onDeath(cid, corpse, deathList)
	if(isMonster(cid)) then
		if(getGlobalStorageValue(cid, storage) == 1) then
			local reward = doAddContainerItem(corpse.uid, 10310, 1)
			setGlobalStorageValue(cid, storage + 1200, 1)
			doItemSetAttribute(reward, "uid", (getGlobalStorageValue(cid, storage)) / 10)
		end
	end

	return true
end

I was thinking to make it something like this:
Lua:
function onDeath(cid, corpse, deathList)
	if(isMonster(cid) and isInArray({"The Noxious Spawn"}, getCreatureName(cid):lower())) then
		reward = doAddContainerItem(corpse.uid, 10310, 1)
		getStorage(5000) == value
		if(doSetStorage(5000, value + 1)) then
			getStorage(5000) == value
			doItemSetAttribute(reward, "aid", getStorage(5000) / 10)
		end
	end

	return true
end

getStorage = getGlobalStorageValue
doSetStorage = setGlobalStorageValue
 
Last edited:
Yes, it should be aid instead of uid.
Btw, your script is kinda same as mine, you just changed name thingy, and the problem is that it will always check storage 5000, but it should check 5000 first time, 6120 next tim, 7240 and so on..
And you are using isInArray, incorrectly :p
 
But why do I have to spam the server with storage keys...can't I use one (like "5000") and just increase its value '(doSetStorage(5000, value + 1)'?

The 'isInArray' works, I tested it. It checks if the monster is The Noxious Spawn.
 
Last edited:
But why do I have to spam the server with storage keys...can't I use one (like "5000") and just increase its value '(doSetStorage(5000, value + 1)'?

The 'isInArray' works, I tested it. It just checks if the monster is The Noxious Spawn.

Yeah, but once you kill monster again, then it will get the storage 5000 and put it to +1 again, so ull get the same always.
And we need it to be +121 cuz 120 times (we are checking times with AIDs not with storages) is the maximum the player can use the noxious spawn
And the isInArray probably works, but, its useless you can just put it normally, but its the same.
 
"However, it's advisable to take it off and wear again after using it around 60 times, or it will be depleted for 1 day"

60 times ^_^
 
I donno what is the problem but if the checking monster failed

try to regstire this event to the monster file, as u cant check for as a cid if it wasn't regestired.
 
Back
Top