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

Puzzling thing

Mera Mero

Guess Who?
Joined
Dec 27, 2014
Messages
417
Reaction score
86
I need to make a Stone (it can be other thing, but stone is for example) what is required to kill. Every 10% hp (it can be just amount of hp) lose, it will spawn wave of monsters. Every wave will be stronger that previous. After kill the Stone, teleport will appear. i already saw it before on ot
Thanks
Yo @Limos
 
Last edited:
***** it works on mobs, ya just need to register in the monster file now someone plez do this for tfs 1.0

everyone says go use tfs 1.0
guess what? every script being made is for 0.4/0.3 good luck getting new peeps to use 1.0
tfs 1.1 hasn't been updated for months and it's still on the 10.41 client (which was fucking 10 months ago)

guess we'll be stuck in 8.6 forever

Dude you need to check yourself just a bit, first off you can't come on here cursing at people and calling them names (you may not intend to be offensive, but many take it offensively, especially with your tone), and expect people to jump right on helping you get shit done. Secondly, need to check your facts homie, TFS 1.1's last update as of this post:

upload_2015-1-31_21-20-11.png

Yeah, tfs 1.1 is REGULARLY updated! And as for the new scripts, people can choose what the fuck they want to work on, who are you to say someone shouldn't develop this or that, if they want to yeah go for it. Now as for this forum supporting the older servers and distro's centered around 8.6, I agree, time to move out of the dark ages. But you definitely need to check yourself bro, can't come at people like you are and think anything good is going to come from it...
 
If I recall right, then 0.3.x didn't support onStatsChange for monsters, it had it's purpose for players only.
However you can do this with onThink, it's pretty similiar scriptwise to what Flatlander posted already.
okey thanks i gone try it again
did you
registerCreatureEvent(uid, eventName) ?
yea i already created it but i didn't try onthink like evil hero said but i will try it ;)
***** it works on mobs, ya just need to register in the monster file now someone plez do this for tfs 1.0

everyone says go use tfs 1.0
guess what? every script being made is for 0.4/0.3 good luck getting new peeps to use 1.0

guess we'll be stuck in 8.6 forever
The first not attached to anything that you do not understand anything about it and secondly this is not my problem that you use TFS 1.0 and If you have problems, go and cry somewhere do not cry here please :)
 
go into your monster folder and look if you have a folder called "scripts" if not create that folder.
put the lua file with the stuff I'll post now into that folder.

Code:
local state = {}
local wave = {
   {"monstername1","monstername2"}, -- this happens at 90% health
   {"monstername1","monstername2"}, -- this happens at 80% health
   {"monstername1","monstername2"}, -- this happens at 70% health
   {"monstername1","monstername2"}, -- this happens at 60% health
   {"monstername1","monstername2"}, -- this happens at 50% health
   {"monstername1","monstername2"}, -- this happens at 40% health
   {"monstername1","monstername2"}, -- this happens at 30% health
   {"monstername1","monstername2"}, -- this happens at 20% health
   {"monstername1","monstername2"} -- this happens at 10% health
}

function onThink(cid, interval)
   if not isCreature(cid) then
     return
   end
   if state[cid] == nil then
     state[cid] = 1
   end
   if state[cid] <= #wave then
     if getCreatureHealth(cid) <= (getCreatureMaxHealth(cid) - (getCreatureMaxHealth(cid) / 10 * state[cid])) then
       for i = 1, #wave[state[cid]] do
         doSummonMonster(cid, wave[state[cid]][i])
       end
       state[cid] = state[cid] + 1
     end
   end
end

now open the xml file of the monster and insert the following:
search for
Code:
manacost="x"
after that put this
Code:
script="FILENAME.lua"
You have to rename the FILENAME to the same name as the lua file is called in the folder.
Then you have to edit the tables with the monster spawns "{"monstername1","monstername2"}" the more monsters you add the more monsters will be spawned.

This is only for the purpose to spawn the waves of monsters at certain health ammounts of the monster, you can make the teleport with an onDeath script as that one suits better for that case.
 
go into your monster folder and look if you have a folder called "scripts" if not create that folder.
put the lua file with the stuff I'll post now into that folder.

Code:
local state = {}
local wave = {
   {"monstername1","monstername2"}, -- this happens at 90% health
   {"monstername1","monstername2"}, -- this happens at 80% health
   {"monstername1","monstername2"}, -- this happens at 70% health
   {"monstername1","monstername2"}, -- this happens at 60% health
   {"monstername1","monstername2"}, -- this happens at 50% health
   {"monstername1","monstername2"}, -- this happens at 40% health
   {"monstername1","monstername2"}, -- this happens at 30% health
   {"monstername1","monstername2"}, -- this happens at 20% health
   {"monstername1","monstername2"} -- this happens at 10% health
}

