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

No item loss

Xaiman

New Member
Joined
Feb 27, 2010
Messages
94
Reaction score
0
I want to set it where my server will have no item loss ever, not even with RS.

I found this:

Code:
void Player::dropLoot(Container* corpse)
{
	if(!corpse || lootDrop != LOOT_DROP_FULL)
		return;

	uint32_t start = g_config.getNumber(ConfigManager::BLESS_REDUCTION_BASE), loss = lossPercent[LOSS_CONTAINERS], bless = getBlessings();
	while(bless > 0 && loss > 0)
	{
		loss -= start;
		start -= g_config.getNumber(ConfigManager::BLESS_REDUCTION_DECREAMENT);
		bless--;
	}

	uint32_t itemLoss = (uint32_t)std::floor((5. + loss) * lossPercent[LOSS_ITEMS] / 1000.);
	for(int32_t i = SLOT_FIRST; i < SLOT_LAST; ++i)
	{
		Item* item = inventory[i];
		if(!item)
			continue;

		uint32_t rand = random_range(1, 100);
		if(skull > SKULL_WHITE || (item->getContainer() && rand < loss) || (!item->getContainer() && rand < itemLoss))
		{
			g_game.internalMoveItem(NULL, this, corpse, INDEX_WHEREEVER, item, item->getItemCount(), 0);
			sendRemoveInventoryItem((slots_t)i, inventory[(slots_t)i]);
		}
	}
}

and was wanting to know what do i need to add/edit in that to make no item loss. (I have never done c++ scripting)

tfs 3.6
 
omg

why C++ when can be done @ LUA??!!

*tfs 0.3.6pl1

data/creaturescripts/scripts/antiloss.lua
LUA:
function onPrepareDeath(cid, deathList)
    if isPlayer(cid) then 
        doCreatureSetDropLoot(cid, false)
    end
return true
end

data/creaturescripts/creaturescripts.xml
LUA:
<event type="preparedeath" name="antiloss" script="antiloss.lua"/>

data/creaturescripts/scripts/login.lua
LUA:
registerCreatureEvent(cid, 'antiloss')
 
Last edited:
and was wanting to know what do i need to add/edit in that to make no item loss. (I have never done c++ scripting)
guess he'll have to google stian's repack
it'll be easier for him just a lua script for now, or he can learn to compile

btw keep deprecating to lua huahuahausha more lua functions less c++ compiling dependency
 
guess he'll have to google stian's repack
it'll be easier for him just a lua script for now, or he can learn to compile

btw keep deprecating to lua huahuahausha more lua functions less c++ compiling dependency

Phi, it's not big difference if he's beginner between adding script and compiling, when he wants to add script he has to go to creaturescripts, create file with script, add line to creaturescripts.xml in case of compilin downloading src & dev-cpp, changing function, pressing F9 xD

Idk why everybody is scared of compiling, lol.
 
I have already done a couple source edits. I made the server 8.54-8.57 compatible and i fixed the house commands in tfs 3.6. so i KNOW how too compile i just dont know how to write in c++ so i didnt want to just delete the whole fuction and bug my server or something.

and i have tried many many many many different ways of scripting it for lua. When it is scripted in lua they still loose their ammys and during red skull they loose all items, look at any "infinate aol" or "no item loss" in the xml and lua section of the threads, it doesnt work.

So if i just delete the "void Player::dropLoot(Container* corpse)" function this will cause no item loss?
 
:/ well i wouldn't count changing a couple 854's to 857's and then removing some *'s as c++ scripting. xD

But yea, still need the fix on this please x.x
 
Back
Top