- Joined
- Nov 15, 2007
- Messages
- 854
- Solutions
- 10
- Reaction score
- 389
- Location
- Santiago, Chile (Australian)
Am working on a script for the Azerus quest in Yalahar for my server.
The one I had was not ideal as players could summon Azerus and his minions as many times as they wished. I am sure this is not the best way to deal with the situation but I really don't know that much about scripting.
** I wan't the script to check a players storage value to determine if he/she has 'started' the quest before, and if so not to restart it.
** If the player has not 'started' the quest before, to start it.
How the quest works - Player 'uses' the focal item, the quest is initiated and monsters are summoned.
This is what I have so far
At the moment the script skips the function Potwory's, adds the storage value as desired and then cancels as desired. Basically I would like to know how to have this script work as i'd like it to.
Thanks for any help
The one I had was not ideal as players could summon Azerus and his minions as many times as they wished. I am sure this is not the best way to deal with the situation but I really don't know that much about scripting.
** I wan't the script to check a players storage value to determine if he/she has 'started' the quest before, and if so not to restart it.
** If the player has not 'started' the quest before, to start it.
How the quest works - Player 'uses' the focal item, the quest is initiated and monsters are summoned.
This is what I have so far
Code:
function onUse(cid, item, frompos, item2, topos)
Activated = getPlayerStorageValue(cid, 98761)
if item.itemid == 9767 then
if Activated == -1 then
setPlayerStorageValue(cid, 98761, 1)
doPlayerSendCancel(cid, "Azerus is summoning his army")
function Potwory1()
doSummonCreature("Rift Worm", {x=1189,y=984,z=10})
doSummonCreature("Rift Worm", {x=1197,y=988,z=10})
doSummonCreature("Rift Worm", {x=1189,y=983,z=10})
doSummonCreature("Rift Worm", {x=1197,y=983,z=10})
end
function Potwory2()
doSummonCreature("Rift Brood", {x=1189,y=984,z=10})
doSummonCreature("Rift Brood", {x=1197,y=988,z=10})
doSummonCreature("Rift Brood", {x=1189,y=983,z=10})
doSummonCreature("Rift Brood", {x=1197,y=983,z=10})
end
function Potwory3()
doSummonCreature("Rift Scythe", {x=1189,y=984,z=10})
doSummonCreature("Rift Scythe", {x=1197,y=988,z=10})
doSummonCreature("Rift Scythe", {x=1189,y=983,z=10})
doSummonCreature("Rift Scythe", {x=1197,y=983,z=10})
end
function Potwory4()
doSummonCreature("Azerus", {x=1193,y=985,z=10})
doSummonCreature("War Golem", {x=1189,y=984,z=10})
doSummonCreature("War Golem", {x=1197,y=988,z=10})
doSummonCreature("War Golem", {x=1189,y=983,z=10})
doSummonCreature("War Golem", {x=1197,y=983,z=10})
end
function onUse(cid, item, frompos, item2, topos)
addEvent(Potwory1, 0)
addEvent(Potwory2, 10000)
addEvent(Potwory3, 60000)
addEvent(Potwory4, 120000)
return TRUE
end
else
doPlayerSendCancel(cid, "You have already summoned Azerus!")
end
end
return 1
end
At the moment the script skips the function Potwory's, adds the storage value as desired and then cancels as desired. Basically I would like to know how to have this script work as i'd like it to.
Thanks for any help