What's new

[7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Status
Not open for further replies.

tollaks

Advanced User
Joined
Jul 29, 2009
Messages
231
Reaction score
9
Age
30
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Wersja Tibi 8.5
Silnik:The forgotten server 0.2.4 mystic spirit
Opis B??du:Zrobilem anhilator 2 tylko ze jak ktos juz wykonal anhilator zwykly to nie moze wziasc itemow z anhilator 2;/ prosze o pomoc:)
Skrypt:
local playerPosition =
{
{x = 1243, y = 897, z = 9, stackpos = STACKPOS_TOP_CREATURE},
{x = 1242, y = 897, z = 9, stackpos = STACKPOS_TOP_CREATURE},
{x = 1241, y = 897, z = 9, stackpos = STACKPOS_TOP_CREATURE},
{x = 1240, y = 897, z = 9, stackpos = STACKPOS_TOP_CREATURE}
}

local newPosition =
{
{x = 1262, y = 897, z = 9},
{x = 1261, y = 897, z = 9},
{x = 1260, y = 897, z = 9},
{x = 1259, y = 897, z = 9}
}

-- Do not modify the declaration lines below.
local player = {0, 0, 0, 0}
local failed = TRUE

function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
for i = 1, 4 do
player = getThingfromPos(playerPosition)
if player.itemid > 0 then
if isPlayer(player.uid) == TRUE then
if getPlayerStorageValue(player.uid, 30016) == -1 then
if getPlayerLevel(player.uid) >= 100 then
failed = FALSE
end
end
end
end

if failed == TRUE then
doPlayerSendCancel(cid, "Sorry, not possible.")
return TRUE
end

failed = TRUE
end

for i = 1, 4 do
doSendMagicEffect(playerPosition, CONST_ME_POFF)
doTeleportThing(player.uid, newPosition, FALSE)
doSendMagicEffect(newPosition, CONST_ME_ENERGYAREA)
end
doTransformItem(item.uid, item.itemid + 1)
elseif item.itemid == 1946 then
doPlayerSendCancel(cid, "Sorry, not possible.")
end

return TRUE
end
 

BodyRemo

User
Joined
Apr 11, 2009
Messages
33
Reaction score
0
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Witam wiem ze to jest poprawianie skryptow ale ja prosze o malutki skrypcik hehe :D
Tibia:8.1
Evolution
Skrypt ze jak sie stanie na kratce xxx to po 3 sek od staniecia na plytce pojawia sie 6 scian i pojawia sie potworek na wsp?lrzednych x i jak sie zabijego tego potworka to ta sciana znika :)
 

GarQet

Senior User
Joined
Jul 27, 2008
Messages
512
Reaction score
31
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Tibia: 8.42
TFS
Skrypt: Mam pytanie co do jednej linijki
Code:
doSummonCreature("Ghost",{x=1382, y=1302, z=6})
Czy mo?na jako? zast?pi?
doSummonCreature
na tak? funkcj? ?eby przyzywa?o monstera kt?ry nie daje expa? Taki jak np. w starszych wersjach tibii Gamemaster m?g? przyzywa? monstera za pomoc? komendy /s i gdy gracz go zabi? nie dostawa? expa.
Wiem jaki jest na to spos?b, zrobienie nowego np:
ze spacj? w ?rodku, ale ja chc? tego w?a?nie unikn??, jest jaka? mo?liwo?? ?eby to zrobi??
Z g?ry dzi?kuj? i Pozdrawiam GarQet.

Ps. Fajnie ?e taki temat istnieje, nawet nie wiedzia?em o_O

@Pan UP - tollaks
Musisz zmieni? StorageValue. (Tak mi si? wydaje)
if getPlayerStorageValue(player.uid, 30016) == -1 then
 
Last edited:

Xinx

Senior User
Joined
Jun 17, 2008
Messages
712
Reaction score
127
Age
31
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Wersja tibii : --
Silnik : --
Tre?? b??du / opis b??du : --
Skrypt :
Code:
--[[
   Script by Xinx
]]--