function onThink(cid, interval)
   if not isCreature(cid) then
     return
   end
   if state[cid] == nil then
     state[cid] = 1
   end
   if state[cid] <= #wave then
     if getCreatureHealth(cid) <= (getCreatureMaxHealth(cid) - (getCreatureMaxHealth(cid) / 10 * state[cid])) then
       for i = 1, #wave[state[cid]] do
         doSummonMonster(cid, wave[state[cid]][i])
       end
       state[cid] = state[cid] + 1
     end
   end
end

now open the xml file of the monster and insert the following:
search for
Code:
manacost="x"
after that put this
Code:
script="FILENAME.lua"
You have to rename the FILENAME to the same name as the lua file is called in the folder.
Then you have to edit the tables with the monster spawns "{"monstername1","monstername2"}" the more monsters you add the more monsters will be spawned.

This is only for the purpose to spawn the waves of monsters at certain health ammounts of the monster, you can make the teleport with an onDeath script as that one suits better for that case.
omg thanks man for this script i didnt test it yet but i will after i back home :p btw where can i put name of main monster on local state =(BOSS NAME?)
 
omg thanks man for this script i didnt test it yet but i will after i back home :p btw where can i put name of main monster on local state =(BOSS NAME?)
You don't need to put the name anywhere, it's already connected to the boss monster through the xml file.
This way only the bossmonster will behave in that way and no other monsters.
 
You don't need to put the name anywhere, it's already connected to the boss monster through the xml file.
This way only the bossmonster will behave in that way and no other monsters.
doesn't work :( here you are what i did
Code:
<monster name="Ghazbaran" nameDescription="Ghazbaran" race="undead" experience="15000" speed="400" manacost="0" script="lucky.lua">
    <health now="60000" max="60000"/>
and i've tried lucky.lua and lucky only and i've edited the script with name of the monsters like
Code:
local state = {}
local wave = {
   {"Troll","Monk"}, -- this happens at 90% health
   {"rat","dragon"}, -- this happens at 80% health
   {"dragon","dragon"}, -- this happens at 70% health
   {"dragon","dragon"}, -- this happens at 60% health
   {"dragon","dragon"}, -- this happens at 50% health
   {"dragon","dragon"}, -- this happens at 40% health
   {"dragon","dragon"}, -- this happens at 30% health
   {"dragon","dragon"}, -- this happens at 20% health
   {"dragon","dragon lord"} -- this happens at 10% health
}

function onThink(cid, interval)
   if not isCreature(cid) then
     return
   end
   if state[cid] == nil then
     state[cid] = 1
   end
   if state[cid] <= #wave then
     if getCreatureHealth(cid) <= (getCreatureMaxHealth(cid) - (getCreatureMaxHealth(cid) / 10 * state[cid])) then
       for i = 1, #wave[state[cid]] do
         doSummonMonster(cid, wave[state[cid]][i])
       end
       state[cid] = state[cid] + 1
     end
   end
end
are you sure this script is working with 0.3.6? :(
 
doesn't work :( here you are what i did
Code:
<monster name="Ghazbaran" nameDescription="Ghazbaran" race="undead" experience="15000" speed="400" manacost="0" script="lucky.lua">
    <health now="60000" max="60000"/>
and i've tried lucky.lua and lucky only and i've edited the script with name of the monsters like
Code:
local state = {}
local wave = {
   {"Troll","Monk"}, -- this happens at 90% health
   {"rat","dragon"}, -- this happens at 80% health
   {"dragon","dragon"}, -- this happens at 70% health
   {"dragon","dragon"}, -- this happens at 60% health
   {"dragon","dragon"}, -- this happens at 50% health
   {"dragon","dragon"}, -- this happens at 40% health
   {"dragon","dragon"}, -- this happens at 30% health
   {"dragon","dragon"}, -- this happens at 20% health
   {"dragon","dragon lord"} -- this happens at 10% health
}

function onThink(cid, interval)
   if not isCreature(cid) then
     return
   end
   if state[cid] == nil then
     state[cid] = 1
   end
   if state[cid] <= #wave then
     if getCreatureHealth(cid) <= (getCreatureMaxHealth(cid) - (getCreatureMaxHealth(cid) / 10 * state[cid])) then
       for i = 1, #wave[state[cid]] do
         doSummonMonster(cid, wave[state[cid]][i])
       end
       state[cid] = state[cid] + 1
     end
   end
end
are you sure this script is working with 0.3.6? :(
have you put the lucky.lua into the monsters/scripts folder?
do you get any kind of errors or such?
 
have you put the lucky.lua into the monsters/scripts folder?
do you get any kind of errors or such?
yea i made all steps and i didnt get any errors
2mgplld.jpg

YEA SOLVED IT!
THANKS
 
Last edited:
Ok! I am going to teach you the most important lua scripting tool you will ever use.

ANY time you do not get errors and do not know why a script is not working.
You do this:

Code:
function onStatsChange(cid, attacker, type, combat, value)
   doCreatureSay(cid, "Running onStatsChange Script", 1)
   if type == 1 then
     doCreatureSay(cid, "HealthLoss Damage Being Done", 1)
     if (getCreatureHealth(cid) > getCreatureMaxHealth(cid)*0.9) and (getCreatureHealth(cid)-value < getCreatureMaxHealth(cid)*0.9) then
       doCreatureSay(cid, "I have been damaged below 90% health", 1)
       --Do whatever you want to happen after dropping below 90% health
     end
   end
   return true
end

Now, after adding in "doCreatureSay(cid, "Whats Happening", 1)" to every important part of the script, you can find out what part of the script is not working. Or if the script is not running at all.

Also, if you would post the .xml file for the monster that this script is for, and the script you are trying to get to work with the monster, everyone will be able to help you MUCH faster.
 
Ok! I am going to teach you the most important lua scripting tool you will ever use.

ANY time you do not get errors and do not know why a script is not working.
You do this:

Code:
function onStatsChange(cid, attacker, type, combat, value)
   doCreatureSay(cid, "Running onStatsChange Script", 1)
   if type == 1 then
     doCreatureSay(cid, "HealthLoss Damage Being Done", 1)
     if (getCreatureHealth(cid) > getCreatureMaxHealth(cid)*0.9) and (getCreatureHealth(cid)-value < getCreatureMaxHealth(cid)*0.9) then
       doCreatureSay(cid, "I have been damaged below 90% health", 1)
       --Do whatever you want to happen after dropping below 90% health
     end
   end
   return true
end

Now, after adding in "doCreatureSay(cid, "Whats Happening", 1)" to every important part of the script, you can find out what part of the script is not working. Or if the script is not running at all.

Also, if you would post the .xml file for the monster that this script is for, and the script you are trying to get to work with the monster, everyone will be able to help you MUCH faster.
hmm thx for this advice but i'm using script of @Evil Hero and its working good not but there is one problem more i used this script on creaturescripts not on scripts/monsters like evil said and now when the monster die all his monsters going to die is there solve for it?
 
Last edited:
well I basicly made the monsters summons, you need to change:
Code:
doSummonMonster(cid, wave[state[cid]][i])
this part to create normal monsters instead of summons, will post the solution later.
 
well I basicly made the monsters summons, you need to change:
Code:
doSummonMonster(cid, wave[state[cid]][i])
this part to create normal monsters instead of summons, will post the solution later.
mm i tried to make it doCreateMonster instead of doSummonMonster but found this error
Code:
[02/02/2015 17:07:50] [Error - CreatureScript Interface]
[02/02/2015 17:07:50] data/creaturescripts/scripts/MOS.lua:onThink
[02/02/2015 17:07:50] Description:
[02/02/2015 17:07:50] (luaDoCreateMonster) Monster with name '1073750832' not found
 
mm i tried to make it doCreateMonster instead of doSummonMonster but found this error
Code:
[02/02/2015 17:07:50] [Error - CreatureScript Interface]
[02/02/2015 17:07:50] data/creaturescripts/scripts/MOS.lua:onThink
[02/02/2015 17:07:50] Description:
[02/02/2015 17:07:50] (luaDoCreateMonster) Monster with name '1073750832' not found

Go to the LUA_FUNCTIONS file in the DOC folder, and search for "doCreateMonster.

You will find that doCreateMonster works like this :
Code:
doCreateMonster(name, pos[, extend = false[, force = false]])
 
Go to the LUA_FUNCTIONS file in the DOC folder, and search for "doCreateMonster.

You will find that doCreateMonster works like this :
Code:
doCreateMonster(name, pos[, extend = false[, force = false]])
sorry but i didn't get it :S still newbie with lua and couldn't understand what you mean :(
Game designers don't program and if they do its very minute.
http://en.wikipedia.org/wiki/Game_design
What is this income with my thread? o_O
 
Code:
doCreateMonster(wave[state[cid]][i], getCreaturePosition(cid), false, true)
should do the trick

[02/02/2015 17:30:35] [Error - CreatureScript Interface]
[02/02/2015 17:30:36] data/creaturescripts/scripts/MOS.lua:eek:nThink
[02/02/2015 17:30:36] Description:
[02/02/2015 17:30:36] (luaDoCreateMonster) Monster with name '' not found
i'm trying to learn :p and as soon as i will be good with it ;D
 
Back
Top