• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Linux NPC trade onLoock/onTarget

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,764
Solutions
1
Reaction score
227
Location
Chile, Santiago
Hello there,

It is possible to open the trade window (if the NPC has it) when player take a look (at battle, or ingame window) or when he attacks/target the NPC?

If you got any idea, please post here to build this ;)

Would be pretty nice ;)

Bump!
 
Last edited by a moderator:
then change in npc/lib/npcsystem/npchandler.lua
"if self:isFocused(cid) and msgtype == TALKTYPE_PRIVATE_PN or not self:isFocused(cid) then"
for
"if self:isFocused(cid) and (msgtype == TALKTYPE_PRIVATE_PN or msgtype == TALKTYPE_PRIVATE_NP) or not self:isFocused(cid) then"
and it should work for TALKTYPE_PRIVATE_NP

Tried it, but not working.

Also the TALKTYPE_PRIVATE_NP show a message on lightblue to everyone online, so it wouldn't be an option I think :S
 
Tried it, but not working.

Also the TALKTYPE_PRIVATE_NP show a message on lightblue to everyone online, so it wouldn't be an option I think :S
Actually tried it myself and this working with onLook:
Code:
    if(thing:isNpc()) then
        self:say("hi", TALKTYPE_SAY, false, thing)
        addEvent(doCreatureSay, 200, self:getId(), "trade", TALKTYPE_PRIVATE_PN, false, thing:getId())
    end
 
Actually tried it myself and this working with onLook:
Code:
    if(thing:isNpc()) then
        self:say("hi", TALKTYPE_SAY, false, thing)
        addEvent(doCreatureSay, 200, self:getId(), "trade", TALKTYPE_PRIVATE_PN, false, thing:getId())
    end

Yes, worked!

If you could make it work now on target, I would love you xD
 
Last edited by a moderator:
Back
Top