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

Questions of Ziomster

Ziomster44

New Member
Joined
Jan 10, 2013
Messages
5
Reaction score
0
Rather than starting a new topic for every question I came across (that I could not figure out nor find anywhere using the search function nor even google) I thought it might be a good idea to create one topic and ask these questions. They're random and might help sharpen your critical thinking skills :p

Note: I am using TFS 0.2.14

So here are a few for a start:

1. According to an online Tibia damage calculator, a lvl 6 character with 20 axe skill and 21 weapon attack should do a maximum 37 damage in attack mode... why did my character do 62 damage to a white deer?

2. Why can't I sell food to NPCs? The choices exist for that specific NPC and I specified the exact itemid to be sold by the NPC. Other items could be sold to that NPC without a problem except for food.

3. This one is two parts:

... so the following is my starting skills script:
Code:
function onLogin(cid)
	local playerVoc = getPlayerVocation(cid)
	local reqTries = getPlayerRequiredSkillTries
	local skillStor = 56364
	local gotSkills = getPlayerStorageValue(cid, 56364)
	if playerVoc == 0 and gotSkills == -1 then
		doPlayerSetSkill(cid, SKILL_FIST, 20)
		doPlayerSetSkill(cid, SKILL_AXE, 20)
		doPlayerSetSkill(cid, SKILL_SWORD, 20)
		doPlayerSetSkill(cid, SKILL_CLUB, 20)
		doPlayerSetSkill(cid, SKILL_SHIELD, 20)
		doPlayerSetSkill(cid, SKILL_DISTANCE, 20)
		doPlayerSetSkill(cid, SKILL_SHIELD, 20)
		doPlayerSetSkill(cid, SKILL_FISHING, 20)
		setPlayerStorageValue(cid, skillStor, 1)
	end
	return TRUE
end

where doPlayerSetSkill, which is located in global.lua, does the following:

Code:
function doPlayerSetSkill(cid, skillid, skill)
	if getPlayerSkill(cid, skillid) >= skill then
		return TRUE
	end
	local cskill = getPlayerSkill(cid, skillid)
	while cskill < skill do
		doPlayerAddSkillTry(cid, skillid, 1)
		cskill = getPlayerSkill(cid, skillid)
	end
	return TRUE
end

a) Is there a way I could do the above without having the player get spammed with messages that he has leveled up to blabla level #?
b) Is there a way to also "doPlayerSetSkill" for a magic level in this version of TFS?

Thank you everyone in advance, rep to anyone that helps me out!
 
Last edited:
1. Maybe the damage formula is for a specific tibia version and damage formula of your server is another tibia version.
2. Post the script of npc.
3. a) I don't know
b) doPlayerAddMagLevel(cid, amount)
 
1. I guess that's possible... I just assumed that TFS bases it's data from the actual Tibia and that the statistics would be all the same... maybe that's not the case? If anyone knows a concrete answer to my question, shoot :P



2.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Arnthrud the Kind" script="data/npc/scripts/default.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="136" head="116" body="113" legs="128" feet="0" addons="0"/>
	<parameters>
		<parameter key="message_greet" value="Hey, |PLAYERNAME|. Are you okay? If you're hungry or need healing supplies, we could {trade}."/>
		<parameter key="message_farewell" value="Be careful now, okay |PLAYERNAME|?"/>
		<parameter key="module_shop" value="1"/>
		<parameter key="shop_buyable" value="fish,2667,3;meat,2666,5;ham,2671,8;health potion,7618,25;antidote potion,8474,10;life ring,2168,250"/>
		<parameter key="shop_sellable" value="fish,2667,1;meat,2666,2;ham,2671,3;empty flask,7636,5"/>
	</parameters>
</npc>
The things she sells, as defined by "shop_buyable", work perfectly fine. I literally copied that line of code and used it for "shop_sellable", removing only the items I didn't want her to sell. They show up in the trade screen but it's as if the items are not detected when I try to sell them to her. I checked for the same items that could have different IDs, but there aren't any xD

Here's basically how it looks:
http://img824.imageshack.us/img824/9157/tradehi.jpg



3. b. According to this version of TFS (0.2.14 as I specified before), there's no such lua function that exists. I've seen lua scripts that do this but they require yet another function, doPlayerAddSpentMana, which this version doesn't have as well xD I also read somewhere that it MIGHT be not possible to create such functions in this version of TFS, but I'm not so sure about that... however I am out of ideas xD
 
Back
Top