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

[REQUEST] Helper to fix runes/pots by switchs PLEASE HELP !!! :S

Rappine

Empire will back
Joined
Feb 6, 2009
Messages
106
Reaction score
0
Location
Brazil
Can you anyone make an small edit for me?
ACT IDofSWITCH,ID OF POT/RUNE,PRICE,BP COLLOR,runes charges
Pots:
HP,7618,7618,900,Red
MP,7620,7620,1000,Purple
SHP,7588,7588,2000,Red
SMP,7589,7589,1600,Purple
GHP,7591,7591,3800,Red
GMP,7590,7590,2400,Purple
GSP,8472,8472,3800,Brown
UP,8473,8473,6200,Red,
*
H: Health
M: Mana
P: Potion
G: Great
U: Ultimate
*
----------------------
Runes:
SD,2268,2268,6500,Gray,3
EXPLO,2313,2313,5000,Purple,6
GFB,2304,2304,3600,Red,4
HMM,2311,2311,2400,Purple,10
UH,2273,2273,3500,Blue,1

{Switch without exausted,
When player buy found a mensage "Thanks",
And player can buy with both position from switch {\ or /}

Thanks a Lot
If like you to edit,
Code:
local runemana = 
{ 
    [8704] = {8704, 400},  -- bp small health potion
    [7618] = {7618, 900},  -- bp health potion
    [7620] = {7620, 1000},  -- bp mana potion
    [7588] = {7588, 2000},  -- bp strong health potion
    [7589] = {7589, 1600},  -- bp strong mana potion
    [7591] = {7591, 3800},  -- bp great health potions
    [7590] = {7590, 2400},  -- bp great mana potions
    [8472] = {8472, 3800},  -- bp great spirit potions
    [8473] = {8473, 6200},  -- bp ultimate health potions
    [8474] = {8474, 2000},  -- bp antidote potions
    [2268] = {2268, 6500},  -- bp sd rune
    [2313] = {2313, 5000},  -- bp explosion rune
    [2304] = {2304, 3600},  -- bp gfb rune
    [2311] = {2311, 2400},  -- bp hmm rune
    [2273] = {2273, 3500}  -- bp uh rune
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = getCreaturePosition(cid)
if item.itemid == 1945 or item.itemid == 1946 then
    local rune = runemana[item.actionid]
    if rune then
	if doPlayerRemoveMoney(cid, rune[2]) == TRUE then
        local container = doPlayerAddItem(cid,1988,1)
        for i = 1, 20 do
            doAddContainerItem(container, rune[1], i)
			doSendAnimatedText(pos, "Thanks", TEXTCOLOR_RED)
        end
	else 
	doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "You dont have money")
	end
    end
end
	return TRUE
end

But This script have an bug, when player buy an BP of runes come one rune with 20x, other 19x, other 18, other 17x, other 16x, other 15x, oter 14x, other 13x~~~ other 1x...
Anyone can FIX it for me? And tell me how put BP collors? :S

Thanks
 
Lua:
-- by josejunior23

local CONFIG = 
{
    [1526]={backpack_id = 2002, item_id = 2273, charges = 2, cost = 2000}, -- ultimate healing rune
    [1525]={backpack_id = 1999, item_id = 2293, charges = 3, cost = 1000}, -- magic wall rune
    [1524]={backpack_id = 2001, item_id = 2313, charges = 6, cost = 1200}, -- explosion rune
    [1523]={backpack_id = 2003, item_id = 2268, charges = 3, cost = 2000}, -- sudden death rune
    [1522]={backpack_id = 2000, item_id = 8473, charges = 1, cost = 2200}, -- ultimate health potion
    [1521]={backpack_id = 1988, item_id = 8472, charges = 1, cost = 2200}, -- great spirit potion    
    [1520]={backpack_id = 2000, item_id = 7591, charges = 1, cost = 1800}, -- great health potion
    [1519]={backpack_id = 2000, item_id = 7588, charges = 1, cost = 1000}, -- strong health potion    
    [1518]={backpack_id = 2000, item_id = 7618, charges = 1, cost = 800},  -- health potion 
    [1517]={backpack_id = 2001, item_id = 7590, charges = 1, cost = 2200}, -- great mana potion
    [1516]={backpack_id = 2001, item_id = 7589, charges = 1, cost = 1000}, -- strong mana potion
    [1515]={backpack_id = 2001, item_id = 7620, charges = 1, cost = 800}   -- mana potion
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local container = 0
 	if item.itemid == 1945 then	
		if doPlayerRemoveMoney(cid, CONFIG[item.actionid].cost) == TRUE then
	    	doTransformItem(item.uid, item.itemid+1)
		     container = doPlayerAddItem(cid, CONFIG[item.actionid].backpack_id, CONFIG[item.actionid].charges)
		        for i = 1, 20 do
				    doAddContainerItem(container, CONFIG[item.actionid].item_id)
                end
        else
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "You don't have enough money. The price is "..CONFIG[item.actionid].cost.." gold pieces.") 
		end
 	elseif item.itemid == 1946 then
		doTransformItem(item.uid, item.itemid-1)
	else
        return FALSE	
	end
  return TRUE
end
 
Back
Top