Djin

Status
Zamknięty.

Gucior

Active User
Zarejestrowany
Dołączył
Kwiecień 6, 2008
Posty
76
Liczba reakcji
7
Witam.

OTS/data/NPC
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Shad" script="data/npc/scripts/SellEliteLoot.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="51" head="78" body="88" legs="0" feet="88" addons="3"/>
</npc>

OTS/data/npc/scripts/SellEliteLoot.lua
PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid)				npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) 			npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) 	npcHandler:onCreatureSay(cid, type, msg) end
function onThink() 						npcHandler:onThink() end
npcHandler:setMessage(MESSAGE_GREET, "Greetings |PLAYERNAME|. Im selling elite loot only for good players. Did you do djin quest ? Say {trade}.")
function selleliteloot(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    queststatus = getPlayerStorageValue(cid,10576)
    if (parameters.confirm ~= true) and (parameters.decline ~= true) then
	if queststatus == -1 then
            npcHandler:say('Sorry, but you dont did djin quest!', cid)
            npcHandler:resetNpc()
            return false
	end
    end
    return false
end
local noNode = KeywordNode:new({'no'}, playerBuyAddonNPC, {decline = true})
local yesNode = KeywordNode:new({'yes'}, playerBuyAddonNPC, {confirm = true})
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addSellableItem({'serpent sword'}, 2409, 900, 'serpent sword') 
shopModule:addSellableItem({'dragonbone staff'}, 7430, 2500, 'dragonbone staff')
shopModule:addSellableItem({'giant sword'}, 2393, 17000, 'giant sword')
shopModule:addSellableItem({'ice rapier'}, 2396, 1000, 'ice rapier') 
shopModule:addSellableItem({'fire sword'}, 2392, 4000, 'fire sword')
shopModule:addSellableItem({'war hammer'}, 2391, 1200, 'war hammer') 
shopModule:addSellableItem({'skull staff'}, 2436, 6000, 'skull staff') 
shopModule:addSellableItem({'dragon hammer'}, 2434, 2000, 'dragon hammer') 
shopModule:addSellableItem({'dragon lance'}, 2414, 9000, 'dragon lance') 
shopModule:addSellableItem({'fire axe'}, 2432, 8000, 'fire axe') 
shopModule:addSellableItem({'guardian halberd'}, 2427, 10000, 'guardian halberd') 
shopModule:addSellableItem({'naginata'}, 2426, 1000, 'naginata') 
shopModule:addSellableItem({'obsidian lance'}, 2425, 500, 'obsidian lance axe') 
shopModule:addSellableItem({'knight axe'}, 2430, 4000, 'knight axe') 
shopModule:addSellableItem({'royal helmet'}, 2498, 30000, 'royal helmet') 
shopModule:addSellableItem({'warrior helmet'}, 2475, 5000, 'warrior helmet') 
shopModule:addSellableItem({'crown helmet'}, 2491, 2500, 'crown helmet') 
shopModule:addSellableItem({'devil helmet'}, 2462, 1000, 'devil helmet') 
shopModule:addSellableItem({'strange helmet'}, 2479, 500, 'strange helmet')
shopModule:addSellableItem({'dragon scale mail', 'dsm'}, 2492, 40000, 'dragon scale mail') 
shopModule:addSellableItem({'golden armor'}, 2466, 15000, 'golden armor') 
shopModule:addSellableItem({'crown armor'}, 2487, 12000, 'crown armor') 
shopModule:addSellableItem({'knight armor'}, 2476, 5000, 'knight armor') 
shopModule:addSellableItem({'blue robe'}, 2656, 15000, 'blue robe') 
shopModule:addSellableItem({'crown legs'}, 2488, 12000, 'crown legs') 
shopModule:addSellableItem({'knight legs'}, 2477, 5000, 'knight legs') 
shopModule:addSellableItem({'demon shield'}, 2520, 25000,  'demon shield') 
shopModule:addSellableItem({'vampire shield'}, 2534, 15000, 'vampire shield') 
shopModule:addSellableItem({'medusa shield'}, 2536, 9000, 'medusa shield') 
shopModule:addSellableItem({'crown shield'}, 2519, 8000,  'crown shield') 
shopModule:addSellableItem({'tower shield'}, 2528, 8000, 'tower shield') 
shopModule:addSellableItem({'dragon shield'}, 2516, 4000, 'dragon shield')
shopModule:addSellableItem({'steel boots', 'sbs'}, 2645, 40000, 'steel boots') 
shopModule:addSellableItem({'boots of haste', 'boh'}, 2195, 30000, 'boots of haste') 
shopModule:addSellableItem({'platinum amulet'}, 2171, 3000, 'platinum amulet') 
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To buy the first addon say \'first NAME addon\', for the second addon say \'second NAME addon\'.'})
npcHandler:addModule(FocusModule:new())

