Quomak
Senior User
- Dołączył
- Lipiec 15, 2010
- Posty
- 631
- Liczba reakcji
- 39
- Wiek
- 11
Witam!
Znalazlem u siebie w silniku pare skryptow i pomyslalem ze przydadza sie one i wam
Wiec zacznijmy
1.Toporek ktorym mozemy zucac
W weapons.xml
Teraz zawarto?? pliku siekierka.lua
2.NPC Ksiadz
W data/npc robimy pilk o nazwie Ksiadz.xml
Teraz w data/npc/scripts robimy plik o nazwie slub.lua
3.BP POTOW I RUNEK
data/npc/ tworzysz Maximus.xml
Nast?pnie data/npc/scripts runki.lua
4.Wand Of God (God jako Bog nie administracja
)
Wchodzimy w data/items/items.xml
naciskamy ctrl+f wpisujemy 7451
Wychodzi:
Zamieniamy:
Nast?pnie w data/weapons/scripts tworzymy plik o nazwie Godhand.lua
(MINIMALNY DMG MAxymalny DMG)
Nast?pnie otwieramy data/weapons/weapons.xml
Znalazlem u siebie w silniku pare skryptow i pomyslalem ze przydadza sie one i wam

Wiec zacznijmy

1.Toporek ktorym mozemy zucac
W weapons.xml
Kod:
<distance id="2447" range="8" enabled="1" exhaustion="0" hitchance="100" ammo="removecount" script="siekierka.lua"></distance>
Kod:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 25)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 0, 0)
function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end
W data/npc robimy pilk o nazwie Ksiadz.xml
Kod:
<?xml version="1.0"?>
<npc name="Ksiadz" script="data/npc/scripts/slub.lua" access="3" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="57" head="20" body="30" legs="40" feet="50"/>
</npc>
Kod:
---Ksiadz---
focus1 = 0
focus2 = 0
talk_start = 0
target = 0
following = false
attacking = false
talkstate = 0
moved=0
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(id, stackpos)
if id == focus1 or id == focus1 then
ceremonyend('Z Panem Bogiem !'
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')
end
function ceremonyend(msg)
focus1 = 0
focus2 = 0
talk_start = 0
talkstate = 0
selfSay(msg)
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if talkstate == 1 then
if cid == focus2 then
if msgcontains(msg, 'tak' then
talkstate=2
selfSay('' .. creatureGetName(focus1) .. ' Powinienem rozpoczac ceremonie?'
else
ceremonyend('Wroccie kiedy bedziecie gotowi..'
end
end
end
if talkstate == 2 then
if cid == focus1 then
if msgcontains(msg, 'tak' then
talkstate=3
else
ceremonyend('Wroccie kiedy bedziecie gotowi.'
end
end
end
if talkstate == 9 then
if cid == focus1 then
if string.find(msg, '(%a*)tak(%a*)' then
talkstate=10
else
ceremonyend('Wroccie kiedy bedziecie gotowi.'
end
end
end
if talkstate == 11 then
if cid == focus2 then
if string.find(msg, '(%a*)tak(%a*)' then
talkstate=12
else
ceremonyend('Wroccie kiedy bedziecie gotowi.'
end
end
end
if msgcontains(msg, 'hi' and focus1 > 0 and focus2 == 0 and not(cid==focus1) and isPromoted(cid) and getDistanceToCreature(cid) < 4 then
if getPlayerStorageValue(cid,2001) == -1 then
selfSay('Witam, ' .. creatureGetName(cid) .. '! Jestem ksiedzem z Wieliszewa. Powinienem zaczac ceremonie?'
focus2 = cid
talk_start = os.clock()
talkstate=1
else
selfSay('Jestes po ceremonii slubu!'
end
end
if msgcontains(msg, 'hi' and focus1 == 0 and isPromoted(cid) and getDistanceToCreature(cid) < 4 then
if getPlayerStorageValue(cid,2001) == -1 then
selfSay('Witam, ' .. creatureGetName(cid) .. '! Jestem ksiedzem z Wieliszewa. Moge udzielic slubu Tobie i Twojej wybrance lub wybrankowi.'
focus1 = cid
talk_start = os.clock()
else
selfSay('Jestes juz po slubie.'
end
end
if msgcontains(msg, 'wieliszew' and (focus1 == cid or focus2 == cid) then
selfSay('Wieliszew to mala miejscowosc, w ktorej wyroslem na to, czym jestem.'
talk_start = os.clock()
end
if string.find(msg, '(%a*)bye(%a*)' and (focus1 == cid or focus2 == cid) and getDistanceToCreature(cid) < 6 then
ceremonyend('Z Panem Bogiem ! ' .. creatureGetName(cid) .. '!'
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if talkstate==3 and (os.clock() - talk_start) > 10 then
selfSay('Polozcie tu swoje obraczki na znak swojej wiary.';
talk_start = os.clock()
talkstate=4
end
if talkstate==4 and (os.clock() - talk_start) > 6 then
selfSay('Stoicie tu teraz razem, poniewaz udzielacie sie w przybyciu swojej przyszlosci..';
talk_start = os.clock()
talkstate=5
end
if talkstate==5 and (os.clock() - talk_start) > 6 then
selfSay('Przeszlosc jest przeszloscia. Zarodki jednak kwitna, z troska i zaufaniem....';
talk_start = os.clock()
talkstate=6
end
if talkstate==6 and (os.clock() - talk_start) > 8 then
selfSay('Uczciwosc i zyczliwosc, sa owocami milosci.';
talk_start = os.clock()
talkstate=7
end
if talkstate==7 and (os.clock() - talk_start) > 6 then
selfSay('Zatem niech Pan Bog blogoslawi ten dzien i zawsze wzbogacac bedzie Wasza milosc... bez konca.';
talk_start = os.clock()
talkstate=8
end
if talkstate==8 and (os.clock() - talk_start) > 6 then
selfSay(creatureGetName(focus1) .. ' Czy Ty obiecujesz ' .. creatureGetName(focus2) .. ' w obecnosci wyslannika Bozego ... w dobrej... i zlej doli... w bogactwie... czy biedzie... w chorobie i zdrowiu... MILOSC... WIERNOSC... I UCZCIWOSC MALZENSKA?';
talk_start = os.clock()
talkstate=9
end
if talkstate==10 and (os.clock() - talk_start) > 6 then
selfSay(creatureGetName(focus2) .. ' Czy Ty obiecujesz ' .. creatureGetName(focus1) .. ' w obecnosci wyslannika Bozego... w dobrej... i zlej doli... w bogactwie... czy biedzie... w chorobie i zdrowiu... MILOSC... WIERNOSC... I UCZCIWOSC MALZENSKA?';
talk_start = os.clock()
talkstate=11
end
if talkstate==12 and (os.clock() - talk_start) > 6 then
setPlayerStorageValue(focus2,2001,1)
setPlayerStorageValue(focus1,2001,1)
ceremonyend('Oglaszam was MEZEM i ZONA ! Zalozcie obraczki.. Niech Pan ma was w swojej opiece.';
talk_start = os.clock()
end
if (os.clock() - talk_start) > 100 then
if focus1 > 0 or focus2 > 0 then
ceremonyend('Z Panem Bogiem !'
end
end
--if moved==0 then
--x, y, z = selfGetPosition()
--moveToPosition(x+1, y, z)
--moved=1
--end
end
data/npc/ tworzysz Maximus.xml
Kod:
<?xml version="1.0"?>
<npc name="Maximus" script="data/npc/scripts/runki.lua" access="3" lookdir="2" autowalk="1">
<mana now="666" max="666"/>
<health now="200" max="200"/>
<look type="134" head="114" body="113" legs="113" feet="113"/>
</npc>
Kod:
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function onCreatureSay(cid, type, msg)
local msg = string.lower(msg)
if msgcontains(msg, 'yo') and focus == 0 and getDistanceToCreature(cid) < 4 then
selfSay('Hello ' .. creatureGetName(cid) .. '! Sellam backpacki run (bp runes).')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'yo') and focus ~= cid and getDistanceToCreature(cid) < 4 then
selfSay('Przepraszam, ' .. creatureGetName(cid) .. '! czekaj chwile!.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'backpacks') or msgcontains(msg, 'bp runes') then
selfSay('Selluje bp hmm (20k), bp uh (20k), bp gfb (20k), bp explosion (20k), bp sd (20k), bp mwall(20k), BP MANA POTION, HEALTH POTION, STRONG MANA POTION, GREAT MANA POTION, GREAT HEALTH POTION, STRON HEALTH POION')
elseif msgcontains(msg, 'bp sd') then
buyContainer(cid,2003,2268,10,100000)
elseif msgcontains(msg, 'bp hmm') then
buyContainer(cid,1998,2311,100,100000)
elseif msgcontains(msg, 'bp uh') then
buyContainer(cid,2002,2273,10,100000)
elseif msgcontains(msg, 'bp gfb') then
buyContainer(cid,2000,2304,100,100000)
elseif msgcontains(msg, 'bp explosion') or msgcontains(msg, 'bp explo') then
buyContainer(cid,2001,2313,100,100000)
elseif msgcontains(msg, 'bp mwall') then
buyContainer(cid,1999,2293,100,100000)
elseif msgcontains(msg, 'bp strong health potion') then
buyContainer(cid,1999,7588,1,100000)
elseif msgcontains(msg, 'bp strong mana potion') then
buyContainer(cid,1999,7589,1,200000)
elseif msgcontains(msg, 'bp mana potion') then
buyContainer(cid,1999,7620,1,200000)
elseif msgcontains(msg, 'bp health potion') then
buyContainer(cid,1999,7618,1,200000)
elseif msgcontains(msg, 'bp great mana potion') then
buyContainer(cid,1999,7590,1,200000)
elseif msgcontains(msg, 'bp great health potion') then
buyContainer(cid,1999,7591,1,200000)
elseif string.find(msg, '(%a*)nara(%a*)') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Nastepny...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('No narka.')
focus = 0
end
end
end

Wchodzimy w data/items/items.xml
naciskamy ctrl+f wpisujemy 7451
Wychodzi:
Kod:
<item id="7451" name="">
<attribute key="weight" value="0"/>
</item>
Kod:
<item id="7451" article="a" name="Death Hand God">
<attribute key="description" value="God make this wand to help Sorcerers in fight with demons."/>
<attribute key="weight" value="3050"/>
<attribute key="weaponType" value="wand"/>
<attribute key="range" value="3"/>
Kod:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, [COLOR="DarkOrange"]-90[/COLOR], 0, [COLOR="Yellow"]-110[/COLOR])
function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end
Nast?pnie otwieramy data/weapons/weapons.xml
Kod:
<wand id="7451" range="3" lvl="41" mana="16" enabled="1" exhaustion="0" script="Godhand.lua"><vocation id="1"/><vocation id="5"/></wand>