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

[7.6] Avesta

Anyone got a sample NPC script? It would help me a lot ;)

Code:
<npc name="Daniel Steelsoul" script="edron/daniel steelsoul.lua" autowalk="25">
	<health now="150" max="150"/>
	<look type="73" head="20" body="30" legs="40" feet="50" corpse="2212"/>
	<parameters>
		<parameter key="message_greet" value="Greetings and Banor with you, |PLAYERNAME|!" />
		<parameter key="message_placedinqueue" value="Shut up! I am talking already!" />
		<parameter key="message_idletimeout" value="PRAISE TO BANOR!" />
		<parameter key="message_farewell" value="PRAISE TO BANOR!" />
		<parameter key="message_walkaway" value="PRAISE TO BANOR!" />
		
		<parameter key="module_keywords" value="1" />
		<parameter key="keywords" value="news;king;leader;name;job;how are you;army;guard;general;enemies;enemy;banors blood;castle;edron;colony;minotaur;cyclop;allies;kaine;ruins;taboo;cult;monk;agaltha;eremo;fisherman;cormaya;falk;horn plenty;mirabell;willard;weapon;armor;academy;amanda;benjamin;ferumbras;join;honor;piety;bravery;quest;mission;god;banor;brog;monster;excalibug;kazordoon;dwarf;carlin" />
		<parameter key="keyword_reply1" value="Nothing new from the north." />
		<parameter key="keyword_reply2" value="LONG LIVE THE KING!" />
		<parameter key="keyword_reply3" value="King Tibianus III is our wise and just leader." />
		<parameter key="keyword_reply4" value="I am Sir Daniel Steelsoul of the Sacred Order of Banor's Blood." />
		<parameter key="keyword_reply5" value="I am the governor of this isle, Edron, and grandmaster of the Knights of Banor's Blood." />
		<parameter key="keyword_reply6" value="I did not have much sleep lately, but I am fine." />
		<parameter key="keyword_reply7" value="The army protects the Thaian realm. The order of the Knights of Banor's Blood supports them with all our skills." />
		<parameter key="keyword_reply8" value="The army protects the Thaian realm. The order of the Knights of Banor's Blood supports them with all our skills." />
		<parameter key="keyword_reply9" value="Harkath Bloodblade declined the governorship because he's needed more in Thais." />
		<parameter key="keyword_reply10" value="Evil challenges the forces of good in any shape. Be it the claws of vicious monsters or the seductive dark secrets of rotten power." />
		<parameter key="keyword_reply11" value="Evil challenges the forces of good in any shape. Be it the claws of vicious monsters or the seductive dark secrets of rotten power." />
		<parameter key="keyword_reply12" value="We believe that the blood of Banor runs through the veins of all humans. Therefore, we are responsible to live up to Banors standards and not to stain his legacy with sinful acts." />
		<parameter key="keyword_reply13" value="The castle was built on elder foundations we found on this isle." />
		<parameter key="keyword_reply14" value="This isle is rumoured to have been the home of a powerful ancient race which became extinct before the corpsewars. It was up to King Tibianus III to reclaim it for humanity and to found this colony." />
		<parameter key="keyword_reply15" value="With the Thaian army bound to other duties, our order was entrusted to secure the area. We defeated the evil minotaurs living right here and cleansed the isle of their unholy presence." />
		<parameter key="keyword_reply16" value="The minotaurs, though evil, were worthy opponents. After the treason of the man who is now known as Kaine Kinslayer, we lack the manpower to crush their cyclopean allies, too." />
		<parameter key="keyword_reply17" value="They live in an underground city, known as cyclopolis in the north of the isle. Constantly forging weapons for the servants of darkness." />
		<parameter key="keyword_reply18" value="They live in an underground city, known as cyclopolis in the north of the isle. Constantly forging weapons for the servants of darkness." />
		<parameter key="keyword_reply19" value="He was my second in command. After learning about the forbidden ruins, he, the priestess Agaltha, and their followers freed the criminals we brought here as workers and headed to the north." />
		<parameter key="keyword_reply20" value="An ancient taboo forbids to enter the northern ruins." />
		<parameter key="keyword_reply21" value="We thought it was only superstition and no one bothered that Kaine and his friends went there to hunt servants of evil that might have hidden there. So we did not notice the dark cult they started." />
		<parameter key="keyword_reply22" value="We know only little about them. Kaine and his fallen knights were joined by criminal scum and remaining forces of darkness that escaped us. They were joined by some ominous dark monks." />
		<parameter key="keyword_reply23" value="We don't know if they came here or already hid in the ruins as we arrived. Maybe they seduced Kaine or Agaltha, maybe they were theirs for years." />
		<parameter key="keyword_reply24" value="She was beautiful but seemed cold hearted. She spoke little to me, prefered the company of Kaine." />
		<parameter key="keyword_reply25" value="Eremo is a very wise man. I visit him sometimes on his little island near Edron. Just ask a fisherman for a passage." />
		<parameter key="keyword_reply26" value="Pemaret is a fisherman on Cormaya." />
		<parameter key="keyword_reply27" value="It is a peaceful isle next to Edron with a nice village. There, you should visit the wonderful garden." />
		<parameter key="keyword_reply28" value="A promising young fellow." />
		<parameter key="keyword_reply29" value="I hardly find the time to visit the tavern." />
		<parameter key="keyword_reply30" value="I hardly find the time to visit the tavern." />
		<parameter key="keyword_reply31" value="When he were young, Willard served in the royal army." />
		<parameter key="keyword_reply32" value="Look for Willard, our local blacksmith." />
		<parameter key="keyword_reply33" value="Look for Willard, our local blacksmith." />
		<parameter key="keyword_reply34" value="After the treason of Kaine, we observe these mages closely. If even a knight falls prey to the seduction of the forbidden ruins, no one can tell how easy some of these mystics might betray his people." />
		<parameter key="keyword_reply35" value="I think this nun might be a bit young for this position, but I won't question the decisions of the church of Banor's Blood." />
		<parameter key="keyword_reply36" value="He and his men fought against Ferumbras somewhere in the north of this isle, long before there were even plans of a colony. Only old Ben returned alive from the battle, but his mind was broken." />
		<parameter key="keyword_reply37" value="He searched something in the north of the isle years ago. Probably he needed something from the forbidden ruins. He was chased and fought by the troops of General Benjamin." />
		<parameter key="keyword_reply38" value="You may join the order of Banor's blood if you prove your honor." />
		<parameter key="keyword_reply39" value="Only those who live a life of bravery, honor, and piety may join our sacred order." />
		<parameter key="keyword_reply40" value="Only those who live a life of bravery, honor, and piety may join our sacred order." />
		<parameter key="keyword_reply41" value="Only those who live a life of bravery, honor, and piety may join our sacred order." />
		<parameter key="keyword_reply42" value="A life in bravery, honor, and piety should be every man's most important quest." />
		<parameter key="keyword_reply43" value="A life in bravery, honor, and piety should be every man's most important quest." />
		<parameter key="keyword_reply44" value="I worship Banor, the first champion of good!" />
		<parameter key="keyword_reply45" value="His spirit and blood are within us. Honor this fact or be cast into hell." />
		<parameter key="keyword_reply46" value="The rotten cyclopses whorship the raging giant of hell." />
		<parameter key="keyword_reply47" value="We cleansed the south of any major enemy, but watch out while travelling the north." />
		<parameter key="keyword_reply48" value="With this weapon in my hand, I would teach the servants of darkness the true meaning of the word fear." />
		<parameter key="keyword_reply49" value="Now and then a dwarf comes to this isle. Most behave secretive about their reason to come here. As far as I can tell they are looking for some dwarfish artifact which was lost in ancient times." />
		<parameter key="keyword_reply50" value="Now and then a dwarf comes to this isle. Most behave secretive about their reason to come here. As far as I can tell they are looking for some dwarfish artifact which was lost in ancient times." />
		<parameter key="keyword_reply51" value="I belong to a sacred order and don't bother about mundane politics." />
	</parameters>
