• 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 [Runes] Inspect Rune + Duplicate Rune

Roman

New Member
Joined
Jun 6, 2008
Messages
16
Reaction score
0
Hello, I have a chance to post two of my new scripts I did for fun.

1. Inspect Rune - I got the idea from WoW, and later on discovered there was something called a spy rune which is similar to mine but was released for 7.6
The inspect rune looks like this:
PHP:
17:17 Player [Chaotic Warlock] is level [80] [Male] [Sorcerer] with an access level of [0]
17:17 Health: [945] Mana: [2195] Soul: [0]
17:17 Magic Level: [55] Fist: [20] Club: [20] Sword: [20] Axe: [20] Distance: [20] Shielding: [20] Fishing: [20]
17:17 Items: [crown helmet] [amulet of loss] [backpack] [blue robe] [crown shield] [wand of Inferno] [plate legs] [leather boots] [] [rune]
17:17 Free Capacity: [1190] Food Level: [0] - [Empty]
17:17 Gold Coins: [0] Platinum Coins: [0] Crystal Coins: [0]
You are also able to set options whether or not to allow displaying private things like skills, food, cap, money, and items incase you plan to use it for normal characters.

2. Duplicate Rune - Then I made this, it simply duplicates the item that you used this rune on and gives you a message:
PHP:
17:20 You have duplicated a/an [dragon scale mail] with a count of [1] and type of []
The item is duplicated and appears under you. Remember it is extremely buggy since a debug will be present if you use on a player or yourself (tried using isPlayer or isCreature but didnt work). Make sure only GMs get a hold of this and use it only on moveable items like equipment.


Lets begin:
In actions.xml
PHP:
<action itemid="2282" script="inspectrune.lua" allowfaruse="1" blockwalls="0" />
<action itemid="2312" script="duplicaterune.lua" allowfaruse="1" blockwalls="0" />
In inspectrune.lua
PHP:
-- Inspect Rune made by Roman
-- Credits also to [ Anonymous] - did not want to reveal name
-- Roman - ******
function onUse(cid, item, frompos, item2, topos)
-- Roman - ******
local access_req = 0 -- access required to use rune
local access_other = 3 -- access of the player that the rune cannot be used on (ie. GMS)
local display_private = 1 -- 1 to display private things such as equipment items, feeding levels, capacity, etc.
local display_skills = 1 -- 1 to display skills and magic level
local gold_ID = 2148 -- gold coin ID
local plat_ID = 2152 -- platinum coin ID
local crystal_ID = 2160 -- crystal coin ID
-- Roman - ******
local playerpos = {x=topos.x,y=topos.y,z=topos.z,stackpos=253}
local player2 = getThingfromPos(playerpos)
-- Roman - ******
if isPlayer(player2.uid) == 1 then
    name = getPlayerName(player2.uid)
    sex = getPlayerSex(player2.uid)
    level = getPlayerLevel(player2.uid)
    vocation = getPlayerVocation(player2.uid)
    access = getPlayerAccess(player2.uid)
-- Roman - ******
    health = getPlayerHealth(player2.uid) 
    mana = getPlayerMana(player2.uid) 
    soul = getPlayerSoul(player2.uid)
-- Roman - ******
    magic = getPlayerMagLevel(player2.uid)
    fist = getPlayerSkill(player2.uid, 0)
    club = getPlayerSkill(player2.uid, 1)
    sword = getPlayerSkill(player2.uid, 2)
    axe = getPlayerSkill(player2.uid, 3)
    distance = getPlayerSkill(player2.uid, 4)
    shielding = getPlayerSkill(player2.uid, 5)
    fishing = getPlayerSkill(player2.uid, 6)
-- Roman - ******
    food = getPlayerFood(player2.uid)
    food_desc = ""
    cap = getPlayerFreeCap(player2.uid)
    gold = getPlayerItemCount(player2.uid, gold_ID)
    platinum = getPlayerItemCount(player2.uid, plat_ID)
    crystal = getPlayerItemCount(player2.uid, crystal_ID)
-- Roman - ******
    slot1_item = getItemName(getPlayerSlotItem(player2.uid, 1).itemid)
    slot2_item = getItemName(getPlayerSlotItem(player2.uid, 2).itemid)
    slot3_item = getItemName(getPlayerSlotItem(player2.uid, 3).itemid)
    slot4_item = getItemName(getPlayerSlotItem(player2.uid, 4).itemid)
    slot5_item = getItemName(getPlayerSlotItem(player2.uid, 5).itemid)
    slot6_item = getItemName(getPlayerSlotItem(player2.uid, 6).itemid)
    slot7_item = getItemName(getPlayerSlotItem(player2.uid, 7).itemid)
    slot8_item = getItemName(getPlayerSlotItem(player2.uid, 8).itemid)
    slot9_item = getItemName(getPlayerSlotItem(player2.uid, 9).itemid)
    slot10_item = getItemName(getPlayerSlotItem(player2.uid, 10).itemid)
