• logo_cipsoft
    Nowe serwery zostały otwarte 19 Lut 2025:
    Noctalia (Open PvP) Ignitera (Open PvP) us_logo Xybra (Open PvP)

[Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

Status
Zamknięty.
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

Serca w edit. : )!
EDIT. :
Kod:
function onDeath(cid, corpse, killer)
local serce = 1234 -- Tu wpisz ID Serca !: )
local serc = doPlayerAddItem(cid,serce,1)
if isPlayer(cid) == TRUE then
		doPlayerSendCancel(cid,"Zabiles "..getCreatureName(cid).." !")
                doSetItemSpecialDescription(serc, "Its heart of "..getCreatureName..". Killed on lvl "..getCreatureLevel(cid).." by "..getCreatureName(killer).." !")
	end
return TRUE
end
Ew. b??dy, napisz !: )
Do creaturescirpt.xml :
Kod:
<event type="kill" name="Heart" script="herat.lua"/>
 
Ostatnia edycja:
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

B??d w tym sercu
Kod:
[03/02/2009 14:12:25] Warning: [Event::loadScript] Can not load script. data/creaturescripts/scripts/heart.lua
[03/02/2009 14:12:25] data/creaturescripts/scripts/heart.lua:5: ')' expected near 'heart'
Aa, o ile dobrze widz? to m?g?by? mi powiedzie? jaki level mia?a osoba, kt?ra zgin??a? Bo jak kto? by chcia? mie? szpan, ?e ubi? h-lvl ;p

@EDIT Jak to zrobisz to repucik poleci, a i jeszcze jedno jak b?dziesz mia? czas to popraw tego cityguarda.

Pozdrawiam,
Julcio
 
Ostatnia edycja:
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

Jest tam : ) ! Zaraz poprawie :P
 
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

Magic Hereos mam do Ciebie bardzo wielk? pro?b?, a wi?c tak mam problem, gdy kto? padnie na moim OTS to nie spada mu level tylko skille do 10 i w komendzie /deathlist nick nic nie pisze tak samo na stronie. Sta?o si? tak po zrobieniu acc.makera na stronie.

Druga sprawa jest taka, ?e mam taki skrypt:
Kod:
function onAdvance(cid, skill, oldlevel, newlevel)
if newlevel == 100 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 100, congratulations!", 21)

if newlevel == 200 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 200, congratulations!", 21)

if newlevel == 300 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 300, congratulations!", 21)

if newlevel == 400 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 400, congratulations!", 21)

if newlevel == 500 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 500, congratulations!", 21)

if newlevel == 600 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 600, congratulations!", 21)

if newlevel == 700 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 700, congratulations!", 21)

if newlevel == 800 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 800, congratulations!", 21)

if newlevel == 900 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 900, congratulations!", 21)

if newlevel == 1000 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 1000, congratulations!", 21)
end
end

A na konsoli pisze:
Kod:
[03/02/2009 14:51:28] Warning: [Event::loadScript] Can not load script. data/creaturescripts/scripts/advance.lua
[03/02/2009 14:51:28] data/creaturescripts/scripts/advance.lua:32: 'end' expected (to close 'if' at line 23) near '<eof>'

Bardzo prosz? o pomoc.

Pozdrawiam,
Julcio
 
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

Kod:
local target = 0
local prevTarget = 0
local maxChaseDistance = 20
local origPos = 0
local lastAttack = 0
local followTimeout = 10
local brzydkie = {
{huj},
{dziwka},
{kurwa},
{jebac},
{pierdole}
}
local hp = (getCreatureHealth(cid)-1)
local mana = (getCreatureMana(cid)-10)
local function isSkulled(cid)
	if(getCreatureSkullType(cid) >= 3 and isPlayerPzLocked(cid) == TRUE) then
		return true
	end
	return false
end
local function goToOrigPos()
	target = 0
	lastAttack  = 0
	selfFollow(0)
	doTeleportThing(getNpcCid(), origPos)
end
local function updateTarget()
	if(isPlayer(target) == FALSE) then
		goToOrigPos()
	elseif(not isSkulled(target)) then
		selfSay("Now, behave in the future.")
		goToOrigPos()
	end
	if(target == 0) then
		local list = getSpectators(getNpcPos(), 9, 9, false)
		for i = 1, table.getn(list) do
			local _target = list[i]
			if(_target ~= 0) then
				if(isPlayer(_target) == TRUE and isSkulled(_target)) then
					if(getTilePzInfo(getCreaturePosition(_target)) == FALSE) then
						if(selfFollow(_target)) then
							target = _target
							if(target ~= prevTarget) then
								selfSay("We do not tolerate people like you here!")
							end
							prevTarget = target
							break
						end
					end
				end
			end
		end
	end
