Thanks Prozail!! Your fix does exactly what I was after... kill the cursed item and insert the uncursed version!
SpoilerShow
Code: Select all
function dagger1000StingsCursedEquip(self,champion,slot)
local ordinal = champion:getOrdinal()
local skill = champion:getSkillLevel("light_weapons")
local name = champion:getName()
local t = findEntity("stingTimer")
local st = findEntity("stingsTeleportBack")
local sb = findEntity("stings1000blocker1")
local hb = findEntity("hiveBlocker")
local position = hb:getWorldPosition()
if st then
st:destroy()
end
if sb then
sb:destroy()
end
if slot == 1 or slot == 2 then
if skill >= 5 then
--if not stings1000blocker1 then
spawn("blocker", party.level, party.x, party.y, party.elevation, party.facing, "stings1000blocker1")
party:setWorldPosition(position)
--party:playScreenEffect("teleport_screen")
hudPrint("The 1000 Stings Curse takes you into the middle of a Shrakk Torr hive!!!")
playSound("blinkgate2")
spawn("timer",party.level,party.x,party.y,party.elevation,party.facing,"stingTimer")
stingTimer.timer:setTimerInterval(1)
stingTimer.timer:addConnector("onActivate", "cursedItemScript", "checkSting")
stingTimer.timer:start()
else
champion:removeItemFromSlot(slot)
spawn( "dagger_1000_stings_cursed",party.level,party.x,party.y,party.elevation,party.facing)
playSound("item_drop")
hudPrint("You are not skillful enough to weild the exotic dagger....")
end
return true
else
playSound("item_drop")
hudPrint(""..name..": This thing looks dangerous... be careful about holding it....")
end
end
function dagger1000StingsCursedUnequip(self,champion, slot)
local skill = champion:getSkillLevel("light_weapons")
local name = champion:getName()
local st = findEntity("stingsTeleportBack")
local t = findEntity("stingTimer")
if t then
t:destroy()
end
if st then
st:destroy()
end
if slot == 1 or slot == 2 then
local sb = findEntity("stings1000blocker1")
if sb then
spawn("teleporter", party.level, party.x, party.y, 0, party.elevation, "stingsTeleportBack")
stingsTeleportBack.teleporter:setTeleportTarget(sb.level, sb.x, sb.y, 0)
--party:playScreenEffect("teleport_screen")
hudPrint("The 1000 Stings Curse returns you to your world....")
--playSound("guardianstave_summon")
sb:destroy()
end
return true
else
playSound("item_drop")
hudPrint(""..name..": This thing looks dangerous... be careful about holding it....")
end
end
function stings1000CurseStop()
setMouseItem(nil)
setMouseItem(spawn("dagger_1000_stings").item)
--playSound("singingbowl_chime")
hudPrint("You have survived the Cursed Hive... and the curse is lifted so that you may keep the Dagger and revisit the Hive (equip in right hand).")
return true
end
function checkForThings(thing,xMin,xMax,yMin,yMax)
for x = xMin,xMax do
for y = yMin,yMax do
for entity in self.go.map:entitiesAt(x,y) do
if entity.name == "shrakk_torr" then
return true
end
end
end
end
return false
end
function checkSting()
local itemFound = false
if checkForThings("shrakk_torr",1,3,11,13) then
return false
else
for champ = 1,4 do
for slot = 1,2 do
local c = party.party:getChampion(champ)
if c then
local item = c:getItem(slot)
print(c,item)
if item and item.go.name == "dagger_1000_stings_cursed" then
c:removeItemFromSlot(slot)
c:insertItem(slot,spawn("dagger_1000_stings").item)
local timer = findEntity("stingHiveTimer")
if timer then
timer.go:destroy()
end
hudPrint("You have beaten back the stinging Shrakk Torr hordes!! ... and as such, lifted the curse on the dagger!!")
--playSound("ressurect")
return true
end
end
end
end
end
end
strangely though.. when the item is removed and respawned
SpoilerShow
Code: Select all
champion:removeItemFromSlot(slot)
spawn( "dagger_1000_stings_cursed",party.level,party.x,party.y,party.elevation,party.facing)
playSound("item_drop")
hudPrint("You are not skillful enough to weild the exotic dagger....")
I have found, also, using the 'spawn teleport' on the party space allows you to equip and move forward at the same time > which then creates a teleporter in the space you just moved from (and therefore not teleporting the party to the designated area) this kind of disrupts the whole show....
Is there a way we can use setWorldPosition properly? without the party having to 'fall from a pit' when they teleport back?
I tried using setWorldPosition to do the teleporting but kept getting moved to a high elevation... and then falling
EDIT - Yes indeed, I have the latest beta version (2.1.17)