sync taikisauva, make kummitus drop wands properly, fix enemys holding wands improperly also, fix notplayer cheese >:(, put in spell refresh syncing logic

This commit is contained in:
bgkillas 2024-11-03 18:04:14 -05:00
parent 179271e18c
commit edbf0bf1b8
10 changed files with 97 additions and 39 deletions

View file

@ -0,0 +1,35 @@
if not GameHasFlagRun("ew_flag_this_is_host") then
return
end
dofile_once("data/scripts/lib/utilities.lua")
local entity_id = GetUpdatedEntityID()
local pos_x, pos_y = EntityGetTransform( entity_id )
local entity_pick_up_this_item = EntityLoad( "data/entities/items/wand_level_03.xml", pos_x, pos_y)
local entity_ghost = entity_id
local itempickup = EntityGetFirstComponent( entity_ghost, "ItemPickUpperComponent" )
if( itempickup ) then
ComponentSetValue2( itempickup, "only_pick_this_entity", entity_pick_up_this_item )
GamePickUpInventoryItem( entity_ghost, entity_pick_up_this_item, false )
end
-- check that we hold the item
local items = GameGetAllInventoryItems( entity_ghost )
local has_item = false
if( items ~= nil ) then
for i,v in ipairs(items) do
if( v == entity_pick_up_this_item ) then
has_item = true
end
end
end
-- if we don't have the item kill us for we are too dangerous to be left alive
if( has_item == false ) then
EntityKill( entity_ghost )
end