end
-- Roman - ******
-- Leave it alone
if sex == 1 then
    sex = "Male"
elseif sex == 2 then
    sex = "Female"
end
-- Roman - ******
-- Change vocation names if neccesary
if vocation == 0 then
    vocation = "Rookie"
elseif vocation == 1 then
    vocation = "Sorcerer"
elseif vocation == 2 then
    vocation = "Druid"
elseif vocation == 3 then
    vocation = "Paladin"
elseif vocation == 4 then
    vocation = "Knight"
end
-- Roman - ******
-- Leave it alone
if food >= 2000 then
    food_desc = "Full"
elseif food >= 1000 and food <= 1999 then
    food_desc = "Half Full"
elseif food >= 100 and food <= 999 then
    food_desc = "Hungry"
elseif food == 0 then
    food_desc = "Empty"
end

-- Roman - ******
-- Change text carefully if necessary
if isPlayer(player2.uid) == 1 then
    if getPlayerName(cid) ~= getPlayerName(player2.uid) then
        if getPlayerAccess(cid) >= access_req and getPlayerAccess(player2.uid) ~= access_other then
            doSetMonsterOutfit(cid,"assassin",60*1000)
            doSendMagicEffect(topos, 13)
            doSendMagicEffect(frompos, 13)
             doPlayerSendTextMessage(player2.uid,22,""..getPlayerName(cid).." is inspecting you.")
            doPlayerSendTextMessage(cid,19,"Player ["..name.."] is level ["..level.."] ["..sex.."] ["..vocation.."] with an access level of ["..access.."]")
            doPlayerSendTextMessage(cid,19,"Health: ["..health.."] Mana: ["..mana.."] Soul: ["..soul.."]")
            if display_skills == 1 then
                doPlayerSendTextMessage(cid,19,"Magic Level: ["..magic.."] Fist: ["..fist.."] Club: ["..club.."] Sword: ["..sword.."] Axe: ["..axe.."] Distance: ["..distance.."] Shielding: ["..shielding.."] Fishing: ["..fishing.."]")
            end
            if display_private == 1 then
                doPlayerSendTextMessage(cid,19,"Items: ["..slot1_item.."] ["..slot2_item.."] ["..slot3_item.."] ["..slot4_item.."] ["..slot5_item.."] ["..slot6_item.."] ["..slot7_item.."] ["..slot8_item.."] ["..slot9_item.."] ["..slot10_item.."]")
                doPlayerSendTextMessage(cid,19,"Free Capacity: ["..cap.."] Food Level: ["..food.."] - ["..food_desc.."]")
                doPlayerSendTextMessage(cid,19,"Gold Coins: ["..gold.."] Platinum Coins: ["..platinum.."] Crystal Coins: ["..crystal.."]")
            end
        else
            doPlayerSendCancel(cid,"You cannot use this rune.")
        end
    else
        doPlayerSendCancel(cid,"You cannot use this rune on yourself.")
    end
else
    doPlayerSendCancel(cid,"Incorrect target.")
end
end
-- Roman - ******
Everything is self explanatory, read the comments (--) to set options.

In duplicaterune.lua
PHP:
-- Duplicate Rune by Roman
-- Note: Only gms should be able to use this rune, or gods, otherwise it may crash the server debug the character, use carefully and only on dragable items such as equipment
-- Roman - ******
function onUse(cid, item, frompos, item2, topos)
access_req = 3 -- access required to use rune, please set to high
item_dup = getItemName(item2.itemid)
item_dup_type = getItemName(item2.type)
item_dup_count = getItemName(item2.count)
-- Roman - ******
if getPlayerAccess(cid) >= access_req then
            doCreateItem(item2.itemid,item2.count,getPlayerPosition(cid))
            doSendMagicEffect(topos,2)
            doSendMagicEffect(frompos,2)
            doPlayerSendTextMessage(cid,19,"You have duplicated a/an ["..item_dup.."] with a count of ["..item_dup_count.."] and type of ["..item_dup_type.."]")
else
    doPlayerSendCancel(cid,"You cannot use this rune.")
end
end
-- Roman - ******
Everything is simple here, if you want to, you may set things like:
PHP:
if item2.itemid >= 2000 and item2.itemid <= 3000 then
If you want to create boundaries for duplicating items.
You may also try adding these:
PHP:
if isPlayer(item2.uid) == 0 and isCreature(item2.uid) == 0 then
Credits
Me and someone else helped with inspect rune (did not want to reveal name)

Note

  • Item count/type may not work properly in the duplicate rune
  • There are probably a few ways to shorten the inspect rune script, but im not doing that :)
  • Both scripts tested on 8.0 GTH Evolutions
Enjoy :)
 
Last edited:
Great work Roman :)
as I said in ur other thread use php tag next time :)
 
And same like I said in the other thread use [php ] [/ php]
no spaces of course.
 
Np, I am here for help :) If u need help just pm me ^_^
 
Back
Top