end
function onCreatureAppear(cid)
	if(cid == getNpcCid()) then
		origPos = getNpcPos()
	end
end
function onCreatureDisappear(cid)
	if(cid == target) then
		goToOrigPos()
	end
end
function onCreatureSay(cid, type, msg)
for i=1, #brzydkie do
  	msg = string.lower(msg)
  	if ((msgcontains(msg, ''..brzydkie[i]..'') and (focus == 0)) and getDistanceToCreature(cid) < 7 then
  		selfSay('' .. getCreatureName(cid) .. '! We do not tolerate people like you here!', cid)
  		focus = cid
function onCreatureMove(creature, oldPos, newPos)
	--
end
function onThink()
	updateTarget()
	if(target == 0) then
		return
	end
	local playerPos = getCreaturePosition(target)
	local myPos = getNpcPos()
	if(myPos.z ~= playerPos.z) then
		goToOrigPos()
		return
	end
	if(math.abs(myPos.x - origPos.x) > maxChaseDistance or math.abs(myPos.y - origPos.y) > maxChaseDistance) then
		selfSay("I'll catch you next time.")
		goToOrigPos()
		return
	end
	if(lastAttack == 0) then
		lastAttack = os.clock()
	end
	if(os.clock() - lastAttack > followTimeout) then
		selfSay("You got me this time, but just wait.")
		goToOrigPos()
		return
	end
	if((math.abs(playerPos.x - myPos.x) <= 1) and (math.abs(playerPos.y - myPos.y) <= 1)) then
		doTargetCombatHealth(getNpcCid(), target, COMBAT_LIFEDRAIN, -200, -300, CONST_ME_BLOCKHIT)
		lastAttack = os.clock()
	end
end
Nie dzia?a.
W?a?ciwie to potrzebuje czego? prostego. Widzi playera ze skullem i pz > zabija.
M?g? by? ?
@Edit [UP]
Spr?buj pododawa? endy na ko?cu.
 
Ostatnia edycja:
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

@UP
To Magic Hereos zrobi? na moj? pro?b?, ja ci mog? da? prostego, kt?ry tylko jak kogo? widzi ze skullem to zabija

npc/scripts a w nim cityguard.lua
Kod:
local target = 0
local prevTarget = 0
local maxChaseDistance = 20
local origPos = 0
local lastAttack = 0
local followTimeout = 10

local function isSkulled(cid)
	if(getCreatureSkullType(cid) >= 3 and isPlayerPzLocked(cid) == TRUE) then
		return true
	end

	return false
end

local function goToOrigPos()
	target = 0
	lastAttack  = 0
	selfFollow(0)
	doTeleportThing(getNpcCid(), origPos)
end

local function updateTarget()
	if(isPlayer(target) == FALSE) then
		goToOrigPos()
	elseif(not isSkulled(target)) then
		selfSay("Now, behave in the future.")
		goToOrigPos()
	end

	if(target == 0) then
		local list = getSpectators(getNpcPos(), 9, 9, false)
		for i = 1, table.getn(list) do
			local _target = list[i]
			if(_target ~= 0) then
				if(isPlayer(_target) == TRUE and isSkulled(_target)) then
					if(getTilePzInfo(getCreaturePosition(_target)) == FALSE) then
						if(selfFollow(_target)) then
							target = _target
							if(target ~= prevTarget) then
								selfSay("We do not tolerate people like you here!")
							end

							prevTarget = target
							break
						end
					end
				end
			end
		end
	end
end

function onCreatureAppear(cid)
	if(cid == getNpcCid()) then
		origPos = getNpcPos()
	end
end

function onCreatureDisappear(cid)
	if(cid == target) then
		goToOrigPos()
	end
end

function onCreatureMove(creature, oldPos, newPos)
	--
end

function onThink()
	updateTarget()

	if(target == 0) then
		return
	end

	local playerPos = getCreaturePosition(target)
	local myPos = getNpcPos()

	if(myPos.z ~= playerPos.z) then
		goToOrigPos()
		return
	end

	if(math.abs(myPos.x - origPos.x) > maxChaseDistance or math.abs(myPos.y - origPos.y) > maxChaseDistance) then
		selfSay("I'll catch you next time.")
		goToOrigPos()
		return
	end

	if(lastAttack == 0) then
		lastAttack = os.clock()
	end

	if(os.clock() - lastAttack > followTimeout) then
		selfSay("You got me this time, but just wait.")
		goToOrigPos()
		return
	end

	if((math.abs(playerPos.x - myPos.x) <= 1) and (math.abs(playerPos.y - myPos.y) <= 1)) then
		doTargetCombatHealth(getNpcCid(), target, COMBAT_LIFEDRAIN, -200, -300, CONST_ME_BLOCKHIT)
		lastAttack = os.clock()
	end
end

Nastepnie w folderze npc robisz citygaurd.xml, a w nim:
Kod:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Cityguard" script="data/npc/scripts/cityguard.lua" walkinterval="0" floorchange="0" speed="900">
	<health now="150" max="150"/>
	<look type="131" head="19" body="19" legs="19" feet="19"/>

  <interaction range="3" idletime="60">

    <interact keywords="hi" focus="1">
      <keywords>hello</keywords>

      <response text="Nothing to see here, move along.">
        <action name="idle" value="1"/>
      </response>
    </interact>

    <interact keywords="bye" focus="0">
      <keywords>farewell</keywords>

      <response text="Good bye."/>
    </interact>
  </interaction>

</npc>

Pozdrawiam,
Julcio
 
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

@UP
Poczytaj regulamin...
Kod:
function onAdvance(cid, skill, oldlevel, newlevel)
if newlevel == 100 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 100, congratulations!", 21)
elseif newlevel == 200 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 200, congratulations!", 21)
elseif newlevel == 300 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 300, congratulations!", 21)
elseif newlevel == 400 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 400, congratulations!", 21)
elseif newlevel == 500 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 500, congratulations!", 21)
elseif newlevel == 600 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 600, congratulations!", 21)
elseif newlevel == 700 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 700, congratulations!", 21)
elseif newlevel == 800 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 800, congratulations!", 21)
elseif newlevel == 900 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 900, congratulations!", 21)
elseif newlevel == 1000 then
doBroadcastMessage(getPlayerName(cid).." just advanced to level 1000, congratulations!", 21)
end
end
 
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

No nie doko?ca. On ma jakie? dzikie funkcje, kt?re nie dzia?aj? u mnie.
Ja potrzebuj? co? takiego,?e widzi i od razu pach dead XD Nie gada, nie biega.
@Edit [Down]
Kod:
Lua Script Error: [Npc interface]
data/npc/scripts/guard.lua:onThink
attempt to index a number value
(To co? z doTeleportThing)
@Edit2
Chyba naprawi?em powy?sze
Doda?em :

Kod:
local telepos = {origPos,stackpos=1}
i
Kod:
	doTeleportThing(getNpcCid(), origPos)
zamieni?em na :
Kod:
doTeleportThing(getNpcCid(), telepos, 0)

teraz w konsoli :
Kod:
Lua Script Error: [Npc interface]
data/npc/scripts/guard.lua:onThink

data/npc/scripts/guard.lua:26: attempt to call global 'getNpcPos' (a nil value)
 
Ostatnia edycja:
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

Nie ma dzikich funkcji ;<
Jak masz Silnik bez odpowiednich funkcji, nie zrobisz (b??d podaj, mo?e naprawi? !)
NPC Nie robi?, jak i nikt inny nie zrobi !

A w?a?nie, og?oszenie
Winged z powodu ma?ej ilo?ci czasu, b?dzie mniej aktywny(Ta, nie b?dzie robi? skrypt?w cz?sto !)
 
Ostatnia edycja:
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

potrzebuje skrypty zeby do danej itemki dodawal m lvl albo skile bo jak pisze w item.xml to mi nie dodaja
skrypt albo mi ktos powie jak to ustawic

Edit: potrzebuje skrypty zeby do danej itemki dodawal m lvl albo skile bo jak pisze w item.xml to mi nie dodaja
skrypt albo mi ktos powie jak to ustawic
 
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

Chcia?bym takiego oto potworka
Pythius The Rotten wygl?daj?cego identycznie jak Undead Dragon.
Potworek posiada oko?o 9000 punkt?w ?ycia. Nie daje on jednak punkt?w do?wiadczenia, ani tym bardziej nie pozostawia po sobie ?adnego loota. Po jego ?mierci pojawia si? teleport, kt?ry zaprowadzi mnie do questa
 
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

A wali po ile? Opisz dok?adnie, najlepiej podstaw wszystko do wzoru z tibia.pl !
Wtedy szybko zrobi? potwora, i skrypt onDeath !;)
 
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

Magic Hereos sorki, ?e Ci tak zawracam g?ow?, ale bardzo bym prosi? jeszcze o naprawienie tych serc podam jeszcze raz b??d z konsoli:
Kod:
[03/02/2009 14:51:28] Warning: [Event::loadScript] Can not load script. data/creaturescripts/scripts/heart.lua
[03/02/2009 14:51:28] data/creaturescripts/scripts/heart.lua:5: ')' expected near 'heart'
 
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

A wi?c
podaj? dok?adniejsze dane
Pythius The Rotten
wygl?d : Undead Dragon
9000hp 0 expa 0 loota dalej wiesz ;p
sumonuje (0-1) undead Gladiator
ca?kowicie odporny na energi? i sd'ki
jego moc niech b?dzie podobna do undead dragon tak troszk? mocniejszy ale lekko :rolleyes: to chyba wszystko

PS : wie kto?, gdzie si? ustawia exhausted w tfs'ie (8.4) w configu nie mam czego? takiego
 
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

@UP
Ka?dy skrypt osobno, zaraz zrobi? potworka.
@2x UP
Skrypt poprawiony !;)
Kod:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Pythius The Rotten" nameDescription="a Pythius The Rotten" race="undead" experience="0" speed="350" manacost="0">
  <health now="9000" max="9000"/>
  <look type="231" corpse="6306"/>
  <targetchange interval="5000" chance="8"/>
  <strategy attack="100" defense="0"/>
  <flags>
    <flag summonable="0"/>
    <flag attackable="1"/>
    <flag hostile="1"/>
    <flag illusionable="1"/>
    <flag convinceable="0"/>
    <flag pushable="0"/>
    <flag canpushitems="1"/>
    <flag canpushcreatures="1"/>
    <flag targetdistance="1"/>
    <flag staticattack="90"/>
    <flag runonhealth="0"/>
  </flags>
  <attacks>
    <attack name="melee" interval="1950" skill="90" attack="90"/>
    <attack name="melee" interval="2000" chance="30" range="7" radius="4" target="1" min="-300" max="-395">
      <attribute key="shootEffect" value="fire"/>
      <attribute key="areaEffect" value="redspark"/>
    </attack>
    <attack name="physical" interval="2800" chance="13" range="7" min="-0" max="-500">
      <attribute key="shootEffect" value="suddendeath"/>
      <attribute key="areaEffect" value="mortarea"/>
    </attack>
    <attack name="poison" interval="2000" chance="20" range="7" radius="4" target="1" min="-120" max="-390">
      <attribute key="shootEffect" value="poison"/>
      <attribute key="areaEffect" value="poison"/>
    </attack>
    <attack name="poison" interval="1000" chance="23" range="7" min="-50" max="-180">
      <attribute key="shootEffect" value="poison"/>
      <attribute key="areaEffect" value="poison"/>
    </attack>
    <attack name="fire" interval="4000" chance="20" length="8" spread="3" min="-500" max="-600">
      <attribute key="areaEffect" value="firearea"/>
    </attack>
    <attack name="poison" interval="2000" chance="20" length="8" spread="3" min="-200" max="-685">
      <attribute key="areaEffect" value="poison"/>
    </attack>
    <attack name="lifedrain" interval="2600" chance="35" length="8" spread="3" min="-300" max="-600">
      <attribute key="areaEffect" value="greenshimmer"/>
    </attack>
    <attack name="drowncondition" interval="1000" chance="20" length="8" spread="3">
      <attribute key="areaEffect" value="poff"/>
    </attack>
  </attacks>
  <defenses armor="5" defense="35">
  </defenses>
  <elements>
	<element deathPercent="100"/>
	<element earthPercent="100"/>
	<element firePercent="100"/>
	<element physicalPercent="10"/>
	<element icePercent="8"/>
	<element holyPercent="-20"/>
  </elements>
  <immunities>
    <immunity paralyze="1"/>
    <immunity invisible="1"/>
  </immunities>
  <voices interval="5000" chance="10">
    <voice sentence="FEEEED MY ETERNAL HUNGER!" yell="1"/>
	<voice sentence="I SENSE LIFE" yell="1"/>
  </voices>
