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

Chris77's Scripting Services

Change this
Code:
<event type="advance" name="Banana" event="script" value="Banana.lua" />
to this
Code:
<event type="death" name="Banana" event="script" value="Banana.lua" />

:thumbup:

It could be better if he change:
Lua:
function onDeath(cid, corpse, killer)
To
Lua:
function onKill(cid, killer)
 
@up you could add this function

Code:
function doPlayerAddMagLevel(cid, add) 
local current = getPlayerRequiredMana(cid, getPlayerMagLevel(cid)) 
local manaspend = ((getPlayerRequiredMana(cid, getPlayerMagLevel(cid)+add)) / getConfigInfo("rateMagic")) 
    if isPlayer(cid) == TRUE then 
        doPlayerAddSpentMana(cid, (current + manaspend)) 
    else 
        error("Player not found in function doPlayerAddMagLevel") 
    end 
end

Then change line
Code:
doPlayerAddSpentMana(cid, getPlayerRequiredMana(cid, getPlayerMagLevel(cid, ignoreBuffs))) --recieving power--

to

Code:
doPlayerAddMagLevel(cid, 1)
 
Change this
Code:
<event type="advance" name="Banana" event="script" value="Banana.lua" />
to this
Code:
<event type="death" name="Banana" event="script" value="Banana.lua" />

:thumbup:

Yah, that was my second guess and didn't work either... It might only work in C++... ;(
 
Hey chris and greg... I couldnt get ur 2 items teleport thing to work properly :S Here is the code im using now:

Code:
		  function onUse(cid, item, fromPosition, itemEx, toPosition)

firstID = 2651          -- id of the first item
secondID = 2652         -- id of the second item
newPOS = {1054,1139,7}      -- player teleported too...

local piece1pos = {

        x = 1055,
        y = 1138,    -- Poition of the first item
        z = 7,

stackpos=1}
local piece2pos = {

        x = 1053,
        y = 1138,    -- Poition of the second item
        z = 7,

stackpos=1}
local getpiece1 = getThingfromPos(piece1pos)
local getpiece2 = getThingfromPos(piece2pos)
local playerpos = getPlayerPosition(cid)
        if getpiece1.itemid == firstID and getpiece2.itemid == secondID or getpiece1.itemid == secondID and getpiece2.itemid == firstID then
                if item.itemid == 1945 then
                        doTransformItem(item.uid,item.itemid+1)
                elseif item.itemid == 1946 then
                        doTransformItem(item.uid,item.itemid-1)
                end
                doRemoveItem(getpiece1.uid,1)
                doRemoveItem(getpiece2.uid,1)
                doSendMagicEffect(piece1pos,2)
                doSendMagicEffect(piece2pos,2)
                                doTeleportThing(cid, newPOS)
                doSendMagicEffect(playerpos, CONST_ME_TELEPORT)
                end
        else
                doPlayerSendTextMessage(cid, 22, "You need " .. getItemArticleById(firstID) .. " "..getItemNameById(firstID).." and " .. getItemArticleById(secondID) .. " "..getItemNameById(secondID)..".")
        return TRUE
end

This is the error i get
Code:
[26/06/2009 03:04:38] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/test.lua)
[26/06/2009 03:04:38] data/actions/scripts/quests/test.lua:37: 'end' expected (to close 'function' at line 1) near 'else'


Please help me out on it ^^ It's on page 3
 
Hey chris and greg... I couldnt get ur 2 items teleport thing to work properly :S Here is the code im using now:

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

firstID = 2651          -- id of the first item
secondID = 2652         -- id of the second item
newPOS = {1054,1139,7}      -- player teleported too...

local piece1pos = {

        x = 1055,
        y = 1138,    -- Poition of the first item
        z = 7,

stackpos=1}
local piece2pos = {

        x = 1053,
        y = 1138,    -- Poition of the second item
        z = 7,

stackpos=1}
local getpiece1 = getThingfromPos(piece1pos)
local getpiece2 = getThingfromPos(piece2pos)
local playerpos = getPlayerPosition(cid)
        if getpiece1.itemid == firstID and getpiece2.itemid == secondID or getpiece1.itemid == secondID and getpiece2.itemid == firstID then
                if item.itemid == 1945 then
                        doTransformItem(item.uid,item.itemid+1)
                elseif item.itemid == 1946 then
                        doTransformItem(item.uid,item.itemid-1)
                end
                doRemoveItem(getpiece1.uid,1)
                doRemoveItem(getpiece2.uid,1)
                doSendMagicEffect(piece1pos,2)
                doSendMagicEffect(piece2pos,2)
                                doTeleportThing(cid, newPOS)
                doSendMagicEffect(playerpos, CONST_ME_TELEPORT)
                end
        else
                doPlayerSendTextMessage(cid, 22, "You need " .. getItemArticleById(firstID) .. " "..getItemNameById(firstID).." and " .. getItemArticleById(secondID) .. " "..getItemNameById(secondID)..".")
        return TRUE
