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

[request] Only x weapon can kill x monster.

brendan2

Sensation black
Joined
Feb 19, 2009
Messages
507
Reaction score
1
Lets say theres a monster immuned to everything.
And only the unique item can kill it.

How can I do this?
 
best to probably find a damage type that players dont have as a spell eg: drown, that damage type you can make the monster weak to and create a weapon that deals that type of damage
 
Not tested, I have no idea if it will work.
At least it's a start. Good luck. :thumbup:

data/creaturescripts/scripts/script_name.lua
Code:
function onAttack(cid, target)
	local m = {
		["rat"] = {
			[xxxx] = {
				useWeapon = "no" -- "yes" or "no"
			}
		},
		["dog"] = {
			[xxxx] = {
				useWeapon = "no" -- "yes" or "no"
			}
		}
	}
	local monster = m[string.lower(getCreatureName(target))]
	if not monster then
		return true
	end

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

	local weapon = monster[wep.itemid]
	local check = weapon.useWeapon
	if check and not weapon then
		return doCreatureSay(cid, "Sorry, you must be using a " .. getItemInfo(weapon).name .. " to attack this monster.", TALKTYPE_ORANGE_1, false, cid)
	end
	
	return true
end
 
Back
Top