<loot>
<item id="2148" chance="100000" countmax="100"/> -- gold coin
<item id="2152" chance="28000" countmax="12"/> -- platinum coin
<item id="2236" chance="15000"/> -- torn book
<item id="2413" chance="20000"/> -- broad sword
<item id="2413" chance="3000"/> -- golden armor
<item id="2413" chance="8000"/> -- knight armor
<item id="2413" chance="950"/> -- dragon scale mail
<item id="2413" chance="1200"/> -- war axe
<item id="2413" chance="4200"/> -- underworld rod
<item id="1987" chance="100000"> -- bag
<inside>
	<item id="6500" chance="2818" countmax="3"/> -- demonic essence
	<item id="5944" chance="2538" countmax="2"/> -- soul orb
	<item id="2413" chance="4500"/> -- hardened bone
	<item id="2547" chance="4600" countmax="15"/> -- power bolt
</inside>
</item>
</loot>
</monster>
Zaraz dodam creaturescirpt !:)
Kod:
function onDeath(cid, corpse, killer)
local tp = 1234 -- ID Teleportera !
local skad = {x = xxx, y = yyy, z = zzz} -- Gdzie ma sie pojawic?
local gdzie = {x = xxx, y = yyy, z = zzz} -- Gdzie ma teleportowac?
	if getCreatureName(cid) == "Pythius The Rotten" then
		doPlayerSendCancel(cid,"Zabiles "..getCreatureName(cid).." !")
		doCreateTeleport(tp, skad, gdzie)
		addEvent(doRemoveItem(cid,1), 1000*180, param)
	end