</npc>

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

local burning = createConditionObject(CONDITION_FIRE)
setConditionParam(burning, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(burning, 10, 1000, - 10)

function creatureSayCallback(cid, type, msg)
	if(npcHandler.focus ~= cid) then
		return false
	end
	
	if msgcontains(msg, "sell") then
		selfSay("Are you suggesting I am corruptible?")
		talkState = 1
	elseif msgcontains(msg, "yes") and talkState == 1 then
		selfSay("Take this!")
		doBurnPlayer(cid, getNpcCid(), burning)
		talkState = 0
	elseif msgcontains(msg, "no") and talkState == 1 then
		selfSay("Then be more careful with your words!")
		talkState = 0
	elseif msgcontains(msg, "zathroth") then
		selfSay("Do not mention the name of the cursed one!")
		doBurnPlayer(cid, getNpcCid(), burning)
	elseif isSwear(msg) == TRUE then
		doBurnPlayer(cid, getNpcCid(), burning)
		selfSay("Take this!")
	end
	
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
oh, i don't realy use server save for now, I got an error while importing my schema.sqlite, can you help me out please ?
 
No auto save, used this one for 2 months, Its good if you don't have a pc that will crash! And if you fix all major bugs in your server ~example /clean crashs the server too ~
 
Back
Top