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

[Mod] Random Item Stats

if(it.weaponType == WEAPON_AMMO)
range = player->getShootRange();

if(std::max(std::abs(playerPos.x - targetPos.x), std::abs(playerPos.y - targetPos.y)) > range)
return 0;
where paste code?
else if(it.weaponType == WEAPON_WAND && player->getWeapon())
range = player->getWeapon()->getShootRange();
????
 
one problem, it doesn't add any attributes to wands or distance weapons, any solution for this? Rest is fine and running perfectly on 0.4
 
PROBLEM : When a monster dies and have summon, L A G, using OTX 2.5
 
Hi , is it possible that you will give an example how to make possible to add for example skillSword attribute?
I'm a little bit newbie
I added this in config:
Lua:
attr['good'] = {
	attr = 'skillSword',
	name = 'Sword Skill',
	percent = {6, 20},
	types = {MELEE}
}
and in function createLoot:
Lua:
elseif( n.attr == 'skillSword' ) then
	new = round( f[n['attr']] + percent )
But when weapon with this attribute should loot the console was showing this:
Code:
[23:17:41.948] [Error - CreatureScript Interface]
[23:17:41.948] In a timer event called from:
[23:17:41.948] data/creaturescripts/scripts/customloot.lua:onKill
[23:17:41.948] Description:
[COLOR="#FF0000"][23:17:41.948] data/creaturescripts/scripts/customloot.lua:224: attempt to perform arithmetic on field '?' (a nil value)[/COLOR]
[23:17:41.948] stack traceback:
[23:17:41.948]  data/creaturescripts/scripts/customloot.lua:224: in function 'createLoot'
[23:17:41.948]  data/creaturescripts/scripts/customloot.lua:322: in function <data/creaturescripts/scripts/customloot.lua:309>

If I should to add sth in sources too, write one example if it isn't a problem.

This in item.cpp:
Code:
	case ATTR_SKILLSWORD:
		{
			int32_t skillSword;
			if(!propStream.getLong((uint32_t&)skillSword))
				return ATTR_READ_ERROR;

			setAttribute("skillsword", skillSword);
			break;
		}
make, when trying to compile
Code:
item.cpp: In member function 'virtual Attr_ReadValue Item::readAttr(AttrTypes_t, PropStream&)':
item.cpp:438: error: 'ATTR_SKILLSWORD' was not declared in this scope
make[1]: *** [item.o] Error 1
make[1]: Leaving directory `/media/pora'
make: *** [all] Error 2


-- Anyone ??
 
Last edited:
Two problems:
- Item gets renamed to normal(only article left) after it's upgraded
- This code doesn't support demon backpack(only common bags) - I want bosses to drop some rare backpacks with items inside them
 
This work fine for me but what is this? :

13:36 You see an epic mace (Atk:16, Def:11, AS: 1695).
It weighs 28.00 oz.
[Attack Speed: +18%]

when normal wheapon is 13:38 You see an emerald sword (Atk:49, Def:33 +3).
It can only be wielded properly by players of level 100 or higher.
It weighs 41.00 oz.
 
This work fine for me but what is this? :

13:36 You see an epic mace (Atk:16, Def:11, AS: 1695).
It weighs 28.00 oz.
[Attack Speed: +18%]

when normal wheapon is 13:38 You see an emerald sword (Atk:49, Def:33 +3).
It can only be wielded properly by players of level 100 or higher.
It weighs 41.00 oz.

the AS: 1695 means attack speed. Because your 'Epic Mace' has bonus %attack speed, it shows what the new attack speed on the weapon is.
 
Where I can change "AS" to full name?

item.cpp
Code:
		bool begin = true;
		if(it.weaponType == WEAPON_DIST && it.ammoType != AMMO_NONE)
		{
			begin = false;
			s << " (Range:" << int32_t(item ? item->getShootRange() : it.shootRange);
			if(it.attack || it.extraAttack || (item && (item->getAttack() || item->getExtraAttack())))
			{
				s << ", Atk " << std::showpos << int32_t(item ? item->getAttack() : it.attack);
				if(it.extraAttack || (item && item->getExtraAttack()))
					s << " " << std::showpos << int32_t(item ? item->getExtraAttack() : it.extraAttack) << std::noshowpos;
			}

			if(it.hitChance != -1 || (item && item->getHitChance() != -1))
				s << ", Hit% " << std::showpos << (item ? item->getHitChance() : it.hitChance) << std::noshowpos;

			if(it.attackSpeed || (item && item->getAttackSpeed()))
				s << ", AS: " << (item ? item->getAttackSpeed() : it.attackSpeed);
		}

some lines below too:
Code:
		if(it.attackSpeed || (item && item->getAttackSpeed()))
		{
			if(begin)
			{
				begin = false;
				s << " (";
			}
			else
				s << ", ";

			s << "AS: " << (item ? item->getAttackSpeed() : it.attackSpeed);
		}
 
Last edited:
I do have my own preferences.
01.jpg
28.jpg
03.jpg
05.jpg
04.jpg
29.jpg
 
So how do i change this from Dosendanimated text to sending this in the server log with different coloured writing, I cannot seen to get the server log text to work!
 
Last edited:
@up
use doPlayerSendTextMessage or doCreatureSay instead

I've removed rare/legendary messages leaving only magic effect because it sometimes returned cid not found

It doesn't work with mock's fly system - corpses are dropped level below and there is huge console error with mod script, returning "item not found"
I have 10 creatures on invisible floor 460 - 4 on anni, 6 on unfinished quest - they don't decay or anything
 
everythings fine except bows, they got additional stats but don't work. i've tied it with 0.4.0, 0.2.9, 0.3.6
what version is the mod compatible with?
 
can't reproduce again, and evil says it works good with 0.4

I use 0.4 and it works good for me accept for one thing. It seems to count players in the mod and gives an error whenever a player is pk'd. It says

Monster not found
monster mismatch=Aware---(player name)

Anyone know how to fix this? Thanks ill REP++
 
Cykotitan thanks for this great mod, it work perfectly on my ot....

I have only a question.. if i want use one amulet to up rate rare, how can i do it?
 
@AnarchGov,
Just tested and I got no error. When does this error seem to come up most? Any time a player gets killed, or when?

@Cyko,
If you still offer support for your script, I am wondering how would I go about making a ring that increases the rare loot chance for a player?
 
I have a bug in this script... When a player are in party only appear loot at one player of party the message
 
How do I go about installing this in 0.2.15 (Mystic Spirit), the server doesn't load mods as far as I can see. Any help is greatly appreciated.
 
Back
Top