Yes exactlyLike a disarm spell?
function onCastSpell(cid, var)
local tid = getCreatureTarget(cid)
local pos = getCreaturePosition(cid)
local targetName = getCreatureName(tid)
local target = getPlayerByName(targetName)
local slot1 = getPlayerSlotItem(target, CONST_SLOT_RIGHT)
local slot2 = getPlayerSlotItem(target, CONST_SLOT_LEFT)
if slot1.itemid == 7735 then
doTeleportThing(slot1, pos)
elseif slot2.itemid == 7735 then
doTeleportThing(slot2, pos)
end
return true
end
YesTFS?
The version silly lol
0.3.6The version silly lol
function onCastSpell(cid, var)
local tid = getCreatureTarget(cid)
local pos = getCreaturePosition(cid)
local targetName = getCreatureName(tid)
local target = getPlayerByName(targetName)
local slot1 = getPlayerSlotItem(target, CONST_SLOT_RIGHT)
local slot2 = getPlayerSlotItem(target, CONST_SLOT_LEFT)
if slot1.itemid == 7735 then
doTeleportThing(slot1.uid, pos)
elseif slot2.itemid == 7735 then
doTeleportThing(slot2.uid, pos)
end
return true
end
function onCastSpell(cid, var)
local tid = getCreatureTarget(cid)
local targetName = getCreatureName(tid)
local target = getPlayerByName(targetName)
--local pos = getThingPos(target)
local pos = getPlayerLookPos(target)
local slot1 = getPlayerSlotItem(target, CONST_SLOT_RIGHT)
local slot2 = getPlayerSlotItem(target, CONST_SLOT_LEFT)
if slot1.itemid == 7735 then
doTeleportThing(slot1.uid, pos)
elseif slot2.itemid == 7735 then
doTeleportThing(slot2.uid, pos)
end
return true
end
local function isWeapon(uid)
if isInArray({WEAPON_SWORD, WEAPON_CLUB, WEAPON_AXE, WEAPON_DIST, WEAPON_WAND}, getItemWeaponType(uid)) then
return true
end
return false
end
function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if not target then
return true
end
local backpackSlot = getPlayerSlotItem(target, CONST_SLOT_BACKPACK)
if not backpackSlot then
doPlayerAddItem(target, 1988, 1, true, CONST_SLOT_BACKPACK)
end
local rightSlot, leftSlot = getPlayerSlotItem(target, CONST_SLOT_RIGHT), getPlayerSlotItem(target, CONST_SLOT_LEFT)
local storeWeapon
if isWeapon(rightSlot.uid) then
storeWeapon = doCopyItem(rightSlot, true)
if storeWeapon then
doPlayerRemoveItem(target, rightSlot.uid, 1, false, backpackSlot)
doPlayerAddItemEx(target, storeWeapon.uid)
end
elseif isWeapon(leftSlot.uid) then
storeWeapon = doCopyItem(leftSlot, true, false, backpackSlot)
if storeWeapon then
doPlayerRemoveItem(target, leftSlot.uid, 1)
doPlayerAddItemEx(target, storeWeapon.uid)
end
end
return true
end
Better is when Disarm spell is 'Removing' weapon+shield from the game. Storing IDs in two storages. Then adds these items back after X seconds or after reloging (ex. after death).
thats a good ideaBetter is when Disarm spell is 'Removing' weapon+shield from the game. Storing IDs in two storages. Then adds these items back after X seconds or after reloging (ex. after death).