• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

NPC NPC example using mods

Mikuch

/home/mikuch
Joined
Jul 1, 2008
Messages
440
Reaction score
1
Location
Poland/Kielce
/mods/npc/aldo.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Aldo" script="mods/npc/scripts/aldo_script.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="128" head="17" body="54" legs="114" feet="0" addons="2"/>
	<parameters>
		<parameter key="message_greet" value="Hello |PLAYERNAME|, I am selling ammunition."/>
	</parameters>
</npc>



mods/npc/scripts/aldo_script.lua
Code:
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({'letter'}, 2597, 5, 'letter')
shopModule:addBuyableItem({'parcel'}, 2595, 15, 'parcel')

shopModule:addBuyableItem({'label'}, 2599, 5, 'label')



npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
I haven't played around much with the current system as I don't like it, but what I can see there isn't any difference? :S
 
I haven't played around much with the current system as I don't like it, but what I can see there isn't any difference? :S

Thats exactly what I was thinking but forgot to post :D

Someone point me the differences, I really see it like old one but maybe Im not watching correctly ;)
 
Back
Top Bottom