Skip to content

Commit

Permalink
update lua
Browse files Browse the repository at this point in the history
  • Loading branch information
kokekanon committed Apr 22, 2024
1 parent 9ae594b commit 5d73a7c
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 2 deletions.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@ If you need help, please visit the [support forum on OTLand](https://otland.net/

We use the [issue tracker on GitHub](https://github.com/otland/forgottenserver/issues). Keep in mind that everyone who is watching the repository gets notified by e-mail when there is activity, so be thoughtful and avoid writing comments that aren't meaningful for an issue (e.g. "+1"). If you'd like for an issue to be fixed faster, you should either fix it yourself and submit a pull request, or place a bounty on the issue.


Client:
```lua
g_game.enableFeature(GameWingsAurasEffectsShader)
g_game.enableFeature(GameFormatCreatureName)
g_game.enableFeature(GameCreatureShader)
g_game.enableFeature(GameCreatureAttachedEffect)
g_game.enableFeature(GameItemShader)
g_game.enableFeature(GameItemTooltipV8);
```
DATA BASE
```sql
ALTER TABLE `players`
ADD COLUMN `currentwing` smallint UNSIGNED NOT NULL DEFAULT '0',
ADD COLUMN `randomizewing` tinyint NOT NULL DEFAULT '0',
Expand All @@ -27,8 +37,21 @@ ADD COLUMN `currenteffect` smallint UNSIGNED NOT NULL DEFAULT '0',
ADD COLUMN `randomizeeffect` tinyint NOT NULL DEFAULT '0',
ADD COLUMN `currentshader` smallint UNSIGNED NOT NULL DEFAULT '0',
ADD COLUMN `randomizeshader` tinyint NOT NULL DEFAULT '0';
```


```sql
ALTER TABLE `players`
ADD COLUMN `currentwing` smallint UNSIGNED NOT NULL DEFAULT '0',
ADD COLUMN `randomizewing` tinyint NOT NULL DEFAULT '0',
ADD COLUMN `currentaura` smallint UNSIGNED NOT NULL DEFAULT '0',
ADD COLUMN `randomizeaura` tinyint NOT NULL DEFAULT '0',
ADD COLUMN `currenteffect` smallint UNSIGNED NOT NULL DEFAULT '0',
ADD COLUMN `randomizeeffect` tinyint NOT NULL DEFAULT '0',
ADD COLUMN `currentshader` smallint UNSIGNED NOT NULL DEFAULT '0',
ADD COLUMN `randomizeshader` tinyint NOT NULL DEFAULT '0';
```
```sql
CREATE TABLE IF NOT EXISTS `player_wings` (
`player_id` int NOT NULL DEFAULT '0',
`wing_id` smallint unsigned NOT NULL DEFAULT '0',
Expand Down Expand Up @@ -56,3 +79,6 @@ CREATE TABLE IF NOT EXISTS `player_shaders` (
PRIMARY KEY (`player_id`, `shader_id`),
FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
```

![img](https://github.com/Nottinghster/otclient/assets/114332266/782e0fcf-b1cf-451e-b102-d7e7943bd50b)
2 changes: 1 addition & 1 deletion data/monster/monsters/orc.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Orc" nameDescription="an orc" race="blood" experience="25" speed="150" manacost="300">
<monster name="Orc" nameDescription="an orc" race="blood" experience="25" speed="150" manacost="300" raceId="5" shaderEffect = "Outfit - Rainbow" auraEffect = "8" wignsEffect ="11" rayosEffect="7" >
<health now="70" max="70" />
<look type="5" corpse="5966" />
<targetchange interval="4000" chance="0" />
Expand Down
92 changes: 92 additions & 0 deletions data/scripts/OTCMEHAH/Attachedeffect.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
local mehah = {
talkactions = {
attacheffect = "!attacheffect",
detachEffect = "!detacheffect",
playerSetShader = "!playerSetShader",
itemSetShader = "!itemSetShader",
mapShader = "!mapShader"
},
}

local events = {}

local function processCommand(player, words, param, type, action)
if not player:getGroup():getAccess() or player:getAccountType() < ACCOUNT_TYPE_GOD then
player:sendCancelMessage("No tienes acceso a este comando.")
return false
end

local params, arg
if param:find("\"") then
params = { param:match("\"(.+)\",*(.*)") }
arg = params[1]
print(params)
print(arg)
pdump(params)
else
params = param:split(", ")
arg = params[1]
print("2",params)
print("2",arg)
end

if not arg then
player:sendCancelMessage("Parámetro inválido. Por favor proporciona un argumento válido.")
return false
end

local creature
if params[2] and params[2] ~= "" then
creature = Player(params[2])
if not creature then
player:sendCancelMessage("El nombre del jugador proporcionado no es válido.")
return false
end
else
creature = player
end

action(creature, arg)
return false
end

local attachEffect = TalkAction(mehah.talkactions.attacheffect)
function attachEffect.onSay(player, words, param, type)
return processCommand(player, words, param, type, function(creature, effect)
creature:attachEffectById(tonumber(effect), false)
end)
end
table.insert(events, attachEffect)

local detachEffect = TalkAction(mehah.talkactions.detachEffect)
function detachEffect.onSay(player, words, param, type)
return processCommand(player, words, param, type, function(creature, effect)
creature:detachEffectById(tonumber(effect))
end)
end
table.insert(events, detachEffect)

local setShader = TalkAction(mehah.talkactions.playerSetShader)
function setShader.onSay(player, words, param, type)
return processCommand(player, words, param, type, function(creature, shader)
creature:setShader(shader)
end)
end
table.insert(events, setShader)

local mapShader = TalkAction(mehah.talkactions.mapShader)
function mapShader.onSay(player, words, param, type)
return processCommand(player, words, param, type, function(creature, shader)
if creature:getMapShader() ~= shader then
creature:setMapShader(shader, true)
end
end)
end
table.insert(events, mapShader)

for _, event in ipairs(events) do
event:accountType(ACCOUNT_TYPE_GOD)
event:access(true)
event:separator(" ")
event:register()
end

0 comments on commit 5d73a7c

Please sign in to comment.