local config = {
-- script config --
cost = 1000,
itemID = xxxx,xxxx,xxxx,xxxx
itemCount = 1,
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveMoney(cid, config.cost) then
local addItem = doPlayerAddItem(cid, config.itemID, config.itemCount)
doPlayerSendTextMessage(cid, 19, "Dostales "..config.itemCount.." ) za "..config.cost.." gp.
else
doPlayerSendCancel(cid, "Sorry, you don't have enough money.")
end
return TRUE
end

Ewentualne uwagi : Mam dla Was bomba zadanie,prosi?bym tak :

- Skrypt by? w talkactions,czyli chodzi o to,?eby dzia?a?,jak np napisze . !nagroda

- Skrypt nie by? na kase,tylko na 5 item?w,czyli zabiera mi 5 itemow o tym samym id..

-Dodaje mi jeden z 30 item?w o r?znych id losowo..

Z g?ry dzi?kuje,postaram si? odwdzi?czy? w jaki? spos?b,w razie problemu pisa? : 11464521.

Wiem,by?em do?? wymagajacy,ale pilnie mi to potrzebne..

Jeszcze raz z g?ry dzi?ki i pozdrawiam,
Xinx.
 

Poufny

Senior User
Joined
Jul 31, 2009
Messages
662
Reaction score
46
Age
31
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Takies kozaki? :D Poprawcie ten skrypt, aby mozna bylo przeprowadzic rozmowe, z NPC, On jest lipny bo robiony przezemne xd
Code:
local node1 = keywordHandler:addKeyword({'hi'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Witaj |PLAYERNAME| Czy przyszedles mi podokuczac?'})
	node1:addChildKeyword({'no'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, text = 'Dobrze. Chcesz posluchac pewnej historii?Powiedz historia.'})
	node1:addChildKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Spadaj! Przeklinam Cie!.', reset = true})
local node2 = keywordHandler:addKeyword({'historia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Pewnej ciemnej Nocy, na nasza Armonie napadlo 2 Tibia Bugow, sa to silne potwory, ktorym ja sam Knight nie daje rady! Ledwo co ucieklem i ch rek, zniszczyli nasza Armonie, lecz Krol ja naprawil, niektore expowiska nadal sa uszkodzone. Przestarszne Bugi, nadal panuja w miescie! Czy dasz rade ich zabic, gdy uzyszkasz lvl 20k? Czy przyniesiesz mi ich serce? Wzamian ofiaruje Ci prezent!'})
	node1:addChildKeyword({'no'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, text = 'Dobrze. Wiec Nie wiem po co marnuje czas....'})
	node1:addChildKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Badz Blogoslawiony! Dziekuje Ci! Powodzenia....', reset = true})

Nie wiem czy mozna to nazwac skryptem, ale bardzo mi zalezy! ^^ Poprostu NPC Nie jest czytany na mapce =|

TFS 8.5
 
Last edited:

Bartastkd

Advanced User
Joined
Nov 11, 2008
Messages
464
Reaction score
10
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Wersja tibii : 8.4
Silnik : TFS 0.2.0.0
Tre?? b??du / opis b??du :exura gran mas res na pomaranczowo
Przerobi? ten skrypt z exura vita na exura gran mas res , zeby wyswietlalo ile sie leczysz na pomaranczowo

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function getCombatFormulas(cid, lv, maglv)
	critical = math.random(1,100)
	local formula_min = ((lv*1 + maglv*4) * 2.08)
	local formula_max = ((lv*1 + maglv*4) * 2.7)

	if(formula_max < formula_min) then
		local tmp = formula_max
		formula_max = formula_min
		formula_min = tmp
	end
	local healing = math.random(formula_min,formula_max)
	doSendAnimatedText(getCreaturePosition(cid), healing, TEXTCOLOR_ORANGE)
	return healing, healing
end


setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "getCombatFormulas")


function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
 

szymo022

Active User
Joined
Apr 29, 2009
Messages
58
Reaction score
2
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Wersja tibii : 8.10
Silnik : Evolution 8.1 by Aciek, zastrzegam prawa co do mojego nicku
Tre?? b??du / opis b??du : Podczas odpalania OTS'a nie moze zaladowac i otworzyc tepcik.lua
dam screen:
attachment.php


Skrypt:
Code:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 9687 then
player1pos = {x=1027, y=994, z=7, stackpos=253}
player1 = getThingfromPos(player1pos)

player2pos = {x=1028, y=994, z=7, stackpos=253}
player2 = getThingfromPos(player2pos)


           if player1.itemid > 0 and player2.itemid


player1level = getPlayerLevel(player1.uid)
player2level = getPlayerLevel(player2.uid)

questlevel = 1

 if player1level >= questlevel and player2level

  queststatus1 = getPlayerStorageValue(player1.uid,987)
  queststatus2 = getPlayerStorageValue(player2.uid,987)

  if queststatus1 == -1 and queststatus2
  
  nplayer1pos = {x=1025, y=982, z=7}
  nplayer2pos = {x=1026, y=982, z=7}

  doTeleportThing(player1.uid,nplayer1pos)
  doTeleportThing(player2.uid,nplayer2pos)
  else
  return 0
  end
  return 1
  end
  end
  end
 

Attachments

  • tep.JPG
    tep.JPG
    5.4 KB · Views: 0
Last edited:

Aureos

Active User
Joined
Feb 9, 2009
Messages
64
Reaction score
4
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Wersja tibii : 8.5
Silnik : TFS 0.3.5PL1
Opis b??du : Skrypt po prostu nie dzia?a, nic si? nie dzieje
Skrypt :
Code:
function onAdvance(cid, fromPosition, toPosition, oldlevel, newlevel)
local ppos = getPlayerPosition(cid)
doSendMagicEffect(ppos, CONST_ME_BIGCLOUDS)
doCreatureAddHealth(cid, 9999)
doPlayerAddMana(cid, 9999)
end
Ewentualne uwagi : Gdy kto? wbije jaki? level, skrypt powinien mu dawa? full hp i man?

TIA
 

Sayax

User
Joined
Apr 12, 2009
Messages
32
Reaction score
0
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Wersja tibii : 8.0
Silnik : TDB - Engine v0.5
Opis b??du:Ten skroyt debuguje mi serwer, poniwaz jak jest uzyty kto sie wyloguje odrazu debug;/ prosilbym o poprawienie go poprzez zrobienie ze nie mozna sie wylogowac gdi jest w uzyciu i nie mozna zaatakowac postaci ktora go uzyla na czas dzialania tego czaru. Z g?ry dzieki. to jest pod 8.0 forgottena silnik



local drunk = createConditionObject(CONDITION_DRUNK)
setConditionParam(drunk, CONDITION_PARAM_TICKS, 24*60*1000)

function statup(cid)
local ppos = getPlayerPosition(cid)
doPlayerAddHealth(cid,(getPlayerLevel(cid) * math.random(1,3)))
doPlayerAddMana(cid,(getPlayerLevel(cid) * math.random(1,3)))
doSendMagicEffect(ppos,26)
end

function check1(cid)
if (hasCondition(cid, CONDITION_DRUNK) == TRUE) then
if (hasCondition(cid, CONDITION_INFIGHT) == FALSE) then
if getPlayerHealth(cid) == getPlayerMaxHealth(cid) then
if getPlayerMana(cid) == getPlayerMaxMana(cid) then
mayNotMove(cid, 0)
doRemoveCondition(cid, 11)
else
addEvent(statup,1000,cid)
addEvent(check1,1000,cid)
end
else
addEvent(statup,1000,cid)
addEvent(check1,1000,cid)
end
else
mayNotMove(cid, 0)
stopEvent(statup)
stopEvent(check1)
doRemoveCondition(cid, 11)
end
else
mayNotMove(cid, 0)
stopEvent(statup)
stopEvent(check1)
doRemoveCondition(cid, 11)
end
end

function onCastSpell(cid, var)
if(hasCondition(cid, CONDITION_INFIGHT) == FALSE) then
if(hasCondition(cid, CONDITION_DRUNK) == FALSE) then
doTargetCombatCondition(0, cid, drunk, CONST_ME_NONE)
mayNotMove(cid, 1)
addEvent(check1,1000,cid)
end
end
end
 
Last edited:

minusek

Active User
Joined
Apr 6, 2009
Messages
56
Reaction score
0
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Wersja tibii : 8.0
Silnik : Star Class Server 8.0
Tre?? b??du / opis b??du : Nie dodaje mi hp many
Skrypt :
-- Transformation System by Piotrek1447
local configuration =
{
playerVocation = {0, 1},
playerNewVocation = 2,
playerNewLookType = 30,
playerLevel = 10,
manaCost = 10,
soulCost = 1,
timeActive = 999999
PlayerAddHealthMax = 1000
PlayerAddManaMax = 1000
}
local VOCATION_STORAGE = 10000
local outfit = {lookType = configuration.playerNewLookType, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 0}
function onSay(cid, words, param)
if(isInArray(configuration.playerVocation, getPlayerVocation(cid)) == TRUE) then
if(getPlayerLevel(cid) >= configuration.playerLevel) then
if(getPlayerMana(cid) >= configuration.manaCost) then
if(getPlayerSoul(cid) >= configuration.soulCost) then
setPlayerStorageValue(cid, VOCATION_STORAGE, getPlayerVocation(cid))
doPlayerSetVocation(cid, configuration.playerNewVocation)
doPlayerAddMana(cid, - configuration.manaCost)
doPlayerAddSoul(cid, - configuration.soulCost)
doPlayerAddHealthMax(cid, - configuration.PlayerAddHealthMax)
doPlayerAddManaMax(cid, - configuration.PlayerAddManaMax)
doSetCreatureOutfit(cid, outfit, configuration.timeActive * 1000)
addEvent(transformBack, configuration.timeActive * 1000, cid)
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required soul points.")
end
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required mana points.")
end
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required level.")
end
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required vocation.")
end
end
function transformBack(cid)
doPlayerSetVocation(cid, getPlayerStorageValue(cid, VOCATION_STORAGE))
setPlayerStorageValue(cid, VOCATION_STORAGE, 0)
end
Ewentualne uwagi : B?ad po w??czeniu otsa
Loading talkactions.xml...Warning : [Event::LoadScript ] Can not load script. data/talkactions/scripts/transform.lua
ata/talkactions/scripts/transform.lua:11 '}' expected < to close '{' at line 3> near 'PlayerAddHealtMax'
 
Last edited:

Smoth

New User
Joined
Aug 5, 2009
Messages
7
Reaction score
0
Age
30
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Wersja tibii : 8.0
silnik : devland 8.0 sql
skrypt :
<?php
$query = mysql_query("SELECT `bonus` FROM `accounts` WHERE (`id` = '".$_SESSION['acc']."') ") or die(mysql_error());
while($sql = mysql_fetch_array($query)) {
$bon = $sql['bonus'];
if($bon<$prize and $e == 0)
{
$brak = $prize - $bon;
echo "Masz za ma?o pkt!<br>";
echo "Brakuje Ci : <b>$brak</b> punkt?w!<br>";
echo '<a href="index.php?page=doladuj">Zam?w Punkty</a><br>';
$e = 1;
}
}
if($_SESSION['unique'] == $_POST['unique'] and $e == 0)
{
$query = mysql_query("SELECT * FROM `players` WHERE (`name` = '$nick') ") or die(mysql_error());
while($sql = mysql_fetch_array($query)){
{ $playerid = $sql['id']; }}
$backpack = "INSERT INTO player_depotitems(player_id, depot_id, pid, sid, itemtype, count, attributes) values('$playerid','','0','0','0','0','')";
$bp_item1 = "INSERT INTO player_depotitems(player_id, depot_id, pid, sid, itemtype, count, attributes) values('$playerid','','0','','$item','0','')";
if(isset($backpack)) { mysql_query($backpack)or die($dup = "Niestety w twoim dp znajduje si? ju? jaki? zam?wiony przedmiot! Przed zam?wieniem nastepnego musisz si? zalogowa? i odebra? go! $playerid"); }
if(isset($bp_item1) && isset($backpack)) { mysql_query($bp_item1)or die(); }
//$dup = "Niestety w twoim dp znajduje si? ju? jaki? zam?wiony przedmiot! Przed zam?wieniem nastepnego musisz si? zalogowa? i odebra? go!"
$query2 = mysql_query("SELECT `bonus` FROM `accounts` WHERE (`id` = '".$_SESSION['acc']."') ") or die(mysql_error());
while($sql = mysql_fetch_array($query2)) {
$b = $sql['bonus'];
$bonus = $b-$prize; //ilosc bonusu
}
$Sql = "UPDATE accounts SET bonus = '$bonus' WHERE (id = '".$_SESSION['acc']."')";
if (!$Result = mysql_query($Sql)) {
echo "Error at updateing.<br/>\n";
echo "Error is: <b>" . mysql_error() . "</b><br/>\n";
echo "Error in SQL: <b>" . $Sql . "</b><br/>\n";
die();
} elseif(!empty($nick)) {
echo "<p>Gratulacje $nick zam?wi?e? $itemname . Przed zam?wieniem nastepnego odbierz go z DP</p>";
echo "<b>Zosta?o: $bonus punkt?w</b><br>";
echo '<a href="index.php?page=item">Kliknij tutaj aby zam?wi? nast?pny!</a>';
$data = date("U");
mysql_query("INSERT INTO archiwum(user, kod, data, typ) values('$nick', '$item', '$data', '3')");
unset($_SESSION['unique']);
}}
elseif($_SESSION['unique'] != $_POST['unique'])
{
echo "Niedawno kupi?e? przedmiot!Odbierz go z DP i wr?? po nast?pny je?li chcesz";
echo '<a href="index.php?page=item">Kliknij tutaj aby zam?wi? nast?pny!</a>';
}
elseif(!empty($dup))
{
echo "$dup";
}
?>
Nie daje itemu w sms shopie pisze ze jest juz jakis item zamuwiony w dp, a tak niejest
 

Swiatas

Advanced User
Joined
Oct 16, 2008
Messages
160
Reaction score
3
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Klient: 8.41 & 8.42
Silnik: TFS 0.3.4 Patch 2(Crying Damson)
Opis B??du: Wyskakuja mi w konsoli takie Bledy:

[.CODE]Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/GuildWar.lua
cannot open ./GuildWar.lua: No such file or directory
[Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/GuildWar.lua)
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/GuildWar.lua
cannot open ./GuildWar.lua: No such file or directory
[Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/GuildWar.lua)
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/GuildWar.lua
cannot open ./GuildWar.lua: No such file or directory
[Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/GuildWar.lua)
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/GuildWar.lua
cannot open ./GuildWar.lua: No such file or directory
[Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/GuildWar.lua)
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/GuildWar.lua
cannot open ./GuildWar.lua: No such file or directory
[Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/GuildWar.lua)
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/GuildWar.lua
cannot open ./GuildWar.lua: No such file or directory
[Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/GuildWar.lua)
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/war_attack.lua
cannot open ./GuildWar.lua: No such file or directory
[Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/war_attack.lua)
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/war_kill.lua
cannot open ./GuildWar.lua: No such file or directory
[Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/war_kill.lua)
Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/wars.lua
cannot open ./GuildWar.lua: No such file or directory
[Warning - Event::loadScript] Cannot load script (data/globalevents/scripts/wars.lua)[.CODE]

Skrypty:

Guild War:
[.CODE]dofile("./GuildWar.lua")
function onSay(cid, words, param)
if getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER then
local myGuild = getPlayerGuildId(cid)
if words == "/war-invite" then
if GuildIsInPEace(myGuild) == true then
if param ~= "" then
if guildExist(param) ~= LUA_ERROR then
local invitedGuild = getGuildId(param)
if invitedGuild ~= LUA_ERROR then
if invitedGuild ~= myGuild then
if GuildIsInPEace(invitedGuild) == true then
doInviteToWar(myGuild, invitedGuild)
doBroadcastMessage(BroadCast[1][1] ..getPlayerGuildName(cid).. BroadCast[1][2] ..getGuildNameById(invitedGuild).. BroadCast[1][3], BroadCast_Type)
else
doPlayerSendCancel(cid, CancelMessagesWar[6])
end
else
doPlayerSendCancel(cid, CancelMessagesWar[8])
end
else
doPlayerSendCancel(cid, CancelMessagesWar[4])
end
else
doPlayerSendCancel(cid, CancelMessagesWar[4])
end
else
doPlayerSendCancel(cid, CancelMessagesWar[7])
end
else
doPlayerSendCancel(cid, CancelMessagesWar[5])
end
elseif words == "/war-accept" then
if getGuildWarInfo(myGuild).By ~= 0 then
local enemyGuild = getGuildWarInfo(myGuild).By
doBroadcastMessage(BroadCast[2][1] ..getPlayerGuildName(cid).. BroadCast[2][2] ..getGuildNameById(enemyGuild).. BroadCast[2][3], BroadCast_Type)
WarAccept(myGuild, enemyGuild)
else
doPlayerSendCancel(cid, CancelMessagesWar[1])
end
elseif words == "/war-reject" then
if getGuildWarInfo(myGuild).By ~= 0 then
doBroadcastMessage(BroadCast[3][1] ..getPlayerGuildName(cid).. BroadCast[3][2] ..getGuildNameById(getGuildWarInfo(myGuild).By).. BroadCast[3][3], BroadCast_Type)
cleanInfo(getGuildWarInfo(myGuild).By)
cleanInfo(myGuild)
else
doPlayerSendCancel(cid, CancelMessagesWar[1])
end
elseif words == "/war-cancel-invite" then
if getGuildWarInfo(myGuild).To ~= 0 then
if getGuildWarInfo(myGuild).With == 0 then
doBroadcastMessage(BroadCast[4][1] ..getPlayerGuildName(cid).. BroadCast[4][2] ..getGuildNameById(getGuildWarInfo(myGuild).To).. BroadCast[4][3], BroadCast_Type)
cleanInfo(getGuildWarInfo(myGuild).To)
cleanInfo(myGuild)
else
doPlayerSendCancel(cid, CancelMessagesWar[3])
end
else
doPlayerSendCancel(cid, CancelMessagesWar[1])
end
elseif words == "/war-challenge" then
local map = Maps[param]
if map then
if getGuildWarInfo(myGuild).With ~= 0 and getGuildWarInfo(myGuild).ON == 0 then
local enemyGuild = getGuildWarInfo(myGuild).With
addEvent(StarWar, 15 * 1000, {myGuild = myGuild, enemyGuild = enemyGuild, map = param})
doBroadcastMessage(BroadCast[5][1] ..getPlayerGuildName(cid).. BroadCast[5][2] ..getGuildNameById(enemyGuild).. BroadCast[5][3] .. param ..".", BroadCast_Type)
else
doPlayerSendCancel(cid, CancelMessagesWar[10])
end
else
doPlayerSendCancel(cid, CancelMessagesWar[9])
end
elseif words == "/war-cancel" then
local enemy = getGuildWarInfo(myGuild).With
if enemy ~= 0 then
if (os.time() - getGuildWarInfo(myGuild).T) >= (1 * DelayToCancel) then
StopWar(myGuild, enemy)
doBroadcastMessage(BroadCast[6][1] ..getGuildNameById(myGuild).. BroadCast[6][2] ..getGuildNameById(enemy).. BroadCast[6][3], BroadCast_Type)
else
doPlayerSendCancel(cid, CancelMessagesWar[11])
end
else
doPlayerSendCancel(cid, CancelMessagesWar[10])
end
end
else
doPlayerSendCancel(cid, CancelMessagesWar[2])
end
local file = io.open("data/logs/Wars.txt", "a")
file:write("".. os.date("%d %B %Y %X ", os.time()) .." --> "..getCreatureName(cid)..": "..words.." "..param.."\n")
file:close()
return TRUE
end[.CODE]

War_Attack:

[.CODE]dofile("./GuildWar.lua")

function onAttack(cid, target)
if isPlayer(cid) == TRUE and isPlayer(target) == TRUE then
local myGuild = getPlayerGuildId(cid)
local enemyGuild = getPlayerGuildId(target)
if myGuild ~= 0 and enemyGuild ~= 0 then
if enemyGuild == getGuildWarInfo(myGuild).With then
if getPlayerSkullType(cid) == 3 or getPlayerSkullType(cid) == 4 then
if getPlayerSkullType(target) == 0 then
doCreatureSetSkullType(cid, 1)
doCreatureSetSkullType(target, 1)
end
end
end
end
end
return TRUE
end[.CODE]

War_Kill:

[.CODE]dofile("./GuildWar.lua")

local PZ = createConditionObject(CONDITION_INFIGHT)
setConditionParam(PZ, CONDITION_PARAM_TICKS, getConfigInfo('whiteSkullTime'))

function onKill(cid, target)
if isPlayer(cid) == TRUE and isPlayer(target) == TRUE then
local myGuild = getPlayerGuildId(cid)
local enemyGuild = getPlayerGuildId(target)
if myGuild ~= 0 and enemyGuild ~= 0 then
if enemyGuild == getGuildWarInfo(myGuild).With then
doAddCondition(cid, PZ)
registerDeath(myGuild, enemyGuild, cid, target)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "This frag will not count!")

end
end
end
return TRUE
end[.CODE]

Wars:

[.CODE]dofile("./GuildWar.lua")

function onThink(interval, lastExecution)
for _, id in ipairs(getGuildsWithWar()) do
local Check = db.getResult("SELECT `name` FROM `guilds` WHERE id = ".. getGuildWarInfo(id).With .."")
if Check:getID() == LUA_ERROR then
cleanInfo(id)
end
end
return TRUE
end[.CODE]

Ewentualne Uwagi: Nie wiem w czym problem ktorys z skryptow nie dziala poprawnie i prosze o poprawienie go oraz jesli nie bedzie to sprawialo duzego klopotu wyjasnienie bledu z gory dziekuje.
 
Last edited:

Xart Irok

Senior User
Joined
Sep 7, 2008
Messages
2,925
Reaction score
419
Age
32
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

@switas
a gdzie wgrales ten plik ("./GuildWar.lua") jesli do folderu data to go cofnij tam gdzie masz config.lua
 

TymeX

User
Joined
Apr 10, 2008
Messages
13
Reaction score
1
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Post?pi?em dok?adnie tak jak w pracy konkursowej licznik zabitych potwor?w 8.50 a ja mam silnik tfs 0.2.3 Mystic Spirit niestety nie dzia?a czy poda mi skrypt pod t? wersje silnika ??
 
Last edited:

minusek

Active User
Joined
Apr 6, 2009
Messages
56
Reaction score
0
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Jeju czekam ju? z 3tygodnie na odpowied? je?li niema odpowiedzi prosz? o zamkniecie tematu
 

Xevixo

Advanced User
Joined
Aug 26, 2009
Messages
432
Reaction score
98
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Jeju czekam ju? z 3tygodnie na odpowied? je?li niema odpowiedzi prosz? o zamkniecie tematu
Ja spr?buje pom?c

Code:
-- Transformation System by Piotrek1447
local configuration =
{
playerVocation = {0, 1},
playerNewVocation = 2,
playerNewLookType = 30,
playerLevel = 10,
manaCost = 10,
soulCost = 1,
timeActive = 999999
gethealth = 1000
get ManaMax = 1000
}
local VOCATION_STORAGE = 10000
local outfit = {lookType = configuration.playerNewLookType, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 0}
function onSay(cid, words, param)
if(isInArray(configuration.playerVocation, getPlayerVocation(cid)) == TRUE) then
if(getPlayerLevel(cid) >= configuration.playerLevel) then
if(getPlayerMana(cid) >= configuration.manaCost) then
if(getPlayerSoul(cid) >= configuration.soulCost) then
setPlayerStorageValue(cid, VOCATION_STORAGE, getPlayerVocation(cid))
doPlayerSetVocation(cid, configuration.playerNewVocation)
doPlayerAddMana(cid, - configuration.manaCost)
doPlayerAddSoul(cid, - configuration.soulCost)
doPlayerAddHealthMax(cid, - configuration.PlayerAddHealthMa
doPlayerAddManaMax(cid, - configuration.PlayerAddManaMa
doSetCreatureOutfit(cid, outfit, configuration.timeActive * 1000)
addEvent(transformBack, configuration.timeActive * 1000, cid)
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required soul points.")
end
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required mana points.")
end
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required level.")
end
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required vocation.")
end
end
function transformBack(cid)
doPlayerSetVocation(cid, getPlayerStorageValue(cid, VOCATION_STORAGE))
setPlayerStorageValue(cid, VOCATION_STORAGE, 0)
end
Raczej powinno dzia?a? :)
Pozdrawiam
 

minusek

Active User
Joined
Apr 6, 2009
Messages
56
Reaction score
0
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Nie dziala bo wogule to Ty tylko dodales linijke
gethealth = 1000
get ManaMax = 1000
a tam dalej nic nie zrobiles i nie dziala ;/
 
Joined
Jun 27, 2009
Messages
11
Reaction score
0
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Dobra to dla mnie poprawcie skrypta na 8.5 Actions. Dla was to bedzie pestka
Chce zeby dawal exhausted bo nie daje
function onUse(cid, item, frompos, item2, topos)
pos = getPlayerPosition(cid)
if item.itemid == 2703 then
if getPlayerStorageValue(cid, 25945) == -1 or getPlayerStorageValue(cid, 25945) == 1 then
doSendMagicEffect(topos,46)
doTransformItem(item.uid, 2703)
doPlayerAddItem(cid,2674,1)
addEvent(exh_1,5000,cid)
return 0
else
doPlayerSendCancel(cid, 'You are exhausted.')
end
end
return 1
end
function exh_1(cid)
if getPlayerStorageValue(cid, 25945) == 2 then
setPlayerStorageValue(cid, 25945, 1)
end
return TRUE
end
 

bockwurstpaule

Active User
Joined
Dec 28, 2008
Messages
61
Reaction score
7
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

Witam,
Mam pewien problem, napisze skrypt i powiem o co chodzi:
function onKill(cid, target)
local name = getCreatureName(target)
local killed = getPlayerStorageValue(cid,666)
if(isMonster(target) == TRUE) then
setPlayerStorageValue(cid, 666,killed + 1)
doPlayerSendTextMessage(cid,22,"Congratulations you have killed ".. name .." and you gain 1 point reputation!")
return TRUE
elseif(isPlayer(target) == TRUE) then
setPlayerStorageValue(cid, 666,killed + 5)
doPlayerSendTextMessage(cid,22,"Congratulations you have killed ".. name .." and you gain 5 point reputation!")
return TRUE
end
end

Wiec chodzi mi o to, zeby napis ten pojawiajacy sie po zabiciu potworka lub czlowieka pojawial sie co 100 potworkow i co 10 ludzi,
Z g?ry dziekuje za wszelaka pomoc,

Pozdrawiam,
Bockwurstpaule
 

olgierd555

Senior User
Joined
May 28, 2008
Messages
650
Reaction score
21
Odp: [7.92+] Firma poprawiaj?ca skrypty by Ovner & Gelio

sa 2, a ten trzeci post, to chyba niejest zadna prosba, wiec:
chce aby skrypt sprawdzal, czy gracz ma wywolanego szkieleta, a sprawdza wszystko ;/
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)


function onTargetTile(cid, pos)

if (NECRO_MAX_SKELETONS < getPlayerStorageValue(cid, STORAGE_SAVE)) then
doConvinceCreature(cid, doCreateMonster(cid, "Skeleton", pos))
setPlayerStorageValue(cid, STORAGE_SAVE, getPlayerStorageValue(cid, STORAGE_SAVE) + 1)
elseif getCreatureSummons(cid) == 4 then
SetPlayerStorageValue(cid, STORAGE_SAVE, 4)
elseif getCreatureSummons(cid) == 3 then
SetPlayerStorageValue(cid, STORAGE_SAVE, 3)
elseif getCreatureSummons(cid) == 2 then
SetPlayerStorageValue(cid, STORAGE_SAVE, 2)
elseif getCreatureSummons(cid) == 1 then
SetPlayerStorageValue(cid, STORAGE_SAVE, 1)
elseif getCreatureSummons(cid) < 1 then
SetPlayerStorageValue(cid, STORAGE_SAVE, -1)
elseif (NECRO_MAX_SKELETONS > getPlayerStorageValue(cid, STORAGE_SAVE)) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You cannot summon more creatures.")
end

end

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
 
Status
Not open for further replies.
Top