Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- allowed = true
- function OnCreate()
- this:RegisterCommand("buffer", CommandChatType.CHAT_ALLY, CommandAccessLevel.ACCESS_ME)
- end;
- function OnCommand_buffer(vCommandChatType, vNick, vCommandParam)
- if ( allowed == false ) then
- allowed = true;
- ShowToClient("buffer", "ON")
- else
- allowed = false;
- ShowToClient("buffer", "OFF");
- end
- end;
- function OnChatSystemMessage(id, msg)
- if ( allowed == true ) then
- if(isStartingWith(msg,"You have acquired")) then
- members = GetPartyList();
- for player in members.list do
- if(player:GetHp() < 2) then
- Command("/target "..player:GetName());
- Sleep(1000);
- Command("/useskill angel's resurrection");
- Sleep(1000);
- ClearTargets();
- end;
- end;
- end;
- end;
- end;
- function OnChatUserMessage(chatType, nick, msg)
- if ( allowed == true ) then
- local caller = GetUserByName(nick);
- local Message = string.lower(msg); -- Converts message to lower case letters.
- Message = Message:gsub("^%s*(.-)%s*$", "%1"); -- Trimming message of spaces on start.
- if (chatType == L2ChatType.CHAT_PARTY) then
- if ((Message == "full") or (Message == "fullbuff") or (Message == "buffs") or (Message == "buffy") or (Message == "buff") or (Message == "melody")) and (GetPartyMaster():GetName() == nick) then
- Sleep (1000);
- Command("/useskill pipe organ melody");
- Sleep (1000);
- Command("/useskill drum melody");
- Sleep (1000);
- Command("/useskill guitar melody");
- Sleep (1000);
- Command("/useskill lute melody");
- Sleep (1000);
- Command("/useskill horn melody");
- Sleep (1000);
- Command("/useskill harp melody");
- Sleep (1000);
- --Command("/useskill divine protection");
- --Sleep (1000);
- --Command("/useskill elemental protection");
- Command("/useshortcut 4 7");
- Sleep (1000);
- Command("/useshortcut 4 8");
- Sleep (1000);
- Command("/useshortcut 4 9");
- --Command("/useskill mental protection");
- Sleep (1000);
- Command("/useskill refreshing sonata");
- Sleep (1000);
- Command("/useskill prevailing sonata");
- Sleep (1000);
- Command("/useskill daring sonata");
- end;
- if (Message == "knight") then
- Command("/target " .. nick);
- Sleep (1000);
- Command("/useskill knight's harmony");
- end;
- if (Message == "warrior") then
- Command("/target " .. nick);
- Sleep (1000);
- Command("/useskill warrior's harmony");
- end;
- if (Message == "wizard") then
- Command("/target " .. nick);
- Sleep (1000);
- Command("/useskill wizard's harmony");
- end;
- if(Message == "sonaty") or (Message == "sonata") or (Message == "sonatas") or (Message == "dance") or (Message == "dancy") or (Message == "dances") then
- Sleep (1000);
- Command("/useskill refreshing sonata");
- Sleep (1000);
- Command("/useskill prevailing sonata");
- Sleep (1000);
- Command("/useskill daring sonata");
- end;
- if (Message == "res") then
- Command("/target " .. nick);
- Sleep (1000);
- Command("/useskill angel's resurrection");
- end;
- if (Message == "heal") then
- Command("/target " .. nick);
- Sleep (1000);
- Command("/useskill healing melody");
- end;
- if (Message == "cpheal") then
- Command("/target " .. nick);
- Sleep (1000);
- Command("/useskill recovery melody");
- end;
- -- if (Message == "assistkill") then
- -- Target(caller:GetTarget():GetNpcId());
- -- Sleep (1000);
- -- Command("/attack");
- -- end;
- if (Message == "followme") then
- Command("/target " .. nick);
- Sleep (100);
- Command("/target " .. nick);
- end;
- --and (GetPartyMaster():GetName() == nick)
- if (Message == "debuff") then
- Sleep (1000);
- Command("/useshortcut 2 6");
- Sleep (1000);
- Command("/useshortcut 2 7");
- end;
- if (Message == "shadow") then
- Sleep (1000);
- Command("/useskill devil's movement");
- end;
- -- give xxx to yyy
- if (isStartingWith(Message,"give")) then
- -- split(Message, " ");
- local array = split(Message, " ");
- if (array[1] == "knight") then
- Command("/target " .. array[4]);
- Sleep (1000);
- Command("/useskill knight's harmony");
- end;
- if (array[1] == "warrior") then
- Command("/target " .. array[4]);
- Sleep (1000);
- Command("/useskill warrior's harmony");
- end;
- if (array[1] == "wizard") then
- Command("/target " .. array[4]);
- Sleep (1000);
- Command("/useskill wizard's harmony");
- end;
- if (array[1] == "res") then
- Command("/target " .. array[4]);
- Sleep (1000);
- Command("/useskill angel's resurrection");
- end;
- if (array[1] == "heal") then
- Command("/target " .. array[4]);
- Sleep (1000);
- Command("/useskill healing melody");
- end;
- if (array[1] == "cpheal") then
- Command("/target " .. array[4]);
- Sleep (1000);
- Command("/useskill recovery melody");
- end;
- end;
- -- if (Message == "cpheal full") then
- -- if(GetMe():GetMpPercent() < 40) then
- -- Say2(L2ChatType.CHAT_PARTY,"no mp","");
- -- else
- -- Command("/target " .. nick);
- -- while(GetTarget():GetCpPercent() < 95) do
- -- Sleep (1000);
- --ShowToClient("cpheal"," "..GetTarget():GetCpPercent());
- -- Command("/useskill recovery melody");
- -- end;
- -- end;
- -- end;
- end;
- end;
- end;
- function isStartingWith(String,Start)
- return string.sub(String,1,string.len(Start))==Start
- end;
- function string.ends(String,End)
- return End=='' or string.sub(String,-string.len(End))==End
- end;
- function split(str, c)
- a = string.find(str, c)
- str = string.gsub(str, c, "", 1)
- aCount = 0
- start = 1
- array = {}
- last = 0
- while a do
- array[aCount] = string.sub(str, start, a - 1)
- start = a
- a = string.find(str, c)
- str = string.gsub(str, c, "", 1)
- aCount = aCount + 1
- end
- return array
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement