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

Tasks on Nostalrius 7.7 TFS 1.2 Problem

froy

Active Member
Joined
Sep 30, 2009
Messages
151
Solutions
3
Reaction score
36
Hey!

I've been trying to setup a task system/task npc in the files ezzz released 2 months ago.
Now I'm having some problems due to the NPC files does not look like the rest of TFS files.

I'm using this creaturescript CreatureEvent - [CreatureEvent/Npc] Killing in the name of... [Now player can choose the task] (https://otland.net/threads/creatureevent-npc-killing-in-the-name-of-now-player-can-choose-the-task.107936/)

And reduced it down to this for testing purposes:

Code:
local questCreatures =
{
    ["troll"] = {questStarted = (15000,1) questStorage = 15100, creatureStorage = (15000,5) killsRequired = 100, raceName = "Trolls"},
    
    
}
 
local msgType = MESSAGE_STATUS_CONSOLE_RED
 
function onKill(cid, target, lastHit)
 
local creature = questCreatures[getCreatureName(target):lower()]
 
    if creature then
        if isPlayer(target) or isSummon(target) then return true end
 
        if getCreatureStorage(cid, creature.questStarted) > 0 then
            if getCreatureStorage(cid, creature.questStorange) < creature.killsRequired then
                if getCreatureStorage(cid, creature.questStorage) < 0 then
                    doCreatureSetStorage(cid, creature.questStorage, 0)
                end
 
                if getCreatureStorage(cid, creature.creatureStorage) < 0 then
                    doCreatureSetStorage(cid, creature.creatureStorage, 0)
                end
                doCreatureSetStorage(cid, creature.questStorage, getCreatureStorage(cid, creature.questStorage) + 1)
                doCreatureSetStorage(cid, creature.creatureStorage, getCreatureStorage(cid, creature.creatureStorage) + 1)
                doPlayerSendTextMessage(cid, msgType, getCreatureStorage(cid, creature.creatureStorage) .. " " .. getCreatureName(target) .. " defeated. Total [" .. getCreatureStorage(cid, creature.questStorage) .. "/" .. creature.killsRequired .. "] " .. creature.raceName .. ".")
            end
        end
    end
    return true
end

My login.lua text line looks like this:
Code:
registerCreatureEvent("task")
And finally my Creaturescript.xml looks like this
Code:
<event type="kill" name="task" value="task.lua"/>


It could also be my usage of storage that might be wrong?

Here's how the npc looks like:

Code:
# GIMUD - Graphical Interface Multi User Dungeon
# tasknpc.npc: Test task NPC

Name = "TASK NPC"
Outfit = (64,0-0-0-0)
Home = [32337,32206,6] 
Radius = 2

Behaviour = {
ADDRESS,"hello$",male,!   -> "Salute, Sir %N."
ADDRESS,"hi$",male,!      -> *
ADDRESS,"hello$",female,! -> "Salute Madam %N."
ADDRESS,"hi$",female,!    -> *
ADDRESS,!                 -> Idle
BUSY,"hello$",!           -> "Please have some patience %N!", Queue
BUSY,"hi$",!              -> *
BUSY,!                    -> "No!"
VANISH,!                  -> "Farewell. Be careful out there!"

"bye"          -> "Good bye. Dont walk in the dark alone, the evil is just around the corner!", Idle
"farewell"     -> *


# TEST TASK
"task",     ->  "I have a task for you, if you are prepared to face and slay 100 trolls that is?", Topic=1
Topic=1           -> "I guess not.."


Topic=1,"yes"       ->  "Return to me when you've slained the 100 trolls!", SetQuestValue(15000,1)

"task",QuestValue(15000)>0,QuestValue(15000)<2   ->  "You've not succeded with your task yet, return when you are done!"
}

I've reached a wall it feels like.. Anyone can see something that I cannot? ..
 
Solution
goto data/creaturescripts/ and create a file tasks.lua
Lua:
local config = {
    ["crocodile"] = {count = 200, storage = 1001, start = 1, plural = "crocodiles"},

    ["dwarf"] = {count = 200, storage = 1002, start = 1, plural = "dwarves"},
    ["dwarf soldier"] = {count = 200, storage = 1002, start = 1, plural = "dwarves"},

    ["ghoul"] = {count = 150, storage = 1003, start = 1, plural = "ghouls"},
    ["goblin"] = {count = 75, storage = 1004, start = 1, plural = "goblins"},
    ["larva"] = {count = 100, storage = 1005, start = 1, plural = "larva"},

    ["minotaur"] = {count = 100, storage = 1006, start = 1, plural = "minotaurs all kind"},
    ["minotaur guard"] = {count = 100, storage = 1006, start = 1, plural = "minotaurs all...
Fantastic! It worked perfectly ... I apologize for my inattention. I'm studying the codes and I confess I'm a little overwhelmed. Thank you so much! One last doubt. What is the difference from ".npc" to ".ndb". What does "NDB" do inside the npcs folder?
 
I reset my database (In parts. Deletes all old characters). I redid the process and even then NPC Tusker gives us a mission, but when I kill the specified monster, it doesn't count. Before, a message appeared (if I'm not mistaken, it was in red) saying how many monsters were missing. Does anyone have any idea what's going to happen?

I'm without an error on the console. However I am using the command Reload npcs and reload creaturescript. Would it be interesting to test with a complete server reboot?

NOW: [Warning - Monster::Monster] Unknown event name: task
 
Last edited:
goto data/creaturescripts/ and create a file tasks.lua
Lua:
local config = {
    ["crocodile"] = {count = 200, storage = 1001, start = 1, plural = "crocodiles"},

    ["dwarf"] = {count = 200, storage = 1002, start = 1, plural = "dwarves"},
    ["dwarf soldier"] = {count = 200, storage = 1002, start = 1, plural = "dwarves"},

    ["ghoul"] = {count = 150, storage = 1003, start = 1, plural = "ghouls"},
    ["goblin"] = {count = 75, storage = 1004, start = 1, plural = "goblins"},
    ["larva"] = {count = 100, storage = 1005, start = 1, plural = "larva"},

    ["minotaur"] = {count = 100, storage = 1006, start = 1, plural = "minotaurs all kind"},
    ["minotaur guard"] = {count = 100, storage = 1006, start = 1, plural = "minotaurs all kind"},
    ["minotaur mage"] = {count = 100, storage = 1006, start = 1, plural = "minotaurs all kind"},
    ["minotaur archer"] = {count = 100, storage = 1006, start = 1, plural = "minotaurs all kind"},

    ["rotworm"] = {count = 80, storage = 1007, start = 1, plural = "rotworms"},

    ["orc"] = {count = 250, storage = 1008, start = 1, plural = "orcs all kind"},
    ["orc shaman"] = {count = 250, storage = 1008, start = 1, plural = "orcs all kind"},
    ["orc rider"] = {count = 250, storage = 1008, start = 1, plural = "orcs all kind"},
    ["orc warlord"] = {count = 250, storage = 1008, start = 1, plural = "orcs all kind"},
    ["orc leader"] = {count = 250, storage = 1008, start = 1, plural = "orcs all kind"},
    ["orc berserker"] = {count = 250, storage = 1008, start = 1, plural = "orcs all kind"},
    ["orc warrior"] = {count = 250, storage = 1008, start = 1, plural = "orcs all kind"},

    --["panda"] = {count = 150, storage = 1009, start = 1, plural = "pandas"},

    ["scarab"] = {count = 100, storage = 1010, start = 1, plural = "scarabs"},


    ["tarantula"] = {count = 150, storage = 1011, start = 1, plural = "tarantulas"},

    ["troll"] = {count = 50, storage = 1012, start = 1, plural = "trolls"},

    ["ancient scarab"] = {count = 200, storage = 1013, start = 1, plural = "ancient scarabs"},

    ["kongra"] = {count = 120, storage = 1014, start = 1, plural = "apes"},
    ["merlkin"] = {count = 120, storage = 1014, start = 1, plural = "apes"},
    ["sibang"] = {count = 120, storage = 1014, start = 1, plural = "apes"},

    ["black knight"] = {count = 75, storage = 1015, start = 1, plural = "black knight"},

    ["cyclops"] = {count = 120, storage = 1016, start = 1, plural = "cyclopses"},

    ["demon skeleton"] = {count = 100, storage = 1017, start = 1, plural = "demon skeleton"},

    ["dragon"] = {count = 350, storage = 1018, start = 1, plural = "dragons"},

    ["dwarf guard"] = {count = 200, storage = 1019, start = 1, plural = "dwarf guards"},

    ["fire elemental"] = {count = 70, storage = 1020, start = 1, plural = "fire elementals"},

    ["giant spider"] = {count = 300, storage = 1021, start = 1, plural = "giant spiders"},

    ["hero"] = {count = 300, storage = 1022, start = 1, plural = "heroes"},

    ["lizard sentinel"] = {count = 500, storage = 1023, start = 1, plural = "lizards"},
    ["lizard snakecharmer"] = {count = 500, storage = 1023, start = 1, plural = "lizards"},
    ["lizard templar"] = {count = 500, storage = 1023, start = 1, plural = "lizards"},

    ["necromancer"] = {count = 350, storage = 1024, start = 1, plural = "necromancers"},

    --["terror bird"] = {count = 150, storage = 1025, start = 1, plural = "terror birds"},

    ["vampire"] = {count = 500, storage = 1026, start = 1, plural = "vampires"},

    ["behemoth"] = {count = 500, storage = 1027, start = 1, plural = "behemoth"},

    ["dragon lord"] = {count = 500, storage = 1028, start = 1, plural = "dragon lords"},

    ["demon"] = {count = 3000, storage = 1029, start = 1, plural = "demons"},

    ["hydra"] = {count = 600, storage = 1030, start = 1, plural = "hydras"},

    ["serpent spawn"] = {count = 300, storage = 1031, start = 1, plural = "serpent spawns"},

    ["warlock"] = {count = 450, storage = 1032, start = 1, plural = "warlocks"},

    ["swamp troll"] = {count = 100, storage = 1033, start = 1, plural = "swamp trolls"},
    ["bug"] = {count = 100, storage = 1034, start = 1, plural = "bugs"},
    ["hyaena"] = {count = 100, storage = 1035, start = 1, plural = "hyaenas"},
    ["frost troll"] = {count = 250, storage = 1036, start = 1, plural = "frost troll"},
    ["wasp"] = {count = 150, storage = 1037, start = 1, plural = "wasps"},
    ["stone golem"] = {count = 100, storage = 1038, start = 1, plural = "stone golem"},
    ["poison spider"] = {count = 75, storage = 1039, start = 1, plural = "poison spider"},
    ["witch"] = {count = 50, storage = 1040, start = 1, plural = "witch"},
    ["skeleton"] = {count = 100, storage = 1041, start = 1, plural = "skeleton"},
    ["elf scout"] = {count = 200, storage = 1042, start = 1, plural = "elven scouts"},
    ["ghost"] = {count = 150, storage = 1043, start = 1, plural = "ghost"},
    ["scorpion"] = {count = 100, storage = 1044, start = 1, plural = "scorpion"},
    ["cave rat"] = {count = 50, storage = 1045, start = 1, plural = "cave rats"},
    ["snake"] = {count = 100, storage = 1046, start = 1, plural = "snakes"},
    ["lion"] = {count = 50, storage = 1047, start = 1, plural = "lions"},
    ["amazon"] = {count = 100, storage = 1048, start = 1, plural = "amazon"},
    ["valkyrie"] = {count = 100, storage = 1049, start = 1, plural = "valkyrie"},
    ["orc spearman"] = {count = 400, storage = 1050, start = 1, plural = "orc spearman"},
    ["beholder"] = {count = 100, storage = 1051, start = 1, plural = "beholders"},
    ["crypt shambler"] = {count = 150, storage = 1052, start = 1, plural = "crypt shamblers"},
    ["mummy"] = {count = 150, storage = 1053, start = 1, plural = "mummies"},
    ["rat"] = {count = 50, storage = 1054, start = 1, plural = "rats"},
}

function onKill(player, target)
    local monster = config[target:getName():lower()]
    if not monster or target:getMaster() then
        return true
    end

    local storageValue = player:getStorageValue(monster.storage)
    if storageValue >= monster.start then
        if storageValue >= monster.count then
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have already killed " .. monster.count .. " " .. monster.plural .. ". Report back to Tusker in Thais.")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have killed [" .. storageValue .. "/" .. monster.count .. "] " .. monster.plural .. ".")
        end
            player:setStorageValue(monster.storage, storageValue + 1)
    end
    return true
end
add this
Code:
<event type="kill" name="Tasks" script="tasks.lua"/>
to creaturescripts.lua
goto data/npc/ and create npc called tusker.npc

CODE]# GIMUD - Graphical Interface Multi User Dungeon

Name = "Tusker"
Outfit = (75,78-79-113-95-3)
Home = [32359,32233,7]
Radius = 1

Behaviour = {
ADDRESS,"hello$",! -> "Welcome %N! The royal Tibians army is looking for brave adventurers to complete tasks for our legion.", SetQuestValue(49999, 1)
ADDRESS,"hi$",! -> *
ADDRESS,"hiho$",! -> *
ADDRESS,! -> Idle

BUSY,"hello$",! -> "Show some patience please.", Queue
BUSY,"hi$",! -> *
BUSY,"hiho$",! -> *
BUSY,! -> NOP
VANISH,! -> "Farewell."

"bye" -> "Farewell.", Idle
"farewell" -> *

@"gen-tasks.ndb"
}[/CODE]

download and extract the attached file and put it in data/npc

Hey. Sorry to relive that. What function do you use to give items as a reward?
 
Hey. Sorry to relive that. What function do you use to give items as a reward?
put that file in npcs and make the Tasker NPC use it i believe you know how.
Hello how are you, a query, is it possible that you can put what the task counts while in party?
sorry but i don't have that information.
 

Attachments

put that file in npcs and make the Tasker NPC use it i believe you know how.

sorry but i don't have that information.


I already have a gen task. You sent it to us.
Yes I know. But in this case he only gives money and exp as in the other? I am wanting to give item.
And I don't know how to do it
 
I already have a gen task. You sent it to us.
Yes I know. But in this case he only gives money and exp as in the other? I am wanting to give item.
And I don't know how to do it
use this as example...
Lua:
"reward",QuestValue(1029)>=3000 -> "Thank you! Here's your reward.", Amount=1, Create(3389), SetQuestValue(999, 0), SetQuestValue(1029, 0), SetQuestValue(929, QuestValue(929)+1)
"reward",QuestValue(1029)>=1,QuestValue(1029)<3000 -> "You have to kill 3000 demons. Come back later.", Idle
 
use this as example...
Lua:
"reward",QuestValue(1029)>=3000 -> "Thank you! Here's your reward.", Amount=1, Create(3389), SetQuestValue(999, 0), SetQuestValue(1029, 0), SetQuestValue(929, QuestValue(929)+1)
"reward",QuestValue(1029)>=1,QuestValue(1029)<3000 -> "You have to kill 3000 demons. Come back later.", Idle

I changed 3000 monsters to 1, and even then he says I need to kill 3,000. So I put Quantity = 1, Create (3389) in an easier task and finished. However, it only gives us an experience. (I put both the item and the exp). Do you know how to solve it?
 
I changed 3000 monsters to 1, and even then he says I need to kill 3,000. So I put Quantity = 1, Create (3389) in an easier task and finished. However, it only gives us an experience. (I put both the item and the exp). Do you know how to solve it?
If that example doesn’t work for you then something might be wrong in your task system. I dont use task system those files are from old nostalrius datapack if they don’t work correctly I can’t help with that mate 😕
 
goto data/creaturescripts/ and create a file tasks.lua
Lua:
local config = {
    ["crocodile"] = {count = 200, storage = 1001, start = 1, plural = "crocodiles"},

    ["dwarf"] = {count = 200, storage = 1002, start = 1, plural = "dwarves"},
    ["dwarf soldier"] = {count = 200, storage = 1002, start = 1, plural = "dwarves"},

    ["ghoul"] = {count = 150, storage = 1003, start = 1, plural = "ghouls"},
    ["goblin"] = {count = 75, storage = 1004, start = 1, plural = "goblins"},
    ["larva"] = {count = 100, storage = 1005, start = 1, plural = "larva"},

    ["minotaur"] = {count = 100, storage = 1006, start = 1, plural = "minotaurs all kind"},
    ["minotaur guard"] = {count = 100, storage = 1006, start = 1, plural = "minotaurs all kind"},
    ["minotaur mage"] = {count = 100, storage = 1006, start = 1, plural = "minotaurs all kind"},
    ["minotaur archer"] = {count = 100, storage = 1006, start = 1, plural = "minotaurs all kind"},

    ["rotworm"] = {count = 80, storage = 1007, start = 1, plural = "rotworms"},

    ["orc"] = {count = 250, storage = 1008, start = 1, plural = "orcs all kind"},
    ["orc shaman"] = {count = 250, storage = 1008, start = 1, plural = "orcs all kind"},
    ["orc rider"] = {count = 250, storage = 1008, start = 1, plural = "orcs all kind"},
    ["orc warlord"] = {count = 250, storage = 1008, start = 1, plural = "orcs all kind"},
    ["orc leader"] = {count = 250, storage = 1008, start = 1, plural = "orcs all kind"},
    ["orc berserker"] = {count = 250, storage = 1008, start = 1, plural = "orcs all kind"},
    ["orc warrior"] = {count = 250, storage = 1008, start = 1, plural = "orcs all kind"},

    --["panda"] = {count = 150, storage = 1009, start = 1, plural = "pandas"},

    ["scarab"] = {count = 100, storage = 1010, start = 1, plural = "scarabs"},


    ["tarantula"] = {count = 150, storage = 1011, start = 1, plural = "tarantulas"},

    ["troll"] = {count = 50, storage = 1012, start = 1, plural = "trolls"},

    ["ancient scarab"] = {count = 200, storage = 1013, start = 1, plural = "ancient scarabs"},

    ["kongra"] = {count = 120, storage = 1014, start = 1, plural = "apes"},
    ["merlkin"] = {count = 120, storage = 1014, start = 1, plural = "apes"},
    ["sibang"] = {count = 120, storage = 1014, start = 1, plural = "apes"},

    ["black knight"] = {count = 75, storage = 1015, start = 1, plural = "black knight"},

    ["cyclops"] = {count = 120, storage = 1016, start = 1, plural = "cyclopses"},

    ["demon skeleton"] = {count = 100, storage = 1017, start = 1, plural = "demon skeleton"},

    ["dragon"] = {count = 350, storage = 1018, start = 1, plural = "dragons"},

    ["dwarf guard"] = {count = 200, storage = 1019, start = 1, plural = "dwarf guards"},

    ["fire elemental"] = {count = 70, storage = 1020, start = 1, plural = "fire elementals"},

    ["giant spider"] = {count = 300, storage = 1021, start = 1, plural = "giant spiders"},

    ["hero"] = {count = 300, storage = 1022, start = 1, plural = "heroes"},

    ["lizard sentinel"] = {count = 500, storage = 1023, start = 1, plural = "lizards"},
    ["lizard snakecharmer"] = {count = 500, storage = 1023, start = 1, plural = "lizards"},
    ["lizard templar"] = {count = 500, storage = 1023, start = 1, plural = "lizards"},

    ["necromancer"] = {count = 350, storage = 1024, start = 1, plural = "necromancers"},

    --["terror bird"] = {count = 150, storage = 1025, start = 1, plural = "terror birds"},

    ["vampire"] = {count = 500, storage = 1026, start = 1, plural = "vampires"},

    ["behemoth"] = {count = 500, storage = 1027, start = 1, plural = "behemoth"},

    ["dragon lord"] = {count = 500, storage = 1028, start = 1, plural = "dragon lords"},

    ["demon"] = {count = 3000, storage = 1029, start = 1, plural = "demons"},

    ["hydra"] = {count = 600, storage = 1030, start = 1, plural = "hydras"},

    ["serpent spawn"] = {count = 300, storage = 1031, start = 1, plural = "serpent spawns"},

    ["warlock"] = {count = 450, storage = 1032, start = 1, plural = "warlocks"},

    ["swamp troll"] = {count = 100, storage = 1033, start = 1, plural = "swamp trolls"},
    ["bug"] = {count = 100, storage = 1034, start = 1, plural = "bugs"},
    ["hyaena"] = {count = 100, storage = 1035, start = 1, plural = "hyaenas"},
    ["frost troll"] = {count = 250, storage = 1036, start = 1, plural = "frost troll"},
    ["wasp"] = {count = 150, storage = 1037, start = 1, plural = "wasps"},
    ["stone golem"] = {count = 100, storage = 1038, start = 1, plural = "stone golem"},
    ["poison spider"] = {count = 75, storage = 1039, start = 1, plural = "poison spider"},
    ["witch"] = {count = 50, storage = 1040, start = 1, plural = "witch"},
    ["skeleton"] = {count = 100, storage = 1041, start = 1, plural = "skeleton"},
    ["elf scout"] = {count = 200, storage = 1042, start = 1, plural = "elven scouts"},
    ["ghost"] = {count = 150, storage = 1043, start = 1, plural = "ghost"},
    ["scorpion"] = {count = 100, storage = 1044, start = 1, plural = "scorpion"},
    ["cave rat"] = {count = 50, storage = 1045, start = 1, plural = "cave rats"},
    ["snake"] = {count = 100, storage = 1046, start = 1, plural = "snakes"},
    ["lion"] = {count = 50, storage = 1047, start = 1, plural = "lions"},
    ["amazon"] = {count = 100, storage = 1048, start = 1, plural = "amazon"},
    ["valkyrie"] = {count = 100, storage = 1049, start = 1, plural = "valkyrie"},
    ["orc spearman"] = {count = 400, storage = 1050, start = 1, plural = "orc spearman"},
    ["beholder"] = {count = 100, storage = 1051, start = 1, plural = "beholders"},
    ["crypt shambler"] = {count = 150, storage = 1052, start = 1, plural = "crypt shamblers"},
    ["mummy"] = {count = 150, storage = 1053, start = 1, plural = "mummies"},
    ["rat"] = {count = 50, storage = 1054, start = 1, plural = "rats"},
}

function onKill(player, target)
    local monster = config[target:getName():lower()]
    if not monster or target:getMaster() then
        return true
    end

    local storageValue = player:getStorageValue(monster.storage)
    if storageValue >= monster.start then
        if storageValue >= monster.count then
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have already killed " .. monster.count .. " " .. monster.plural .. ". Report back to Tusker in Thais.")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have killed [" .. storageValue .. "/" .. monster.count .. "] " .. monster.plural .. ".")
        end
            player:setStorageValue(monster.storage, storageValue + 1)
    end
    return true
end
add this
Code:
<event type="kill" name="Tasks" script="tasks.lua"/>
to creaturescripts.lua
goto data/npc/ and create npc called tusker.npc

CODE]# GIMUD - Graphical Interface Multi User Dungeon

Name = "Tusker"
Outfit = (75,78-79-113-95-3)
Home = [32359,32233,7]
Radius = 1

Behaviour = {
ADDRESS,"hello$",! -> "Welcome %N! The royal Tibians army is looking for brave adventurers to complete tasks for our legion.", SetQuestValue(49999, 1)
ADDRESS,"hi$",! -> *
ADDRESS,"hiho$",! -> *
ADDRESS,! -> Idle

BUSY,"hello$",! -> "Show some patience please.", Queue
BUSY,"hi$",! -> *
BUSY,"hiho$",! -> *
BUSY,! -> NOP
VANISH,! -> "Farewell."

"bye" -> "Farewell.", Idle
"farewell" -> *

@"gen-tasks.ndb"
}[/CODE]

download and extract the attached file and put it in data/npc
Great code, but I think that the cancel part coud be improved because it works without checking what task is the player running and it creates as many rows on database as tasks you have in your system.
I'm talking about this part:
Lua:
# --------- CANCEL TASK -----------

"cancel",QuestValue(999)=1 -> "Are you sure you want to cancel your currently active task?", Topic=2
"cancel" -> "You are not in a task."
Topic=2,"yes" -> "Okay. I have disposed your assigned task.", SetQuestValue(999,0), SetQuestValue(1001,0)
, SetQuestValue(1002,0), SetQuestValue(1003,0), SetQuestValue(1004,0), SetQuestValue(1005,0), SetQuestValue(1006,0), SetQuestValue(1007,0), SetQuestValue(1008,0), SetQuestValue(1009,0)
, SetQuestValue(1010,0), SetQuestValue(1011,0), SetQuestValue(1012,0), SetQuestValue(1013,0), SetQuestValue(1014,0), SetQuestValue(1015,0), SetQuestValue(1016,0), SetQuestValue(1017,0)
, SetQuestValue(1018,0), SetQuestValue(1019,0), SetQuestValue(1020,0), SetQuestValue(1021,0), SetQuestValue(1022,0), SetQuestValue(1023,0), SetQuestValue(1024,0), SetQuestValue(1025,0)
, SetQuestValue(1026,0), SetQuestValue(1027,0), SetQuestValue(1028,0), SetQuestValue(1029,0), SetQuestValue(1030,0), SetQuestValue(1031,0), SetQuestValue(1032,0), SetQuestValue(1033,0)
, SetQuestValue(1034,0), SetQuestValue(1035,0), SetQuestValue(1036,0), SetQuestValue(1037,0), SetQuestValue(1038,0), SetQuestValue(1039,0), SetQuestValue(1040,0), SetQuestValue(1041,0)
, SetQuestValue(1042,0), SetQuestValue(1043,0), SetQuestValue(1044,0), SetQuestValue(1045,0), SetQuestValue(1046,0), SetQuestValue(1047,0), SetQuestValue(1048,0), SetQuestValue(1049,0)
, SetQuestValue(1050,0), SetQuestValue(1051,0), SetQuestValue(1052,0), SetQuestValue(1053,0), SetQuestValue(1054,0)

Topic=2 -> "Some other time then."

I think it could be more effective to only cancel the current task, that way the db it's more optimized, but I still didn't have time to solve.
 
Great code, but I think that the cancel part coud be improved because it works without checking what task is the player running and it creates as many rows on database as tasks you have in your system.
I'm talking about this part:
Lua:
# --------- CANCEL TASK -----------

"cancel",QuestValue(999)=1 -> "Are you sure you want to cancel your currently active task?", Topic=2
"cancel" -> "You are not in a task."
Topic=2,"yes" -> "Okay. I have disposed your assigned task.", SetQuestValue(999,0), SetQuestValue(1001,0)
, SetQuestValue(1002,0), SetQuestValue(1003,0), SetQuestValue(1004,0), SetQuestValue(1005,0), SetQuestValue(1006,0), SetQuestValue(1007,0), SetQuestValue(1008,0), SetQuestValue(1009,0)
, SetQuestValue(1010,0), SetQuestValue(1011,0), SetQuestValue(1012,0), SetQuestValue(1013,0), SetQuestValue(1014,0), SetQuestValue(1015,0), SetQuestValue(1016,0), SetQuestValue(1017,0)
, SetQuestValue(1018,0), SetQuestValue(1019,0), SetQuestValue(1020,0), SetQuestValue(1021,0), SetQuestValue(1022,0), SetQuestValue(1023,0), SetQuestValue(1024,0), SetQuestValue(1025,0)
, SetQuestValue(1026,0), SetQuestValue(1027,0), SetQuestValue(1028,0), SetQuestValue(1029,0), SetQuestValue(1030,0), SetQuestValue(1031,0), SetQuestValue(1032,0), SetQuestValue(1033,0)
, SetQuestValue(1034,0), SetQuestValue(1035,0), SetQuestValue(1036,0), SetQuestValue(1037,0), SetQuestValue(1038,0), SetQuestValue(1039,0), SetQuestValue(1040,0), SetQuestValue(1041,0)
, SetQuestValue(1042,0), SetQuestValue(1043,0), SetQuestValue(1044,0), SetQuestValue(1045,0), SetQuestValue(1046,0), SetQuestValue(1047,0), SetQuestValue(1048,0), SetQuestValue(1049,0)
, SetQuestValue(1050,0), SetQuestValue(1051,0), SetQuestValue(1052,0), SetQuestValue(1053,0), SetQuestValue(1054,0)

Topic=2 -> "Some other time then."

I think it could be more effective to only cancel the current task, that way the db it's more optimized, but I still didn't have time to solve.
well i really don't use it so someone else could do that, i did posted that script because i have it on my server files but as said before im not using task system on my server.
 
Bump. Someone have !task command for this? And how to set up it to work on party? (only 1 hit and count task).

actually it's:

function onKill(player, target)
 
Back
Top