Maybe you wrote bad the position because i can't find any problem in your script.
Ah so npc should teleport me to "THESNAPPER_POSITION" but where have I to put location (x:, y:, z: ) ?
Maybe you wrote bad the position because i can't find any problem in your script.
Ah so npc should teleport me to "THESNAPPER_POSITION" but where have I to put location (x:, y:, z: ) ?
local THESNAPPER_POSITION = {x = 100, y = 100, z = 7}
Change "THESNAPER_POSITION" for the position, Ex: {x = 100, y = 100, z = 7}.
second = {enable = true, type = "boss", values = {x=972,y=971,z=7}, [B]false}[/B]
second = {enable = true, type = "boss", values = {x=972,y=971,z=7[B]}}[/B]
second = {enable = true, type = "boss", values = {x=972,y=971,z=7},[B] true}[/B]
when i say "tasks" to npc its in console, i killed like 1000 trolls but grizzly still says that[Warning - Error::Killing in the name of::Tasks config] Something is wrong.
missionQuest = {}
missionQuest.__index = missionQuest
function missionQuest.new(doneStorage, confirmedStorage)
if(type(doneStorage) ~= 'number') then
return FALSE, error("missionQuest: Requiring number for 'doneStorage' (got " .. type(doneStorage) .. ")")
end
local mt = {
doneStorage = doneStorage,
confirmedStorage = confirmedStorage,
missions = {}
}
setmetatable(mt, missionQuest)
return mt
end
function missionQuest:add(name)
table.insert(self.missions, name)
_G["MISSION_" .. name:gsub(" ", "_"):upper()] = #self.missions
end
function missionQuest:check(cid, storageValue)
local flags = getPlayerStorageValue(cid, storageValue)
local found, success = 0, TRUE
for k, name in ipairs(self.missions) do
local flag = k ^ 2
if(bit.band(flags, flag) == flag) then
found = found + 1
elseif(success == TRUE) then
success = FALSE
end
end
return success, found
end
function missionQuest:checkDone(cid)
return self:check(cid, self.doneStorage)
end
function missionQuest:checkConfirmed(cid)
return self:check(cid, self.confirmedStorage)
end
function missionQuest:has(cid, flag, storageValue)
flag = flag ^ 2
local flags = getPlayerStorageValue(cid, storageValue)
return (bit.band(flags, flag) == flag) and TRUE or FALSE
end
function missionQuest:hasDone(cid, flag)
return self:has(cid, flag, self.doneStorage)
end
function missionQuest:doneTakeItems(cid, flag, ...)
if(self:hasDone(cid, flag) == FALSE) then
return FALSE
end
for _, v in ipairs(arg) do
local count, itemid = 1
if(type(v) == 'table') then
itemid, count = unpack(v)
else
itemid = v
end
if(getPlayerItemCount(cid, itemid) < count) then
return FALSE, itemid, count
end
end
for _, v in ipairs(arg) do
local count, itemid = 1
if(type(v) == 'table') then
itemid, count = unpack(v)
else
itemid = v
end
if(isItemStackable(itemid) == TRUE) then
doPlayerRemoveItem(cid, itemid, count)
else
for i = 1, count do
doPlayerRemoveItem(cid, itemid, 1)
end
end
end
return TRUE
end
function missionQuest:hasConfirmed(cid, flag)
return self:has(cid, flag, self.confirmedStorage)
end
function missionQuest:set(cid, flag, storageValue)
local flags = getPlayerStorageValue(cid, storageValue)
setPlayerStorageValue(cid, storageValue, bit.bor(flags, flag))
end
function missionQuest:setDone(cid, flag)
self:set(cid, flag, self.doneStorage)
end
function missionQuest:setConfirmed(cid, flag)
self:set(cid, flag, self.confirmedStorage)
end
-- Simplification function for adding missions using table.
function createMission(t, doneStorage, confirmedStorage)
local missionQ = missionQuest.new(doneStorage, confirmedStorage)
for _, name in ipairs(t) do
missionQ:add(name)
end
return missionQ
end
[28] = {questStarted = 1537, questStorage = 65027, killsRequired = 4000, raceName = "Magicians", rewards = {first = {enable = true, type = "boss", values = {x=32028,y=32431,z=12}}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
["Necromancer"] = {questStarted = 1537, questStorage = 65027, creatureStorage = 15071, killsRequired = 4000, raceName = "Magicians"},
["Priestess"] = {questStarted = 1537, questStorage = 65027, creatureStorage = 15072, killsRequired = 4000, raceName = "Magicians"},
19:05 Grizzly Adams: Current 0 Magicians killed, you need to kill 4000.
I've found a bug.
All worked perfect until 28th task
Code:[28] = {questStarted = 1537, questStorage = 65027, killsRequired = 4000, raceName = "Magicians", rewards = {first = {enable = true, type = "boss", values = {x=32028,y=32431,z=12}}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
Code:["Necromancer"] = {questStarted = 1537, questStorage = 65027, creatureStorage = 15071, killsRequired = 4000, raceName = "Magicians"}, ["Priestess"] = {questStarted = 1537, questStorage = 65027, creatureStorage = 15072, killsRequired = 4000, raceName = "Magicians"},
NPC gave me task but he says all time
And when I kill necro/priestess then there is no blue massage in default "killed xx/4000"
i'm sure there is no problem with monster name
so whats wrong?
The problem is in the monsters names, remember, monster names need to be equal in creaturescript and monster file (Ex: Necromancer.xml)
The storages are good. The problem is there, in the names.
local creature = questCreatures[getCreatureName(target)[B][COLOR="Red"]:lower()[/COLOR][/B]]
The problem is in the monsters names, remember, monster names need to be equal in creaturescript and monster file (Ex: Necromancer.xml)
The storages are good. The problem is there, in the names.
["Minotaur"] = {questStarted = 1536, questStorage = 65026, creatureStorage = 15070, killsRequired = 5000, raceName = "Minotaurs"},
["Priestess"] = {questStarted = 1537, questStorage = 65027, creatureStorage = 15071, killsRequired = 4000, raceName = "Magicians"},
["Necromancer"] = {questStarted = 1537, questStorage = 65027, creatureStorage = 15072, killsRequired = 4000, raceName = "Magicians"},
["Priestess"] = {questStarted = 1538, questStorage = 65028, creatureStorage = 15073, killsRequired = 1000, raceName = "Magicians"},
["Necromancer"] = {questStarted = 1538, questStorage = 65028, creatureStorage = 15074, killsRequired = 1000, raceName = "Magicians"},
[27] = {questStarted = 1536, questStorage = 65026, killsRequired = 5000, raceName = "Minotaurs", rewards = {first = {enable = true, type = "boss", values = {x=32454,y=31997,z=9}}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[28] = {questStarted = 1537, questStorage = 65027, killsRequired = 4000, raceName = "Magicians", rewards = {first = {enable = true, type = "boss", values = {x=32028,y=32431,z=12}}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[29] = {questStarted = 1538, questStorage = 65028, killsRequired = 1000, raceName = "Magicians", rewards = {first = {enable = true, type = "exp", values = 40000}, second = {enable = true, type = "boss", values = {x=32873,y=32607,z=6}}, third = {enable = false, type = nil, values = {nil, nil}}}},
function onKill(cid, target, lastHit)
local questCreatures =
{
["Troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15000, killsRequired = 100, raceName = "Trolls"},
["Frost Troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15001, killsRequired = 100, raceName = "Trolls"},
["Furious Troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15002, killsRequired = 100, raceName = "Trolls"},
["Island Troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15003, killsRequired = 100, raceName = "Trolls"},
["Swamp Troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15004, killsRequired = 100, raceName = "Trolls"},
["Troll Champion"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15005, killsRequired = 100, raceName = "Trolls"},
["Troll Legionnaire"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15006, killsRequired = 100, raceName = "Trolls"},
["Goblin"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15007, killsRequired = 150, raceName = "Goblins"},
["Goblin Assassin"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15008, killsRequired = 150, raceName = "Goblins"},
["Goblin Leader"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15009, killsRequired = 150, raceName = "Goblins"},
["Goblin Scavenger"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15010, killsRequired = 150, raceName = "Goblins"},
["Rotworm"] = {questStarted = 1512, questStorage = 65002, creatureStorage = 15011, killsRequired = 300, raceName = "Rotworms"},
["Carriom Worm"] = {questStarted = 1512, questStorage = 65002, creatureStorage = 15012, killsRequired = 300, raceName = "Rotworms"},
["Cyclops"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15013, killsRequired = 500, raceName = "Cyclops"},
["Cyclops Smith"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15014, killsRequired = 500, raceName = "Cyclops"},
["Cyclops Drone"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15015, killsRequired = 500, raceName = "Cyclops"},
["Crocodile"] = {questStarted = 1514, questStorage = 65004, creatureStorage = 15016, killsRequired = 300, raceName = "Crocodiles"},
["Tarantula"] = {questStarted = 1515, questStorage = 65005, creatureStorage = 15017, killsRequired = 300, raceName = "Tarantulas"},
["Carniphila"] = {questStarted = 1516, questStorage = 65006, creatureStorage = 15018, killsRequired = 150, raceName = "Carniphilas"},
["Stone Golem"] = {questStarted = 1517, questStorage = 65007, creatureStorage = 15019, killsRequired = 200, raceName = "Stone Golems"},
["Mammoth"] = {questStarted = 1518, questStorage = 65008, creatureStorage = 15020, killsRequired = 300, raceName = "Mammoths"},
["Ice Golem"] = {questStarted = 1519, questStorage = 65009, creatureStorage = 15021, killsRequired = 300, raceName = "Ice Golems"},
["Quara Predator Scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15022, killsRequired = 300, raceName = "Quaras Scout"},
["Quara Constrictor Scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15023, killsRequired = 300, raceName = "Quaras Scout"},
["Quara Hydromancer Scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15024, killsRequired = 300, raceName = "Quaras Scout"},
["Quara Mantassin Scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15025, killsRequired = 300, raceName = "Quaras Scout"},
["Quara Pincher Scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15026, killsRequired = 300, raceName = "Quaras Scout"},
["Quara Predator"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15027, killsRequired = 300, raceName = "Quaras"},
["Quara Constrictor"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15028, killsRequired = 300, raceName = "Quaras"},
["Quara Hydromancer"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15029, killsRequired = 300, raceName = "Quaras"},
["Quara Mantassin"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15030, killsRequired = 300, raceName = "Quaras"},
["Quara Pincher"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15031, killsRequired = 300, raceName = "Quaras"},
["Water Elemental"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15032, killsRequired = 70, raceName = "Water Elementals"},
["Roaring Water Elemental"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15033, killsRequired = 70, raceName = "Water Elementals"},
["Slick Water Elemental"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15034, killsRequired = 70, raceName = "Water Elementals"},
["Massive Water Elemental"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15035, killsRequired = 70, raceName = "Water Elementals"},
["Earth Elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15036, killsRequired = 70, raceName = "Earth Elementals"},
["Jagged Earth Elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15037, killsRequired = 70, raceName = "Earth Elementals"},
["Massive Earth Elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15038, killsRequired = 70, raceName = "Earth Elementals"},
["Muddy Earth Elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15039, killsRequired = 70, raceName = "Earth Elementals"},
["Energy Elemental"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15040, killsRequired = 70, raceName = "Energy Elementals"},
["Charged Energy Elemental"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15041, killsRequired = 70, raceName = "Energy Elementals"},
["Massive Energy Elemental"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15042, killsRequired = 70, raceName = "Energy Elementals"},
["Overcharged Energy Elemental"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15043, killsRequired = 70, raceName = "Energy Elementals"},
["Fire Elemental"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15044, killsRequired = 70, raceName = "Fire Elementals"},
["Blazing Fire Elemental"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15045, killsRequired = 70, raceName = "Fire Elementals"},
["Blistering Fire Elemental"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15046, killsRequired = 70, raceName = "Fire Elementals"},
["Massive Fire Elemental"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15047, killsRequired = 70, raceName = "Fire Elementals"},
["Mutated Rat"] = {questStarted = 1526, questStorage = 65016, creatureStorage = 15048, killsRequired = 200, raceName = "Mutated Rats"},
["Giant Spider"] = {questStarted = 1527, questStorage = 65017, creatureStorage = 15049, killsRequired = 500, raceName = "Giant Spiders"},
["Hydra"] = {questStarted = 1528, questStorage = 65018, creatureStorage = 15050, killsRequired = 2000, raceName = "Hydras"},
["Sea Serpent"] = {questStarted = 1529, questStorage = 65019, creatureStorage = 15051, killsRequired = 2000, raceName = "Sea Serpents"},
["Behemoth"] = {questStarted = 1530, questStorage = 65020, creatureStorage = 15052, killsRequired = 2000, raceName = "Behemoths"},
["Serpent Spawn"] = {questStarted = 1531, questStorage = 65021, creatureStorage = 15053, killsRequired = 1500, raceName = "Serpents Spawn"},
["Green Djinn"] = {questStarted = 1532, questStorage = 65022, creatureStorage = 15054, killsRequired = 500, raceName = "Green Djinns"},
["Efreet"] = {questStarted = 1532, questStorage = 65022, creatureStorage = 15055, killsRequired = 500, raceName = "Green Djinns"},
["Blue Djinn"] = {questStarted = 1533, questStorage = 65023, creatureStorage = 15056, killsRequired = 500, raceName = "Blue Djinns"},
["Marid"] = {questStarted = 1533, questStorage = 65023, creatureStorage = 15057, killsRequired = 500, raceName = "Blue Djinns"},
["Pirate Buccaneer"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15058, killsRequired = 3000, raceName = "Pirates"},
["Pirate Corsair"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15059, killsRequired = 3000, raceName = "Pirates"},
["Pirate Cutthroat"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15060, killsRequired = 3000, raceName = "Pirates"},
["Pirate Ghost"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15061, killsRequired = 3000, raceName = "Pirates"},
["Pirate Marauder"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15062, killsRequired = 3000, raceName = "Pirates"},
["Pirate Skeleton"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15063, killsRequired = 3000, raceName = "Pirates"},
["Pirate Buccaneer"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15064, killsRequired = 3000, raceName = "Pirates"},
["Pirate Corsair"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15065, killsRequired = 3000, raceName = "Pirates"},
["Pirate Butthroat"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15066, killsRequired = 3000, raceName = "Pirates"},
["Pirate Ghost"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15067, killsRequired = 3000, raceName = "Pirates"},
["Pirate Marauder"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15068, killsRequired = 3000, raceName = "Pirates"},
["Pirate Skeleton"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15069, killsRequired = 3000, raceName = "Pirates"},
["Minotaur"] = {questStarted = 1536, questStorage = 65026, creatureStorage = 15070, killsRequired = 5000, raceName = "Minotaurs"},
["Priestess"] = {questStarted = 1537, questStorage = 65027, creatureStorage = 15071, killsRequired = 4000, raceName = "Magicians"},
["Necromancer"] = {questStarted = 1537, questStorage = 65027, creatureStorage = 15072, killsRequired = 4000, raceName = "Magicians"},
["Priestess"] = {questStarted = 1538, questStorage = 65028, creatureStorage = 15073, killsRequired = 1000, raceName = "Magicians"},
["Necromancer"] = {questStarted = 1538, questStorage = 65028, creatureStorage = 15074, killsRequired = 1000, raceName = "Magicians"},
["Demon"] = {questStarted = 1539, questStorage = 65029, creatureStorage = 15075, killsRequired = 6666, raceName = "Demons"}
}
local creature = questCreatures[getCreatureName(target)]
if creature then
if(isPlayer(target) == true) then
return true
end
if getPlayerStorageValue(cid, creature.questStarted) > 0 then
if getPlayerStorageValue(cid, creature.questStorage) < creature.killsRequired then
if getPlayerStorageValue(cid, creature.questStorage) < 0 then
doPlayerSetStorageValue(cid, creature.questStorage, 0)
end
if getPlayerStorageValue(cid, creature.creatureStorage) < 0 then
doPlayerSetStorageValue(cid, creature.creatureStorage, 0)
end
doPlayerSetStorageValue(cid, creature.questStorage, getPlayerStorageValue(cid, creature.questStorage) + 1)
doPlayerSetStorageValue(cid, creature.creatureStorage, getPlayerStorageValue(cid, creature.creatureStorage) + 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "" .. getPlayerStorageValue(cid, creature.creatureStorage) .. " " .. getCreatureName(target) .. " defeated. Total [" .. getPlayerStorageValue(cid, creature.questStorage) .. "/" .. creature.killsRequired .. "] " .. creature.raceName .. ".")
end
end
end
return true
end
local tasks =
{
[1] = {questStarted = 1510, questStorage = 65000, killsRequired = 100, raceName = "Trolls", rewards = {first = {enable = true, type = "exp", values = 200}, second = {enable = true, type = "money", values = 200}, third = {enable = false, type = nil, values = {nil, nil}}}},
[2] = {questStarted = 1511, questStorage = 65001, killsRequired = 150, raceName = "Goblins", rewards = {first = {enable = true, type = "exp", values = 300}, second = {enable = true, type = "money", values = 250}, third = {enable = false, type = nil, values = {nil, nil}}}},
[3] = {questStarted = 1512, questStorage = 65002, killsRequired = 300, raceName = "Rotworms", rewards = {first = {enable = true, type = "exp", values = 1000}, second = {enable = true, type = "money", values = 400}, third = {enable = false, type = nil, values = {nil, nil}}}},
[4] = {questStarted = 1513, questStorage = 65003, killsRequired = 500, raceName = "Cyclops", rewards = {first = {enable = true, type = "exp", values = 3000}, second = {enable = true, type = "money", values = 800}, third = {enable = false, type = nil, values = {nil, nil}}}},
[5] = {questStarted = 1514, questStorage = 65004, killsRequired = 300, raceName = "Crocodiles", rewards = {first = {enable = true, type = "exp", values = 800}, second = {enable = true, type = "boss", values = {x=32596,y=32726,z=8}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[6] = {questStarted = 1515, questStorage = 65005, killsRequired = 300, raceName = "Tarantulas", rewards = {first = {enable = true, type = "exp", values = 1500}, second = {enable = true, type = "boss", values = {x=32823,y=32711,z=8}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[7] = {questStarted = 1516, questStorage = 65006, killsRequired = 150, raceName = "Carniphilas", rewards = {first = {enable = true, type = "exp", values = 1500}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[8] = {questStarted = 1517, questStorage = 65007, killsRequired = 200, raceName = "Stone Golems", rewards = {first = {enable = true, type = "exp", values = 2000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[9] = {questStarted = 1518, questStorage = 65008, killsRequired = 300, raceName = "Mammoths", rewards = {first = {enable = true, type = "exp", values = 4000}, second = {enable = true, type = "boss", values = {x=32249,y=31186,z=3}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[10] = {questStarted = 1519, questStorage = 65009, killsRequired = 300, raceName = "Ice Golems", rewards = {first = {enable = true, type = "exp", values = 15000}, second = {enable = true, type = "boss", values = {x=32187,y=31177,z=2}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[11] = {questStarted = 1520, questStorage = 65010, killsRequired = 300, raceName = "Quaras Scout", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[12] = {questStarted = 1521, questStorage = 65011, killsRequired = 300, raceName = "Quaras", rewards = {first = {enable = true, type = "exp", values = 12000}, second = {enable = true, type = "boss", values = {x=32078,y=32784,z=13}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[13] = {questStarted = 1522, questStorage = 65012, killsRequired = 70, raceName = "Water Elementals", rewards = {first = {enable = true, type = "exp", values = 7000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[14] = {questStarted = 1523, questStorage = 65013, killsRequired = 70, raceName = "Earth Elementals", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[15] = {questStarted = 1524, questStorage = 65014, killsRequired = 70, raceName = "Energy Elementals", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[16] = {questStarted = 1525, questStorage = 65015, killsRequired = 70, raceName = "Fire Elementals", rewards = {first = {enable = true, type = "exp", values = 7000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[17] = {questStarted = 1526, questStorage = 65016, killsRequired = 200, raceName = "Mutated Rats", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "boss", values = {x=561,y=650,z=9}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[18] = {questStarted = 1527, questStorage = 65017, killsRequired = 500, raceName = "Giant Spiders", rewards = {first = {enable = true, type = "exp", values = 5000}, second = {enable = true, type = "boss", values = {x=32805,y=32282,z=8}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[19] = {questStarted = 1528, questStorage = 65018, killsRequired = 2000, raceName = "Hydras", rewards = {first = {enable = true, type = "boss", values = {x=32804,y=32553,z=12}}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[20] = {questStarted = 1529, questStorage = 65019, killsRequired = 2000, raceName = "Sea Serpents", rewards = {first = {enable = true, type = "boss", values = {x=32452,y=31176,z=13}}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[21] = {questStarted = 1530, questStorage = 65020, killsRequired = 2000, raceName = "Behemoths", rewards = {first = {enable = true, type = "boss", values = {x=33233,y=31660,z=14}}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[22] = {questStarted = 1531, questStorage = 65021, killsRequired = 1500, raceName = "Serpents Spawn", rewards = {first = {enable = true, type = "boss", values = {x=33799,y=32514,z=12}}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[23] = {questStarted = 1532, questStorage = 65022, killsRequired = 500, raceName = "Green Djinns", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = {x=622,y=681,z=8}}}},
[24] = {questStarted = 1533, questStorage = 65023, killsRequired = 500, raceName = "Blue Djinns", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = {x=621,y=527,z=2}}}},
[25] = {questStarted = 1534, questStorage = 65024, killsRequired = 3000, raceName = "Pirates", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = {x=31952,y=32876,z=3}}}},
[26] = {questStarted = 1535, questStorage = 65025, killsRequired = 3000, raceName = "Pirates", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = false, type = nil, values = {nil, nil}}}},
[27] = {questStarted = 1536, questStorage = 65026, killsRequired = 5000, raceName = "Minotaurs", rewards = {first = {enable = true, type = "boss", values = {x=32454,y=31997,z=9}}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[28] = {questStarted = 1537, questStorage = 65027, killsRequired = 4000, raceName = "Magicians", rewards = {first = {enable = true, type = "boss", values = {x=32028,y=32431,z=12}}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[29] = {questStarted = 1538, questStorage = 65028, killsRequired = 1000, raceName = "Magicians", rewards = {first = {enable = true, type = "exp", values = 40000}, second = {enable = true, type = "boss", values = {x=32873,y=32607,z=6}}, third = {enable = false, type = nil, values = {nil, nil}}}},
[30] = {questStarted = 1539, questStorage = 65029, killsRequired = 6666, raceName = "Demons", rewards = {first = {enable = true, type = "storage", values = {65535, 1}}, second = {enable = true, type = "boss", values = {x=32742,y=32291,z=10}}, third = {enable = false, type = nil, values = {nil, nil}}}}
}
local storage = 64521
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local voc = {}
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
function creatureSayCallback(cid, type, msg)
local s = getPlayerStorageValue(cid, storage)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid
if msgcontains(msg, 'task') then
if(s < 1) then
doPlayerSetStorageValue(cid, storage, 1)
end
if tasks[s] then
if(getPlayerStorageValue(cid, tasks[s].questStarted) < 1) then
if(getPlayerStorageValue(cid, tasks[s].creatureStorage) < 0) then
doPlayerSetStorageValue(cid, tasks[s].creatureStorage, 0)
end
if(getPlayerStorageValue(cid, tasks[s].questStorage) < 0) then
doPlayerSetStorageValue(cid, tasks[s].questStorage, 0)
end
doPlayerSetStorageValue(cid, tasks[s].questStarted, 1)
selfSay('You have started the task number ' .. getPlayerStorageValue(cid, storage) .. ', in this task you need to kill ' .. tasks[s].killsRequired .. ' ' .. tasks[s].raceName .. '.', cid)
else
selfSay('You are currently making task about ' .. tasks[s].raceName .. '.', cid)
end
else
print("[Warning - Error::Killing in the name of::Tasks config] Something is wrong.")
end
elseif msgcontains(msg, 'report') then
if tasks[s] and tasks[s].questStarted > 0 then
if(getPlayerStorageValue(cid, tasks[s].creatureStorage) < 0) then
doPlayerSetStorageValue(cid, tasks[s].creatureStorage, 0)
end
if(getPlayerStorageValue(cid, tasks[s].questStorage) < 0) then
doPlayerSetStorageValue(cid, tasks[s].questStorage, 0)
end
if(getPlayerStorageValue(cid, tasks[s].questStorage) >= tasks[s].killsRequired) then
selfSay('Great!... you have finished the task number ' .. s .. '. Good job.', cid)
doPlayerSetStorageValue(cid, storage, s + 1)
if(tasks[s].rewards.first.enable) then
if(tasks[s].rewards.first.type == "boss") then
doTeleportThing(cid, tasks[s].rewards.first.values)
elseif(tasks[s].rewards.first.type == "exp") then
doPlayerAddExperience(cid, tasks[s].rewards.first.values)
elseif(tasks[s].rewards.first.type == "item") then
doPlayerAddItem(cid, tasks[s].rewards.first.values[1], tasks[s].rewards.first.values[2])
elseif(tasks[s].rewards.first.type == "money") then
doPlayerAddMoney(cid, tasks[s].rewards.first.values)
elseif(tasks[s].rewards.first.type == "storage") then
doPlayerSetStorageValue(cid, tasks[s].rewards.first.values[1], tasks[s].rewards.first.values[2])
end
end
if(tasks[s].rewards.second.enable) then
if(tasks[s].rewards.second.type == "boss") then
doTeleportThing(cid, tasks[s].rewards.second.values)
elseif(tasks[s].rewards.second.type == "exp") then
doPlayerAddExperience(cid, tasks[s].rewards.second.values)
elseif(tasks[s].rewards.second.type == "item") then
doPlayerAddItem(cid, tasks[s].rewards.second.values[1], tasks[s].rewards.second.values[2])
elseif(tasks[s].rewards.second.type == "money") then
doPlayerAddMoney(cid, tasks[s].rewards.second.values)
elseif(tasks[s].rewards.second.type == "storage") then
doPlayerSetStorageValue(cid, tasks[s].rewards.second.values[1], tasks[s].rewards.second.values[2])
end
end
if(tasks[s].rewards.third.enable) then
if(tasks[s].rewards.third.type == "boss") then
doTeleportThing(cid, tasks[s].rewards.third.values)
elseif(tasks[s].rewards.third.type == "exp") then
doPlayerAddExperience(cid, tasks[s].rewards.third.values)
elseif(tasks[s].rewards.third.type == "item") then
doPlayerAddItem(cid, tasks[s].rewards.third.values[1], tasks[s].rewards.third.values[2])
elseif(tasks[s].rewards.third.type == "money") then
doPlayerAddMoney(cid, tasks[s].rewards.third.values)
elseif(tasks[s].rewards.third.type == "storage") then
doPlayerSetStorageValue(cid, tasks[s].rewards.third.values[1], tasks[s].rewards.third.values[2])
end
end
else
selfSay('Current ' .. getPlayerStorageValue(cid, tasks[s].questStorage) .. ' ' .. tasks[s].raceName .. ' killed, you need to kill ' .. tasks[s].killsRequired .. '.', cid)
end
else
selfSay('You do not have started any task.', cid)
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Necromancer" nameDescription="a necromancer" race="blood" experience="580" speed="200" manacost="0">
<health now="580" max="580"/>
<look type="9" corpse="6080"/>
<targetchange interval="5000" chance="8"/>
<strategy attack="100" defense="0"/>
<flags>
<flag summonable="0"/>
<flag attackable="1"/>
<flag hostile="1"/>
<flag illusionable="0"/>
<flag convinceable="0"/>
<flag pushable="0"/>
<flag canpushitems="1"/>
<flag canpushcreatures="1"/>
<flag targetdistance="4"/>
<flag staticattack="90"/>
<flag runonhealth="0"/>
</flags>
<script>
<event name="KillingInTheNameOf"/>
</script>
<attacks>
<attack name="melee" interval="2000" skill="30" attack="40" poison="90"/>
<attack name="lifedrain" interval="1000" chance="20" range="1" min="-60" max="-100">
<attribute key="areaEffect" value="redspark"/>
</attack>
<attack name="poison" interval="3000" chance="17" range="7" min="-35" max="-95">
<attribute key="shootEffect" value="poison"/>
<attribute key="areaEffect" value="poison"/>
</attack>
</attacks>
<defenses armor="20" defense="20">
<defense name="healing" interval="1000" chance="25" min="42" max="68">
<attribute key="areaEffect" value="blueshimmer"/>
</defense>
</defenses>
<elements>
<element earthPercent="100"/>
<element energyPercent="20"/>
<element icePercent="10"/>
<element deathPercent="10"/>
<element physicalPercent="-15"/>
<element firePercent="-5"/>
<element holyPercent="-5"/>
</elements>
<immunities>
<immunity invisible="1"/>
</immunities>
<summons maxSummons="4">
<summon name="Ghoul" interval="1000" chance="17" max="2"/>
<summon name="Ghost" interval="1000" chance="15" max="1"/>
<summon name="Mummy" interval="1000" chance="13" max="1"/>
</summons>
<voices interval="5000" chance="10">
<voice sentence="Your corpse will be mine!"/>
<voice sentence="Taste the sweetness of death!"/>
</voices>
<loot>
<item id="2186" chance="110"/><!-- moonlight rod -->
<item id="2148" countmax="40" chance="100000"/><!-- gold coin -->
<item id="2032" chance="10000"/><!-- bowl -->
<item id="2804" countmax="2" chance="20000"/><!-- shadow herb -->
<item id="2182" chance="1333"/><!-- snakebite rod -->
<item id="2406" chance="15000"/><!-- short sword -->
<item id="1987" chance="100000"><!-- bag -->
<inside>
<item id="2412" chance="10000"/><!-- katana -->
<item id="2483" chance="10000"/><!-- scale armor -->
<item id="2796" countmax="1" chance="1500"/><!-- green mushroom -->
<item id="2229" countmax="3" chance="20000"/><!-- skull -->
<item id="2747" chance="20000"/><!-- grave flower -->
<item id="2436" chance="833"/><!-- skull staff -->
<item id="2663" chance="909"/><!-- mystic turban -->
<item id="2195" chance="666"/><!-- boots of haste -->
<item id="2423" chance="5000"/><!-- clerical mace -->
</inside>
</item>
</loot>
</monster>
[1] = {questStarted = 1510, questStorage = 65000, killsRequired = 100, raceName = "Trolls", rewards = {first = {enable = true, type = "exp", values = 200}, second = {enable = true, type = "money", values = 200}, third = {enable = false, type = nil, values = {nil, nil}}}}, //Troll task example
[1] = number of task
questStarted = storage to start the task
questStorage = storage to check the kills
killsRequired = kills required to finish the task
raceName = race name
rewards = this contains the possible rewards.
rewards.first = first reward
rewards.first.enable = enable or disable the reward (true or false)
rewards.first.type = type of reward ("exp" = give exp, "boss" = teleport player to the boss room (edit the positions), "money" = give money to player, "item" = give item to player, "storage" = set an storage to the player (maybe for a quest like demon oak))
reward.first.values = the values of the reward (how many exp will be gived, money, storage, etc..) ~NOTE:~ Only use a table value for "storage" and "item" (These types requires 2 values) for "exp", "boss" and "money" use (Ex values = 15000 // values = {x = 100, y = 100, z = 7)