Pozdrawiam. :)
 
Odp: Djin

W skrypcie nie widz? b??d?w ale tw?j angielski.... ????? Hahahahahahaa

"haha" Skrypt pisany na szybko. I nie b?d? poprawia? kto? b?dzie chcia? poprawi.
Po 2 jak bym nie zna? angielskiego to bym nie pisa? skrypt?w.
 
Odp: Djin

?wietne , przyda mi si? ale takie jedno pytanko. Czy trzeba jakie? questy robi? ?eby mu sprzedawa? itemy no bo : sorry you don't did djinn quest . Co to ma znaczy?? Aha i gdzie ustawi? cene itemka? Z g?ry dzi?ki i pozdrawiam :) Reputek leci.
 
Odp: Djin

?wietne , przyda mi si? ale takie jedno pytanko. Czy trzeba jakie? questy robi? ?eby mu sprzedawa? itemy no bo : sorry you don't did djinn quest . Co to ma znaczy?? Aha i gdzie ustawi? cene itemka? Z g?ry dzi?ki i pozdrawiam :) Reputek leci.

shopModule:addSellableItem({'serpent sword'}, 2409, 900, 'serpent sword')

To pogrubione to cena itemka.
 
Odp: Djin

Aha , dzi?ki , a czy trzeba zrobi? jakiego? questa zeby m?c u niego sprzedawa? jak ju? wy?ej napisa?em?
 
Odp: Djin

Tutaj prosz? Poprawiony NPC :

Data/Npc

PHP:
<?xml version="1.0"?>

<npc name="Alesar" script="data/npc/scripts/lootgreen.lua" access="3" lookdir="2" autowalk="25">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="51" head="20" body="30" legs="40" feet="50"/>
<parameters>
<parameter key="module_shop" value="1" />
<parameter key="message_greet" value="Hello |PLAYERNAME|. I buy swords, clubs, axes, helmets, boots, legs, shields and armors." />
<parameter key="shop_sellable" value="warrior helmet,2475,5000;mystic turban,2663,150;knight armor,2476,5000;knight legs,2477,5000;vampire shield,2534,15000;tower shield,2528,8000;giant sword,2393,17000;serpent sword,2409,900;knight axe,2430,2000;skull staff,2436,6000;dragon hammer,2434,2000;terra rod,2181,2000;necrotic rod,2185,1000;hailstorm rod,2183,3000;poison dagger,2411,50;scimitar,2419,150;dark armor,2489,400;dark helmet,2490,250;strange helmet,2479,500;black shield,2529,800;ancient shield,2532,900;" />
</parameters>
</npc>

Data/Npc/scripts

PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)



-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end
-- OTServ event handling functions end


-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
keywordHandler:addKeyword({'hefdghfdghlmets'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy royal (40k), warrior (6k), crusader (9k), crown (5k), devil (4k), chain (35gp) and iron helmets (30gp), also mystic turbans (500gp).'})
keywordHandler:addKeyword({'bohjghjots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden boots (100k), steel boots (40k) and boots of haste (40k).'})
keywordHandler:addKeyword({'armfgjgfjors'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (30k), crown (20k), knight (5k), lady (7,5k), plate (400gp), brass (200gp) and chain armors (100gp), also mpa (100k), dsm (60k) and blue robes (15k).'})
keywordHandler:addKeyword({'lfdhfdghfdegs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (80k), crown (15k), knight (6k), plate (500gp) and brass legs (100gp).'})
keywordHandler:addKeyword({'shiedfhdfhlds'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy blessed (150k), great (100k), demon (40k), vampire (25k), medusa (8k), amazon (4k), crown (5k), tower (4k), dragon (3k), guardian (2k), beholder (1k), and dwarven shields (100gp), also mms (80k).'})

keywordHandler:addKeyword({'swodfhfdhfdrds'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy giant (10k), bright (6k), fire (3k) serpent (1.5k), spike (800gp) and two handed swords (400gp), also ice rapiers (4k), magic longswords (150k), magic swords (90k), warlord swords (100k) broad swords (70gp), short swords (30gp), sabres (25gp) and swords (25gp).'})
keywordHandler:addKeyword({'axdfhdfhfdes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy fire (10k), guardian halberds (7,5k) knight (2k), double (200gp) and battle axes (100gp), also dragon lances (10k), stonecutters axes (90k), halberds (200gp) and hatchets (20gp).'})
keywordHandler:addKeyword({'clfhdfhdfhubs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy thunder hammers (90k), war (6k), dragon (2k) and battle hammers (60gp), also skull staffs (10k) and clerical maces (200gp).'})

-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())

O to 2 NPC (Nah'Bob)

Data/Npc

PHP:
<?xml version="1.0"?>

<npc name="Nah'Bob" script="data/npc/scripts/lootblue.lua" access="3" lookdir="2" autowalk="25">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="80" head="20" body="30" legs="40" feet="50"/>
<parameters>
<parameter key="module_shop" value="1" />
<parameter key="message_greet" value="Hello |PLAYERNAME|. I buy swords, clubs, axes, helmets, boots, legs, shields and armors." />
<parameter key="shop_sellable" value="royal helmet,2498,30000;crusader helmet,2497,6000;crown helmet,2491,2500;boots of haste,2195,30000;crown armor,2487,12000;blue robe,2656,10000;crown legs,2488,12000;crown shield,2519,8000;guardian shield,2515,2000;beholder shield,2518,1200;ice rapier,2396,1000;fire sword,2392,4000;spike sword,2383,1000;broad sword,2413,500;fire axe,2432,8000;war hammer,2391,1200;wand of inferno,2187,3000;wand of decay,2188,1000;wand of cosmic energy,2189,2000;dragon shield,2516,4000;dragon lance,2414,9000;obsidian lance,2425,500;noble armor,2486,900" />
</parameters>
</npc>

Data/Npc/scripts

PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)



-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end
-- OTServ event handling functions end


-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
keywordHandler:addKeyword({'hefdghfdghlmets'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy royal (40k), warrior (6k), crusader (9k), crown (5k), devil (4k), chain (35gp) and iron helmets (30gp), also mystic turbans (500gp).'})
keywordHandler:addKeyword({'bohjghjots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden boots (100k), steel boots (40k) and boots of haste (40k).'})
keywordHandler:addKeyword({'armfgjgfjors'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (30k), crown (20k), knight (5k), lady (7,5k), plate (400gp), brass (200gp) and chain armors (100gp), also mpa (100k), dsm (60k) and blue robes (15k).'})
keywordHandler:addKeyword({'lfdhfdghfdegs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (80k), crown (15k), knight (6k), plate (500gp) and brass legs (100gp).'})
keywordHandler:addKeyword({'shiedfhdfhlds'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy blessed (150k), great (100k), demon (40k), vampire (25k), medusa (8k), amazon (4k), crown (5k), tower (4k), dragon (3k), guardian (2k), beholder (1k), and dwarven shields (100gp), also mms (80k).'})

keywordHandler:addKeyword({'swodfhfdhfdrds'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy giant (10k), bright (6k), fire (3k) serpent (1.5k), spike (800gp) and two handed swords (400gp), also ice rapiers (4k), magic longswords (150k), magic swords (90k), warlord swords (100k) broad swords (70gp), short swords (30gp), sabres (25gp) and swords (25gp).'})
keywordHandler:addKeyword({'axdfhdfhfdes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy fire (10k), guardian halberds (7,5k) knight (2k), double (200gp) and battle axes (100gp), also dragon lances (10k), stonecutters axes (90k), halberds (200gp) and hatchets (20gp).'})
keywordHandler:addKeyword({'clfhdfhdfhubs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy thunder hammers (90k), war (6k), dragon (2k) and battle hammers (60gp), also skull staffs (10k) and clerical maces (200gp).'})

-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())

Pozdrawiam.
 
Status
Zamknięty.
Back
Do góry