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

Some Questions about NPC system

lolzack

New Member
Joined
Sep 19, 2007
Messages
103
Reaction score
0
I'm an old-school (meaning outdated and stupid) OT creator so I don't really know how the new NPC sys works.

Some quick questions:

1) Is it possible for NPCs to confer exp on players without me having to create a function in source?
2) Can NPCs execute commands found in talkactions like /a or /i?
3) Can NPCs be programmed to attack players / monsters on sight? I know there's a function for "onAppear" but if there one that causes the NPC to attack?
 
Hey! Look at this thread number! 1337 xD!
The best thread :D

@topic: If I were you, I would test and try to see if it works like that. It would be faster then waiting for that one guy who knows if it will work.

I assume you got some knowledge about scripting npcs and stuff.
 
I'm an old-school (meaning outdated and stupid) OT creator so I don't really know how the new NPC sys works.

Some quick questions:

1) Is it possible for NPCs to confer exp on players without me having to create a function in source?
2) Can NPCs execute commands found in talkactions like /a or /i?
3) Can NPCs be programmed to attack players / monsters on sight? I know there's a function for "onAppear" but if there one that causes the NPC to attack?


1. Yes it is able with "DoGivePlayerExp" orsomting like that :p
2. all the /Commands can be done by Npc's but diferent.
Example:
/clean <-- Dunno if it exist yet :p
DoCleanMap <-- Dunno if it exist yet :p
3. Yes indeed is exist look in lua section to find examples, Check the stickys first!
 
This script makes a NPC attack:
Code:
<?xml version="1.0"?>

<npc name="Axis - Knight" script="data/npc/scripts/knight.lua" race="blood" experience="10000" speed="340" team="1">
	<health now="2500" max="2500"/>
	<mana now="500" max="500"/>
	<look type="160" head="59" body="59" legs="59" feet="59" corpse="3058"/>
	<targetchange interval="5000" chance="7"/>
	<strategy attack="70" defense="30"/>
	<flags>
		<flag attackable="1"/>
		<flag hostile="1"/>
   		<flag canpushitems="1"/>
		<flag canrespawn="1"/>
    		<flag respawntime="35"/>
    		<flag targetdistance="1"/>
    		<flag runonhealth="600"/>

    		<flag healthticks="1"/>
    		<flag healthamount="20"/>
    		<flag manaticks="3"/>
    		<flag manaamount="20"/>
  	</flags>

  	<attacks>
    		<attack name="melee" interval="400" skill="100" attack="45"/>
    		<attack name="explosion" interval="1000" chance="80" min="-80" max="-135"/>
    		<attack name="exori" interval="2500" chance="50" min="-190" max="-580"/>
  	</attacks>

        <defenses armor="40" defense="65">
    		<defense name="speed" interval="1000" chance="7" speedchange="900" duration="10000">
      			<attribute key="areaEffect" value="redshimmer"/>
    		</defense>
		<defense name="healing" interval="3000" chance="35" min="500" max="800">
      			<attribute key="areaEffect" value="blueshimmer"/>
    		</defense>
  	</defenses>

    	<summons max="2">
      		<summon name="demon skeleton" interval="4000" chance="50"/>
    	</summons>
</npc>
 
Back
Top