Obsiadan knife pytanko

Status
Zamknięty.

PanTade???

Advanced User
Zarejestrowany
Dołączył
Październik 21, 2008
Posty
262
Liczba reakcji
4
local DUSTS = {
-- Demons
[2956] = {25000, 5905},

-- Vampires
[2916] = {25000, 5906}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerLevel(cid) <= 1) then
doPlayerSendCancel(cid, "You have to be at least Level 2 to use this tool.")
return TRUE
end

local dust = DUSTS[itemEx.itemid]
if(dust == nil) then
doPlayerSendCancel(cid, "Sorry, not possible.")
return TRUE
end

local random = math.random(1, 100000)
if(random <= dust[1]) then
doSendMagicEffect(toPosition, CONST_ME_GROUNDSHAKER)
doPlayerAddItem(cid, dust[2], 1)
elseif(dust[3] and random >= dust[3]) then
doSendMagicEffect(toPosition, CONST_ME_GROUNDSHAKER)
doPlayerAddItem(cid, dust[4], 1)
else
doSendMagicEffect(toPosition, CONST_ME_POFF)
end

doTransformItem(itemEx.uid, itemEx.itemid + 1)
return TRUE
end




co na ile ustawic zeby wycinalo sie zawsze?
 
Odp: Obsiadan knife pytanko

onst
obsidian_knife = 5908;
skin_body = [4011, 4047, 4052, 4057];
function searchIntArray(id:integer): boolean;
var
i: integer;
begin
result := false;
for i := low(skin_body) to high(skin_body) do begin
if skin_body = id then result := true;
end;
end;
function GetItemFromOpenBackpack(ID: integer): TItem;
var
y: integer;
begin
Result := nil;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for y := 0 to Self.Containers.Container[x].Count - 1 do
begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then
begin
Result := Self.Containers.Container[x].Item[y];
Exit;
end;
end;
end;
end;
function SkinBodies(id:integer): Boolean;
var
x, y: integer;
knife: TItem;
t: integer;
begin
UpdateWorld;
knife := GetItemFromOpenBackpack(obsidian_knife);
if knife = nil then
begin
Self.DisplayText('An Obsidian Knife could not be found, please open a container with it.');
exit;
end;
t := -1;
for x := -1 to 1 do begin
for y := -1 to 1 do begin
// if Screen.Tile[7+x, 5+y].Count >= 3 then begin
// t := -2
// end else t := -1;
if searchIntArray(Screen.Tile[7+x, 5+y].Item[Screen.Tile[7+x, 5+y].Count+t].ID) = true then begin
UpdateWorld;
knife := GetItemFromOpenBackpack(obsidian_knife);
if knife <> nil then begin
knife.UseWithGround(Self.X+X, Self.Y+Y, Self.Z);
Self.DisplayText('Attempted to skin a creature with the ID ' + IntToStr(Screen.Tile[7+x, 5+y].Item[Screen.Tile[7+x, 5+y].Count-1].ID) + '.');
Sleep(100);
UpdateWorld;
end;
end;
end;
end;
end;
begin
while not terminated do begin
UpdateWorld;
SkinBodies(skin_body);
Sleep(100);
end;
end;

Ten skrypt powinien ci dzia?ac^^Nie mojego autorstwa..Mam nadzieje ze pomoglem
Pozdro :p
 
Odp: Obsiadan knife pytanko

jak cos to knif mniej wiecej tak wyglada
PHP:
local SKINS = {
	-- Minotaurs
	[2830] = {25000, 5878},
	[2871] = {25000, 5878},
	[2866] = {25000, 5878},
	[2876] = {25000, 5878},
	[3090] = {25000, 5878},

	-- Lizards
	[4259] = {25000, 5876},
	[4262] = {25000, 5876},
	[4256] = {25000, 5876},

	-- Dragons
	[3104] = {25000, 5877},
	[2844] = {25000, 5877},

	-- Dragon Lords
	[2881] = {25000, 5948},

	-- Behemoths
	[2931] = {25000, 5930, 90000, 5893},

	-- Bone Beasts
	[3031] = {25000, 5925}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerLevel(cid) <= 1) then
		doPlayerSendCancel(cid, "You have to be at least Level 2 to use this tool.")
		return TRUE
	end

	local skin = SKINS[itemEx.itemid]
	if(skin == nil) then
		doPlayerSendCancel(cid, "Sorry, not possible.")
		return TRUE
	end

	local random = math.random(1, 100000)
	if(random <= skin[1]) then
		doSendMagicEffect(toPosition, CONST_ME_GROUNDSHAKER)
		doPlayerAddItem(cid, skin[2], 1)
	elseif(skin[3] and random >= skin[3]) then
		doSendMagicEffect(toPosition, CONST_ME_GROUNDSHAKER)
		doPlayerAddItem(cid, skin[4], 1)
	else
		doSendMagicEffect(toPosition, CONST_ME_POFF)
	end

	doTransformItem(itemEx.uid, itemEx.itemid + 1)
	return TRUE
end
krotki opis
Kod:
[[COLOR="Red"]2830[/COLOR]] = {[COLOR="Blue"]25000[/COLOR], [COLOR="MediumTurquoise"]5878[/COLOR]},
25000 - szansa na wyciagniecie item
5878 - item ktory zostanie wyciagniety
2830 - zwloki danego potwora
 
Ostatnia edycja:
Odp: Obsiadan knife pytanko

zmienilem 25000 na 100000 i nic tak samo wycina ;pp wiem ze to nie byl obsiadan ale mi sie pomylil z stake ;pp
 
Odp: Obsiadan knife pytanko

przepraszam cie ja sie pomylilem to jest exhaustion tak jak masz radom to sa szanse jesli bedzie mniejsz liczba bedzie wieksze prawdopodopienstwo wyciagniecia
 
Odp: Obsiadan knife pytanko

oks dzi?ki zaraz zmieni? i zobaczymy czy wycina :)



Edit : Wszystko dzia?a jak powinno :) dziex
 
Ostatnia edycja:
Status
Zamknięty.
Back
Do góry