[FELD="Inhaltsverzeichnis"]
[COLOR="Red"]0.1.0.0[/COLOR] - [COLOR="Lime"]Vorwort[/COLOR]
[COLOR="#ff0000"]0.2.0.0[/COLOR] - [COLOR="#00ff00"]LuaFunc Ordner[/COLOR]
[COLOR="#ff0000"]0.2.0.1[/COLOR] - [COLOR="#00ff00"]CreateMonsterFunc.lua[/COLOR]
[COLOR="#ff0000"]0.2.0.2[/COLOR] - [COLOR="#00ff00"]EventFunc.lua[/COLOR]
[COLOR="#ff0000"]0.2.0.3[/COLOR] - [COLOR="#00ff00"]EventMonsterFunc.lua[/COLOR]
[COLOR="#ff0000"]0.2.0.4[/COLOR] - [COLOR="#00ff00"]InstanceDungeonBase.lua[/COLOR]
[COLOR="#ff0000"]0.2.0.5[/COLOR] - [COLOR="#00ff00"]MonsterSkillFunc.lua[/COLOR]
[COLOR="#ff0000"]0.2.0.6[/COLOR] - [COLOR="#00ff00"]PartyDungeon.lua[/COLOR]
[COLOR="#ff0000"]0.2.0.7[/COLOR] - [COLOR="#00ff00"]PCBang.lua[/COLOR]
[COLOR="#ff0000"]0.2.0.8[/COLOR] - [COLOR="#00ff00"]RainbowRaceFunc.lua[/COLOR]
[COLOR="#ff0000"]0.2.0.9[/COLOR] - [COLOR="#00ff00"]SecretRoomFunc.lua[/COLOR]
[COLOR="#ff0000"]0.2.1.0[/COLOR] - [COLOR="#00ff00"]Tax.lua[/COLOR]
[COLOR="#ff0000"]0.2.1.1[/COLOR] - [COLOR="#00ff00"]TaxFunc.lua[/COLOR]
[/FELD]
[SIZE="1"][COLOR="#ff0000"]0.1.0.0[/COLOR] - [COLOR="Lime"]Vorwort[/COLOR]:
[COLOR="Cyan"]
Daher viele nach einer "Resourcen"-Erklärung verlangen, schreibe ich hier mal eine, Stück für Stück! Diese wird sich nach der Zeit füllen und ich würde mich sehr über Ratschlage und Verbesserungsvorschlägen freuen! Hierbei gehts mir keinerlei um Thanks oder Karma. Dieser Theard dient nur dazu, um zu verstehen, was die verschiedenen "Resource"-Datein bewirken oder was diese für bedeuten haben.[/COLOR][/SIZE]
[SIZE="1"][COLOR="Red"]0.2.0.0[/COLOR] - [COLOR="Lime"]LuaFunc Ordner[/COLOR]:[/SIZE]
[SIZE="1"][COLOR="Cyan"]
Daher ich die "Resource"-Datein Ordner für Ordner erkären will und im Ordner LuaFunc die ersten Datein sind, die Intressant wären, fange ich auch gleich in diesem Ordner an, auf Wunsch fange ich soger von ganz Oben an! :)[/COLOR][/SIZE]
[SIZE="1"][COLOR="Red"]0.2.0.1[/COLOR] - [COLOR="Lime"]CreateMonsterFunc.lua[/COLOR]:[/SIZE]
Code
[SIZE="1"][COLOR="Cyan"]Zuersteinmal widmen wir uns dieser Datei! Hier der Datei Source wie ich ihn habe:
tCreateMonster = {}
function SEC( n ) return n * 1000 end
function MIN( n ) return n * SEC( 60 ) end
function AddItem( strItemId, dwKeepTime )
local nSize = table.getn( tCreateMonster ) + 1
tCreateMonster[nSize] = {}
tCreateMonster[nSize].strItemId = strItemId
tCreateMonster[nSize].dwKeepTime = dwKeepTime
tCreateMonster[nSize].tMonster = {}
end
function AddMonster( strMonsterId, nProbability )
local n = table.getn( tCreateMonster )
nSize = table.getn( tCreateMonster[n].tMonster ) + 1
tCreateMonster[n].tMonster[nSize] = {}
tCreateMonster[n].tMonster[nSize].strMonsterId = strMonsterId
tCreateMonster[n].tMonster[nSize].nProbability = nProbability
end
Alles anzeigen
[/COLOR][/SIZE]
[SIZE="1"][COLOR="Red"]0.2.0.2[/COLOR] - [COLOR="Lime"]EventFunc.lua[/COLOR]:[/SIZE]
[SIZE="1"][COLOR="#00ffff"]Als nächstes widmen wir uns dieser Datei! Hier der Datei Source wie ich ihn habe:
tEvent = {} -- À̺¥Æ® ÀúÀå Å×À̺í
function SEC( n )
return n*1000
end
function MIN( n )
return n*SEC(60)
end
-----------------------------------------------------------------------------------
------- C¿¡¼* È£ÃâÇÒ ·ç¾Æ ÇÔ¼ö ----------------------------------------------------
-----------------------------------------------------------------------------------
-- º¯°æµÈ À̺¥Æ® ¸®½ºÆ® (DBSERVER)
function GetEventState()
local tReturn = {}
local nCount = 1
for i in pairs(tEvent) do
local OldState = tEvent[i].State
for j in pairs(tEvent[i].Time) do
if( tEvent[i].Time[j].nStart <= tonumber(os.date("%Y%m%d%H%M")) ) then
if( tEvent[i].Time[j].nEnd > tonumber(os.date("%Y%m%d%H%M")) ) then
if( tEvent[i].State == 0 ) then
tEvent[i].State = 1
end
else
if( tEvent[i].State == 1 ) then
tEvent[i].State = 0
end
end
end
end
if( OldState ~= tEvent[i].State ) then
tReturn[nCount] = {}
tReturn[nCount].nId = i
tReturn[nCount].State = tEvent[i].State
nCount = nCount + 1
end
end
return tReturn
end
-- WORLDSERVER¿¡¼* ½ÇÇàµÈ ½ºÅ©¸³Æ® ÆÄÀÏ¿¡µµ º¯°æµÈ state¸¦ Àû¿ëÇϱâ À§ÇÑ ÇÔ¼ö
function SetState( nId, nState )
tEvent[nId].State = nState
TRACE( string.format( "Event - ID:%d, Title:%s, State:%d", nId, tEvent[nId].Desc, tEvent[nId].State ) )
ERROR( string.format( "Event - ID:%d, Title:%s, State:%d", nId, tEvent[nId].Desc, tEvent[nId].State ) )
end
-- ÁøÇàÁßÀÎ À̺¥Æ® ¸®½ºÆ®
function GetEventList()
local tList = {}
local nCount = 1
for i in pairs(tEvent) do
if( tEvent[i].State == 1 ) then
tList[nCount] = i
nCount = nCount + 1
end
end
return tList
end
-- À̺¥Æ® Å×ÀÌºí¿¡ ÀÖ´Â ¸ðµç ¸®½ºÆ®
function GetAllEventList()
local tAllList = {}
local nCount = 1
for i in pairs(tEvent) do
tAllList[nCount] = {}
tAllList[nCount].nId = i
tAllList[nCount].strTitle = tEvent[i].Desc
tAllList[nCount].nState = tEvent[i].State
nCount = nCount + 1
end
return tAllList
end
-- À̺¥Æ® »ó¼¼ Á¤º¸ Å×À̺íÀ» ¸®ÅÏ
function GetEventInfo( nId )
local tEventInfo = {}
if( tEvent[nId] == nil ) then
tEventInfo[1] = "No EventInfo ID = "..nId
return tEventInfo
end
local nCount = 3
tEventInfo[1] = "Title = " .. tEvent[nId].Desc
tEventInfo[2] = "State = " .. tEvent[nId].State
for i in pairs(tEvent[nId].Time) do
local strTime = tEvent[nId].Time[i].nStart .. ", " ..tEvent[nId].Time[i].nEnd
tEventInfo[nCount] = "Time["..i.."] = " .. strTime
nCount = nCount + 1
end
for i in pairs(tEvent[nId].Item) do
local strItem = tEvent[nId].Item[i].ItemId ..", ".. tEvent[nId].Item[i].ItemMaxNum ..", ".. tEvent[nId].Item[i].ItemNum ..", ".. tEvent[nId].Item[i].nLevel
tEventInfo[nCount] = "Item["..i.."] = " .. strItem
nCount = nCount + 1
end
if( tEvent[nId].fExpFactor ~= 1 ) then
tEventInfo[nCount] = "ExpFactor = " .. tEvent[nId].fExpFactor
nCount = nCount + 1
end
if( tEvent[nId].fItemDropRate ~= 1 ) then
tEventInfo[nCount] = "ItemDropRate = " .. tEvent[nId].fItemDropRate
nCount = nCount + 1
end
if( tEvent[nId].fPieceItemDropRate ~= 1 ) then
tEventInfo[nCount] = "fPieceItemDropRate = " .. tEvent[nId].fPieceItemDropRate
nCount = nCount + 1
end
if( tEvent[nId].fGoldDropFactor ~= 1 ) then
tEventInfo[nCount] = "fGoldDropFactor = " .. tEvent[nId].fGoldDropFactor
nCount = nCount + 1
end
if( tEvent[nId].nAttackPower ~= 0 ) then
tEventInfo[nCount] = "nAttackPower = " .. tEvent[nId].nAttackPower
nCount = nCount + 1
end
if( tEvent[nId].nDefensePower ~= 0 ) then
tEventInfo[nCount] = "nDefensePower = " .. tEvent[nId].nDefensePower
nCount = nCount + 1
end
if( tEvent[nId].nCouponEvent ~= 0 ) then
if( tEvent[nId].nCouponEvent < MIN(1) ) then
tEventInfo[nCount] = "nCouponEventTime = " .. tEvent[nId].nCouponEvent / SEC(1) .. "Sec"
else
tEventInfo[nCount] = "nCouponEventTime = " .. tEvent[nId].nCouponEvent / MIN(1) .. "Min"
end
nCount = nCount + 1
end
for i in pairs(tEvent[nId].Gift) do
local strGift = tEvent[nId].Gift[i].nLevel ..", ".. tEvent[nId].Gift[i].strAccount ..", ".. tEvent[nId].Gift[i].strItemId ..", ".. tEvent[nId].Gift[i].nItemNum
tEventInfo[nCount] = "Gift["..i.."] = " .. strGift
nCount = nCount + 1
end
return tEventInfo
end
-- À̺¥Æ® ¼³¸í
function GetDesc( nId )
local strDesc = tEvent[nId].Desc
return strDesc
end
-- ½Ã°£À» ¼ýÀÚ·Î ¹Ù²ãÁÖ´Â ÇÔ¼ö
function GetTimeToNumber( strTime )
local strTemp = ""
local j = 0
for i in string.gfind( strTime, "%d+" ) do
j = j + 1
if( (j~=1) and (tonumber(i)<10) ) then
i = "0"..tonumber(i)
end
strTemp = strTemp..i
end
return tonumber( strTemp )
end
---------------------------------------------------------------------------
------ µ¥ÀÌÅÍ Ãß°¡ ÇÔ¼ö ---------------------------------------------------
---------------------------------------------------------------------------
-- »õ·Î¿î À̺¥Æ® Ãß°¡
function AddEvent( strDesc )
local nEventId = table.getn(tEvent) + 1
tEvent[nEventId] = {}
tEvent[nEventId].Item = {}
tEvent[nEventId].Time = {}
tEvent[nEventId].Desc = strDesc
tEvent[nEventId].fExpFactor = 1
tEvent[nEventId].fItemDropRate = 1
tEvent[nEventId].fPieceItemDropRate = 1
tEvent[nEventId].fGoldDropFactor = 1
tEvent[nEventId].State = 0
tEvent[nEventId].nAttackPower = 0
tEvent[nEventId].nDefensePower = 0
tEvent[nEventId].nCouponEvent = 0
tEvent[nEventId].Gift = {}
end
-- ½ÃÀ۽ð£, ³¡½Ã°£
function SetTime( strStart, strEnd )
local nEventId = table.getn(tEvent)
local nSize = table.getn( tEvent[nEventId].Time ) + 1
tEvent[nEventId].Time[nSize] = {}
tEvent[nEventId].Time[nSize].nStart = GetTimeToNumber( strStart )
tEvent[nEventId].Time[nSize].nEnd = GetTimeToNumber( strEnd )
end
-- ¾ÆÀÌÅÛ
function SetItem( ItemId, nItemMaxNum, nItemNum, nLevel )
local nEventId = table.getn(tEvent)
local nSize = table.getn(tEvent[nEventId].Item)
tEvent[nEventId].Item[nSize+1] = {}
tEvent[nEventId].Item[nSize+1].ItemId = ItemId
tEvent[nEventId].Item[nSize+1].ItemMaxNum = nItemMaxNum
tEvent[nEventId].Item[nSize+1].ItemNum = nItemNum
tEvent[nEventId].Item[nSize+1].nLevel = nLevel
tEvent[nEventId].Item[nSize+1].TimeOut = 0
tEvent[nEventId].Item[nSize+1].Skip = 0
local tInterval = {}
local nTotal = 0
for i in pairs(tHour) do
nTotal = nTotal + tHour[i]
end
for i in pairs(tHour) do
tInterval[i] = 3600000 / ( nItemMaxNum * tHour[i] / nTotal )
tInterval[i] = math.floor(tInterval[i])
end
tEvent[nEventId].Item[nSize+1].tInterval = tInterval
end
-- µå·ÓµÉ ¾ÆÀÌÅÛ ¸ñ·Ï
function GetItem( nTickCount, nLevel )
local nHour = tonumber(os.date("%H")) + 1
local tList = GetEventList()
local tReturn = {}
local nCount = 1
for i in pairs(tList) do
local tItem = tEvent[tList[i]].Item
for j in pairs(tItem) do
if( (nTickCount >= tItem[j].TimeOut) and (tItem[j].nLevel <= nLevel) ) then
tItem[j].TimeOut = tItem[j].tInterval[nHour] + nTickCount
if( tItem[j].Skip == 0 ) then
local nRandom = math.random(1, tItem[j].ItemNum)
tReturn[nCount] = {}
tReturn[nCount].ItemId = tItem[j].ItemId
tReturn[nCount].ItemNum = nRandom
tItem[j].Skip = nRandom - 1
nCount = nCount + 1
TRACE( "Event.lua : GetItem() - Drop - "..tItem[j].ItemId..", "..nRandom.."°³, Skip:"..tItem[j].Skip.." ½Ã°£´ë:"..(nHour-1).." ~ "..nHour )
else
tItem[j].Skip = tItem[j].Skip - 1
TRACE( "Event.lua : GetItem() - Skip - "..tItem[j].ItemId..", ³²Àº Skip:"..tItem[j].Skip.." ½Ã°£´ë:"..(nHour-1).." ~ "..nHour )
end
end
end
end
return tReturn
end
-- °æÇèÄ¡ ¹è¼ö
function SetExpFactor( fExpFactor )
local nEventId = table.getn(tEvent)
tEvent[nEventId].fExpFactor = fExpFactor
end
function GetExpFactor()
local tList = GetEventList()
local fExpFactor = 5
for i in pairs(tList) do
if( tEvent[tList[i]].fExpFactor ~= nil ) then
fExpFactor = fExpFactor * tEvent[tList[i]].fExpFactor
end
end
return fExpFactor
end
-- ¾ÆÀÌÅÛ µå·Ó·ü ¹è¼ö
function SetItemDropRate( fItemDropRate )
local nEventId = table.getn(tEvent)
tEvent[nEventId].fItemDropRate = fItemDropRate
end
function GetItemDropRate()
local tList = GetEventList()
local fItemDropRate = 15
for i in pairs(tList) do
if( tEvent[tList[i]].fItemDropRate ~= nil ) then
fItemDropRate = fItemDropRate * tEvent[tList[i]].fItemDropRate
end
end
return fItemDropRate
end
-- °³º° ¾ÆÀÌÅÛ µå·Ó·ü ¹è¼ö
function SetPieceItemDropRate( fPieceItemDropRate )
local nEventId = table.getn(tEvent)
tEvent[nEventId].fPieceItemDropRate = fPieceItemDropRate
end
function GetPieceItemDropRate()
local tList = GetEventList()
local fPieceItemDropRate = 5
for i in pairs(tList) do
if( tEvent[tList[i]].fPieceItemDropRate ~= nil ) then
fPieceItemDropRate = fPieceItemDropRate * tEvent[tList[i]].fPieceItemDropRate
end
end
return fPieceItemDropRate
end
-- Æä³Ä µå·Ó ¹è¼ö
function SetGoldDropFactor( fGoldDropFactor )
local nEventId = table.getn(tEvent)
tEvent[nEventId].fGoldDropFactor = fGoldDropFactor
end
function GetGoldDropFactor()
local tList = GetEventList()
local fGoldDropFactor = 20
for i in pairs(tList) do
if( tEvent[tList[i]].fGoldDropFactor ~= nil ) then
fGoldDropFactor = fGoldDropFactor * tEvent[tList[i]].fGoldDropFactor
end
end
return fGoldDropFactor
end
-- °ø°Ý·Â Áõ°¡
function SetAttackPower( nAttackPower )
local nEventId = table.getn(tEvent)
tEvent[nEventId].nAttackPower = nAttackPower
end
function GetAttackPower()
local tList = GetEventList()
local nAttackPower = 0
for i in pairs(tList) do
if( tEvent[tList[i]].nAttackPower ~= nil ) then
nAttackPower = nAttackPower + tEvent[tList[i]].nAttackPower
end
end
return nAttackPower
end
-- ¹æ¾î·Â Áõ°¡
function SetDefensePower( nDefensePower )
local nEventId = table.getn(tEvent)
tEvent[nEventId].nDefensePower = nDefensePower
end
function GetDefensePower()
local tList = GetEventList()
local nDefensePower = 0
for i in pairs(tList) do
if( tEvent[tList[i]].nDefensePower ~= nil ) then
nDefensePower = nDefensePower + tEvent[tList[i]].nDefensePower
end
end
return nDefensePower
end
-- ÄíÆù À̺¥Æ®
function SetCouponEvent( nTime )
local nEventId = table.getn(tEvent)
tEvent[nEventId].nCouponEvent = nTime
end
function GetCouponEvent()
local tList = GetEventList()
for i in pairs(tList) do
if( tEvent[tList[i]].nCouponEvent ~= 0 ) then
return tEvent[tList[i]].nCouponEvent
end
end
return 0
end
function SetLevelUpGift( nLevel, strAccount, strItemId, nItemNum )
local nEventId = table.getn(tEvent)
local nSize = table.getn(tEvent[nEventId].Gift)
tEvent[nEventId].Gift[nSize+1] = {}
tEvent[nEventId].Gift[nSize+1].nLevel = nLevel
tEvent[nEventId].Gift[nSize+1].strAccount = strAccount
tEvent[nEventId].Gift[nSize+1].strItemId = strItemId
tEvent[nEventId].Gift[nSize+1].nItemNum = nItemNum
end
function GetLevelUpGift( nLevel, strAccount )
local nCount = 1
local tGiftList = {}
local tList = GetEventList()
for i in pairs(tList) do
local tGift = tEvent[tList[i]].Gift
for j in pairs(tGift) do
local nTemp = string.find( strAccount, tGift[j].strAccount )
if( (tGift[j].strAccount == "all") or (nTemp ~= nil) ) then
if( tGift[j].nLevel == nLevel ) then
tGiftList[nCount] = {}
tGiftList[nCount].strItemId = tGift[j].strItemId
tGiftList[nCount].nItemNum = tGift[j].nItemNum
nCount = nCount + 1
end
end
end
end
return tGiftList
end
Alles anzeigen
[/COLOR][/SIZE]
[SIZE="1"][COLOR="Red"]0.2.0.3[/COLOR] - [COLOR="Lime"]EventMonsterFunc.lua[/COLOR]:[/SIZE]
[SIZE="1"][COLOR="Cyan"]Als drittes widmen wir uns nun diesem Datei Source:
tEventMonster = {}
function AddMonster( strMonsterId, nLevel, nLootTime, fItemDropRange, bPet, bGiftBox )
local nSize = table.getn( tEventMonster ) + 1
tEventMonster[nSize] = {}
tEventMonster[nSize].strMonsterId = strMonsterId
tEventMonster[nSize].nLevel = nLevel
tEventMonster[nSize].nLootTime = nLootTime
tEventMonster[nSize].fItemDropRange = fItemDropRange
tEventMonster[nSize].bPet = bPet
tEventMonster[nSize].bGiftBox = bGiftBox
end
Alles anzeigen
[/COLOR][/SIZE]
[SIZE="1"][COLOR="Red"]0.2.0.4[/COLOR] - [COLOR="Lime"]InstanceDungeonBase.lua[/COLOR]:[/SIZE]
[SIZE="1"][COLOR="#00ffff"]Als Viertes widme wir uns diesen Datei Source:
nMaxInstanceDungeon = 100
tDungeon = {}
--------------------------------------------------------------------
-- ½Ã°£ ¼³Á¤ °ü·Ã ÇÔ¼ö ---------------------------------------------
--------------------------------------------------------------------
function SEC( a ) return a * 1000 end
function MIN( a ) return SEC( a ) * 60 end
function AddDungeon( strWorldId )
local nIndex = table.getn( tDungeon ) + 1
tDungeon[nIndex] = {}
tDungeon[nIndex].strWorldId = strWorldId
tDungeon[nIndex].dwClass = 65535
tDungeon[nIndex].nMinLevel = 1 [COLOR="Red"]<-- Mindestlevel[/COLOR]
tDungeon[nIndex].nMaxLevel = 120 [COLOR="#ff0000"]<-- Maximallevel[/COLOR]
tDungeon[nIndex].dwCoolTime = MIN( 30 ) [COLOR="#ff0000"]<-- Zeit in Minuten[/COLOR]
tDungeon[nIndex].tMonster = {}
tDungeon[nIndex].tTeleport = {}
end
CLASS_NORMAL = 1
CLASS_MASTER = 2
CLASS_HERO = 4
function SetClass( ... )
local nIndex = table.getn( tDungeon )
local dwClass = 0
if( arg.n > 0 ) then
for indx = 1, arg.n do
dwClass = dwClass + arg[indx]
end
end
tDungeon[nIndex].dwClass = dwClass
end
function SetLevel( nMinLevel, nMaxLevel )
local nIndex = table.getn( tDungeon )
tDungeon[nIndex].nMinLevel = nMinLevel
tDungeon[nIndex].nMaxLevel = nMaxLevel
end
function SetCoolTime( dwCoolTime )
local nIndex = table.getn( tDungeon )
tDungeon[nIndex].dwCoolTime = dwCoolTime
end
ID_NORMAL = 0 [COLOR="#ff0000"]<-- Monster Stufe Normal[/COLOR]
ID_MIDBOSS = 1 [COLOR="#ff0000"]<-- Monster Stufe Mittlerer Boss[/COLOR]
ID_BOSS = 2 [COLOR="#ff0000"]<-- Monster Stufe Boss[/COLOR]
function SetMonster( nType, strMonsterId, bRed, x, y, z )
local nPDIndex = table.getn( tDungeon )
local nMTIndex = table.getn( tDungeon[nPDIndex].tMonster ) + 1
tDungeon[nPDIndex].tMonster[nMTIndex] = {}
tDungeon[nPDIndex].tMonster[nMTIndex].nType = nType
tDungeon[nPDIndex].tMonster[nMTIndex].strMonsterId = strMonsterId
tDungeon[nPDIndex].tMonster[nMTIndex].bRed = bRed
tDungeon[nPDIndex].tMonster[nMTIndex].x = x
tDungeon[nPDIndex].tMonster[nMTIndex].y = y
tDungeon[nPDIndex].tMonster[nMTIndex].z = z
end
function SetTeleportPos( nType, x, y, z )
local nPDIndex = table.getn( tDungeon )
local nTPIndex = table.getn( tDungeon[nPDIndex].tTeleport ) + 1
tDungeon[nPDIndex].tTeleport[nTPIndex] = {}
tDungeon[nPDIndex].tTeleport[nTPIndex].nType = nType
tDungeon[nPDIndex].tTeleport[nTPIndex].x = x
tDungeon[nPDIndex].tTeleport[nTPIndex].y = y
tDungeon[nPDIndex].tTeleport[nTPIndex].z = z
end
Alles anzeigen
[/COLOR][/SIZE]
[SIZE="1"][COLOR="Red"]0.2.0.5[/COLOR] - [COLOR="Lime"]MonsterSkillFunc.lua[/COLOR]:[/SIZE]
[SIZE="1"][COLOR="#00ffff"]Als fünftes widmen wir unsere Aufmerksameit diesem Datei Source:
tMonsterSkill = {}
ATK_MELEE = 1
ATK_RANGE = 2
function AddMonster( strMonsterId )
local nSize = table.getn( tMonsterSkill ) + 1
tMonsterSkill[nSize] = {}
tMonsterSkill[nSize].strMonsterId = strMonsterId
tMonsterSkill[nSize].tSkill = {}
end
function AddSkill( nAtkMethod, strSkillId, nSkillLv, nHitCount, nRange, nProb, dwSkillTime, bIgnore )
local n = table.getn( tMonsterSkill )
nSize = table.getn( tMonsterSkill[n].tSkill ) + 1
tMonsterSkill[n].tSkill[nSize] = {}
tMonsterSkill[n].tSkill[nSize].nAtkMethod = nAtkMethod
tMonsterSkill[n].tSkill[nSize].strSkillId = strSkillId
tMonsterSkill[n].tSkill[nSize].dwSkillLv = nSkillLv
tMonsterSkill[n].tSkill[nSize].nHitCount = nHitCount - 1
tMonsterSkill[n].tSkill[nSize].nRange = nRange
tMonsterSkill[n].tSkill[nSize].nProb = nProb
tMonsterSkill[n].tSkill[nSize].dwSkillTime = dwSkillTime * 1000
tMonsterSkill[n].tSkill[nSize].bIgnore = bIgnore
end
Alles anzeigen
[/COLOR][/SIZE]
[SIZE="1"][COLOR="Red"]0.2.0.6[/COLOR] - [COLOR="Lime"]PartyDungeon.lua[/COLOR]:[/SIZE]
[SIZE="1"][COLOR="Cyan"]Nun widmen wir unsere Aufmerksamkeit diesem Datei-Source:
--------------------------------------------------------------------
-- ÃʱâÈ* ----------------------------------------------------------
--------------------------------------------------------------------
dofile( ".\\LuaFunc\\InstanceDungeonBase.lua" )
--------------------------------------------------------------------
--[[
AddDungeon( "WI_DUNGEON_SECRET_L" )
--{
SetClass( dwClass )
SetLevel( nMinLevel, nMaxLevel )
SetCoolTime( dwCoolTime )
SetMonster( nType, strMonsterId, bRed, x, y, z )
:
:
SetTeleportPos( nType, x, y, z )
:
:
--}
--]]
--[[
-- Sample
AddDungeon( "WI_DUNGEON_FL_MAS" )
--{
SetClass( CLASS_NORMAL, CLASS_MASTER, CLASS_HERO )
SetLevel( 80, 120 )
SetCoolTime( MIN(1) )
SetTeleportPos( ID_NORMAL, 695, 90, 684 ) -- Á¤ÀÇÇÏÁö ¾ÊÀ¸¸é ¸Ê¿¡¼* ¼³Á¤ÇÑ ÁÂÇ¥·Î À̵¿ÇÑ´Ù.
SetTeleportPos( ID_MIDBOSS, 695, 90, 684 )
SetTeleportPos( ID_BOSS, 695, 100, 684 )
SetMonster( ID_NORMAL, "MI_CAITSITH04_1", false, 695, 90, 684 )
SetMonster( ID_NORMAL, "MI_CAITSITH04_1", false, 695, 90, 684 )
SetMonster( ID_NORMAL, "MI_CAITSITH04_1", false, 695, 90, 684 )
SetMonster( ID_MIDBOSS, "MI_AIBATT1", false, 695, 90, 684 )
SetMonster( ID_BOSS, "MI_AIBATT1", true, 695, 100, 684 )
--}
--]]
AddDungeon( "WI_INSTANCE_OMINOUS" ) [COLOR="#ff0000"]<-- Dungeon der Dazu kommt[/COLOR]
--{
SetClass( CLASS_NORMAL )
SetLevel( 1, 130 )
SetCoolTime( MIN(30) )
--SetTeleportPos( ID_NORMAL, 1358, 102, 1315 )
--SetTeleportPos( ID_MIDBOSS, 695, 90, 684 )
--SetTeleportPos( ID_BOSS, 695, 100, 684 )
SetMonster( ID_NORMAL, "MI_PRICKANT04", true, 1280, 101, 1640 )
SetMonster( ID_NORMAL, "MI_MAULMOUSE04", true, 1234, 101, 1393 )
SetMonster( ID_NORMAL, "MI_CRIPESCENTIPEDE04", true, 1089, 101, 1590 )
SetMonster( ID_MIDBOSS, "MI_LYCANOS01", true, 1078, 101, 1359 )
SetMonster( ID_BOSS, "MI_VEMPAIN01", true, 1079, 101, 1457 )
--}
AddDungeon( "WI_INSTANCE_OMINOUS_1" ) [COLOR="#ff0000"]<-- Dungeon der Hinzukommt[/COLOR]
--{
SetClass( CLASS_MASTER, CLASS_HERO )
SetLevel( 1, 130 )
SetCoolTime( MIN(30) )
--SetTeleportPos( ID_NORMAL, 1358, 102, 1315 )
--SetTeleportPos( ID_MIDBOSS, 695, 90, 684 )
--SetTeleportPos( ID_BOSS, 695, 100, 684 )
SetMonster( ID_NORMAL, "MI_PRICKANT04_1", true, 1280, 101, 1640 )
SetMonster( ID_NORMAL, "MI_MAULMOUSE04_1", true, 1234, 101, 1393 )
SetMonster( ID_NORMAL, "MI_CRIPESCENTIPEDE04_1", true, 1089, 101, 1590 )
SetMonster( ID_MIDBOSS, "MI_LYCANOS01_1", true, 1078, 101, 1359 )
SetMonster( ID_BOSS, "MI_VEMPAIN01_1", true, 1079, 101, 1457 )
--}
[COLOR="#ff0000"]Monster die beim eintreten hinzugefügt werden.[/COLOR]
Alles anzeigen
[/COLOR][/SIZE]
[SIZE="1"][COLOR="Red"]0.2.0.7[/COLOR] - [COLOR="Lime"]PCBang.lua[/COLOR]:[/SIZE]
[SIZE="1"][COLOR="#00ffff"]Als siebtes geben wir nun der Datei PCBang.lua unsere Aufmerksamkeit:
--------------------------------------------------------
tExp = {}
tDropRate = {}
function AddExp( fFactor )
local nIndex = table.getn( tExp ) + 1
tExp[nIndex] = fFactor
end
function AddDropRate( fFactor )
local nIndex = table.getn( tDropRate ) + 1
tDropRate[nIndex] = fFactor
end
--------------------------------------------------------
--------------------------------------------------------
-- Begin Script ----------------------------------------
--------------------------------------------------------
AddExp( 1.1 )
AddExp( 1.2 )
AddExp( 1.3 )
AddExp( 1.35 )
AddExp( 1.4 )
AddExp( 1.45 )
AddExp( 1.5 )
AddDropRate( 1.1 )
Alles anzeigen
[/COLOR][/SIZE]
[SIZE="1"][COLOR="Red"]0.2.0.8[/COLOR] - [COLOR="Lime"]RainbowRaceFunc.lua[/COLOR]:[/SIZE]
[SIZE="1"][COLOR="#00ffff"]Als achtes und fast am Ende des EventFunc Ordners angekommen bieten wir unsere Aufmerksamkeit diesem Datei-Source:
tTime = {}
tNPC = {}
tPrize = {}
tMiniGamePrize = {}
function MIN( nMin )
return nMin * 60 * 1000
end
function SetTime( strWeekDay, strStartTime, strEndTime, strOpenTime, nPayPenya )
local strTemp
local tTemp = {}
strTemp = ""
for i in string.gfind( strStartTime, "%d+" ) do
strTemp = strTemp..i
end
tTemp.nStartTime = tonumber(strTemp)
strTemp = ""
for i in string.gfind( strEndTime, "%d+" ) do
strTemp = strTemp..i
end
tTemp.nEndTime = tonumber(strTemp)
strTemp = ""
for i in string.gfind( strOpenTime, "%d+" ) do
strTemp = strTemp..i
end
tTemp.nOpenTime = tonumber(strTemp)
tTemp.nPayPenya = nPayPenya
tTime[strWeekDay] = tTemp
end
function IsApplicationTime()
local nNowTime = tonumber( os.date( "%H%M" ) )
local tTemp = tTime[os.date("%a")]
if( tTemp ~= nil ) then
if( (nNowTime >= tTemp.nStartTime) and (nNowTime < tTemp.nEndTime) ) then
return true
end
end
return false
end
function IsOpenTime()
local nNowTime = tonumber( os.date( "%H%M" ) )
local tTemp = tTime[os.date("%a")]
if( tTemp ~= nil ) then
if( nNowTime == tTemp.nOpenTime ) then
return true
end
end
return false;
end
function GetPayPenya()
local tTemp = tTime[os.date("%a")]
if( tTemp ~= nil ) then
return tTemp.nPayPenya
end
return 1000000
end
function SetNPC( strNPCId, strCharKey, xPos, yPos, zPos )
local nIndex = table.getn( tNPC ) + 1
tNPC[nIndex] = {}
tNPC[nIndex].strNPCId = strNPCId
tNPC[nIndex].strCharKey = strCharKey
tNPC[nIndex].xPos = xPos
tNPC[nIndex].yPos = yPos
tNPC[nIndex].zPos = zPos
end
function SetPrize( strWeek, strItemId, nItemNum, byFlag, nPenyaRate )
if( tPrize[strWeek] == nil ) then tPrize[strWeek] = {} end
local tTemp = tPrize[strWeek]
local nIndex = table.getn( tTemp ) + 1
tTemp[nIndex] = {}
tTemp[nIndex].strItemId = strItemId
tTemp[nIndex].nItemNum = nItemNum
tTemp[nIndex].byFlag = byFlag
if( tTime[strWeek] ~= nil ) then
tTemp[nIndex].nPenya = tTime[strWeek].nPayPenya * ( nPenyaRate / 100 )
else
tTemp[nIndex].nPenya = 1000000 * ( nPenyaRate / 100 )
end
end
function GetPrize()
return tPrize[os.date("%a")]
end
function SetMiniGamePrize( strWeek, nIndex, strItemId, nItemNum, byFlag )
if( tMiniGamePrize[strWeek] == nil ) then tMiniGamePrize[strWeek] = {} end
local tTemp = tMiniGamePrize[strWeek]
tTemp[nIndex] = {}
tTemp[nIndex].strItemId = strItemId
tTemp[nIndex].nItemNum = nItemNum
tTemp[nIndex].byFlag = byFlag
end
function GetMiniGamePrize( nCompletedNum )
local tTemp = tMiniGamePrize[os.date("%a")]
if( tTemp == nil ) then return nil end
return tMiniGamePrize[os.date("%a")][nCompletedNum]
end
Alles anzeigen
[/COLOR][/SIZE]
[SIZE="1"][COLOR="Red"]0.2.0.9[/COLOR] - [COLOR="Lime"]SecretRoomFunc.lua[/COLOR]:[/SIZE]
[SIZE="1"][COLOR="#00ffff"]Nun bieten wir noch dieser Datei hier, unsere Aufmersamkeit:
--------------------------------------------------------------------
-- ½Ã°£ ¼³Á¤ °ü·Ã ÇÔ¼ö ---------------------------------------------
--------------------------------------------------------------------
function SEC( a ) return a*1000 end
function MIN( a ) return SEC(a)*60 end
function CheckOpenTime()
local Time = OpenTime..":00"
if( Time == os.date("%a %H:%M:%S") ) then
return true
end
return false
end
function GetNextOpenTime()
local nNowDay = tonumber( os.date("%w") )
local nNowHour = tonumber( os.date("%H") )
local nNowMin = tonumber( os.date("%M") )
local nNowSec = tonumber( os.date("%S") )
local a, b, c = GetWeekDayStrToNum()
if( a > nNowDay ) then
return ((a-nNowDay)*24*3600)+((b-nNowHour)*3600)+((c-nNowMin)*60)-nNowSec
elseif( (a == nNowDay) and (b > nNowHour) ) then
return ((b-nNowHour)*3600)+((c-nNowMin)*60)-nNowSec
elseif( (a == nNowDay) and (b == nNowHour) and (c > nNowMin) ) then
return ((c-nNowMin)*60)-nNowSec
elseif( (a == nNowDay) and (b == nNowHour) and (c == nNowMin) ) then
return nNowSec
else
return ((7-nNowDay+a)*24*3600)+((b-nNowHour)*3600)+((c-nNowMin)*60)-nNowSec
end
end
function GetWeekDayStrToNum()
local a = 0
local nTemp1, nTemp2 = string.find(OpenTime, "%d%d:")
local b = tonumber( string.sub(OpenTime, nTemp1, nTemp2-1) )
nTemp1, nTemp2 = string.find(OpenTime, ":%d%d")
local c = tonumber( string.sub(OpenTime, nTemp1+1, nTemp2) )
local strDay = string.sub(OpenTime, string.find(OpenTime, "%a+"))
if( strDay == "Sun" ) then a=0
elseif( strDay == "Mon" ) then a=1
elseif( strDay == "Tue" ) then a=2
elseif( strDay == "Wed" ) then a=3
elseif( strDay == "Thu" ) then a=4
elseif( strDay == "Fri" ) then a=5
elseif( strDay == "Sat" ) then a=6
end
return a, b, c
end
--------------------------------------------------------------------
-- ¸ó½ºÅÍ ¸®Á¨ °ü·Ã ÇÔ¼ö -------------------------------------------
--------------------------------------------------------------------
-- ÇÔ¼ö (¼öÁ¤ ±ÝÁö)
MONSTER_NORMAL = 1 [COLOR="#ff0000"]<-- Normal[/COLOR]
MONSTER_MIDBOSS = 2 [COLOR="#ff0000"]<-- Mittel Boss[/COLOR]
MONSTER_BOSS = 3 [COLOR="#ff0000"]<-- Boss[/COLOR]
tMonster = {}
function AddMonster( nType, strMonsterId, nNum, bRed, x1, z1, x2, z2, y )
nIndex = table.getn( tMonster ) + 1
tMonster[nIndex] = {}
tMonster[nIndex].nType = nType
tMonster[nIndex].dwId = strMonsterId
tMonster[nIndex].nNum = nNum
tMonster[nIndex].bRed = bRed
tMonster[nIndex].x1 = x1
tMonster[nIndex].z1 = z1
tMonster[nIndex].x2 = x2
tMonster[nIndex].z2 = z2
tMonster[nIndex].y = y
end
Alles anzeigen
[/COLOR][/SIZE]
[SIZE="1"][COLOR="Red"]0.2.1.0[/COLOR] - [COLOR="Lime"]Tax.lua[/COLOR]:[/SIZE]
[SIZE="1"][COLOR="#00ffff"]Als vorletztes des Ordner EventFunc bieten wir nun noch diesem Datei-Source unsere Aufmerksamkeit:
----------------------------------------------------------------------------
dofile( ".\\LuaFunc\\TaxFunc.lua" )
----------------------------------------------------------------------------
MinTaxRate = 5 [COLOR="#ff0000"]<-- Minimale Steuerrate[/COLOR] -- ÃÖ¼Ò ¼¼À²
MaxTaxRate = 20 [COLOR="#ff0000"]<-- Maximale Steuerrate [/COLOR] -- ÃÖ´ë ¼¼À²
TaxSecretRoomRate = 45 [COLOR="#ff0000"]<-- Maximale Steuerrate (Secret Room)[/COLOR] -- ´ë·ú Á¡·É ±æµå ¼öÀÍ·ü(%)
TaxLordRate = 45 [COLOR="#ff0000"]<-- Maximale Steuerrate (Lord)[/COLOR] -- ±ºÁÖ ¼öÀÍ·ü(%)
AdmissionSecretRoomRate = 45 -- ÀÔÀå·á ¼öÀÍ·ü(%)
AdmissionLordRate = 45 -- ±ºÁÖ ÀÔÀå·á ¼öÀÍ·ü(%)
PayTime = "00:00" -- ¼¼±Ý Áö±Þ ½Ã°£
ChangeTaxTime = "Mon 00:00" -- ¼¼À² º¯°æ ½Ã°£
DBSaveCount = 10 [COLOR="#ff0000"][COLOR="#ff0000"]<-- Accounts mit den Höchsten Gebot können hier eingestellt werden[/COLOR][/COLOR] -- DB ÀúÀå ºóµµ(°Ç¼ö)
----------------------------------------------------------------------------
-- Á¡·É±æµå Àü¿ë ±¸¸Å ¾ÆÀÌÅÛ ¼³Á¤ ------------------------------------------
----------------------------------------------------------------------------
AddOccupationShopItem( "II_CHP_RED" ) [COLOR="Red"]<-- Item nach dem gewinn eines Guild Wars[/COLOR]
Alles anzeigen
[/COLOR][/SIZE]
[SIZE="1"][COLOR="Red"]0.2.1.1[/COLOR] - [COLOR="Lime"]TaxFunc.lua[/COLOR]:[/SIZE]
[SIZE="1"][COLOR="#00ffff"]Und nun, endlich am Ende angekommen, bieten wir noch dieser Datei unsere Aufmerksamkeit und kommen somit, vorrübergehend zum Schluss:
tOccupationShopItem = {}
-------------------------------------------------------------
--- ¼¼À² º¯°æ ½Ã°£ üũ ÇÔ¼ö --------------------------------
-------------------------------------------------------------
function CheckChangeTime( strDate ) -- strDate ´Â °¡Àå ÃÖ±Ù¿¡ ¼¼À²ÀÌ Àû¿ëµÈ ½Ã°£
local strNowDate = os.date("%a %H:%M")
local nNowDate = tonumber( GetNowDate() ) -- ÇöÀç ³¯Â¥ ¹× ½Ã°£
local nNextDate = tonumber( GetNextDate( strDate ) ) -- ´ÙÀ½ Àû¿ëµÉ ³¯Â¥ ¹× ½Ã°£
if( ChangeTaxTime == strNowDate ) then -- ChangeTaxTime¿¡ ¼³Á¤ÇÑ ½Ã°£ÀÌ¸é º¯°æ
return true, tostring( nNowDate )
elseif( nNowDate >= nNextDate ) then -- ´ÙÀ½ Àû¿ëÇÒ ½Ã°£ÀÌ Áö³µÀ¸¸é º¯°æ
return true, tostring( nNowDate ) -- (ChangeTaxTime¿¡ ±ºÁÖ°¡ ¾ÆÁ÷ ¼³Á¤µÇÁö ¾ÊÀº °æ¿ì)
end
return false, tostring( nNowDate )
end
function CheckPayTime() -- ¼¼±Ý Áö±Þ½Ã°£
if( PayTime == os.date("%H:%M") ) then
return true
end
return false
end
function GetNowDate()
return os.date("%Y%m%d%H%M")
end
----------------------------------------------------------------
-- ¿©±âºÎÅÍ´Â lua¿¡¼*¸¸ »ç¿ëÇÏ´Â ÇÔ¼ö ------------------
----------------------------------------------------------------
function GetNextDate( strDate )
local nYear = tonumber( string.sub( strDate, 1, 4 ) )
local nMonth = tonumber( string.sub( strDate, 5, 6 ) )
local nDay = tonumber( string.sub( strDate, 7, 8 ) )
local nWDay, nHour, nMin = GetCheckTime()
-- ´ÙÀ½ Àû¿ëµÉ ³¯Â¥¸¦ ±¸ÇÑ´Ù.(strDate·Î ºÎÅÍ ´ÙÀ½ ¼³Á¤ ½Ã°£)
local temp = os.date( "*t", os.time{year=nYear, month=nMonth, day=nDay, hour=nHour, min=nMin} )
if( temp.wday >= nWDay ) then
temp.day = temp.day + ( 7 - ( temp.wday - nWDay ) )
elseif( temp.wday < nWDay ) then
temp.day = temp.day + ( nWDay - temp.wday )
end
return os.date( "%Y%m%d%H%M", os.time(temp) )
end
function GetCheckTime()
local strWDay = string.sub( ChangeTaxTime, 1, 3 )
local nHour = string.sub( ChangeTaxTime, 5, 6 )
local nMin = string.sub( ChangeTaxTime, 8, 9 )
local nWDay = 2
if( strWDay == "Sun" ) then nWDay = 1
elseif( strWDay == "Mon" ) then nWDay = 2
elseif( strWDay == "Tue" ) then nWDay = 3
elseif( strWDay == "Wed" ) then nWDay = 4
elseif( strWDay == "Thu" ) then nWDay = 5
elseif( strWDay == "Fri" ) then nWDay = 6
elseif( strWDay == "Sat" ) then nWDay = 7
end
return nWDay, nHour, nMin
end
function AddOccupationShopItem( strItemId )
local nIndex = table.getn( tOccupationShopItem ) + 1
tOccupationShopItem[nIndex] = strItemId
end
Alles anzeigen
[/COLOR][/SIZE]
[SIZE="5"][COLOR="Red"]Dieser Theard ist in Bearbeitung und ist daher noch nicht fertig, ich bitte euch noch keine Kommentare oder Kritik abzugeben! Wenn du es trotzdem tu möchtest, kannst du das über PN machen! :D[/COLOR][/SIZE]