• 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!

Cant loot from any creature.

Nashalito

New Member
Joined
May 21, 2009
Messages
273
Reaction score
0
Hello , everytime i kill any mob , i dont receive any exp or loot yet but in console i get this messege

PHP:
[28/04/2010 23:05:14] [Error - CreatureScript Interface] 
[28/04/2010 23:05:14] data/creaturescripts/scripts/monster_weapon_upgrade.lua:onKill
[28/04/2010 23:05:14] Description: 
[28/04/2010 23:05:15] ...a/creaturescripts/scripts/monster_weapon_upgrade.lua:60: attempt to call global 'getItemExtraAttack' (a nil value)
[28/04/2010 23:05:15] stack traceback:
[28/04/2010 23:05:15] 	...a/creaturescripts/scripts/monster_weapon_upgrade.lua:60: in function <...a/creaturescripts/scripts/monster_weapon_upgrade.lua:41>

This is my monster weapon upgrader . lua

PHP:
--[[
        ** Monster weapon upgrader by RunarM **


        [ignore_monsters]
        - type "yes" and only by the [monsters] the weapon gain kills
        [monsters]
        • {"..","..",".."} - list of monsters where weapon gain kills
        [ingore_weapons]
        - type "yes" and only the [weapons] can be upgraded
        [weapons]
        •       [2395] = {100, 1, 3},
                   |       |   |  |
                   |       |   |  •> extraAttackLimit
                   |       |   •> extraAttack
                   |       •> kills
                   •> id of the weapon
        [default]
        • kills - how much monsters must be killed
        • extraAttack - how much extraAttack points will this weapon get
        • extraAttackLimit - you can set limit of extraAttack points added
]]--


local ignore_monsters = "yes"
local monsters = {"Rat","Dragon","Dragon Lord"}

local ingore_weapons = "yes"
local weapons = {
        [2395] = {600, 1, 5},
        [2383] = {500, 1, 4}

} -- weapon end --

local default = {
        500,   -- kills
        1,     -- extraAttack
        5      -- extraAttackLimit
} -- default end --

function onKill(cid, target)
        if(isPlayer(target) == TRUE) then
                return TRUE
        end

        if (string.lower(ignore_monsters) == "no" and isInArray(monsters, getCreatureName(target)) == TRUE or string.lower(ignore_monsters) == "yes") then

                local playerWeapon = getPlayerWeapon(cid, TRUE)
                if(playerWeapon.itemid == 0) then
                        return TRUE
                end

                local weapon = weapons[getPlayerWeapon(cid).itemid]
                if string.lower(ingore_weapons) == "yes" then
                        weapon = default
                end

                if (string.lower(ingore_weapons) == "no" and (not weapon) == FALSE or string.lower(ingore_weapons) == "yes") then

                        local currentExtraAttack = getItemExtraAttack(playerWeapon.uid)
                        if(currentExtraAttack >= weapon[3]) then
                                return TRUE
                        end

                        local add = weapon[2]
                        if(currentExtraAttack + add > weapon[3]) then
                                add = currentExtraAttack - weapon[3]
                        end

                        if(playerWeapon.actionid ~= 0) then
                                if(playerWeapon.actionid >= weapon[1]+9999) then
                                        doSetItemActionId(playerWeapon.uid, 10000)
                                        setItemExtraAttack(playerWeapon.uid, currentExtraAttack + add)
                                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! Your weapon received +" ..add.. " attack points and now have total extra damage of +" .. getItemExtraAttack(playerWeapon.uid) .. " points!")
                                        doSetItemSpecialDescription(playerWeapon.uid, "["..(playerWeapon.actionid-9999).."/"..weapon[1].." | ".. getItemExtraAttack(playerWeapon.uid).."/"..weapon[3].."]")
                                else
                                        doSetItemActionId(playerWeapon.uid, playerWeapon.actionid + 1)
                                        doSetItemSpecialDescription(playerWeapon.uid, "["..(playerWeapon.actionid-9999).."/"..weapon[1].." | ".. getItemExtraAttack(playerWeapon.uid).."/"..weapon[3].."]")
                                end
                        else
                                doSetItemActionId(playerWeapon.uid, 10001)
                                doSetItemSpecialDescription(playerWeapon.uid, "[1/"..weapon[1].." | ".. getItemExtraAttack(playerWeapon.uid).."/"..weapon[3].."]")
                        end
                end
        end
        return TRUE
