• 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!

How to make Penny give free itens?

samneill

New Member
Joined
Jul 19, 2009
Messages
26
Reaction score
0
Location
Brasil
hello friends!

how to make npc Penny give free letters by jiddo system? (i tried a lot of parameters, but doesen´t work:()

thx!
 
Easy...

Penny.lua
Code:
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

function creatureSayCallback(cid, type, msg)
	if(npcHandler.focus ~= cid) then
		return false
	end
	
	if msgcontains(msg, 'letter') then
	npcHandler:say('Here you are.')
	doPlayerAddItem(cid, 2597, 1)
	end	
		
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
still not works...

i used your 2 posts about penny (2 scripts), but that bitch don´t make any action when CM says letter.

can u give 2 your 2 scripts?

thx!
 
Alright then, here is my handmade Pennny:

Code:
<?xml version="1.0"?>
<npc name="Penny" floorchange="0" walkinterval="1000">
  <health now="150" max="150"/>
  <look type="137" head="96" body="79" legs="95" feet="96"/>

  <interaction range="2" idletimeout="30">

    <interact keywords="hi" param="male" focus="1">
      <keywords>hello</keywords>
      <response text="Welcome home, Sir |NAME|."/>
    </interact>
	
	<interact keywords="hi" param="female" focus="1">
      <keywords>hello</keywords>
      <response text="Welcome home, Lady |NAME|."/>
    </interact>

    <interact keywords="bye" focus="0">
      <keywords>farewell</keywords>
      <response text="May Justice be with you!"/>
    </interact>

    <interact event="onBusy" param="male">
      <response text="Just a minute, Sir |NAME|.">
        <action name="addqueue" value="|PLAYER|"/>
      </response>
    </interact>
	
	    <interact event="onBusy" param="female">
      <response text="Just a minute, Lady |NAME|.">
        <action name="addqueue" value="|PLAYER|"/>
      </response>
    </interact>

    <interact event="onPlayerLeave" focus="0">
      <response text="May Justice be with you!"/>
    </interact>

    <interact keywords="name">
      <response text="I am miss Penny, your secretary."/>
    </interact>

	<interact keywords="job">
      <response text="I'm your secretary. I'm organizing all those criminal records and your mail."/>
    </interact>
	
	<interact keywords="criminal">
      <response text="It's an evil world, isn't it?"/>
    </interact>
	
	<interact keywords="record">
      <response text="It's an evil world, isn't it?"/>
    </interact>
	
	<interact keywords="mail">
      <response text="You can get a letter from me."/>
    </interact>
	
	<interact keywords="letter">
      <response text="Here you are.">
	  	  <action name="giveitem" value="2597"/>
		  </response>
    </interact>

	</interaction>
  
</npc>
 
i used too... this is opentibia system, correct??

only jiddo works... (this is an ot 8.60, real map, if help)

waiting your help :p
 
Are u using TFS ?
If you're, try this:

Penny.lua
Code:
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

function creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end
	
	if msgcontains(msg, "letter") then
	npcHandler:say("Here you are.", cid)
	doPlayerAddItem(cid, 2597, 1)
	end	
		
	return TRUE
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Back
Top