end

This is the error i get
Code:
[26/06/2009 03:04:38] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/test.lua)
[26/06/2009 03:04:38] data/actions/scripts/quests/test.lua:37: 'end' expected (to close 'function' at line 1) near 'else'


Please help me out on it ^^ It's on page 3

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

firstID = 2651          -- id of the first item
secondID = 2652         -- id of the second item
newPOS = {1054,1139,7}      -- player teleported too...

local piece1pos = {

        x = 1055,
        y = 1138,    -- Poition of the first item
        z = 7,

stackpos=1}
local piece2pos = {

        x = 1053,
        y = 1138,    -- Poition of the second item
        z = 7,

stackpos=1}
local getpiece1 = getThingfromPos(piece1pos)
local getpiece2 = getThingfromPos(piece2pos)
local playerpos = getPlayerPosition(cid)
        if getpiece1.itemid == firstID and getpiece2.itemid == secondID or getpiece1.itemid == secondID and getpiece2.itemid == firstID then
                if item.itemid == 1945 then
                        doTransformItem(item.uid,item.itemid+1)
                elseif item.itemid == 1946 then
                        doTransformItem(item.uid,item.itemid-1)
                end
                doRemoveItem(getpiece1.uid,1)
                doRemoveItem(getpiece2.uid,1)
                doSendMagicEffect(piece1pos,2)
                doSendMagicEffect(piece2pos,2)
                                doTeleportThing(cid, newPOS)
                doSendMagicEffect(playerpos, CONST_ME_TELEPORT)
                end
        else
                doPlayerSendTextMessage(cid, 22, "You need " .. getItemArticleById(firstID) .. " "..getItemNameById(firstID).." and " .. getItemArticleById(secondID) .. " "..getItemNameById(secondID)..".")
        end
        return TRUE
end


Noob code anyways ^_^
 
I am taking a break from this thread for awhile, since I am falling behind on scripting for my server. I will re-continue soon. Thread will not die though, Chris and others will help.
 
@up you could add this function

Code:
function doPlayerAddMagLevel(cid, add) 
local current = getPlayerRequiredMana(cid, getPlayerMagLevel(cid)) 
local manaspend = ((getPlayerRequiredMana(cid, getPlayerMagLevel(cid)+add)) / getConfigInfo("rateMagic")) 
    if isPlayer(cid) == TRUE then 
        doPlayerAddSpentMana(cid, (current + manaspend)) 
    else 
        error("Player not found in function doPlayerAddMagLevel") 
    end 
end

Then change line
Code:
doPlayerAddSpentMana(cid, getPlayerRequiredMana(cid, getPlayerMagLevel(cid, ignoreBuffs))) --recieving power--

to

Code:
doPlayerAddMagLevel(cid, 1)

didnt worked.
got this error in consol when i steped inside the sqm and said "power".'



:(

help plx.
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

firstID = 2651          -- id of the first item
secondID = 2652         -- id of the second item
newPOS = {1054,1139,7}      -- player teleported too...

local piece1pos = {

        x = 1055,
        y = 1138,    -- Poition of the first item
        z = 7,

stackpos=1}
local piece2pos = {

        x = 1053,
        y = 1138,    -- Poition of the second item
        z = 7,

stackpos=1}
local getpiece1 = getThingfromPos(piece1pos)
local getpiece2 = getThingfromPos(piece2pos)
local playerpos = getPlayerPosition(cid)
        if getpiece1.itemid == firstID and getpiece2.itemid == secondID or getpiece1.itemid == secondID and getpiece2.itemid == firstID then
                if item.itemid == 1945 then
                        doTransformItem(item.uid,item.itemid+1)
                elseif item.itemid == 1946 then
                        doTransformItem(item.uid,item.itemid-1)
                end
                doRemoveItem(getpiece1.uid,1)
                doRemoveItem(getpiece2.uid,1)
                doSendMagicEffect(piece1pos,2)
                doSendMagicEffect(piece2pos,2)
                                doTeleportThing(cid, newPOS)
                doSendMagicEffect(playerpos, CONST_ME_TELEPORT)
                end
        else
                doPlayerSendTextMessage(cid, 22, "You need " .. getItemArticleById(firstID) .. " "..getItemNameById(firstID).." and " .. getItemArticleById(secondID) .. " "..getItemNameById(secondID)..".")
        end
        return TRUE
end


Noob code anyways ^_^



Ehm.. Did u change anything? I still get the same error :S
 
It could be better if he change:
Lua:
function onDeath(cid, corpse, killer)
To
Lua:
function onKill(cid, killer)

I get this error in consol...

009 09:17:20] [Warning - Event::loadScript] Event onDeath not found (data/creaturescripts/scripts/Banana.lua)

