alright thanks for the info.
was hoping I forgot something so that it would end up working.
oh well.
alright thanks for the info.
was hoping I forgot something so that it would end up working.
oh well.
mmm juste restarted my world and I just found out an error while launching:
Luaengine: scripts/token vendor.lua...failed (could not load)
scripts/token vendor.lua:46: unexpected symbol near '>'
Do you guys know a fix?
Follow me @ Twitch.tv/ShalitasWins
My bad, typo.
Strange, the error actually had nothing to do with the typo.
On line 46, replace
withCode:player:SendChatMessage(12, 0, )
Code:player:SendChatMessage(12, 0, ERR_MSG)
still not working, same error, btw is there a commands to reload lua without restarting server?
Follow me @ Twitch.tv/ShalitasWins
Strange, I'm not seeing any '>' on line 46.
Post what your line 46 is?
mmm I dont have any program to see the line number, dont know if I have to
count spaced line :S
ERR_MSG = "You don't have enough tokens to buy this item.";
function Event_Guide(unit, event, player, misc)
unit:GossipCreateMenu(1, player, 0)
unit:GossipMenuAddItem(0, "10 Donations Token Items", 4, 0)
unit:GossipMenuAddItem(0, "20 Donations Token Items", 5, 0)
unit:GossipSendMenu(player)
end
function Event_Submenu(unit, event, player, id, intid, code, misc)
if(intid == 1) then
unit:GossipCreateMenu(16, player, 0)
unit:GossipMenuAddItem(0, "10 Donations Token Items", 4, 0)
unit:GossipMenuAddItem(0, "20 Donations Token Items", 5, 0)
unit:GossipSendMenu(player)
end
--10 token items
if(intid == 4) then
unit:GossipCreateMenu(21, player, 0)
unit:GossipMenuAddItem(0, "Gurubashi Dagger of Annihilation", 24, 0)
unit:GossipMenuAddItem(0, "Gurubashi Spectral glaive", 25, 0)
unit:GossipMenuAddItem(0, "[Back]", 1, 0)
unit:GossipSendMenu(player)
end
if(intid == 24) then
if player:GetItemCount(100001) > 9 then
player:RemoveItem(100001, 10)
player:AddItem(99993, 1)
player:GossipComplete()
else
player:SendChatMessage(12, 0, ERR_MSG)
end
end
if(intid == 25) then
if player:GetItemCount(100001) > 9 then
player:RemoveItem(100001, 10)
player:AddItem(99994, 1)
player:GossipComplete()
else
player:SendChatMessage(12, 0, ERR_MSG)
end
end
--20 token items
if(intid == 5) then
unit:GossipCreateMenu(21, player, 0)
unit:GossipMenuAddItem(0, "Gurubashi Hand of the Ancient", 29, 0)
unit:GossipMenuAddItem(0, "Gurubashi Staff of Destruction", 30, 0)
unit:GossipMenuAddItem(0, "Gurubashi Arcanite Fury", 31, 0)
--unit:GossipMenuAddItem(0, "Item 6", 32, 0)
--unit:GossipMenuAddItem(0, "Item 3", 33, 0)
unit:GossipMenuAddItem(0, "[Back]", 1, 0)
unit:GossipSendMenu(player)
end
if(intid == 29) then
if player:GetItemCount(100001) > 19 then
player:RemoveItem(100001, 20)
player:AddItem(99991, 1)
player:GossipComplete()
else
player:SendChatMessage(12, 0, ERR_MSG)
end
end
if(intid == 30) then
if player:GetItemCount(100001) > 19 then
player:RemoveItem(100001, 20)
player:AddItem(99992, 1)
player:GossipComplete()
else
player:SendChatMessage(12, 0, ERR_MSG)
end
end
if(intid == 31) then
if player:GetItemCount(100001) > 19 then
player:RemoveItem(100001, 20)
player:AddItem(99995, 1)
player:GossipComplete()
else
player:SendChatMessage(12, 0, ERR_MSG)
end
end
end
RegisterUnitGossipEvent(555555, 1, "Event_Guide")
RegisterUnitGossipEvent(555555, 2, "Event_Subme
Follow me @ Twitch.tv/ShalitasWins
player:SendChatMessage(12, 0, ERR_MSG) is line 46, which has no ">". Strange, only thing I notice is the odd space between end near the bottom.
Don't think that space is needed. Actually don't think you would need 3 ends. Not sure really, never messed with gossip Lua'sCode:player:SendChatMessage(12, 0, ERR_MSG) end end end
Last edited by Linkn; 04-20-2009 at 09:59 PM.
The space isn't needed, but it can be there. White space is ignored.
As for the 3 ends, it finishes the function and two if statements.
I dont know the links worked just fine for me, but here is the paste bin linkthis is too big to post here, its a pda lua thats not working, just keeps on saying "cant open file" if you could look at this and fix it we would love you forever
Filebeam - Free Fast File Hosting
this is too big to post here, its a pda lua thats not working, just keeps on saying "cant open file" if you could look at this and fix it we would love you forever
PDA file
Thanks Dr.Z
Lua pastebin - collaborative debugging tool
thanks again
Dr.Z
if you look closely its saying unexpected symbol NEAR a braket on line 46 now im no genius but why dont u try making your variable one word ^^
make ERR_MSG something like errmsg
and @ DrZoyburg what am i looking for could u please tell me whats wrong first?
Last edited by Scubast3ve; 04-23-2009 at 02:58 PM.
Hey, I've been working on this for a while, and it isn't working.
wondering how it could be fixed, not too experienced in Lua.Code:function Archavon_The_Stonewatcher_Rocks(pUnit, event) print "Archavon_Rocks initiated..." pUnit:FullCastSpell(30282) end function Archavon_The_Stonewatcher_Impale(pUnit, event) print "Archavon_The_Stonewatcher_Impale initiated..." pUnit:FullCastSpellOnTarget(60882, pUnit:GetMainTank()) end end function Archavon_The_Stonewatcher_Stomp(pUnit, event) print "Archavon_The_Stonewatcher_Stomp initiated..." pUnit:FullCastSpellOnTarget(60880, pUnit:GetRandomPlayer(0)) end function Archavon_The_Stonewatcher_Berserk(pUnit, event) print "Archavon_The_Stonewatcher_Berserk initiated..." pUnit:FullCastSpell(47008) end function Archavon_The_Stonewatcher_Cloudthree(pUnit, event) if pUnit:GetHealthPct() < 25 then Dothat=3; print "Archavon_The_Stonewatcher_Cloudthree initiated..." pUnit:StopMovement(6200) pUnit:RemoveEvents() pUnit:FullCastSpell(61672) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Rocks", 13000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Impale", 16000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Stomp", 19000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Berserk", 1100, 1) pUnit:RegisterEvent("Archavon_The_Stonewatcher_PlayerLowHp", 100, 0) end end function Archavon_The_Stonewatcher_Cloudtwo(pUnit, event) if pUnit:GetHealthPct() < 50 then Dothat=2; print "Archavon_The_Stonewatcher_Cloudtwo initiated..." pUnit:StopMovement(6200) pUnit:RemoveEvents() pUnit:FullCastSpell(61672) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Rocks", 13000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Impale", 16000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Stomp", 19000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Cloudthree", 1000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Berserk", 1100, 1) pUnit:RegisterEvent("Archavon_The_Stonewatcher_PlayerLowHp", 100, 0) end end function Archavon_The_Stonewatcher_Cloud(pUnit, event) if pUnit:GetHealthPct() < 75 then Dothat=1; print "Archavon_The_Stonewatcher_Cloud initiated..." pUnit:StopMovement(6200) pUnit:RemoveEvents() pUnit:FullCastSpell(61672) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Rocks", 13000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Impale", 16000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Stomp", 19000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Cloudtwo", 1000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Berserk", 1100, 1) pUnit:RegisterEvent("Archavon_The_Stonewatcher_PlayerLowHp", 100, 0) end end function Archavon_The_Stonewatcher_PlayerLowHp(pUnit, event) Enemy=pUnit:GetRandomPlayer(0); if Enemy:GetHealthPct() < 15 and pUnit:IsInCombat() then print "Archavon_The_Stonewatcher_PlayerLowHp initiated..." pUnit:RemoveEvents() pUnit:SendChatMessage(12, 0, "I have had enough of you!") pUnit:FullCastSpell(61672) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Rocks", 13000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Impale", 16000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Stomp", 19000, 0) if Dothat == 0 then pUnit:RegisterEvent("Archavon_The_Stonewatcher_Cloud", 1000, 0) end if Dothat == 1 then pUnit:RegisterEvent("Archavon_The_Stonewatcher_Cloudtwo", 1000, 0) end if Dothat == 2 then pUnit:RegisterEvent("Archavon_The_Stonewatcher_Cloudthree", 1000, 0) end end end function Archavon_The_Stonewatcher_RemoveRezSickness(pUnit, event) player=pUnit:GetRandomPlayer(0); player:RemoveAura(15007) end function Archavon_The_Stonewatcher_OnEnterCombat(pUnit, event) print "Archavon_The_Stonewatcher_Aggro initiated..." pUnit:SendChatMessage(12, 0, "You dare enter my lair? You think you can best me? We shall see...") Dothat=0; pUnit:RegisterEvent("Archavon_The_Stonewatcher_Rocks", 13000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Impale", 16000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Stomp", 19000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Cloud", 1000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_PlayerLowHp", 100, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_RemoveRezSickness", 50, 40) end RegisterUnitEvent(900049, 1, "Archavon_The_Stonewatcher_OnEnterCombat") function Archavon_The_Stonewatcher_OnWipe(pUnit, event) print "Archavon_The_Stonewatcher_Wipe initiated..." pUnit:RemoveEvents() end RegisterUnitEvent(900049, 2, "Archavon_The_Stonewatcher_OnWipe") function Archavon_The_Stonewatcher_OnDie(pUnit, event) print "Archavon_The_Stonewatcher_Dies initiated..." pUnit:RemoveEvents() pUnit:SendChatMessage(12, 0, "Well done...but there is more...") end RegisterUnitEvent(900049, 4, "Archavon_The_Stonewatcher_OnDie")
Code:function Archavon_The_Stonewatcher_Rocks(pUnit, event) print "Archavon_Rocks initiated..." pUnit:FullCastSpell(30282) end function Archavon_The_Stonewatcher_Impale(pUnit, event) print "Archavon_The_Stonewatcher_Impale initiated..." pUnit:FullCastSpellOnTarget(60882, pUnit:GetMainTank()) end function Archavon_The_Stonewatcher_Stomp(pUnit, event) print "Archavon_The_Stonewatcher_Stomp initiated..." pUnit:FullCastSpellOnTarget(60880, pUnit:GetRandomPlayer(0)) end function Archavon_The_Stonewatcher_Berserk(pUnit, event) print "Archavon_The_Stonewatcher_Berserk initiated..." pUnit:FullCastSpell(47008) end function Archavon_The_Stonewatcher_Cloudthree(pUnit, event) if pUnit:GetHealthPct() < 25 then Dothat=3; print "Archavon_The_Stonewatcher_Cloudthree initiated..." pUnit:StopMovement(6200) pUnit:RemoveEvents() pUnit:FullCastSpell(61672) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Rocks", 13000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Impale", 16000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Stomp", 19000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Berserk", 1100, 1) pUnit:RegisterEvent("Archavon_The_Stonewatcher_PlayerLowHp", 100, 0) end end function Archavon_The_Stonewatcher_Cloudtwo(pUnit, event) if pUnit:GetHealthPct() < 50 then Dothat=2; print "Archavon_The_Stonewatcher_Cloudtwo initiated..." pUnit:StopMovement(6200) pUnit:RemoveEvents() pUnit:FullCastSpell(61672) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Rocks", 13000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Impale", 16000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Stomp", 19000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Cloudthree", 1000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Berserk", 1100, 1) pUnit:RegisterEvent("Archavon_The_Stonewatcher_PlayerLowHp", 100, 0) end end function Archavon_The_Stonewatcher_Cloud(pUnit, event) if pUnit:GetHealthPct() < 75 then Dothat=1; print "Archavon_The_Stonewatcher_Cloud initiated..." pUnit:StopMovement(6200) pUnit:RemoveEvents() pUnit:FullCastSpell(61672) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Rocks", 13000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Impale", 16000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Stomp", 19000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Cloudtwo", 1000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Berserk", 1100, 1) pUnit:RegisterEvent("Archavon_The_Stonewatcher_PlayerLowHp", 100, 0) end end function Archavon_The_Stonewatcher_PlayerLowHp(pUnit, event) Enemy=pUnit:GetRandomPlayer(0); if Enemy:GetHealthPct() < 15 and pUnit:IsInCombat() then print "Archavon_The_Stonewatcher_PlayerLowHp initiated..." pUnit:RemoveEvents() pUnit:SendChatMessage(12, 0, "I have had enough of you!") pUnit:FullCastSpell(61672) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Rocks", 13000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Impale", 16000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Stomp", 19000, 0) if Dothat == 0 then pUnit:RegisterEvent("Archavon_The_Stonewatcher_Cloud", 1000, 0) end if Dothat == 1 then pUnit:RegisterEvent("Archavon_The_Stonewatcher_Cloudtwo", 1000, 0) end if Dothat == 2 then pUnit:RegisterEvent("Archavon_The_Stonewatcher_Cloudthree", 1000, 0) end end end function Archavon_The_Stonewatcher_RemoveRezSickness(pUnit, event) player=pUnit:GetRandomPlayer(0); player:RemoveAura(15007) end function Archavon_The_Stonewatcher_OnEnterCombat(pUnit, event) print "Archavon_The_Stonewatcher_Aggro initiated..." pUnit:SendChatMessage(12, 0, "You dare enter my lair? You think you can best me? We shall see...") Dothat=0; pUnit:RegisterEvent("Archavon_The_Stonewatcher_Rocks", 13000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Impale", 16000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Stomp", 19000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_Cloud", 1000, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_PlayerLowHp", 100, 0) pUnit:RegisterEvent("Archavon_The_Stonewatcher_RemoveRezSickness", 50, 40) end RegisterUnitEvent(900049, 1, "Archavon_The_Stonewatcher_OnEnterCombat") function Archavon_The_Stonewatcher_OnWipe(pUnit, event) print "Archavon_The_Stonewatcher_Wipe initiated..." pUnit:RemoveEvents() end RegisterUnitEvent(900049, 2, "Archavon_The_Stonewatcher_OnWipe") function Archavon_The_Stonewatcher_OnDie(pUnit, event) print "Archavon_The_Stonewatcher_Dies initiated..." pUnit:RemoveEvents() pUnit:SendChatMessage(12, 0, "Well done...but there is more...") end RegisterUnitEvent(900049, 4, "Archavon_The_Stonewatcher_OnDie")
try this one...I fixed your errors but never tested it ingame.
Last edited by Aznex; 04-24-2009 at 11:07 AM.
Still isn't working, he simply doesn't do anything.
Try inserting this into your db and trying again with the new npc id it sounds like you have a flag issue and those are never fun to solveCode:INSERT INTO creature_proto (entry, minlevel, maxlevel, faction, minhealth, maxhealth, mana, scale, npcflags, attacktime, mindamage, maxdamage, rangedattacktime, rangedmindamage, rangedmaxdamage, respawntime, armor, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, combat_reach, bounding_radius, auras, boss, money, invisibility_type, death_state) VALUES (400000, 80, 80, 35, 1000000, 1000000, 1000000, 1.5, 3, 1800, 150, 250, 1800, 500, 650, 36000, 0, 0, 0, 0, 0, 0, 0, 1, 0, "MEMO", 0, 0, 0, 0); INSERT INTO creature_names (entry, `name`, Subname, Flags1, type, Family, Rank, unk4, SpellDataID, male_displayid, female_displayid, unknown_float1, unknown_float2, Civilian, Leader, info_str) VALUES (400000,"Teleporter","",0,7,0,0,0,NULL,16198,16198,1, 1,1,NULL, '');