Gubailovo
Well-Known Member
- Joined
- Dec 19, 2013
- Messages
- 409
- Solutions
- 2
- Reaction score
- 66
клиентская версия 7.6 I do not know the server version (it is completely remade) such programs were used
( Installer2Go ver.4.1.3 * Wombat Game Tools 0.4a MonsterEditor 1.5.5.666 Packman 2.2.6 * devc++ IDE 5.2.0.3 and other programs)

example script
not able to save the character not the map
how to create a database (tilelist)
how to enable the function /i of GOD
( Installer2Go ver.4.1.3 * Wombat Game Tools 0.4a MonsterEditor 1.5.5.666 Packman 2.2.6 * devc++ IDE 5.2.0.3 and other programs)

example script
LUA:
--::::::::::::::::::::::::::::::::::::::::
--System name: Darkonia RPG
--Short Desc: old-style MMoRPG
--Version: 5.0
--Authors: Torian Kel
--Date: 16 октября, 2012
--Modul Desc: скрипт создания доспехов
--::::::::::::::::::::::::::::::::::::::::
ID_LABEL = 2599
ID_TOOL = 5573
ID_ANVIL = 2555
NEED_FOOD = 100
function onUse(cid, item, frompos, item2, topos)
food = getPlayerFood(cid)
-- проверка на задержку
if exhaust(cid, 6501, 1) ~= 1 then
return 0
end
-- изучен ли крафт
if haveCraft(cid, CRAFT_ARMORSMITH) ~= 1 then
doPlayerSendTextMessage(cid, 22, "Ты не знаешь что с этим делать. Тебе нужно изучить " .. getCraftName(CRAFT_ARMORSMITH))
return 1
end
-- голод
if getPlayerFood(cid) < NEED_FOOD then
doPlayerSendTextMessage(cid, 22, "Ты не можешь работать голодным.")
return 1
end
-- Проверяем рядом ли наковальня
if isCloseItem(cid, ID_ANVIL) == 0 then
doPlayerSendTextMessage(cid, 22, "Ты должен находиться рядом с наковальней.")
return 1
end
-- проверка на инструмент в руке
if getSlotItem(cid,6) ~= ID_TOOL then
doPlayerSendTextMessage(cid,22,"Для работы инструмент нужно взять в правую руку.")
return 1
end
-- проверка метки
if (getSlotItem(cid, 5) ~= ID_LABEL) then
doPlayerSendTextMessage(cid,22,"Положите метку с названием предмета в левую руку.")
return 1
end
-- юзаем инструмент на наковальню
if item2.itemid ~= ID_ANVIL then
doPlayerSendTextMessage(cid, 22, "Используйте инструмент на наковальне.")
return 1
end
recipe_name = getSlotItemText(cid,5)
recipe = getRecipeId(recipe_name)
if (recipe ~= 0 and isLearned(cid,recipe) == 1) then
craft_id = getRecipeSkillType(recipe)
recipe_skill_lvl = getRecipeSkillLevel(recipe)
-- получаем текщее состояние
currentTries = getCraftTries(cid, CRAFT_ARMORSMITH)
skill_level = getCraftLevel(cid, CRAFT_ARMORSMITH)
needTries = calcNeedRecipeTries(skill_level)
-- проверяем тип выбраного рецепта
if craft_id ~= CRAFT_ARMORSMITH then
doPlayerSendTextMessage(cid,22,"Этот предмет делают не бронники.")
return 1
end
-- проверяем хватает ли мастерства
if skill_level < recipe_skill_lvl then
doPlayerSendTextMessage(cid,22,"Вам не хватает мастерства.")
return 1
end
-- пытаемся изъять материалы, если удачно - даем вещь
if doPlayerRemoveItembyRecipe(cid, getMaterials(recipe)) == 1 then
uid = doPlayerAddItem(cid, getItembyRecipe(recipe),1)
doSetItemSpecialDescription(uid, 'Эта вещь изготовлена ' .. getPlayerName(cid) .. '. ')
doPlayerAddExp(cid, (recipe_skill_lvl+1)*20)
doSendAnimatedText(frompos, (recipe_skill_lvl+1)*20, 215)
-- прокачаем лвл
if currentTries + 1 >= needTries then
doPlayerSendTextMessage(cid, 22, "Ты увеличил навык бронника с " .. skill_level .. " до " .. (skill_level+1) .. " !")
setCraftLevel(cid, CRAFT_ARMORSMITH, skill_level + 1)
setCraftTries(cid, CRAFT_ARMORSMITH, 0)
else
setCraftTries(cid, CRAFT_ARMORSMITH, currentTries + 1)
end
--Снимаем 1 заряд с наковальни
removeCharge(cid, item2.uid)
else
doPlayerSendTextMessage(cid,22,"Вам не хватает материалов.")
return 1
end
else
doPlayerSendTextMessage(cid,22,"В вашей книге нет такого рецепта.")
return 1
end
return 1
end
LUA:
-- 5173 - кольцо духа гор
function doMining(cid,item_id,skill_level,item_str)
if getSlotItem(cid,9) == 5173 then
random_number = math.random(1,(540/getMasterLvl(cid,1)))
else
random_number = math.random(1,(840/getMasterLvl(cid,1)))
end
if random_number<=skill_level then
doPlayerSendTextMessage(cid,22,"Ты нашел " .. item_str .. ".") -- сапфир
doPlayerAddItem(cid,item_id,1)--2146
doPlayerAddExp(cid,10)
doSendAnimatedText(frompos,10,215)
end
if random_number >= 300 and random_number <= 310 and getSlotItem(cid,9) ~= 5173 then
doRemoveItem(item.uid,2422)
doPlayerSendTextMessage(cid,22,"Ты сломал инструмент.")
end
doPlayerFeed(cid,-15)
if doAddKraftSkillTry(cid,1,1) == 1 then
doPlayerSendTextMessage(cid,22,"Ты увеличил навык добыча с " .. skill_level .. " до " .. skill_level+1 .. " ")
end
end
function onUse(cid, item, frompos, item2, topos)
Food = getPlayerFood(cid)
skill_level = getKraftSkillLevel(cid,1)
if skill_level >= 0 and (exhaust(cid, 6501, 1) == 1 or getSlotItem(cid,9) == 5173) then
if getSlotItem(cid,5) == 2422 or getSlotItem(cid,6) == 2422 then
if Food >= 100 then
if item2.itemid == 3616 then
doSendMagicEffect(topos,3)
doMining(cid,2147,skill_level,"рубин")
elseif item2.itemid == 5377 then
doSendMagicEffect(topos,3)
doMining(cid,2149,skill_level,"изумруд")
elseif item2.itemid == 5694 then
doSendMagicEffect(topos,3)
doMining(cid,2146,skill_level,"сапфир")
elseif item2.itemid == 5536 then
doSendMagicEffect(topos,3)
doMining(cid,2150,skill_level,"аметист")
elseif item2.itemid == 386 or item2.itemid == 387 then
doSendMagicEffect(topos,3)
doMining(cid,5141,skill_level,"соль")
else
doPlayerSendTextMessage(cid,22,"Здесь ты ничего не добудешь.")
return 1
end
else
doPlayerSendTextMessage(cid,22,"Как можно работать на голодный желудок?")
return 1
end
else
doPlayerSendTextMessage(cid,22,"Для добычи инструмент нужно взять в руку.")
return 1
end
else
doPlayerSendTextMessage(cid,22,"Молот то тяжелый - так быстро бить не получится.")
return 1
end
return 1
end
LUA:
focus = 0
talk_start = 0
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('До свидания, ' .. creatureGetName(focus) .. '!')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
cname = creatureGetName(cid)
Level = getPlayerInfo(cid,1)
dist = getDistanceToCreature(cid)
if dist >= 4 then
return
end
---------------------------------- POWITANIE RU --------------------------------------------
if string.find(msg, '(%a*)привет(%a*)') and string.len(msg) == 6 then
if focus == cid then
selfSay('Я уже говорю с тобой!')
else
if focus > 0 then
selfSay('' .. cname .. ', подожди своей очереди!')
end
end
if(focus == 0) then
selfSay('Привет, ' .. cname .. '! Я глава Королевских Паладинов. Я продаю заклинания для войнов и паладинов. Так же я могу дать тебе профессию воин и даю задания. Чтобы торговать со мной зажми клавишу ALT и кликни на меня! [профа] [квест]')
focus = cid
end
talk_start = os.clock()
end
---------------------------------- POWITANIE ENG--------------------------------------------
if string.find(msg, '(%a*)hi(%a*)') and string.len(msg) == 2 then
if focus == cid then
selfSay('Im already talking to you!')
else
if focus > 0 then
selfSay('' .. cname .. ', wait for your turn!')
end
end
if(focus == 0) then
selfSay('Hello, ' .. cname .. '! I am boss of warriors guild. I am selling some and spells for warriors. To buy something from me hold ALT key and click on me!')
focus = cid
end
talk_start = os.clock()
end
--------------------------------- POZEGNANIA ---------------------------------------
if string.find(msg, '(%a*)пока(%a*)') and cid == focus then
selfSay('До свидания, ' .. cname .. '!')
focus = 0
itemid = 0
talk_start = 0
talkcount = 0
end
if string.find(msg, '(%a*)bye(%a*)') and cid == focus then
selfSay('Farewell, ' .. cname .. '!')
focus = 0
itemid = 0
talk_start = 0
talkcount = 0
end
------------------------------- GADANIE RU----------------------------------------------
if string.find(msg, '(%a*)проф(%a*)') and cid == focus then
if getPlayerVocation(cid) == VOCATION_NONE then
selfSay('Ты действительно хочешь получить профессию Воин?')
talkcount = 3
else
selfSay('У тебя уже есть профессия.')
end
talk_start = os.clock()
end
if string.find(msg, '(%a*)да(%a*)') and talkcount == 3 and cid == focus then
if Level >= 8 then
selfSay('Теперь ты воин.')
setPlayerVocation(cid, VOCATION_KNIGHT)
doPlayerAddItem(cid, COOPER_SHIELD, 1)
talkcount = 0
else
selfSay('Ты должен достичь 8 уровня для получения профессии.')
end
talk_start = os.clock()
end
if (string.find(msg, '(%a*)квес(%a*)') or string.find(msg, '(%a*)задан(%a*)') or string.find(msg, '(%a*)мисси(%a*)')) and (cid == focus) then
if getCurrentMission(cid)==0 then
missionid = getMission(Level)
if missionid > 0 then
selfSay(getMissionText(missionid))
setCurrentMission(cid, missionid)
setPlayerComment(cid, getSelfName())
missiontype = getMissionType(missionid)
if (missiontype == MISSION_COURIER) and (getMissionWay(missionid) == MISSION_WAY_FROM) then
doPlayerAddItem(cid, getMissionItem(missionid), getMissionItemCount(missionid))
end
if (missiontype == MISSION_COMBAT) then
addMissionBlock(cid, missionid)
sendToMissionStartPos(cid, missionid)
end
else
selfSay('Извини, я не могу дать тебе задание.') --ошибка выбора миссии
end
else
selfSay('Извини, но у тебя уже есть задание. Выполни его и приходи.')
end
talk_start = os.clock()
end
-- сдаем миссию
if (string.find(msg, '(%a*)законч(%a*)') or string.find(msg, '(%a*)сдат(%a*)') or string.find(msg, '(%a*)выполн(%a*)')) and (cid == focus) then
missionid = getCurrentMission(cid)
writeToLog(getSelfName()..': сдача квеста №' .. missionid .. ' персонажем ' .. creatureGetName(cid) .. ' метка '..getPlayerComment(cid))
--проверяем есть ли у человека миссия и кто ее давал
if (missionid > 0) and (getPlayerComment(cid)==getSelfName()) then
missiontype = getMissionType(missionid)
--Проверка первых двух типов миссий практически идентична
if (missiontype == MISSION_LOOT) or (missiontype == MISSION_COURIER) then
missionitem = getMissionItem(missionid)
itemstatus = doPlayerRemoveItem(cid, missionitem, getMissionItemCount(missionid))
writeToLog(getSelfName()..': missionitem-' .. missionitem .. ' count-' .. getMissionItemCount(missionid) .. ' itemstatus '..itemstatus)
if(itemstatus < 1) then --Если предмет забрать не удалось
--здесь отрабатываем разницу в заданиях - подсказки разные
if missiontype == 1 then
selfSay('Извини, но ты еще не выполнил моего задания. Принеси мне ' .. getItemName(missionitem) .. ', неужели это так сложно?')
else
selfSay('Извини, но ты еще не выполнил моего задания. Сходи к ' .. getMissionTargetNPC(missionid) .. ', неужели это так сложно?')
end
else
payMissPrice(cid,missionid)
addGlory(cid, MISSION_GLORY, getMissionGlory(missionid))
setCurrentMission(cid,0) --не забыть это делать каждый раз
end
elseif missiontype == MISSION_COMBAT then
if getPlayerStorageValue(cid, MISSION_END)==1 then --
if getMissionItem(missionid) > 0 then
itemstatus = doPlayerRemoveItem(cid,getMissionItem(missionid),getMissionItemCount(missionid))
if(itemstatus == 0)then
selfSay('Хорошо, ты убил всех, но где ' ..getItemName(getMissionItem(missionid)).. ' который я просил тебя принести? Хочешь чтобы я опять отправил тебя в зону квеста?')
talkcount = 4
else
payMissPrice(cid,missionid)
addGlory(cid, MISSION_GLORY, getMissionGlory(missionid))
setCurrentMission(cid,0) --не забыть это делать каждый раз
setPlayerStorageValue(cid, MISSION_END, 0)
end
else
payMissPrice(cid,missionid)
addGlory(cid, MISSION_GLORY, getMissionGlory(missionid))
setCurrentMission(cid,0) --не забыть это делать каждый раз
setPlayerStorageValue(cid, MISSION_END, 0)
end
else
selfSay('Извини, но ты еще не выполнил моего задания. Хочешь чтобы я опять отправил тебя в зону квеста?')
talkcount = 4
end
end
else
selfSay('Извини, но я не давал тебе задания.')
end
talk_start = os.clock()
end
if (string.find(msg, '(%a*)отмен(%a*)') or string.find(msg, '(%a*)отказ(%a*)')) and (cid == focus) then
missionid = getCurrentMission(cid)
if (missionid > 0) and (getPlayerComment(cid)==getSelfName()) then
selfSay('Если ты откажешься от задания ты потеряешь часть заработанной славы, ты действительно хочешь отказаться от задания?')
talkcount = 5
else
selfSay('Извини, но я не давал тебе задания.')
end
talk_start = os.clock()
end
if string.find(msg, 'да') and talkcount == 5 and cid == focus then
missionid = getCurrentMission(cid)
selfSay('Ты сделал выбор.')
addGlory(cid, MISSION_GLORY, -1 * getMissionGlory(missionid))
setPlayerStorageValue(cid, MISSION_END, 0)
setCurrentMission(cid,0) --не забыть это делать каждый раз
remMissionBlock(missionid)
resetMissionMarkers(cid)
talkcount = 0
talk_start = os.clock()
end
if string.find(msg, '(%a*)я от(%a*)') and cid == focus then
missionid = getCurrentMission(cid)
missionitem = getMissionItem(missionid)
if (getMissionType(missionid) == MISSION_COURIER) and (getMissionTargetNPC(missionid) == getSelfName()) then
if (getMissionWay(missionid) == MISSION_WAY_FROM) then
itemstatus = doPlayerRemoveItem(cid, missionitem, getMissionItemCount(missionid))
if(itemstatus == 0) then
selfSay('Привет, ты наверное курьер от ' .. getPlayerComment(cid) .. ', но ты не принес мне ' .. getItemName(missionitem) .. '!!')
else
pay = getMissionPay(missionid)
if getPayType(missionid) == PAY_GOLD then
setPlayerStorageValue(cid, BANK_GOLD, getPlayerStorageValue(cid, BANK_GOLD)+pay)
selfSay('Привет, ты наверное курьер от ' .. getPlayerComment(cid) .. ', спасибо что принес мне ' .. getItemName(missionitem) .. '. Спасибо тебе, твоя награда - ' .. pay .. ' золота, они перечислены на твой счет в банке Иваланны.')
elseif getPayType(missionid) == PAY_EXP then
addPlayerExp(cid, pay)
selfSay('Привет, ты наверное курьер от ' .. getPlayerComment(cid) .. ', спасибо что принес мне ' .. getItemName(missionitem) .. '. Спасибо тебе герой, твоя награда - ' .. pay .. ' опыта.')
elseif getPayType(missionid) == PAY_ITEM then
doPlayerAddItem(cid, pay, 1)
selfSay('Привет, ты наверное курьер от ' .. getPlayerComment(cid) .. ', спасибо что принес мне ' .. getItemName(missionitem) .. '. Спасибо тебе герой, твоя награда - ' .. getItemName(pay) .. '.')
end
addGlory(cid, MISSION_GLORY, getMissionGlory(missionid))
setCurrentMission(cid,0) --не забыть это делать каждый раз
end
else
doPlayerAddItem(cid,missionitem,getMissionItemCount(missionid))
selfSay('Привет, ты наверное курьер от ' .. getPlayerComment(cid) .. ', держи - это ' .. getItemName(missionitem) .. '. Ты должен доставить эту вещь ' .. getPlayerComment(cid) .. ' и получишь за это достойную награду!!!')
end
end
talk_start = os.clock()
end
if string.find(msg, 'да') and talkcount == 4 and cid == focus then
selfSay('Счастливого пути ;) .')
missionid = getCurrentMission(cid)
sendToMissionStartPos(cid, missionid)
addMissionBlock(cid, missionid)
talkcount = 0
talk_start = os.clock()
end
if string.find(msg, '(%a*)нет(%a*)') and cid == focus then
selfSay('Ну ладно, ты что-то еще хотел?.')
talkcount = 0
talk_start = os.clock()
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('До свидания, ' .. creatureGetName(focus) .. '!')
end
focus = 0
talk_start = 0
end
if focus > 0 then
dist = getDistanceToCreature(focus)
if dist >= 6 then
selfSay('До свидания, ' .. creatureGetName(focus) .. '!')
focus = 0
talk_start = 0
end
end
end
XML:
<?xml version="1.0"?>
<npc name="Hellkar" script="data/npc/scripts/Hellkar.lua" access="3" lookdir="3">
<look type="118" head="95" body="114" legs="114" feet="114"/>
<shop>
<!-- knight's spells -->
<item type="2" id="1967" promospell="0" spelllvl="8" price="1000" sname="utevo lux"/>
<item type="2" id="1967" promospell="0" spelllvl="8" price="800" sname="exiva"/>
<item type="2" id="1967" promospell="0" spelllvl="8" price="1500" sname="utamo magic"/>
<item type="2" id="1967" promospell="0" spelllvl="9" price="1700" sname="exura"/>
<item type="2" id="1967" promospell="0" spelllvl="9" price="2000" sname="exani tera"/>
<item type="2" id="1967" promospell="0" spelllvl="10" price="1500" sname="exana pox"/>
<item type="2" id="1967" promospell="0" spelllvl="10" price="2000" sname="utamo gran magic"/>
<item type="2" id="1967" promospell="0" spelllvl="12" price="5000" sname="exani hur"/>
<item type="2" id="1967" promospell="0" spelllvl="13" price="5000" sname="utevo gran lux"/>
<item type="2" id="1967" promospell="0" spelllvl="14" price="6000" sname="utani hur"/>
<item type="2" id="1967" promospell="1" spelllvl="20" price="20000" sname="exeta res"/>
<item type="2" id="1967" promospell="0" spelllvl="25" price="13000" sname="utani tempo hur"/>
<item type="2" id="1967" promospell="0" spelllvl="30" price="3000" sname="exana mort"/>
<item type="2" id="1967" promospell="0" spelllvl="32" price="40000" sname="utito mas sio"/>
<item type="2" id="1967" promospell="0" spelllvl="33" price="15000" sname="exori mas"/>
<item type="2" id="1967" promospell="0" spelllvl="35" price="25000" sname="exori"/>
<item type="2" id="1967" promospell="0" spelllvl="55" price="60000" sname="utamo tempo"/>
<item type="2" id="1967" promospell="0" spelllvl="60" price="80000" sname="utito tempo"/>
<item type="2" id="1967" promospell="0" spelllvl="70" price="50000" sname="exori gran"/>
<item type="1" id="2429" price="2000"/> <!-- barbarian axe -->
<item type="1" id="5104" price="2000"/> <!-- crows beak -->
<item type="1" id="3962" price="1500"/> <!-- lizard axe -->
<item type="1" id="5115" price="1500"/> <!-- headhunter axe -->
<item type="1" id="2378" price="800"/> <!-- battle axe -->
<item type="1" id="2428" price="800"/> <!-- orc axe -->
<item type="1" id="2413" price="2000"/> <!-- shirokiy sword -->
<item type="1" id="2384" price="2000"/> <!-- rapira -->
<item type="1" id="2383" price="1500"/> <!-- Spiked sword -->
<item type="1" id="2419" price="1500"/> <!-- yataghan -->
<item type="1" id="2397" price="800"/> <!-- long sword -->
<item type="1" id="5134" price="800"/> <!-- Quietwater Sword -->
<item type="1" id="2394" price="2000"/> <!-- morning star -->
<item type="1" id="2417" price="1500"/> <!-- battle hammer -->
<item type="1" id="2439" price="1500"/> <!-- stone bulava -->
<item type="1" id="2452" price="800"/> <!-- heavy bulava -->
<item type="1" id="2398" price="800"/> <!-- bulava -->
</shop>
</npc>
not able to save the character not the map
how to create a database (tilelist)
how to enable the function /i of GOD
Last edited: