dgprado
Member
Do someone have the npc rock in a hard place to share ?
i don't understand that request , can post it easier , and what should to do?
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Rock in a Hard Place" nameDescription="Rock in a Hard Place" script="rock.lua" walkinterval="2000" floorchange="0" skull="black">
<health now="100" max="100"/>
<look type="130" head="0" body="94" legs="94" feet="79" addons="3"/>
<parameters>
<parameter key="message_greet" value="Welcome |PLAYERNAME|. Hello."/>
<parameter key="message_decline" value="It is okay"/>
</parameters>
</npc>
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:addModule(FocusModule:new())
here you are..
in your npc make file name rock.xml and post the following:
then go to your npc/scripts and create file name rock.lua and post the following:XML:<?xml version="1.0" encoding="UTF-8"?> <npc name="Rock in a Hard Place" nameDescription="Rock in a Hard Place" script="rock.lua" walkinterval="2000" floorchange="0" skull="black"> <health now="100" max="100"/> <look type="130" head="0" body="94" legs="94" feet="79" addons="3"/> <parameters> <parameter key="message_greet" value="Welcome |PLAYERNAME|. Hello."/> <parameter key="message_decline" value="It is okay"/> </parameters> </npc>
if that what you want so:Lua: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:addModule(FocusModule:new())
Rep++ If It Helpful For You..
just edit looktype with his item id -.-
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Rock in a Hard Place" nameDescription="Rock in a Hard Place" script="rock.lua" walkinterval="0" floorchange="0">
<health now="100" max="100"/>
<look typeex="14889"/>
<parameters>
<parameter key="message_greet" value="Welcome |PLAYERNAME|. Hello."/>
<parameter key="message_decline" value="It is okay"/>
<parameter key="shop_sellable" value="Ornate Crossbow,15644,12000;Hive Bow,15643,28000;Deepling Axe,15404,40000;Deepling Squelcher,15647,7000;Deepling Staff,15400,260;Hive Scythe,15492,17000;Ornate Mace,15414,42000;Warrior's Axe,15451,11000;Calopteryx Cape,15489,15000;Depth Calcei,15410,25000;Depth Galea,15408,35000;Depth Scutum,15411,36000;Grasshopper Legs,15490,15000;Ornate Chestplate,15406,60000;Ornate Shield,15413,42000;Warrior's Shield,15453,9000;Carapace Shield,15491,12000;axe,2386,7;battle axe,2378,80;battle hammer,2417,120;battle shield,2513,95;brass armor,2465,150;chain armor,2464,70;chain helmet,2458,17;chain legs,2648,25;dagger,2379,2;halberd,2381,400;hand axe,2380,4;leather armor,2467,12;leather helmet,2461,4;mace,2398,30;morning star,2394,90;plate armor,2463,400;rapier,2384,5;sabre,2385,12;short sword,2406,10;spear,2389,3;steel helmet,2457,190;steel shield,2509,80;sword,2376,25;two handed sword,2377,450;wooden shield,2512,5;crossbow,2455,120;bow,2456,100;spear,2389,3;Compound Eye,15486,150;Crawler Head Plating,15482,210;deepling breaktime snack,15424,90;Deepling Claw,15455,430;Deepling Guard Belt Buckle,15423,230;Deepling Ridge,15452,360;Deepling Warts,15425,180;Deeptags,15426,290;Dung Ball,15622,130;Eye of a Deepling,13870,150;Key to the Drowned Library,15422,330;Kollos Shell,15480,420;Spellsinger's Seal,15421,280;Spitter Nose,15481,340;Swarmer Antenna,15479,130;Waspoid Claw,15483,320;Waspoid Wing,15484,190;"/>
<parameter key="shop_buyable" value="axe,2386,20;battle hammer,2417,350;brass armor,2465,450;chain armor,2464,200;chain helmet,2458,52;chain legs,2648,80;dagger,2379,5;hand axe,2380,8;leather armor,2467,35;leather helmet,2461,12;mace,2398,90;rapier,2384,15;sabre,2385,35;spear,2389,10;steel shield,2509,240;sword,2376,85;throwing knife,2410,25;wooden shield,2512,15;scyzoryk,10516,10000;scyzoryk,10511,10000;scyzoryk,10513,10000;blessed wooden stake,5942,10000;obsidian knife,5908,10000;shovel,2554,50;backpack,1988,20;fishing rod,2580,150;rope,2120,50;machete,2420,40;bag,1987,5;orange backpack,10519,20;orange bag,10520,5;pick,2553,50;scythe,2550,50;machete,2420,40;torch,2050,2;bottle,2007,3,1;book,1955,15;book,1950,15;document,1952,12;book,1958,15;parchment,1948,8;scroll,1949,5;valentines card,6538,30;plate,2035,6;present box,1990,10;watch,2036,20;worm,3976,1;rust remover,9930,100;crowbar,10223,1000;long sword,2397,40;parcel,9081,15;label,6086,1;letter,2597,5;" />
</parameters>
</npc>
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addBuyableItem({'spellbook'}, 2175, 150, 'spellbook')
shopModule:addBuyableItem({'magic lightwand'}, 2163, 400, 'magic lightwand')
shopModule:addBuyableItem({'small health'}, 8704, 20, 1, 'small health potion')
shopModule:addBuyableItem({'health potion'}, 7618, 45, 1, 'health potion')
shopModule:addBuyableItem({'mana potion'}, 7620, 50, 1, 'mana potion')
shopModule:addBuyableItem({'strong health'}, 7588, 60, 1, 'strong health potion')
shopModule:addBuyableItem({'strong mana'}, 7589, 60, 1, 'strong mana potion')
shopModule:addBuyableItem({'great health'}, 7591, 80, 1, 'great health potion')
shopModule:addBuyableItem({'great mana'}, 7590, 80, 1, 'great mana potion')
shopModule:addBuyableItem({'great spirit'}, 8472, 150, 1, 'great spirit potion')
shopModule:addBuyableItem({'ultimate health'}, 8473, 210, 1, 'ultimate health potion')
shopModule:addBuyableItem({'antidote potion'}, 8474, 50, 1, 'antidote potion')
shopModule:addSellableItem({'normal potion flask', 'normal flask'}, 7636, 5, 'empty small potion flask')
shopModule:addSellableItem({'strong potion flask', 'strong flask'}, 7634, 10, 'empty strong potion flask')
shopModule:addSellableItem({'great potion flask', 'great flask'}, 7635, 15, 'empty great potion flask')
shopModule:addBuyableItem({'blank rune'}, 2260, 10, 1, 'blank rune')
shopModule:addBuyableItem({'animate dead'}, 2316, 375, 1, 'animate dead rune')
shopModule:addBuyableItem({'antidote'}, 2266, 65, 1, 'antidote rune')
shopModule:addBuyableItem({'avalanche'}, 2274, 180, 1, 'avalanche rune')
shopModule:addBuyableItem({'chameleon'}, 2291, 210, 1, 'chameleon rune')
shopModule:addBuyableItem({'convince creature'}, 2290, 80, 1, 'convince creature rune')
shopModule:addBuyableItem({'desintegrate'}, 2310, 80, 1, 'desintegrate rune')
shopModule:addBuyableItem({'destroy field'}, 2261, 45, 1, 'destroy field')
shopModule:addBuyableItem({'energy bomb'}, 2262, 325, 1, 'energy bomb rune')
shopModule:addBuyableItem({'energy field'}, 2277, 115, 1, 'energy field')
shopModule:addBuyableItem({'energy wall'}, 2279, 340, 1, 'energy wall rune')
shopModule:addBuyableItem({'explosion'}, 2313, 190, 1, 'explosion rune')
shopModule:addBuyableItem({'fire bomb'}, 2305, 235, 1, 'fire bomb rune')
shopModule:addBuyableItem({'fire field'}, 2301, 85, 1, 'fire field rune')
shopModule:addBuyableItem({'fire wall'}, 2303, 245, 1, 'fire wall rune')
shopModule:addBuyableItem({'fireball'}, 2302, 150, 1, 'fire ball')
shopModule:addBuyableItem({'great fireball'}, 2304, 180, 1, 'great fireball rune')
shopModule:addBuyableItem({'heavy magic missile'}, 2311, 120, 1, 'heavy magic missile rune')
shopModule:addBuyableItem({'holy missile missile'}, 2295, 80, 1, 'holy missile rune')
shopModule:addBuyableItem({'icicle'}, 2271, 150, 1, 'icicle rune')
shopModule:addBuyableItem({'intense healing'}, 2265, 95, 1, 'intense healing rune')
shopModule:addBuyableItem({'light magic missile'}, 2287, 40, 1, 'light magic missile rune')
shopModule:addBuyableItem({'magic wall'}, 2293, 200, 1, 'magic wall rune')
shopModule:addBuyableItem({'paralyze'}, 2278, 250, 1, 'paralyze rune')
shopModule:addBuyableItem({'poison bomb'}, 2286, 170, 1, 'poison bomb rune')
shopModule:addBuyableItem({'poison field'}, 2285, 65, 1, 'poison field')
shopModule:addBuyableItem({'poison wall'}, 2289, 210, 1, 'poison wall rune')
shopModule:addBuyableItem({'soulfire'}, 2308, 140, 1, 'soulfire rune')
shopModule:addBuyableItem({'stalagmite'}, 2292, 120, 1, 'stalagmite rune')
shopModule:addBuyableItem({'stone shower'}, 2288, 150, 1, 'stoneshower rune')
shopModule:addBuyableItem({'sudden death'}, 2268, 50, 1, 'sudden death rune')
shopModule:addBuyableItem({'thunderstorm'}, 2315, 150, 1, 'thunderstorm rune')
shopModule:addBuyableItem({'ultimate healing'}, 2273, 175, 1, 'ultimate healing rune')
shopModule:addBuyableItem({'wild growth'}, 2269, 320, 1, 'wild growth rune')
shopModule:addBuyableItem({'bow'}, 2456, 400, 'bow')
shopModule:addBuyableItem({'crossbow'}, 2455, 500, 'crossbow')
shopModule:addBuyableItem({'royal spear'}, 7378, 15, 'royal spear')
shopModule:addBuyableItem({'spear'}, 2389, 10, 'spear')
shopModule:addBuyableItem({'arrow'}, 2544, 3, 'arrow')
shopModule:addBuyableItem({'sniper arrow'}, 7364, 5, 'sniper arrow')
shopModule:addBuyableItem({'bolt'}, 2543, 4, 'bolt')
shopModule:addBuyableItem({'earth arrow'}, 7850, 5, 'earth arrow')
shopModule:addBuyableItem({'flaming arrow'}, 7840, 5, 'flaming arrow')
shopModule:addBuyableItem({'flash arrow'}, 7838, 5, 'flash arrow')
shopModule:addBuyableItem({'onyx arrow'}, 7365, 7, 'onyx arrow')
shopModule:addBuyableItem({'power bolt'}, 2547, 7, 'power bolt')
shopModule:addBuyableItem({'throwing star'}, 2399, 42, 'throwing star')
shopModule:addBuyableItem({'shiver arrow'}, 7839, 5, 'shiver arrow')
shopModule:addBuyableItem({'piercing bolt'}, 7363, 5, 'piercing bolt')
shopModule:addBuyableItem({'assassin star'}, 7368, 100, 'assassin star')
shopModule:addBuyableItem({'infernal bolt'}, 6529, 300, 'infernal bolt')
shopModule:addBuyableItem({'throwing knife'}, 2410, 25, 'throwing knife')
shopModule:addBuyableItem({'envenomed arrow'}, 18437, 12, 'envenomed arrow')
shopModule:addBuyableItem({'drill bolt'}, 18436, 12, 'drill bolt')
shopModule:addBuyableItem({'crystalline arrow'}, 18304, 20, 'crystalline arrow')
shopModule:addBuyableItem({'prismatic bolt'}, 18435, 20, 'prismatic bolt')
shopModule:addBuyableItem({'tarsal arrow'}, 15648, 6, 'tarsal arrow')
shopModule:addBuyableItem({'Vortex Bolt'}, 15649, 6, 'vortex bolt')
shopModule:addSellableItem({'bow'}, 2456, 130, 'bow')
shopModule:addSellableItem({'crossbow'}, 2455, 160, 'crossbow')
shopModule:addSellableItem({'spear'}, 2389, 3, 'spear')
local items = {[1] = 2190, [2] = 2182, [5] = 2190, [6] = 2182}
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, 'first rod') or msgcontains(msg, 'first wand')) then
if(isSorcerer(cid) or isDruid(cid)) then
if(getPlayerStorageValue(cid, 30002) <= 0) then
selfSay('So you ask me for a {' .. getItemNameById(items[getPlayerVocation(cid)]) .. '} to begin your advanture?', cid)
talkState[talkUser] = 1
else
selfSay('What? I have already gave you one {' .. getItemNameById(items[getPlayerVocation(cid)]) .. '}!', cid)
end
else
selfSay('Sorry, you aren\'t a druid either a sorcerer.', cid)
end
elseif(msgcontains(msg, 'yes')) then
if(talkState[talkUser] == 1) then
doPlayerAddItem(cid, items[getPlayerVocation(cid)], 1)
selfSay('Here you are young adept, take care yourself.', cid)
setPlayerStorageValue(cid, 30002, 1)
end
talkState[talkUser] = 0
elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser])) then
selfSay('Ok then.', cid)
talkState[talkUser] = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())