• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Fixable stuff

Titanum

New Member
Joined
Feb 21, 2016
Messages
22
Reaction score
0
Greeting otlanders :D.
I've got some problems and i hope someone may help me with them, Thanks.
1- This script to charge a special weapon with runes what i need is to do limit for the charges MAX 300 charges.
local config = {
manaCost = 300,
soulCost = 2
}

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

if(item.itemid == 2280 and isInArray({8300}, itemEx.itemid)) then
doTransformItem(itemEx.uid, 4848, 1)
doRemoveItem(item.uid, 1)

doSendMagicEffect(getPlayerPosition(cid), 31)
return true
elseif(item.itemid == 2280 and isInArray({4848}, itemEx.itemid)) then
local subtype = itemEx.type
doTransformItem(itemEx.uid, 4848, subtype+1)
doRemoveItem(item.uid, 1)

doSendMagicEffect(getPlayerPosition(cid), 31)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You may only use it on arrow of disaster.")
return true
end


if(isInArray(enchantableGems, item.itemid)) then
local subtype = item.type
if(subtype == 0) then
subtype = 1
end

local mana = config.manaCost
if(getPlayerMana(cid) < mana) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA)
return true
end

local soul = config.soulCost
if(getPlayerSoul(cid) < soul) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHSOUL)
return true
end

local a = table.find(enchantableGems, item.itemid)
if(a == nil or not isInArray(enchantingAltars[a], itemEx.itemid)) then
return false
end
local info = getItemInfo(enchantedGems[a])
doTransformItem(item.uid, enchantedGems[a], info.charges)
doPlayerAddMana(cid, -mana)
doPlayerAddSoul(cid, -soul)

doPlayerAddSpentMana(cid, mana)
doSendMagicEffect(fromPosition, CONST_ME_HOLYDAMAGE)
return true
end


local b = table.find(enchantedGems, item.itemid)
if(b == nil) then
return false
end

local subtype = itemEx.type
if(not isInArray({8300, 8300}, itemEx.itemid)) then
subtype = 1000
end

doTransformItem(itemEx.uid, enchantedItems[itemEx.itemid], subtype)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_HOLYDAMAGE)
doDecayItem(itemEx.uid)
doRemoveItem(item.uid, 1)
return true
end
2- This script is for npc who is selling coins for special id as you see (9971, 10) and its working good but when i'm trying to buy more than 1 like 10 or something it's still buys only 1 not more :S
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end

local shopWindow = {}
local keys = {
{id = 10571, buy = 10, name = "COIN"}
}
local cost = {9971, 10}

local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
if doPlayerRemoveItem(cid, cost[1], cost[2]) then
local thing = doPlayerAddItem(cid, shopWindow[item].ID)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought a "..shopWindow[item].KeyName.." for gold.")
else
selfSay("You don't have enough money.", cid)
end
return true
end


function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
end

if msgcontains(msg, 'trade') then
for var, item in pairs(keys) do
shopWindow[item.id] = {ID = item.id, Price = item.buy, KeyName = item.name}
end
openShopWindow(cid, keys, onBuy, onSell)
end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
3- I need to do broadcast message before this raid hmmm tried to do globalevent scripts and i've done it but they doesn't match together with the time :S so i need to do broadcast before every raid
<?xml version="1.0" encoding="UTF-8" ?>
- <raid>
<singlespawn delay="1" name="Devento" ref="yes" x="996" y="993" z="7" />
</raid>
<?xml version="1.0" encoding="UTF-8" ?>
- <raids>
<raid name="Devento" file="Devento.xml" interval2="60" margin="0" reftype="block" ref="no" />
- <!--
executed on average once every 2 minutes

<raid name="Example" file="example.xml" interval2="2" margin="0" reftype="single" ref="no"/>
won't be executed again till Cave Rat gets killed

<raid name="Example2" file="example.xml" interval2="2" margin="0" reftype="block" ref="no"/>
will stay as 'running' until Cave Rat gets killed

-->
</raids>
4- This one is with gesior latest news, you will understand from the photo that i can't make a post on news page and i already have admin access, and the version of gesior that i have doesn't support admin panel :S
11azllh.jpg

TFS 0.4


Hmm is it hard to solve?
EDIT
Website- solved
Raid- Solved
NPC- NOT SOLVED
WAND- NOT SOLVED :S
 
Last edited:
I got it from google so? its for all
This is @Titanum's signature
Code:
http://i64.tinypic.com/33e54zb.gif
This is @Xikini's signature
Code:
https://i.imgur.com/oddNvdI.gif

This is @Titanum's signature's checksum
Code:
2372700651A42C0FD12F64C66A43E838
This is @Xikini's signature's checksum
Code:
5791A09C62D50544EE4A9AD4B05F8C23

According to the results they are different files, this could be due to the hosts conversion process or @Titanum is telling the truth.. either way it doesn't matter :p
 
This is @Titanum's signature
Code:
http://i64.tinypic.com/33e54zb.gif
This is @Xikini's signature
Code:
https://i.imgur.com/oddNvdI.gif

This is @Titanum's signature's checksum
Code:
2372700651A42C0FD12F64C66A43E838
This is @Xikini's signature's checksum
Code:
5791A09C62D50544EE4A9AD4B05F8C23

According to the results they are different files, this could be due to the hosts conversion process or @Titanum is telling the truth.. either way it doesn't matter :p
I like this xD, we need more people like you on otland

Otland now a days is full of kids ( no offense to anyone ). It's not as much fun as it was back in the days
 
I like this xD, we need more people like you on otland

Otland now a days is full of kids ( no offense to anyone ). It's not as much fun as it was back in the days
I agree :P
The moment I put the gif I made onto imgur, I forfeited any rights I had to the image/content.
If you don't want your stuff to be passed around, don't put it on the internet. lmao
 
This is @Titanum's signature
Code:
http://i64.tinypic.com/33e54zb.gif
This is @Xikini's signature
Code:
https://i.imgur.com/oddNvdI.gif

This is @Titanum's signature's checksum
Code:
2372700651A42C0FD12F64C66A43E838
This is @Xikini's signature's checksum
Code:
5791A09C62D50544EE4A9AD4B05F8C23

According to the results they are different files, this could be due to the hosts conversion process or @Titanum is telling the truth.. either way it doesn't matter :p
sorry. :(
 
Back
Top