What's new

Summon ! Monsters!

DJSOJA1991

Banned
Joined
Sep 6, 2008
Messages
173
Reaction score
4
Mam pytanko da sie ustawic ze tylko dana profesja moze przywolac tego potwora?
z g?ry thx ;]




Code:
<?xml version="1.0" encoding="UTF-8"?>
  <monster name="Cell Jr II" nameDescription="a bioandroid" race="poison" experience="7500" speed="600" manacost="20000">
    <health now="2000000" max="2000000"/>
    <look type="118" head="20" body="30" legs="40" feet="50" corpse="6045"/>
    <targetchange interval="60000" chance="0"/>
    <strategy attack="100" defense="0"/>
    <flags>
<flag summonable="1"/>
      <flag attackable="1"/>
      <flag hostile="1"/>
      <flag illusionable="0"/>
      <flag convinceable="0"/>
      <flag pushable="0"/>
     <flag canpushitems="1"/>
      <flag staticattack="50"/>
      <flag lightlevel="0"/>
      <flag lightcolor="0"/>
      <flag targetdistance="1"/>
      <flag runonhealth="0"/>
    </flags>
    <attacks>
      <attack name="melee" interval="2000" min="-7000" max="-10000"/>
      <attack name="arrow" interval="3000" chance="100" min="-3000" max="-8000"/>
     
<attack name="barrier" interval="3000" chance="100" min="-2000" max="-8000"/>
    <attack name="big bolt" interval="3000" chance="100" min="-2000" max="-8000"/>

    </attacks>
    <defenses armor="100" defense="100"/>
    <immunities>
      <immunity physical="0"/>
      <immunity energy="0"/>
      <immunity fire="0"/>
      <immunity poison="0"/>
      <immunity lifedrain="0"/>
      <immunity paralyze="0"/>
      <immunity outfit="0"/>
      <immunity drunk="0"/>
      <immunity invisible="0"/>
    </immunities>
    <voices interval="2000" chance="5">
     <voice sentence="Ciri Ciri!"/>
 <voice sentence="Ciri Ciri!"/>
 <voice sentence="Ciri Ciri!"/>
 <voice sentence="Ciri Ciri!"/>
 <voice sentence="Ciri Ciri!"/>
 <voice sentence="Ciri Ciri!"/>
      <voice sentence="Ciri Ciri!"/>
    </voices>
<loot>

 
  </loot>
  </monster>
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Summon ! Monsters!

Znam si? na tworzeniu potwor?w i powiem Ci, ?e nie mo?na w pliku xml ustawi? by tylko dana profesja mog?a tworzy? tego monstera, ale jako i? jestem mi?y to napisze Ci nowy czar, w kt?rym b?dziesz r?cznie ustawia? ile many b?dzie potrzebne do przywo?ania danego potwora. Do wieczora powinien by? gotowy.

#down
Doskonale wiem o co Ci chodzi i takie co? w?a?nie zrobi?.
 
Last edited:

DJSOJA1991

Banned
Joined
Sep 6, 2008
Messages
173
Reaction score
4
Odp: Summon ! Monsters!

hmm dla mnie chodzi o to ze jak napisze summon cell jr pojawia sie moj summon ;]
niechodzi mi o utevo res ;]
poniewaz wtedy kazdy moze a ja chce zrobic
summon cell jr
summon majin buu
summon kid janemba
;]
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Summon ! Monsters!

W?a?nie za poganianie mnie op??niasz wykonanie tego skryptu, kt?ry mam wykonane, ale nie mam dost?pu do komputera by Ci go przekaza?.
Je?li nie wyka?esz si? cierpliwo?ci? to zawsze mo?esz sam napisa? ten skrypt, naprawd? nie jest on trudny.
 

Szybol

Advanced User
Joined
Apr 14, 2008
Messages
210
Reaction score
30
Age
31
Odp: Summon ! Monsters!

Z poziomu talkactions mo?na doda? now? komend? np !summon demon.

Do pliku talkcations.xml dodajesz linijk?:
<talkaction words="/summon" filter="first word" script="summon.lua" />

potem tworzysz skrypt w folderze scripts o nazwie summon.lua i wklejasz:

-- Szybol OTS Engine --

Vocations = {1, 2, 3, 4} -- tutaj wpisujemy profesje
Monster = {'demon'}-- tutaj wpisujemy monsterki

function onSay(cid, words, param)
local name = tostring(param)
if(isInArray(Vocations,getPlayerVocation(cid)) == TRUE and isInArray(Monster,name) == TRUE)then
doSummonCreature(name, getCreaturePosition(cid))
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, words.." "..param)
else
doPlayerSendCancel(cid, "You can not execute this command.")
end
return true
end
 
Last edited:

DJSOJA1991

Banned
Joined
Sep 6, 2008
Messages
173
Reaction score
4
Odp: Summon ! Monsters!

