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

Fix/Patch Clone items on NPC

Fire Element

Member
Joined
Sep 10, 2010
Messages
193
Reaction score
22
Location
Brazil
0.3.6pl1

npc.cpp
Lua:
		if(NpcState* npcState = getState(player, true))
                {
			npcState->amount = amount;
			npcState->subType = count;
			npcState->itemId = itemId;
			npcState->buyPrice = getListItemPrice(itemId, SHOPEVENT_BUY);
			npcState->ignoreCap = ignoreCap;
			npcState->inBackpacks = inBackpacks;

			const NpcResponse* response = getResponse(player, npcState, EVENT_PLAYER_SHOPBUY);
			executeResponse(player, npcState, response);
		}

replace with
Lua:
		if(NpcState* npcState = getState(player, true))
                {
                        if(amount <= 0){
                        amount = 1;
                }
			npcState->amount = amount;
			npcState->subType = count;
			npcState->itemId = itemId;
			npcState->buyPrice = getListItemPrice(itemId, SHOPEVENT_BUY);
			npcState->ignoreCap = ignoreCap;
			npcState->inBackpacks = inBackpacks;

			const NpcResponse* response = getResponse(player, npcState, EVENT_PLAYER_SHOPBUY);
			executeResponse(player, npcState, response);
		}

Credits: MatheusMkalo
 
not 0.3.6 bug, but failure of users to specify a subType for addBuyableItem
 
Some servers 8.6 are just 0.3.6pl1 modified, I think this fix is for them.

for countable items

---

hmm I understand...
 
Last edited:
This bug is enable to use even on 0.2.10 TFS
 
How do they do this bug? maybe i have the same problem, cuz i did everything i could think off against cloning but they still cloned.
 
on NPC? if yes:

npc/scripts/script.lua

example

Lua:
shopModule:addBuyableItem({'spellbook'}, 2175, 150, 'spellbook')

Lua:
shopModule:addBuyableItem({'spellbook'}, 2175, 150, 1, 'spellbook')

I think that's it...
 
But they can clone any items... And i dont know how, I used 0.3.6, I disabled Parcel system, And all dps had same town, and when i was going to restart i closed server, saved and restarted. And they cant save by their own either, I really disabled any clone items bugs i knew :/ But still they copyed.
 
But they can clone any items... And i dont know how, I used 0.3.6, I disabled Parcel system, And all dps had same town, and when i was going to restart i closed server, saved and restarted. And they cant save by their own either, I really disabled any clone items bugs i knew :/ But still they copyed.

Eg:
NPC One - Carlin: buy magic plate armor, 90000golds
NPC Two - Demon Land: buy magic plate armor, 90000000000000golds
 
Back
Top