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

NPC speaking in default chat

poopsiedoodle

Gibe moni plos
Joined
Nov 23, 2011
Messages
2,457
Reaction score
585
Location
Georgia
What should I do to change my NPC script to make it speak in NPC chat instead of Default chat?
Here's the code.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Nilrem" nameDescription="Nilrem" walkinterval="2000" floorchange="0" script="data/npc/scripts/default.lua">
	<health now="100" max="100"/>
	<look type="130" head="45" body="173" legs="125" feet="57" addons="3"/>
	<interaction range="3" idletime="30">

    <interact keywords="hi" focus="1">
      <!--These are the alternative keywords-->
      <keywords>hello</keywords>

      <response text="Oh, be welcome |NAME|."/>
    </interact>

    <interact keywords="hi" focus="1">
      <!--These are the alternative keywords-->
      <keywords>hello</keywords>

      <response text="Hello..."/>
    </interact>

    <interact keywords="bye" focus="0">
      <!--These are the alternative keywords-->
      <keywords>farewell</keywords>

      <response text="Farewell."/>
    </interact>

    <interact event="onBusy">
      <response text="Wait |NAME|, please.">
        <action name="addqueue" value="|PLAYER|"/>
      </response>
    </interact>

    <interact event="onPlayerLeave" focus="0">
      <response text="Goodbye."/>
    </interact>

    <interact keywords="job">
      <response text="I am a teacher of powerful spells!"/>
    </interact>

    <interact keywords="name">
      <response text="My friends call me Kohl, but it is really |NPCNAME|."/>
    </interact>

    <interact keywords="spell">
      <response text="I can teach you instant spells. What kind of spell do you wish to learn? You can also tell me for which level you would like to learn a spell, if you prefer that.">
        <action name="topic" value="1"/>
      </response>
    </interact>

    <interact keywords="level" topic="1">
      <response text="For which level would you like to learn a spell?">
        <action name="topic" value="2"/>
      </response>
    </interact>

    <interact keywords="instant" topic="1">
      <response text="I sell attack spells, healing spells, and support spells. Which of these interests you most?"/>
    </interact>

    <interact keywords="attack;spell" topic="1">
      <response text="In this category I have 'Practice Fire Wave', 'Practice Death Strike', 'Practice Whirlwind Throw' and 'Practice Ethereal Spear'."/>
    </interact>

    <interact keywords="healing;spell" topic="1">
      <response text="In this category I have 'Practice Healing', 'Practice Wound Cleansing', and 'Practice Heal Friend'."/>
    </interact>

    <interact keywords="support;spell" topic="1">
      <response text="In this category I have 'Practice Haste'."/>
    </interact>

    <interact keywords="3" topic="2">
      <response text="For level 3 I have 'Practice Whirlwind Throw' and 'Practice Death Strike'.">
        <action name="topic" value="2"/>
      </response>
    </interact>

    <interact keywords="4" topic="2">
      <response text="For level 4 I have 'Practice Ethereal Spear' and 'Practice Haste'.">
        <action name="topic" value="2"/>
      </response>
    </interact>

    <interact keywords="5" topic="2">
      <response text="For level 5 I have 'Practice Heal Friend'.">
        <action name="topic" value="2"/>
      </response>
    </interact>

    <interact keywords="2" topic="2">
      <response text="For level 2 I have 'Practice Healing'.">
        <action name="topic" value="2"/>
      </response>
    </interact>
	
    <interact keywords="|*|" topic="2">
      <response text="Hmm, I have no spells for this level, but for many levels from 8 to 14.">
        <action name="topic" value="2"/>
      </response>
      </interact>

    <interact keywords="practice;healing" params="sorcerer, druid, paladin">
      <response text="Do you want to learn the spell 'practice healing' for |PRICE| gold?">
        <action name="price" value="50"/>
        <action name="spell" value="practice healing"/>
        <action name="level" value="|SPELLLEVEL|"/>
        <action name="topic" value="3"/>
      </response>
    </interact>

    <interact keywords="practice;haste">
      <response text="Do you want to learn the spell 'Practice Haste' for |PRICE| gold?">
        <action name="price" value="65"/>
        <action name="spell" value="practice haste"/>
        <action name="level" value="|SPELLLEVEL|"/>
        <action name="topic" value="3"/>
      </response>
    </interact>

    <interact keywords="practice;wound;cleansing" param="knight">
      <response text="Do you want to learn the spell 'Practice Wound Cleansing' for |PRICE| gold?">
        <action name="price" value="75"/>
        <action name="spell" value="practice wound cleansing"/>
        <action name="level" value="|SPELLLEVEL|"/>
        <action name="topic" value="3"/>
      </response>
    </interact>

    <interact keywords="practice;heal;friend" param="druid">
      <response text="Do you want to learn the spell 'Practice Heal Friend' for |PRICE| gold?">
        <action name="price" value="100"/>
        <action name="spell" value="practice heal friend"/>
        <action name="level" value="|SPELLLEVEL|"/>
        <action name="topic" value="3"/>
      </response>
    </interact>

    <interact keywords="practice;death;strike" params="sorcerer, druid">
      <response text="Do you want to learn the spell 'Practice Death Strike' for |PRICE| gold?">
        <action name="price" value="55"/>
        <action name="spell" value="practice death strike"/>
        <action name="level" value="|SPELLLEVEL|"/>
        <action name="topic" value="3"/>
      </response>
    </interact>

    <interact keywords="practice;fire;wave" params="sorcerer, druid">
      <response text="Do you want to learn the spell 'Practice Fire Wave' for |PRICE| gold?">
        <action name="price" value="60"/>
        <action name="spell" value="practice fire wave"/>
        <action name="level" value="|SPELLLEVEL|"/>
        <action name="topic" value="3"/>
      </response>
    </interact>

    <interact keywords="practice whirlwind throw" param="knight">
      <response text="Do you want to learn the spell 'Practice Whirlwind Throw' for |PRICE| gold?">
        <action name="price" value="60"/>
        <action name="spell" value="practice whirlwind throw"/>
        <action name="level" value="|SPELLLEVEL|"/>
        <action name="topic" value="3"/>
      </response>
    </interact>

    <interact keywords="practice ethereal spear" param="paladin">
      <response text="Do you want to learn the spell 'Practice Ethereal Spear' for |PRICE| gold?">
        <action name="price" value="60"/>
        <action name="spell" value="practice ethereal spear"/>
        <action name="level" value="|SPELLLEVEL|"/>
        <action name="topic" value="3"/>
      </response>
    </interact>

    <!-- This is he actual selling of the spell -->
    <interact keywords="yes" topic="3">
      <response param="lowlevel" text="You need to be atleast level |LEVEL| to learn this spell!"/>
      <response knowspell="|SPELL|" text="You already know this spell."/>
      <response param="lowmoney" text="Come back when you have the money!"/>
      <response text="Use your knowledge wisely.">
        <action name="takemoney" value="|PRICE|"/>
        <action name="teachspell" value="|SPELL|"/>
        <action name="effect" value="redshimmer"/>
      </response>
    </interact>

    <!-- Player is saying something else than expected-->
    <interact keywords="|*|" topic="2">
      <response text="Maybe some other time."/>
    </interact>

    <!-- Player is saying something else than expected-->
    <interact keywords="|*|" topic="3">
      <response text="Maybe some other time."/>
    </interact>

    <!-- Mainly for testing purposes, will trigger when we do not have any other response -->
    <interact keywords="|*|">
      <response text="I have no idea what you are talking about."/>
    </interact>

  </interaction>
</npc>
 
Back
Top