W?a?nie za poganianie mnie op??niasz wykonanie tego skryptu, kt?ry mam wykonane, ale nie mam dost?pu do komputera by Ci go przekaza?.
Je?li nie wyka?esz si? cierpliwo?ci? to zawsze mo?esz sam napisa? ten skrypt, naprawd? nie jest on trudny.
dobra wez sie ciagnij wiesz ile juz czekam.... @up dzieki l;]
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Summon ! Monsters!

Zapomnia?em o tym temacie.
Prosz? oto skrypt:
PHP:
function onSay(cid, words, param)
local summons = {
				["troll"] = {name = "troll", mana = 507, voc = {3,15,17}},
				["rat"] = {name = "rat", mana = 102, voc = {15,12,13}},
				["vampire bride"] = {name = "vampire bride", mana = 304, voc = {15}}
				}
local summ = summons[tostring(param)]
if isInArray(summ.voc, getPlayerVocation(cid)) then
	if getCreatureMana(cid) >= summ.mana then
		local summons = getCreatureSummons(cid)
		if(table.maxn(summons) <= 1) then
			local mob = doSummonCreature(summ.name, getCreaturePosition(cid))
			doConvinceCreature(cid, mob)
			doCreatureAddMana(cid, -summ.mana)
			doPlayerAddSpentMana(cid, summ.mana)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
			doCreatureSay(cid, words.." "..param, TALKTYPE_ORANGE_1)
		else
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
			doPlayerSendCancel(cid, "Nie mozesz przywolac wiekszej ilosci potworow.")
		end
	else
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		doPlayerSendCancel(cid, "Masz za malo many.")
	end
else
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	doPlayerSendCancel(cid, "Nie jestes w stanie przywolac tego stworzenia.")
end
return true
end
Pobiera man? oraz dolicza j? do magic levela i dodatkowo nie mo?e mie? ilo?ci summon?w wi?ksz? ani?eli 2.
 
Last edited:

DJSOJA1991

Banned
Joined
Sep 6, 2008
Messages
173
Reaction score
4
dzieki ze chociaz przypomniales sobie zaraz sprwadze
@edit
Code:
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/zanzoken.lua:onSay
data/talkactions/scripts/zanzoken.lua:7: attempt to index local 'summ' (a nil va
lue)
Code:
function onSay(cid, words, param)
local summons = {
                ["summon cell jr"] = {name = "summon cell jr", mana = 25000, voc = {51,52,53,274,276,277,278,471}},
                ["summon kid janemba"] = {name = "summon kid janemba", mana = 25000, voc = {338,339,340,341,342,343,344,345,346,347,491}}
                }
local summ = summons[tostring(param)]
if isInArray(summ.voc, getPlayerVocation(cid)) then
    if getPlayerMana(cid) >= summ.mana then
        local summons = getCreatureSummons(cid)
        if(table.maxn(summons) <= 1) then
            local mob = doSummonCreature(summ.name, getCreaturePosition(cid))
            doConvinceCreature(cid, mob)
            doCreatureAddMana(cid, -summ.mana)
            doPlayerAddSpentMana(cid, summ.mana)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
            doCreatureSay(cid, words.." "..param, TALKTYPE_ORANGE_1)
        else
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            doPlayerSendCancel(cid, "Nie mozesz przywolac wiekszej ilosci potworow.")
        end
    else
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        doPlayerSendCancel(cid, "Masz za malo many.")
    end
else
    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
    doPlayerSendCancel(cid, "Nie jestes w stanie przywolac tego stworzenia.")
end
return true
end
usunelem 1 linjke czy to przez to blad? moglbys dobrze sprwadzic?
@edit2
Code:
function onSay(cid, words, param)
playerpos = getPlayerPosition(cid)
mana = getPlayerMana(cid)
vocation = getPlayerVocation(cid)
if mana >= 30000 and vocation == 51 or vocation == 52 or vocation == 53 or vocation == 274 or vocation == 276 or vocation == 277 or vocation == 278 or vocation == 471 then
creature = doSummonCreature("Summon Cell JR", playerpos)
doConvinceCreature(cid, creature)
doPlayerAddMana(cid, -30000)
else
doPlayerSendCancel(cid,"You do not have enough mana") 
end
end
mam jeszcze taki skrypt czemu on niedziala ;/ niema zadnych bledow w konsoli
Szybol cos niedziala
Code:
-- Szybol OTS Engine --
Vocations = {338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 491}
Monster = {'summon kid janemba'}
function onSay(cid, words, param)
local name = tostring(param)
if(isInArray(Vocations,getPlayerVocation(cid)) == TRUE and isInArray(Monster,name) == TRUE)then
doSummonCreature(name, getCreaturePosition(cid))
doConvinceCreature(cid, Monster)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, words.." "..param)
else
doPlayerSendCancel(cid, "You can not execute this command.")
end
return true
end
Code:
<talkaction words="make" script="summon.lua" />
i pisze can no execute this command a mam dobra profesje
Notka moderatorska:
??cz? posty.
 
