채팅0

    여기서 기본공격이 잘못된건가요? 공격이안나가서 질문입니다.

    조회수 268
    --------- flag ----------
    zz_y7.is_others = false;
    zz_y7.teleported_to_mob = false;
    
    --------- custom functions ---------
    zz_y7.filter_only_live_mobs = function (hit,temp,output) 
    	if (hit > 0) then
    		local count = 0
    		for _,c in ipairs(temp) do
    			---@type MobComponent
    			local mob = c.Entity.MobComponent
    			if (mob.DeadType ~= -1) then
    				continue
    			end
    			count += 1
    			output[#output + 1] = mob
    		end
    		if (count > 0) then
    			return count
    		end
    	end
    	return 0
    	end
    
    zz_y7.is_someone_in_world = function()
    	local map_name = _UserService.LocalPlayer.CurrentMapName
    	local entities = _UserService:GetUsersByMapName(map_name)
    	return #entities ~= 1
    end
    
    zz_y7.play_timer_func = function(self)
    	--[[
    	_PlayerAttackLogic:PlayAction(_UserService.LocalPlayer
    		, _UserService.LocalPlayer.AvatarRendererComponent:GetBodyEntity()
    		, nil
    		, _CharacterAction:GetActionString(_CharacterAction.SWINGT1)
    		, 0
    	)
    	]]
    	local output = {}
    	--> BoxShape(vec2, vec2, angle)
    	--> TryDoingMeleeAttack(self, user, skillId, skillLevel, output, lastFinalAttack) 
    	--> OverlapAllFast(CollisionGroup, Shape, output) 
    	local box = BoxShape(Vector2(0.0, 0.0), Vector2(100.0, 100.0), 0) --> i think 0 still god cuzof size
    	local simulator = _CollisionService:GetSimulator(_UserService.LocalPlayer.WsCharacterData.Entity) --> if not working, lets put map's one
    	local temp = {}
    	local output = {}
    	local output2 = {}
    	local hit = simulator:OverlapAllFast(CollisionGroups.MapleMob, box, temp)
    	local count = zz_y7.filter_only_live_mobs(hit, temp, output)
    	_ChatMessageLogic:Add(_ChatMessageType.System, "남은 몹 수: " .. count)
    	if count == 0 then return end
    	zz_y7.teleported_to_mob = false;
    	for i,v in ipairs(output) do
    		local mob_pos = v.Entity.TransformComponent.WorldPosition
    		if zz_y7.is_someone_in_world() then return end
    		-- to do: change lookat
    		zz_y7.teleported_to_mob = true;
    		break 
    	end
    end
    
    zz_y7.hit_timer_func = function(self)
    	if zz_y7.teleported_to_mob then
    		_PlayerActiveSkillLogic:DoActiveSkill(_UserService.LocalPlayer, 0, 0, output2, 0)
    		_UserService.LocalPlayer.WsUserController:ActionPickUp()
    	end
    end

    댓글0

      게시글 리스트
      제목작성자작성일조회
      공지10-2022138
      6168103:1810
      6168000:4373
      6167911-1548
      6167811-1545
      6167711-15232
      6167611-14285
      6167511-14350
      6167411-14317
      6167311-14296
      6167211-13395
      6167111-13473
      6167011-13449
      6166911-13407
      6166811-13419
      6166711-13442
      6166611-13566
      6166511-12570
      6166411-12591
      6166311-12654
      안내 배너 이미지