找回密码
 点一下
查看: 1939|回复: 3

一个物品升级系统

[复制链接]
发表于 2009-9-5 21:57:51 | 显示全部楼层 |阅读模式
globals
integer array wp
integer array wph
gamecache gc
endglobals
function h2i takes handle h returns integer
return h   
return 0   
endfunction
function i2u takes integer i returns unit
return i
return null
endfunction
function i2it takes integer i returns item
return i
return null
endfunction
function ljwp takes nothing returns nothing
local timer tm=GetExpiredTimer()
local unit u=i2u(GetStoredInteger(gc,"dw",I2S(h2i(tm))))
local item wp1=i2it(GetStoredInteger(gc,"wp1",I2S(h2i(tm))))
local integer wp0=GetStoredInteger(gc,"wp",I2S(h2i(tm)))
local integer ljxh=0
local integer wp5
loop
if(wp[ljxh]==wp0)then
call RemoveItem(wp1)
set wp5=wph[ljxh]
call UnitAddItemByIdSwapped(wp5,u)
endif
exitwhen ljxh==1
set ljxh=ljxh+1
endloop
set tm=null
set u=null
set wp1=null
endfunction
function ljjs takes nothing returns nothing
local timer tm=CreateTimer()
local integer ljxh=0
local integer wp0
loop
if(GetItemTypeId(GetManipulatedItem())==wp[ljxh])then
set wp0=wp[ljxh]
call RemoveItem(GetManipulatedItem())
call UnitAddItemByIdSwapped('rnsp',GetTriggerUnit())
call TimerStart(tm,15,false,function ljwp)
call StoreInteger(gc,"wp",I2S(h2i(tm)),wp0)
call StoreInteger(gc,"dw",I2S(h2i(tm)),h2i(GetTriggerUnit()))
call StoreInteger(gc,"wp1",I2S(h2i(tm)),h2i(GetLastCreatedItem()))
endif
exitwhen ljxh==1
set ljxh=ljxh+1
endloop
set tm=null
endfunction
function ljsy takes nothing returns nothing
local trigger lj=CreateTrigger()
local integer ljxh=0
set wp[0]='desc'
set wp[1]='crys'
set wph[0]='ckng'
set wph[1]='ratf'
loop
call TriggerRegisterPlayerUnitEvent(lj,Player(ljxh),EVENT_PLAYER_UNIT_USE_ITEM,null)
exitwhen ljxh==11
set ljxh=ljxh+1
endloop
call TriggerAddAction(lj,function ljjs)
endfunction
为什么没用呢创建了物品15秒后不见删除也不见创建…
发表于 2009-9-5 22:26:40 | 显示全部楼层
用gc了。请初始化
回复

使用道具 举报

 楼主| 发表于 2009-9-6 17:50:04 | 显示全部楼层
用了额
回复

使用道具 举报

 楼主| 发表于 2009-9-6 18:01:33 | 显示全部楼层
悲剧中当我玩魔兽的时候你们在做地图,当我接触作弊脚本的时候你们在研究JASS,当我终于也开始玩JASS的时候你们都退隐了。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-5-4 00:38 , Processed in 0.035951 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表