end

i use 0.3.6
 
Code:
--[[
	** Monster weapon upgrader by RunarM **


	[ignoreMonsters]
	- type "yes" and only by the [monsters] the weapon gain kills
	[monsters]
	• {"..","..",".."} - list of monsters where weapon gain kills
	[ignoreWeapons]
	- type "yes" and only the [weapons] can be upgraded
	[weapons]
	•       [2395] = {100, 1, 3},
		|       |   |  |
		|       |   |  •> extraAttackLimit
		|       |   •> extraAttack
		|       •> kills
		•> id of the weapon
	[default]
	• kills - how much monsters must be killed
	• extraAttack - how much extraAttack points will this weapon get
	• extraAttackLimit - you can set limit of extraAttack points added
]]--


local ignoreMonsters = true
local monsters = {"Rat","Dragon","Dragon Lord"}

local ignoreWeapons = true
local weapons = {
	[2395] = {600, 1, 5},
	[2383] = {500, 1, 4}

} -- weapon end --

local default = {
	500,   -- kills
	1,     -- extraAttack
	5      -- extraAttackLimit
} -- default end --

function onKill(cid, target)
	if(isPlayer(target) == TRUE) then
		return TRUE
	end

	if not ignoreMonsters and isInArray(monsters, getCreatureName(target)) or ignoreMonsters then

		local playerWeapon = getPlayerWeapon(cid, true)
		if playerWeapon.itemid == 0 then
			return true
		end

		local weapon = ignoreWeapons and default or weapons[getPlayerWeapon(cid).itemid]

		if not ignoreWeapons and weapon or ignoreWeapons then
			local currentExtraAttack = getItemAttribute(playerWeapon.uid, "extraAttack") or 0
			if(currentExtraAttack >= weapon[3]) then
				return true
			end

			local add = weapon[2]
			if(currentExtraAttack + add > weapon[3]) then
				add = currentExtraAttack - weapon[3]
			end

			if(playerWeapon.actionid ~= 0) then
				if(playerWeapon.actionid >= weapon[1]+9999) then
					doItemSetAttribute(playerWeapon.uid, "aid", 10000)
					doItemSetAttribute(playerWeapon.uid, "extraAttack", currentExtraAttack + add)
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! Your weapon received +" ..add.. " attack points and now have total extra damage of +" .. getItemAttribute(playerWeapon.uid, "extraAttack") .. " points!")
					doItemSetAttribute(playerWeapon.uid, "description", "["..(playerWeapon.actionid-9999).."/"..weapon[1].." | ".. getItemAttribute(playerWeapon.uid, "extraAttack").."/"..weapon[3].."]")
				else
					doItemSetAttribute(playerWeapon.uid, "aid", playerWeapon.actionid + 1)
					doItemSetAttribute(playerWeapon.uid, "description", "["..(playerWeapon.actionid-9999).."/"..weapon[1].." | "..(getItemAttribute(playerWeapon.uid, "extraAttack") or 0).. "/"..weapon[3].."]")
				end
			else
				doItemSetAttribute(playerWeapon.uid, "aid", 10001)
				doItemSetAttribute(playerWeapon.uid, "description", "[1/"..weapon[1].." | ".. getItemAttribute(playerWeapon.uid, "extraAttack").."/"..weapon[3].."]")
			end
		end
	end
	return true
end
 
Last edited:
Still not working.

[29/04/2010 15:22:40] [Error - CreatureScript Interface]
[29/04/2010 15:22:40] data/creaturescripts/scripts/monster_weapon_upgrade.lua:onKill
[29/04/2010 15:22:40] Description:
[29/04/2010 15:22:40] ...a/creaturescripts/scripts/monster_weapon_upgrade.lua:74: attempt to concatenate a nil value
[29/04/2010 15:22:40] stack traceback:
[29/04/2010 15:22:40] ...a/creaturescripts/scripts/monster_weapon_upgrade.lua:74: in function <...a/creaturescripts/scripts/monster_weapon_upgrade.lua:41>
 
Back
Top