I check and my script is at the good place........... weird.
 
in creaturescripts.xml change
Lua:
<event type="death" name="Banana" event="script" value="Banana.lua" />

To
Lua:
<event type="kill" name="Banana" event="script" value="Banana.lua" />
 
in creaturescripts.xml change
Lua:
<event type="death" name="Banana" event="script" value="Banana.lua" />

To
Lua:
<event type="kill" name="Banana" event="script" value="Banana.lua" />

Now, theres no error in consol but i still don't gain any banana.... Might be only in c++?
 
Bump

Bump my Post!
Type of Script: NPC
Player = RED
NPC = Blue
Ex:
Hi, Hiho, Learn, You want to learn minning skill?, Yes, Ok. If you give-me 50 gold coins you learn the minning skill.
Hi, Hiho, Upgrade, You want upgrade your minning skill to level 2?, Yes, I need 370 gold coins to upgrade your minning skill.



More info on the real postp: http://otland.net/379016-post98.html
 
@Trekes
The minning skill, if you wanna create:
You will use a pick on certain types of large stones, you can find gold, small stones and things like rare diamonds, etc..
You may find it easier if your minning skill is high.
*Limit minning skill level: 4

Sorry. I'm using tools of language.
 
@Trekes
The minning skill, if you wanna create:
You will use a pick on certain types of large stones, you can find gold, small stones and things like rare diamonds, etc..
You may find it easier if your minning skill is high.
*Limit minning skill level: 4

Sorry. I'm using tools of language.

ok i will create it :) (wanna other skills??)
 
Type of Script: movement

Priority: normal

Reason of Request: Making fully rook map. It is for dessapearing spike sword.

Description: When i step on pos xxx,xxx,x and pos yyy,yyy,y. It will remove item with id 1234, and change 4 items(fire, same ids) to another thing on on same pos.

Public/Private publix


<!---- Another One -->

Type of Script: action

Priority: normal

Reason of Request: Ot rook

Description: remove 3 items (i should define positions) when the lever is pulled

Public/Private: public
 
@Technic
Test:
Lua:
function onStepIn(cid, item, position, fromPosition)
-- Script by BomBa
if item.actionid == 5566
 if isPlayer(cid) == TRUE then
  local storageOnRemove = 449933
   setPlayerStorageValue(cid, storageOnRemove, 1)
  end
 return TRUE
-- Script by BomBa
end

if item.actionid == 6655
-- Script by BomBa
 local positions =
  {
   spikeSword = {x=100, y=10, z=1, stackpos=255},
    fieldPos = {{x=100, y=10, z=1, stackpos=1}, {x=100, y=10, z=1, stackpos=1}, {x=100, y=10, z=1, stackpos=1}, {x=100, y=10, z=1, stackpos=1}}
     }
      if isPlayer(cid) == TRUE then
       local storageOnRemove = 449933
        if getPlayerStorageValue(cid, storageOnRemove) == 1 then
         for a = 4, table.maxn(positions.fieldPos) do
         doRemoveItem(getThingfromPos(positions.fieldPos[a]).uid, 1)
        addEvent(onCreateSwordOfFury, 60000)
       setPlayerStorageValue(cid, storageOnRemove, 2)
      elseif getPlayerStorageValue(cid, storageOnRemove) == 2 then
     doPlayerSendCancel(cid, "Sorry, not possible.")
    end
   end
  end
 return TRUE
-- Script by BomBa
end

function onCreateSwordOfFury()
-- Script by BomBa
 local createAgain = FALSE
  if createAgain == TRUE then
   local positions =
    {
     spikeSword = {x=100, y=10, z=1},
      fieldPos = {{x=100, y=10, z=1}, {x=100, y=10, z=1}, {x=100, y=10, z=1}, {x=100, y=10, z=1}}
       }
        local fieldId = 1487
       doCreateItem(2383, 1, positions.spikeSword)
      for b = 4, table.maxn(positions.fieldPos) do
     doCreateItem(fieldId, 1, positions.fieldPos[b])
    end
   return TRUE
  end
 return TRUE
-- Script by BomBa
end
 
Last edited:
Back
Top