Last edited by a moderator:

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Summon ! Monsters!

Czy Ty w swoim silniku masz ponad 150 profesji? Podtabela voc wczytuje id profesji, dla przyk?adu knight ma voc r?wn? 4, czyli ta podtabela powinna wygl?da? tak voc={4}
Sprawd? czy wszystko dobrze wpisa?e?, gdy? konsola powiadamia i? nie mo?e wczyta? profesji.

A w drugim skrypcie brakuje return true
 
Last edited:

Vvex

Banned
Joined
Jun 28, 2009
Messages
460
Reaction score
91
Odp: Summon ! Monsters!

Code:
Vocations = {1, 2, 3, 4} -- tutaj wpisujemy profesje
Monster = {'demon'}-- tutaj wpisujemy monsterki
function onSay(cid, words, param)
local name = tostring(param)
if(isInArray(Vocations,getPlayerVocation(cid)) == TRUE and isInArray(Monster,name) == TRUE)thend
oSummonCreature(monster, getPlayerPosition(cid),1) 
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, words.." "..param)
else
doPlayerSendCancel(cid, "You can not execute this command.")
end
return true
end

Powinno dzia?a?.
Po za tym, oskara skrypt jest 100% dobry!
 

DJSOJA1991

Banned
Joined
Sep 6, 2008
Messages
173
Reaction score
4
Odp: Summon ! Monsters!

Czy Ty w swoim silniku masz ponad 150 profesji? Podtabela voc wczytuje id profesji, dla przyk?adu knight ma voc r?wn? 4, czyli ta podtabela powinna wygl?da? tak voc={4}
Sprawd? czy wszystko dobrze wpisa?e?, gdy? konsola powiadamia i? nie mo?e wczyta? profesji.
A w drugim skrypcie brakuje return true
mam ponad 490 profesji mam silnik wodbo ^^
EDIT HELP!
Code:
function onSay(cid, words, param)
playerpos = getPlayerPosition(cid)
mana = getPlayerMana(cid)
vocation = getPlayerVocation(cid)
if mana >= 30000 and vocation == 51 or vocation == 52 or vocation == 53 or vocation == 274 or vocation == 276 or vocation == 277 or vocation == 278 or vocation == 471 then
creature = doSummonCreature("Summon Cell JR", playerpos)
doConvinceCreature(cid, creature)
doPlayerAddMana(cid, -30000)
else
doPlayerSendCancel(cid,"You do not have enough mana") 
end
return true
end


Czemu moge robic ile chce ? w config mam

-- how many summons player can have
maxsummons = 2
 
Last edited:

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Summon ! Monsters!

Wi?c prawdopodobnie nie posiadasz funkcii isInArray. Zast?p j? funkcj? getPlayerVocation(cid) == 52 i wtedy sprawd? czy dzia?a.
W drugim skrypcie nie masz zadeklarowane, ?e gracz mo?e co najwy?ej dwa potwory przywo?a?. Jak wr?c? do domu to poprawie Ci tamten skrypt.
 

DJSOJA1991

Banned
Joined
Sep 6, 2008
Messages
173
Reaction score
4
Odp: Summon ! Monsters!

Jak Zdeklarowac ile mozna miec summonow ? chcialbym nam zeby mozna bylo 3
function onSay(cid, words, param)
playerpos = getPlayerPosition(cid)
mana = getPlayerMana(cid)
vocation = getPlayerVocation(cid)
if mana >= 30000 and vocation == 51 or vocation == 52 or vocation == 53 or vocation == 274 or vocation == 276 or vocation == 277 or vocation == 278 or vocation == 471 then
creature = doSummonCreature("Summon Cell JR", playerpos)
doConvinceCreature(cid, creature)
doPlayerAddMana(cid, -30000)
else
doPlayerSendCancel(cid,"You do not have enough mana")
end
return true
end
function onSay(cid, words, param)
playerpos = getPlayerPosition(cid)
mana = getPlayerMana(cid)
vocation = getPlayerVocation(cid)
if mana >= 25000 and vocation == 338 or vocation == 339 or vocation == 340 or vocation == 341 or vocation == 342 or vocation == 343 or vocation == 344 or vocation == 345 or vocation == 346 or vocation == 347 or vocation == 491 then
creature = doSummonCreature("Summon Kid Janemba", playerpos)
doConvinceCreature(cid, creature)
doPlayerAddMana(cid, -2500)
else
doPlayerSendCancel(cid,"You do not have enough mana")
end
return true
end

Mam 2 skrypty pomocy ;/
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Summon ! Monsters!

PHP:
local summons = getCreatureSummons(cid)
if(table.maxn(summons) <= 2) then
I maksymalna ich ilo?? r?wna jest 3.
 
Top