What's new

Skrypty & Kody spell quest Storage Problem

Status
Not open for further replies.

KMLK

Active User
Joined
Mar 21, 2011
Messages
142
Reaction score
14
Chodzi ot?? o to , ?e jak nawet nie jest nauczony kto? tego czaru (?e nie klikno? na skrzynke w tym sensie)to zabiera mu dan? ilo?? many, jak to naprawi?, bo chce , ?eby im nie zabiera?o many za to, ?e napisz? czar kt?rego nie umiej?
a tu linijka przyk?adowa

Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 9)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.75, 0, -4.75, 0)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 9)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -4.75, 0, -4.75, 0)

arr1 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}

arr2 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}

local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)


local function onCastSpell1(parameters)
    doCombat(parameters.cid, parameters.combat1, parameters.var)
end

local function onCastSpell2(parameters)
    doCombat(parameters.cid, parameters.combat2, parameters.var)
end


function onCastSpell(cid, var)
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2 }
if getPlayerStorageValue(cid,4429) == 1 then
addEvent(onCastSpell1, 0, parameters)    
addEvent(onCastSpell2, 200, parameters)

else
doPlayerSendCancel(cid, "You must first learned to use this spell.")
		doSendMagicEffect(getPlayerPosition(cid), 2)

end
return
end
 

sawex

Advanced User
Joined
Aug 17, 2008
Messages
421
Reaction score
23
Odp: spell quest Storage Problem

Dlaczego nie zrobisz ?e masz spell kt?rego trza si? nauczy? a po klikni?ciu na skrzynie cie uczy spella zamiast w dodatkowe storage sie bawi?..
 

KMLK

Active User
Joined
Mar 21, 2011
Messages
142
Reaction score
14
Odp: spell quest Storage Problem

Poniewa? learn spell mi nie dzia?a
 

sawex

Advanced User
Joined
Aug 17, 2008
Messages
421
Reaction score
23
Odp: spell quest Storage Problem

To robisz jaki? b??d. Ewentualnie jak naprawde nie dzia?a to lepiej zmie? silniczek skoro najprostrze funkcje nie dzia?aj?.
 

KMLK

Active User
Joined
Mar 21, 2011
Messages
142
Reaction score
14
Odp: spell quest Storage Problem

no to mo?e robie co? ?le to jako? mo?esz wspom?c mnie?? ustawiam w config learn spell i to mam mie? npc czy to jest funkcja, bo ja si? gubi? chyba
 

sawex

Advanced User
Joined
Aug 17, 2008
Messages
421
Reaction score
23
Odp: spell quest Storage Problem

masz mie? w spells.xml needlearn="1" czy co? takiego i jest taka funkcja do nauki spelli doPlayerLearnInstantSpell czy jako? tak. Wszystkiego t?umaczy? nie b?d? bo nauczenie si? podstaw to podstawa.
 

KMLK

Active User
Joined
Mar 21, 2011
Messages
142
Reaction score
14
Odp: spell quest Storage Problem

Ok dzi?ki, a ostatnie pytanie gdzie te podstawy znajde na jakiej stronie ?? i czy ten learn spell mo?na zrobi? na uid bo na id nie chce mi si? robi? nowych skrzynek. Ale te storage jest dobre tyle, ?e jak wyskakuje informacja , ?e czaru nie umiem to zabiera tam dany soul i mane da si? to naprawi? ?
?eby to dzia?a?o jak np jaki? czar powiedzmy furie z WoDBO mo?na u?y? na dany lvl a ja chce ?eby by? quest zrobiony ;/. a z tym spell learn nie mog? wykombinowa? nic ;/ bo znalaz?em tylko, ?eby uczy? czaru, ale nie ma ?adnych informacji dla tych co go nie umiej?, ?e maj? mie? wykonanego questa
 
Last edited:

sawex

Advanced User
Joined
Aug 17, 2008
Messages
421
Reaction score
23
Odp: spell quest Storage Problem

Podstawy? Naucz si? po prostu sk?adni j?zyka LUA ?eby wiedzie? jak zrobi? by nie zepsu? a w skrypcie ze skrzyni? podmie? setPlayerStorageValue na to uczenie si?.
Tu masz (nie wiem czy aktualny) spis funkcji http://tibia.net.pl/threads/88074-Wielki-Spis-Funkcji-(LUA).
Po twoje na pewno aktualne musisz zobaczy? w swoich plikach ?r?d?owych (luascript.cpp chyba)
 

KMLK

Active User
Joined
Mar 21, 2011
Messages
142
Reaction score
14
Odp: spell quest Storage Problem

o jest mam, ale b??d jest w actions i nie mog? si? skapn?? jaki ;/
function onUse(cid, item, fromPosition, itemEx, toPosition)
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local spellname = "Destroy Furie"

 if(getPlayerLearnedInstantSpell(cid,spellname)) == 1 then
 doPlayerSendTextMessage(cid,18 , "You already learned that spell.")
 else
 doPlayerLearnInstantSpell(cid,spellname)
 doPlayerSendTextMessage(cid, 18, "You learned new spell ("..getInstantSpellInfo(cid, spellname).words..").")
 doRemoveItem(item.uid)
 end
 return true
 end

b??d jaki? dziwny m?wi, ?e w 7 linijce czyli doPlayerLearnInstantSpell , ?e jest zerow? warto?ci? o co tu chodzi, a b??d ca?y wygl?da nat?puj?co attempt to call global 'doPlayerLearnInstantSpell' <a nil value> i ten takowy b??d wywala konsola , jak klikne na ten przedmiot o danym id i nie jest to wina silnika, bo zmieni?em i te? nie dzia?a?o albo w silniku dbko ta funkcja jest zmieniona kurcze;/ wodbo itp
 
Last edited:

sawex

Advanced User
Joined
Aug 17, 2008
Messages
421
Reaction score
23
Odp: spell quest Storage Problem

Jeju jeju u mnie w silniku ta funkcja odpowiada za nauczenie si? spella
playerLearnInstantSpell(cid, name) --- name zamien oczywis?ie na nazwe spella.
 

KMLK

Active User
Joined
Mar 21, 2011
Messages
142
Reaction score
14
Odp: spell quest Storage Problem

Ok ok prawie dzia?a, tylko nie wysy?a informacji, ?e si? nauczy?em spella ale co? sprawdze i zara ci reput dam ok zrobi?em troche edyt usuno?em te funkcje sprawdzania wpisa?em swoje i dzia?a dzi?ki za pomoc tak w og?le reput
TEMAT DO ZAMKNIECIA :) DZI?KUJE ZA POMOC !
 
Last edited:
Status
Not open for further replies.
Top