return TRUE
end
Hmmm... my?l?, ?e powinno dzia?a? !: )!
 
Ostatnia edycja:
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

@Magic Hereos
Skrypt na serce sobie ju? sam zrobi?em, za awansowanie leci reput. Mia?bym jeszcze pro?b?, gdyby? m?g? mi zrobi? skrypt talkactions / komenda !trainer - stawia obok playera trainera i mo?e gracz treni? gdzie chce i kiedy chce. Z g?ry THX.

Pozdrawiam,
Julcio
 
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

Witaj,
Tibia 7.6,
Runy :
1.runa nimfa (niesko?czona) daje wyglad nimfa
2.runa dwarfa (nieskonczona) daje wyglad dwarfa

Quests :
Taki, ?eby ka?dy m?g? wyci?gn?? z danej skrzynki co chce. (napisz mi jak to ustawi? [OtMapEditor])

Pozdrawiam,
GutA
 
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

function onDeath(cid, corpse, killer)
local tp = 1234 -- ID Teleportera !
local skad = {x = xxx, y = yyy, z = zzz} -- Gdzie ma sie pojawic?
local gdzie = {x = xxx, y = yyy, z = zzz} -- Gdzie ma teleportowac?
if getCreatureName(cid) == "Pythius The Rotten" then
doPlayerSendCancel(cid,"Zabiles "..getCreatureName(cid).." !")
doCreateTeleport(tp, skad, gdzie)
addEvent(doRemoveItem(cid,1), 1000*180, param)
end
return TRUE
end
to wklejam do creature script a jak nazwac? zmieniam x,y,z i to wszystko?


druga sprawa to by? mi da? scrypt Guild Mastera bo jest popsuty tzn jest ale nic nie mozna pisac do niego
 
Ostatnia edycja:
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

Talkactions
Komenda: !exp
Jak kto? wpisze !exp to pokazuje mu si? potrzebuje expa do nast?pnego lvl.
Silnik Stigma 8.1 XML
 
Odp: [Skrypty][7.6-8.4] Skrypty na zam?wienie by Magic

Witaj,
Tibia 7.6,
Runy :
1.runa nimfa (niesko?czona) daje wyglad nimfa
2.runa dwarfa (nieskonczona) daje wyglad dwarfa
Quests :
Taki, ?eby ka?dy m?g? wyci?gn?? z danej skrzynki co chce. (napisz mi jak to ustawi? [OtMapEditor])
Pozdrawiam,
GutA
Jak mam niby to zrobi?? Skrzynka ma przewidywa?, co gracz chc??...:confused:
Skrypty zrobi? p??niej, narazie, mam inne wa?ne rzeczy xd!
 
Status
Zamknięty.
Do góry