What's new

Zmiana info na temat "fish"

Status
Not open for further replies.

LaVejt

Advanced User
Joined
Jan 26, 2010
Messages
362
Reaction score
7
chcialbym aby wszystkie fishe nie byly do jedzenia lecz do otwierania
wylatywalo by z nich:

- NIc - 30 %
- O?c - 25%
- Ma?z (SAM USTAWIE) - 15%
- Robak (1-3) - 15%

I SAM COS DODAJ CO Z RYB MOZE LECIEC

za skryptor reputor :p
 

LaVejt

Advanced User
Joined
Jan 26, 2010
Messages
362
Reaction score
7
Odp: Zmiana info na temat "fish"

Odswierzamy ^_^"
 

Yoxino

Advanced User
Joined
Aug 12, 2009
Messages
478
Reaction score
51
Odp: Zmiana info na temat "fish"

...data/actions/actions/fishitem.lua
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = 
{
	["nic"] = {szansa = 30},
	["osc"] = {szansa = 20, id = XXXX, ile_max = 1},
	["malz"] = {szansa = 25, id = XXXX, ile_max = 1},
	["robak"] = {szansa = 25, id = XXXX, ile_max = 1}
}
local nic, osc, malz, robak = config["nic"], config["osc"], config["malz"], config["robak"]
local szansa = math.rand(0,100)

if szansa <= nic.szansa then
	doRemoveItem(item.uid ,1)
elseif szansa > nic.szansa and szansa <= osc.szansa then
	doRemoveItem(item.uid, 1)
	doPlayerAddItem(cid, osc.id, math.rand(1,osc.ile_max))
elseif szansa > osc.szansa and szansa <= malz.szansa then
	doRemoveItem(item.uid, 1)
	doPlayerAddItem(cid, malz.id, math.rand(1,malz.ile_max))
elseif szansa > malz.szansa and szansa <= robak.szansa then
	doRemoveItem(item.uid, 1)
	doPlayerAddItem(cid, robak.id, math.rand(1,robak.ile_max))
end
return true
end

...data/actions/actions.xml
PHP:
<action itemid="XXXX" event="script" value="other/fishitem.lua"/>

Podmien wsz?dzie XXXX

Nie testowane, mam nadzieje ?e dzia?a.

Pozdrawiam!
Yoxino
 

LaVejt

Advanced User
Joined
Jan 26, 2010
Messages
362
Reaction score
7
Odp: Zmiana info na temat "fish"

ej a gdzie mam usunac aby ryby nie zjadac ??? :D
 

Yoxino

Advanced User
Joined
Aug 12, 2009
Messages
478
Reaction score
51
Odp: Zmiana info na temat "fish"

Musisz usun?c ID ryby kt?ra ma zosta? "zamieniana" w
1) ...data/actions/actions.xml tutaj przy id twojej ryby nie kieruj do skryptu food.lua, ale do skryptu kt?ry ci napisa?em

2) ...data/actions/scripts/others/food na wszelki wypadek z t?d usun w tabeli id tej ryby.
 
Status
Not open for further replies.
Top