repo_name
stringlengths
6
69
path
stringlengths
6
178
copies
stringclasses
278 values
size
stringlengths
4
7
content
stringlengths
671
917k
license
stringclasses
15 values
DarkstarProject/darkstar
scripts/zones/Sauromugue_Champaign_[S]/Zone.lua
9
1091
----------------------------------- -- -- Zone: Sauromugue_Champaign_[S] (98) -- ----------------------------------- local ID = require("scripts/zones/Sauromugue_Champaign_[S]/IDs") require("scripts/globals/quests") require("scripts/globals/zone") ----------------------------------- function onInitialize(zone) UpdateNMSpawnPoint(ID.mob.COQUECIGRUE) GetMobByID(ID.mob.COQUECIGRUE):setRespawnTime(math.random(7200, 7800)) end; function onZoneIn(player,prevZone) local cs = -1; if (player:getXPos() == 0 and player:getYPos() == 0 and player:getZPos() == 0) then player:setPos(-104,-25.36,-410,195); end if (prevZone == dsp.zone.ROLANBERRY_FIELDS_S and player:getQuestStatus(CRYSTAL_WAR, dsp.quest.id.crystalWar.DOWNWARD_HELIX) == QUEST_ACCEPTED and player:getCharVar("DownwardHelix") == 2) then cs = 3; end return cs; end; function onRegionEnter(player,region) end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) if (csid == 3) then player:setCharVar("DownwardHelix",3); end end;
gpl-3.0
Fenix-XI/Fenix
scripts/zones/Port_Bastok/npcs/Otto.lua
13
1128
----------------------------------- -- Area: Port Bastok -- NPC: Otto -- Standard Info NPC -- Involved in Quest: The Siren's Tear -- @zone: 236 -- @pos -145.929 -7.48 -13.701 ----------------------------------- require("scripts/globals/quests"); ----------------------------------- -- onTrade ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger ----------------------------------- function onTrigger(player,npc) local SirensTear = player:getQuestStatus(BASTOK,THE_SIREN_S_TEAR); if (SirensTear == QUEST_ACCEPTED and player:getVar("SirensTear") == 0) then player:startEvent(0x0005); else player:startEvent(0x0014); end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end;
gpl-3.0
Fenix-XI/Fenix
scripts/globals/mobskills/PL_Heavy_Stomp.lua
33
1168
--------------------------------------------- -- Heavy Stomp -- -- Description: Deals heavy damage to targets within an area of effect. Additional effect: Paralysis -- Type: Physical -- Utsusemi/Blink absorb: 2-3 shadows -- Range: Unknown radial -- Notes: Paralysis effect has a very long duration. --------------------------------------------- require("scripts/globals/settings"); require("scripts/globals/status"); require("scripts/globals/monstertpmoves"); --------------------------------------------- function onMobSkillCheck(target,mob,skill) local mobSkin = mob:getModelId(); if (mobSkin == 421) then return 0; else return 1; end end; function onMobWeaponSkill(target, mob, skill) local numhits = math.random(2,3); local accmod = 1; local dmgmod = .7; local info = MobPhysicalMove(mob,target,skill,numhits,accmod,dmgmod,TP_NO_EFFECT); local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,MOBSKILL_PHYSICAL,MOBPARAM_BLUNT,info.hitslanded); local typeEffect = EFFECT_PARALYSIS; MobPhysicalStatusEffectMove(mob, target, skill, typeEffect, 15, 0, 360); target:delHP(dmg); return dmg; end;
gpl-3.0
Fenix-XI/Fenix
scripts/zones/Chamber_of_Oracles/bcnms/shattering_stars.lua
27
2049
----------------------------------- -- Area: Qu'Bia Arena -- Name: Shattering stars - Maat Fight -- @pos -221 -24 19 206 ----------------------------------- package.loaded["scripts/zones/Sacrificial_Chamber/TextIDs"] = nil; ------------------------------------- require("scripts/zones/Sacrificial_Chamber/TextIDs"); ----------------------------------- -- After registering the BCNM via bcnmRegister(bcnmid) function onBcnmRegister(player,instance) end; -- Physically entering the BCNM via bcnmEnter(bcnmid) function onBcnmEnter(player,instance) -- player:messageSpecial(107); end; -- Leaving the BCNM by every mean possible, given by the LeaveCode -- 1=Select Exit on circle -- 2=Winning the BC -- 3=Disconnected or warped out -- 4=Losing the BC -- via bcnmLeave(1) or bcnmLeave(2). LeaveCodes 3 and 4 are called -- from the core when a player disconnects or the time limit is up, etc function onBcnmLeave(player,instance,leavecode) -- print("leave code "..leavecode); if (leavecode == 2) then -- play end CS. Need time and battle id for record keeping + storage player:startEvent(0x7d01,1,1,1,instance:getTimeInside(),1,1,0); elseif (leavecode == 4) then player:startEvent(0x7d02); end end; function onEventUpdate(player,csid,option) -- print("bc update csid "..csid.." and option "..option); end; function onEventFinish(player,csid,option) -- print("bc finish csid "..csid.." and option "..option); if (csid == 0x7d01) then if (player:getQuestStatus(JEUNO,SHATTERING_STARS) == QUEST_ACCEPTED and player:getFreeSlotsCount() > 0) then player:addItem(4181); player:messageSpecial(ITEM_OBTAINED,4181); end local pjob = player:getMainJob(); player:setVar("maatDefeated",pjob); local maatsCap = player:getVar("maatsCap") if (bit.band(maatsCap, bit.lshift(1, (pjob -1))) ~= 1) then player:setVar("maatsCap",bit.bor(maatsCap, bit.lshift(1, (pjob -1)))) end player:addTitle(MAAT_MASHER); end end;
gpl-3.0
Fenix-XI/Fenix
scripts/zones/Abyssea-La_Theine/npcs/qm18.lua
17
1821
----------------------------------- -- Zone: Abyssea-LaTheine -- NPC: ??? -- Spawns: Hadhayosh ----------------------------------- require("scripts/globals/status"); require("scripts/globals/keyitems"); ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) --[[ if (GetMobAction(17318448) == ACTION_NONE) then -- NM not already spawned from this if (player:hasKeyItem(MARBLED_MUTTON_CHOP) and player:hasKeyItem(BLOODIED_SABER_TOOTH) and player:hasKeyItem(BLOOD_SMEARED_GIGAS_HELM) and player:hasKeyItem(GLITTERING_PIXIE_CHOKER)) then player:startEvent(1020, MARBLED_MUTTON_CHOP, BLOODIED_SABER_TOOTH, GLITTERING_PIXIE_CHOKER, BLOOD_SMEARED_GIGAS_HELM); -- Ask if player wants to use KIs else player:startEvent(1021, MARBLED_MUTTON_CHOP, BLOODIED_SABER_TOOTH, GLITTERING_PIXIE_CHOKER, BLOOD_SMEARED_GIGAS_HELM); -- Do not ask, because player is missing at least 1. end end ]] end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID2: %u",csid); -- printf("RESULT2: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 1020 and option == 1) then SpawnMob(17318448):updateClaim(player); -- Spawn NM, Despawn after inactive for 5 minutes (pt has to reclaim within 5 of a wipe) player:delKeyItem(MARBLED_MUTTON_CHOP); player:delKeyItem(BLOODIED_SABER_TOOTH); player:delKeyItem(GLITTERING_PIXIE_CHOKER); player:delKeyItem(BLOOD_SMEARED_GIGAS_HELM); end end;
gpl-3.0
ungarscool1/HL2RP
hl2rp/gamemode/modules/language/sh_english.lua
5
23549
/*--------------------------------------------------------------------------- English (example) language file --------------------------------------------------------------------------- This is the english language file. The things on the left side of the equals sign are the things you should leave alone The parts between the quotes are the parts you should translate. You can also copy this file and create a new language. = Warning = Sometimes when DarkRP is updated, new phrases are added. If you don't translate these phrases to your language, it will use the English sentence. To fix this, join your server, open your console and enter darkp_getphrases yourlanguage For English the command would be: darkrp_getphrases "en" because "en" is the language code for English. You can copy the missing phrases to this file and translate them. = Note = Make sure the language code is right at the bottom of this file = Using a language = Make sure the convar gmod_language is set to your language code. You can do that in a server CFG file. ---------------------------------------------------------------------------*/ local my_language = { -- Admin things need_admin = "You need admin privileges in order to be able to %s", need_sadmin = "You need super admin privileges in order to be able to %s", no_privilege = "You don't have the right privileges to perform this action", no_jail_pos = "No jail position", invalid_x = "Invalid %s! %s", -- F1 menu f1ChatCommandTitle = "Chat commands", f1Search = "Search...", -- Money things: price = "Price: %s%d", priceTag = "Price: %s", reset_money = "%s has reset all players' money!", has_given = "%s has given you %s", you_gave = "You gave %s %s", npc_killpay = "%s for killing an NPC!", profit = "profit", loss = "loss", -- backwards compatibility deducted_x = "Deducted %s%d", need_x = "Need %s%d", deducted_money = "Deducted %s", need_money = "Need %s", payday_message = "Payday! You received %s!", payday_unemployed = "You received no salary because you are unemployed!", payday_missed = "Pay day missed! (You're Arrested)", property_tax = "Property tax! %s", property_tax_cant_afford = "You couldn't pay the taxes! Your property has been taken away from you!", taxday = "Tax Day! %s%% of your income was taken!", found_cheque = "You have found %s%s in a cheque made out to you from %s.", cheque_details = "This cheque is made out to %s.", cheque_torn = "You have torn up the cheque.", cheque_pay = "Pay: %s", signed = "Signed: %s", found_cash = "You have found %s%d!", -- backwards compatibility found_money = "You have found %s!", owner_poor = "The %s owner is too poor to subsidize this sale!", -- Police Wanted_text = "Wanted!", wanted = "Wanted by Police!\nReason: %s", youre_arrested = "You have been arrested for %d seconds!", youre_arrested_by = "You have been arrested by %s.", youre_unarrested_by = "You were unarrested by %s.", hes_arrested = "%s has been arrested for %d seconds!", hes_unarrested = "%s has been released from jail!", warrant_ordered = "%s ordered a search warrant for %s. Reason: %s", warrant_request = "%s requests a search warrant for %s\nReason: %s", warrant_request2 = "Search warrant request sent to Mayor %s!", warrant_approved = "Search warrant approved for %s!\nReason: %s\nOrdered by: %s", warrant_approved2 = "You are now able to search his house.", warrant_denied = "Mayor %s has denied your search warrant request.", warrant_expired = "The search warrant for %s has expired!", warrant_required = "You need a warrant in order to be able to open this door.", warrant_required_unfreeze = "You need a warrant in order to be able to unfreeze this prop.", warrant_required_unweld = "You need a warrant in order to be able to unweld this prop.", wanted_by_police = "%s is wanted by the police!\nReason: %s\nOrdered by: %s", wanted_by_police_print = "%s has made %s wanted, reason: %s", wanted_expired = "%s is no longer wanted by the Police.", wanted_revoked = "%s is no longer wanted by the Police.\nRevoked by: %s", cant_arrest_other_cp = "You cannot arrest other CPs!", must_be_wanted_for_arrest = "The player must be wanted in order to be able to arrest them.", cant_arrest_fadmin_jailed = "You cannot arrest a player who has been jailed by an admin.", cant_arrest_no_jail_pos = "You cannot arrest people since there are no jail positions set!", cant_arrest_spawning_players = "You cannot arrest players who are spawning.", suspect_doesnt_exist = "Suspect does not exist.", actor_doesnt_exist = "Actor does not exist.", get_a_warrant = "get a warrant", make_someone_wanted = "make someone wanted", remove_wanted_status = "remove wanted status", already_a_warrant = "There already is a search warrant for this suspect.", already_wanted = "The suspect is already wanted.", not_wanted = "The suspect is not wanted.", need_to_be_cp = "You have to be a member of the police force.", suspect_must_be_alive_to_do_x = "The suspect must be alive in order to %s.", suspect_already_arrested = "The suspect is already in jail.", -- Players health = "Health: %s", job = "Job: %s", salary = "Salary: %s%s", wallet = "Wallet: %s%s", weapon = "Weapon: %s", kills = "Kills: %s", deaths = "Deaths: %s", rpname_changed = "%s changed their RPName to: %s", disconnected_player = "Disconnected player", -- Teams need_to_be_before = "You need to be %s first in order to be able to become %s", need_to_make_vote = "You need to make a vote to become a %s!", team_limit_reached = "Can not become %s as the limit is reached", wants_to_be = "%s\nwants to be\n%s", has_not_been_made_team = "%s has not been made %s!", job_has_become = "%s has been made a %s!", -- Disasters meteor_approaching = "WARNING: Meteor storm approaching!", meteor_passing = "Meteor storm passing.", meteor_enabled = "Meteor Storms are now enabled.", meteor_disabled = "Meteor Storms are now disabled.", earthquake_report = "Earthquake reported of magnitude %sMw", earthtremor_report = "Earth tremor reported of magnitude %sMw", -- Keys, vehicles and doors keys_allowed_to_coown = "You are allowed to co-own this\n(Press Reload with keys or press F2 to co-own)\n", keys_other_allowed = "Allowed to co-own:", keys_allow_ownership = "(Press Reload with keys or press F2 to allow ownership)", keys_disallow_ownership = "(Press Reload with keys or press F2 to disallow ownership)", keys_owned_by = "Owned by:", keys_unowned = "Unowned\n(Press Reload with keys or press F2 to own)", keys_everyone = "(Press Reload with keys or press F2 to enable for everyone)", door_unown_arrested = "You can not own or unown things while arrested!", door_unownable = "This door cannot be owned or unowned!", door_sold = "You have sold this for %s", door_already_owned = "This door is already owned by someone!", door_cannot_afford = "You can not afford this door!", door_hobo_unable = "You can not buy a door if you are a hobo!", vehicle_cannot_afford = "You can not afford this vehicle!", door_bought = "You've bought this door for %s%s", vehicle_bought = "You've bought this vehicle for %s%s", door_need_to_own = "You need to own this door in order to be able to %s", door_rem_owners_unownable = "You can not remove owners if a door is non-ownable!", door_add_owners_unownable = "You can not add owners if a door is non-ownable!", rp_addowner_already_owns_door = "%s already owns (or is already allowed to own) this door!", add_owner = "Add owner", remove_owner = "Remove owner", coown_x = "Co-own %s", allow_ownership = "Allow ownership", disallow_ownership = "Disallow ownership", edit_door_group = "Edit door group", door_groups = "Door groups", door_group_doesnt_exist = "Door group does not exist!", door_group_set = "Door group set successfully.", sold_x_doors_for_y = "You have sold %d doors for %s%d!", -- backwards compatibility sold_x_doors = "You have sold %d doors for %s!", -- Entities drugs = "Drugs", drug_lab = "Drug Lab", gun_lab = "Gun Lab", gun = "gun", microwave = "Microwave", food = "Food", money_printer = "Money Printer", sign_this_letter = "Sign this letter", signed_yours = "Yours,", money_printer_exploded = "Your money printer has exploded!", money_printer_overheating = "Your money printer is overheating!", contents = "Contents: ", amount = "Amount: ", picking_lock = "Picking lock", cannot_pocket_x = "You cannot put this in your pocket!", object_too_heavy = "This object is too heavy.", pocket_full = "Your pocket is full!", pocket_no_items = "Your pocket contains no items.", drop_item = "Drop item", bonus_destroying_entity = "destroying this illegal entity.", switched_burst = "Switched to burst-fire mode.", switched_fully_auto = "Switched to fully automatic fire mode.", switched_semi_auto = "Switched to semi-automatic fire mode.", keypad_checker_shoot_keypad = "Shoot a keypad to see what it controls.", keypad_checker_shoot_entity = "Shoot an entity to see which keypads are connected to it", keypad_checker_click_to_clear = "Right click to clear.", keypad_checker_entering_right_pass = "Entering the right password", keypad_checker_entering_wrong_pass = "Entering the wrong password", keypad_checker_after_right_pass = "after having entered the right password", keypad_checker_after_wrong_pass = "after having entered the wrong password", keypad_checker_right_pass_entered = "Right password entered", keypad_checker_wrong_pass_entered = "Wrong password entered", keypad_checker_controls_x_entities = "This keypad controls %d entities", keypad_checker_controlled_by_x_keypads = "This entity is controlled by %d keypads", keypad_on = "ON", keypad_off = "OFF", seconds = "seconds", persons_weapons = "%s's illegal weapons:", returned_persons_weapons = "Returned %s's confiscated weapons.", no_weapons_confiscated = "%s had no weapons confiscated!", no_illegal_weapons = "%s had no illegal weapons.", confiscated_these_weapons = "Confiscated these weapons:", checking_weapons = "Checking weapons", shipment_antispam_wait = "Please wait before spawning another shipment.", shipment_cannot_split = "Cannot split this shipment.", -- Talking hear_noone = "No-one can hear you %s!", hear_everyone = "Everyone can hear you!", hear_certain_persons = "Players who can hear you %s: ", whisper = "whisper", yell = "yell", advert = "[Advert]", broadcast = "[Broadcast!]", radio = "radio", request = "(REQUEST!)", group = "(group)", demote = "(DEMOTE)", ooc = "OOC", radio_x = "Radio %d", talk = "talk", speak = "speak", speak_in_ooc = "speak in OOC", perform_your_action = "perform your action", talk_to_your_group = "talk to your group", channel_set_to_x = "Channel set to %s!", -- Notifies disabled = "%s has been disabled! %s", gm_spawnvehicle = "The spawning of vehicles", gm_spawnsent = "The spawning of scripted entities (SENTs)", gm_spawnnpc = "The spawning of Non-Player Characters (NPCs)", see_settings = "Please see the DarkRP settings.", limit = "You have reached the %s limit!", have_to_wait = "You need to wait another %d seconds before using %s!", must_be_looking_at = "You need to be looking at a %s!", incorrect_job = "You do not have the right job to %s", unavailable = "This %s is unavailable", unable = "You are unable to %s. %s", cant_afford = "You cannot afford this %s", created_x = "%s created a %s", cleaned_up = "Your %s were cleaned up.", you_bought_x = "You have bought %s for %s%d.", -- backwards compatibility you_bought = "You have bought %s for %s.", you_received_x = "You have received %s for %s.", created_first_jailpos = "You have created the first jail position!", added_jailpos = "You have added one extra jail position!", reset_add_jailpos = "You have removed all jail positions and you have added a new one here.", created_spawnpos = "%s's spawn position created.", updated_spawnpos = "%s's spawn position updated.", do_not_own_ent = "You do not own this entity!", cannot_drop_weapon = "Can't drop this weapon!", job_switch = "Jobs switched successfully!", job_switch_question = "Switch jobs with %s?", job_switch_requested = "Job switch requested.", cooks_only = "Cooks only.", -- Misc unknown = "Unknown", arguments = "arguments", no_one = "no one", door = "door", vehicle = "vehicle", door_or_vehicle = "door/vehicle", driver = "Driver: %s", name = "Name: %s", locked = "Locked.", unlocked = "Unlocked.", player_doesnt_exist = "Player does not exist.", job_doesnt_exist = "Job does not exist!", must_be_alive_to_do_x = "You must be alive in order to %s.", banned_or_demoted = "Banned/demoted", wait_with_that = "Wait with that.", could_not_find = "Could not find %s", f3tovote = "Hit F3 to vote", listen_up = "Listen up:", -- In rp_tell or rp_tellall nlr = "New Life Rule: Do Not Revenge Arrest/Kill.", reset_settings = "You have reset all settings!", must_be_x = "You must be a %s in order to be able to %s.", agenda_updated = "The agenda has been updated", job_set = "%s has set his/her job to '%s'", demoted = "%s has been demoted", demoted_not = "%s has not been demoted", demote_vote_started = "%s has started a vote for the demotion of %s", demote_vote_text = "Demotion nominee:\n%s", -- '%s' is the reason here cant_demote_self = "You cannot demote yourself.", i_want_to_demote_you = "I want to demote you. Reason: %s", tried_to_avoid_demotion = "You tried to escape demotion. You failed and have been demoted.", -- naughty boy! lockdown_started = "The mayor has initiated a Lockdown, please return to your homes!", lockdown_ended = "The lockdown has ended", gunlicense_requested = "%s has requested %s a gun license", gunlicense_granted = "%s has granted %s a gun license", gunlicense_denied = "%s has denied %s a gun license", gunlicense_question_text = "Grant %s a gun license?", gunlicense_remove_vote_text = "%s has started a vote for the gun license removal of %s", gunlicense_remove_vote_text2 = "Revoke gunlicense:\n%s", -- Where %s is the reason gunlicense_removed = "%s's license has been removed!", gunlicense_not_removed = "%s's license has not been removed!", vote_specify_reason = "You need to specify a reason!", vote_started = "The vote is created", vote_alone = "You have won the vote since you are alone in the server.", you_cannot_vote = "You cannot vote!", x_cancelled_vote = "%s cancelled the last vote.", cant_cancel_vote = "Could not cancel the last vote as there was no last vote to cancel!", jail_punishment = "Punishment for disconnecting! Jailed for: %d seconds.", admin_only = "Admin only!", -- When doing /addjailpos chief_or = "Chief or ",-- When doing /addjailpos frozen = "Frozen.", dead_in_jail = "You now are dead until your jail time is up!", died_in_jail = "%s has died in jail!", credits_for = "CREDITS FOR %s\n", credits_see_console = "DarkRP credits printed to console.", rp_getvehicles = "Available vehicles for custom vehicles:", data_not_loaded_one = "Your data has not been loaded yet. Please wait.", data_not_loaded_two = "If this persists, try rejoining or contacting an admin.", cant_spawn_weapons = "You cannot spawn weapons.", drive_disabled = "Drive disabled for now.", property_disabled = "Property disabled for now.", not_allowed_to_purchase = "You are not allowed to purchase this item.", rp_teamban_hint = "rp_teamban [player name/ID] [team name/id]. Use this to ban a player from a certain team.", rp_teamunban_hint = "rp_teamunban [player name/ID] [team name/id]. Use this to unban a player from a certain team.", x_teambanned_y = "%s has banned %s from being a %s.", x_teamunbanned_y = "%s has unbanned %s from being a %s.", -- Backwards compatibility: you_set_x_salary_to_y = "You set %s's salary to %s%d.", x_set_your_salary_to_y = "%s set your salary to %s%d.", you_set_x_money_to_y = "You set %s's money to %s%d.", x_set_your_money_to_y = "%s set your money to %s%d.", you_set_x_salary = "You set %s's salary to %s.", x_set_your_salary = "%s set your salary to %s.", you_set_x_money = "You set %s's money to %s.", x_set_your_money = "%s set your money to %s.", you_set_x_name = "You set %s's name to %s", x_set_your_name = "%s set your name to %s", someone_stole_steam_name = "Someone is already using your Steam name as their RP name so we gave you a '1' after your name.", -- Uh oh already_taken = "Already taken.", job_doesnt_require_vote_currently = "This job does not require a vote at the moment!", x_made_you_a_y = "%s has made you a %s!", cmd_cant_be_run_server_console = "This command cannot be run from the server console.", -- The lottery lottery_started = "There is a lottery! Participate for %s%d?", -- backwards compatibility lottery_has_started = "There is a lottery! Participate for %s?", lottery_entered = "You entered the lottery for %s", lottery_not_entered = "%s did not enter the lottery", lottery_noone_entered = "No-one has entered the lottery", lottery_won = "%s has won the lottery! He has won %s", -- Animations custom_animation = "Custom animation!", bow = "Bow", dance = "Dance", follow_me = "Follow me!", laugh = "Laugh", lion_pose = "Lion pose", nonverbal_no = "Non-verbal no", thumbs_up = "Thumbs up", wave = "Wave", -- Hungermod starving = "Starving!", -- AFK afk_mode = "AFK Mode", salary_frozen = "Your salary has been frozen.", salary_restored = "Welcome back, your salary has now been restored.", no_auto_demote = "You will not be auto-demoted.", youre_afk_demoted = "You were demoted for being AFK for too long. Next time use /afk.", hes_afk_demoted = "%s has been demoted for being AFK for too long.", afk_cmd_to_exit = "Type /afk again to exit AFK mode.", player_now_afk = "%s is now AFK.", player_no_longer_afk = "%s is no longer AFK.", -- Hitmenu hit = "hit", hitman = "Hitman", current_hit = "Hit: %s", cannot_request_hit = "Cannot request hit! %s", hitmenu_request = "Request", player_not_hitman = "This player is not a hitman!", distance_too_big = "Distance too big.", hitman_no_suicide = "The hitman won't kill himself.", hitman_no_self_order = "A hitman cannot order a hit for himself.", hitman_already_has_hit = "The hitman already has a hit ongoing.", price_too_low = "Price too low!", hit_target_recently_killed_by_hit = "The target was recently killed by a hit,", customer_recently_bought_hit = "The customer has recently requested a hit.", accept_hit_question = "Accept hit from %s\nregarding %s for %s%d?", -- backwards compatibility accept_hit_request = "Accept hit from %s\nregarding %s for %s?", hit_requested = "Hit requested!", hit_aborted = "Hit aborted! %s", hit_accepted = "Hit accepted!", hit_declined = "The hitman declined the hit!", hitman_left_server = "The hitman has left the server!", customer_left_server = "The customer has left the server!", target_left_server = "The target has left the server!", hit_price_set_to_x = "Hit price set to %s%d.", -- backwards compatibility hit_price_set = "Hit price set to %s.", hit_complete = "Hit by %s complete!", hitman_died = "The hitman died!", target_died = "The target has died!", hitman_arrested = "The hitman was arrested!", hitman_changed_team = "The hitman changed team!", x_had_hit_ordered_by_y = "%s had an active hit ordered by %s", -- Vote Restrictions hobos_no_rights = "Hobos have no voting rights!", gangsters_cant_vote_for_government = "Gangsters cannot vote for government things!", government_cant_vote_for_gangsters = "Government officials cannot vote for gangster things!", -- VGUI and some more doors/vehicles vote = "Vote", time = "Time: %d", yes = "Yes", no = "No", ok = "Okay", cancel = "Cancel", add = "Add", remove = "Remove", none = "None", x_options = "%s options", sell_x = "Sell %s", set_x_title = "Set %s title", set_x_title_long = "Set the title of the %s you are looking at.", jobs = "Jobs", buy_x = "Buy %s", -- F4menu no_extra_weapons = "This job has no extra weapons.", become_job = "Become job", create_vote_for_job = "Create vote", shipments = "Shipments", F4guns = "Weapons", F4entities = "Miscellaneous", F4ammo = "Ammo", F4vehicles = "Vehicles", -- Tab 1 give_money = "Give money to the player you're looking at", drop_money = "Drop money", change_name = "Change your DarkRP name", go_to_sleep = "Go to sleep/wake up", drop_weapon = "Drop current weapon", buy_health = "Buy health(%s)", request_gunlicense = "Request gunlicense", demote_player_menu = "Demote a player", searchwarrantbutton = "Make a player wanted", unwarrantbutton = "Remove the wanted status from a player", noone_available = "No one available", request_warrant = "Request a search warrant for a player", make_wanted = "Make someone wanted", make_unwanted = "Make someone unwanted", set_jailpos = "Set the jail position", add_jailpos = "Add a jail position", set_custom_job = "Set a custom job (press enter to activate)", set_agenda = "Set the agenda (press enter to activate)", initiate_lockdown = "Initiate a lockdown", stop_lockdown = "Stop the lockdown", start_lottery = "Start a lottery", give_license_lookingat = "Give <lookingat> a gun license", laws_of_the_land = "LAWS OF THE LAND", law_added = "Law added.", law_removed = "Law removed.", law_reset = "Laws reset.", law_too_short = "Law too short.", laws_full = "The laws are full.", default_law_change_denied = "You are not allowed to change the default laws.", -- Second tab job_name = "Name: ", job_description = "Description: ", job_weapons = "Weapons: ", -- Entities tab buy_a = "Buy %s: %s", -- Licenseweaponstab license_tab = [[License weapons Tick the weapons people should be able to get WITHOUT a license! ]], license_tab_other_weapons = "Other weapons:", } -- The language code is usually (but not always) a two-letter code. The default language is "en". -- Other examples are "nl" (Dutch), "de" (German) -- If you want to know what your language code is, open GMod, select a language at the bottom right -- then enter gmod_language in console. It will show you the code. -- Make sure language code is a valid entry for the convar gmod_language. DarkRP.addLanguage("en", my_language)
agpl-3.0
jbp4444/PuzzleGame
scripts/ToggleLayout_3x3.lua
1
1911
-- -- Copyright 2013-2014 John Pormann -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- local W = display.contentWidth local H = display.contentHeight local S = 150 local layout = { bg_image = { center_x = W*0.50, center_y = H*0.50, width = W, height = H, bg_file = "assets/conppr_green.jpg" }, tile_size = S, goal_area = { text_center_x = W*0.40, text_center_y = H*0.125, center_x = W*0.50, center_y = H*0.125, width = W*0.09375, height = H*0.15 }, back_btn = { center_x = W*0.50, center_y = H*0.95, width = W*0.1, height = H*0.1 }, play_area = { center_x = W*0.50, center_y = H*0.55, width = 480, height = 480, bg_file = "assets/conppr_grey.jpg" }, play_grid = { { -- row =1, col =1, center_x = W*0.50-S, center_y = H*0.55-S }, { center_x = W*0.50, center_y = H*0.55-S }, { center_x = W*0.50+S, center_y = H*0.55-S }, { -- row =2, col =1, center_x = W*0.50-S, center_y = H*0.55 }, { center_x = W*0.50, center_y = H*0.55 }, { center_x = W*0.50+S, center_y = H*0.55 }, { -- row =3, col =1, center_x = W*0.50-S, center_y = H*0.55+S }, { center_x = W*0.50, center_y = H*0.55+S }, { center_x = W*0.50+S, center_y = H*0.55+S } } } return layout
apache-2.0
ehsan/wesnoth
data/lua/wml/items.lua
1
2749
local helper = wesnoth.require "lua/helper.lua" local wml_actions = wesnoth.wml_actions local game_events = wesnoth.game_events local scenario_items = {} local function add_overlay(x, y, cfg) wesnoth.add_tile_overlay(x, y, cfg) local items = scenario_items[x * 10000 + y] if not items then items = {} scenario_items[x * 10000 + y] = items end table.insert(items, { x = x, y = y, image = cfg.image, halo = cfg.halo, team_name = cfg.team_name, visible_in_fog = cfg.visible_in_fog }) end local function remove_overlay(x, y, name) local items = scenario_items[x * 10000 + y] if not items then return end wesnoth.remove_tile_overlay(x, y, name) if name then for i = #items,1,-1 do local item = items[i] if item.image == name or item.halo == name then table.remove(items, i) end end end if not name or #items == 0 then scenario_items[x * 10000 + y] = nil end end local old_on_save = game_events.on_save function game_events.on_save() local custom_cfg = old_on_save() for i,v in pairs(scenario_items) do for j,w in ipairs(v) do table.insert(custom_cfg, { "item", w }) end end return custom_cfg end local old_on_load = game_events.on_load function game_events.on_load(cfg) local i = 1 while i <= #cfg do local v = cfg[i] if v[1] == "item" then local v2 = v[2] add_overlay(v2.x, v2.y, v2) table.remove(cfg, i) else i = i + 1 end end old_on_load(cfg) end function wml_actions.item(cfg) local locs = wesnoth.get_locations(cfg) cfg = helper.parsed(cfg) if not cfg.image and not cfg.halo then helper.wml_error "[item] missing required image= and halo= attributes." end for i, loc in ipairs(locs) do add_overlay(loc[1], loc[2], cfg) end wml_actions.redraw {} end function wml_actions.remove_item(cfg) local locs = wesnoth.get_locations(cfg) for i, loc in ipairs(locs) do remove_overlay(loc[1], loc[2], cfg.image) end end function wml_actions.store_items(cfg) local variable = cfg.variable or "items" variable = tostring(variable) or helper.wml_error("invalid variable= in [store_items]") wesnoth.set_variable(variable) local index = 0 for i, loc in ipairs(wesnoth.get_locations(cfg)) do --ugly workaround for the lack of the "continue" statement in lua repeat local items = scenario_items[loc[1] * 10000 + loc[2]] if not items then break end for j, item in ipairs(items) do wesnoth.set_variable(string.format("%s[%u]", variable, index), item) index = index + 1 end until true end end local methods = { remove = remove_overlay } function methods.place_image(x, y, name) add_overlay(x, y, { x = x, y = y, image = name }) end function methods.place_halo(x, y, name) add_overlay(x, y, { x = x, y = y, halo = name }) end return methods
gpl-2.0
jbp4444/PuzzleGame
scripts/ToggleLayout_6x6.lua
1
3951
-- -- Copyright 2013-2014 John Pormann -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- local W = display.contentWidth local H = display.contentHeight local S = 80 local layout = { bg_image = { center_x = W*0.50, center_y = H*0.50, width = W, height = H, bg_file = "assets/conppr_green.jpg" }, tile_size = S, goal_area = { text_center_x = W*0.40, text_center_y = H*0.125, center_x = W*0.50, center_y = H*0.125, width = W*0.09375, height = H*0.15 }, back_btn = { center_x = W*0.50, center_y = H*0.95, width = W*0.1, height = H*0.1 }, play_area = { center_x = W*0.50, center_y = H*0.55, width = 480, height = 480, bg_file = "assets/conppr_grey.jpg" }, play_grid = { { -- row=1, col=1, center_x = W*0.50-S*2.50, center_y = H*0.525-S*2.50 }, { center_x = W*0.50-S*1.50, center_y = H*0.525-S*2.50 }, { center_x = W*0.50-S*0.50, center_y = H*0.525-S*2.50 }, { center_x = W*0.50+S*0.50, center_y = H*0.525-S*2.50 }, { center_x = W*0.50+S*1.50, center_y = H*0.525-S*2.50 }, { center_x = W*0.50+S*2.50, center_y = H*0.525-S*2.50 }, { -- row=2, col=1, center_x = W*0.50-S*2.50, center_y = H*0.525-S*1.50 }, { center_x = W*0.50-S*1.50, center_y = H*0.525-S*1.50 }, { center_x = W*0.50-S*0.50, center_y = H*0.525-S*1.50 }, { center_x = W*0.50+S*0.50, center_y = H*0.525-S*1.50 }, { center_x = W*0.50+S*1.50, center_y = H*0.525-S*1.50 }, { center_x = W*0.50+S*2.50, center_y = H*0.525-S*1.50 }, { -- row=3, col=1, center_x = W*0.50-S*2.50, center_y = H*0.525-S*0.50 }, { center_x = W*0.50-S*1.50, center_y = H*0.525-S*0.50 }, { center_x = W*0.50-S*0.50, center_y = H*0.525-S*0.50 }, { center_x = W*0.50+S*0.50, center_y = H*0.525-S*0.50 }, { center_x = W*0.50+S*1.50, center_y = H*0.525-S*0.50 }, { center_x = W*0.50+S*2.50, center_y = H*0.525-S*0.50 }, { -- row=4, col=1, center_x = W*0.50-S*2.50, center_y = H*0.525+S*0.50 }, { center_x = W*0.50-S*1.50, center_y = H*0.525+S*0.50 }, { center_x = W*0.50-S*0.50, center_y = H*0.525+S*0.50 }, { center_x = W*0.50+S*0.50, center_y = H*0.525+S*0.50 }, { center_x = W*0.50+S*1.50, center_y = H*0.525+S*0.50 }, { center_x = W*0.50+S*2.50, center_y = H*0.525+S*0.50 }, { -- row=5, col=1, center_x = W*0.50-S*2.50, center_y = H*0.525+S*1.50 }, { center_x = W*0.50-S*1.50, center_y = H*0.525+S*1.50 }, { center_x = W*0.50-S*0.50, center_y = H*0.525+S*1.50 }, { center_x = W*0.50+S*0.50, center_y = H*0.525+S*1.50 }, { center_x = W*0.50+S*1.50, center_y = H*0.525+S*1.50 }, { center_x = W*0.50+S*2.50, center_y = H*0.525+S*1.50 }, { -- row=6, col=1, center_x = W*0.50-S*2.50, center_y = H*0.525+S*2.50 }, { center_x = W*0.50-S*1.50, center_y = H*0.525+S*2.50 }, { center_x = W*0.50-S*0.50, center_y = H*0.525+S*2.50 }, { center_x = W*0.50+S*0.50, center_y = H*0.525+S*2.50 }, { center_x = W*0.50+S*1.50, center_y = H*0.525+S*2.50 }, { center_x = W*0.50+S*2.50, center_y = H*0.525+S*2.50 }, } } return layout
apache-2.0
franko/gsl-shell
data/pre3d/pre3d_shape_utils.lua
1
26928
-- Pre3d, a JavaScript software 3d renderer. -- (c) Dean McNamee <dean@gmail.com>, Dec 2008. -- -- Permission is hereby granted, free of charge, to any person obtaining a copy -- of this software and associated documentation files (the "Software"), to -- deal in the Software without restriction, including without limitation the -- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -- sell copies of the Software, and to permit persons to whom the Software is -- furnished to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be included in -- all copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -- IN THE SOFTWARE. -- -- This file implements helpers related to creating / modifying Shapes. Some -- routines exist for basic primitives (box, sphere, etc), along with some -- routines for procedural shape operations (extrude, subdivide, etc). -- -- The procedural operations were inspired from the demoscene. A lot of the -- ideas are based on similar concepts in Farbrausch's werkkzeug1. use 'math' local Pre3d = require 'pre3d/pre3d' -- TODO(deanm): Having to import all the math like this is a bummer. local crossProduct = Pre3d.Math.crossProduct; local dotProduct2d = Pre3d.Math.dotProduct2d; local dotProduct3d = Pre3d.Math.dotProduct3d; local subPoints2d = Pre3d.Math.subPoints2d; local subPoints3d = Pre3d.Math.subPoints3d; local addPoints2d = Pre3d.Math.addPoints2d; local addPoints3d = Pre3d.Math.addPoints3d; local mulPoint2d = Pre3d.Math.mulPoint2d; local mulPoint3d = Pre3d.Math.mulPoint3d; local vecMag2d = Pre3d.Math.vecMag2d; local vecMag3d = Pre3d.Math.vecMag3d; local unitVector2d = Pre3d.Math.unitVector2d; local unitVector3d = Pre3d.Math.unitVector3d; local linearInterpolate = Pre3d.Math.linearInterpolate; local linearInterpolatePoints3d = Pre3d.Math.linearInterpolatePoints3d; local averagePoints = Pre3d.Math.averagePoints; local k2PI = pi * 2; local push = table.insert -- averagePoints() specialized for averaging 2 points. local function averagePoints2(a, b) return { x= (a.x + b.x) * 0.5, y= (a.y + b.y) * 0.5, z= (a.z + b.z) * 0.5 } end -- Rebuild the pre-computed "metadata", for the Shape |shape|. This -- calculates the centroids and normal vectors for each QuadFace. local function rebuildMeta(shape) local quads = shape.quads local vertices = shape.vertices -- TODO: It's possible we could save some work here, we could mark the -- faces "dirty" which need their centroid or normal recomputed. Right now -- if we do an operation on a single face, we rebuild all of them. A -- simple scheme would be to track any writes to a QuadFace, and to set -- centroid / normal1 / normal2 to null. This would also prevent bugs -- where you forget to call rebuildMeta() and used stale metadata. for i, qf in ipairs(quads) do local centroid local n1, n2 local vert0 = vertices[qf.i0] local vert1 = vertices[qf.i1] local vert2 = vertices[qf.i2] local vec01 = subPoints3d(vert1, vert0) local vec02 = subPoints3d(vert2, vert0) local n1 = crossProduct(vec01, vec02) if qf:isTriangle() then n2 = n1 centroid = averagePoints({vert0, vert1, vert2}) else local vert3 = vertices[qf.i3] local vec03 = subPoints3d(vert3, vert0) n2 = crossProduct(vec02, vec03) centroid = averagePoints({vert0, vert1, vert2, vert3}) end qf.centroid = centroid qf.normal1 = n1 qf.normal2 = n2 end return shape end -- Convert any quad faces into two triangle faces. After triangulation, -- |shape| should only consist of triangles. local function triangulate(shape) local quads = shape.quads local num_quads = #quads for i=1, num_quads do local qf = quads[i] if not qf:isTriangle() then -- TODO(deanm): Should we follow some clockwise rule here? local newtri = Pre3d.QuadFace(qf.i0, qf.i2, qf.i3) -- Convert the original quad into a triangle. qf.i3 = nil -- Add the new triangle to the list of faces. table.insert(quads, newtri) end end rebuildMeta(shape) return shape end -- Call |func| for each face of |shape|. The callback |func| should return -- false to continue iteration, or true to stop. For example: -- forEachFace(shape, function(quad_face, quad_index, shape) { -- return false -- }) local function forEachFace(shape, func) local quads = shape.quads for i, qf in ipairs(quads) do if func(qf, i, shape) then break end end end local function forEachVertex(shape, func) local vertices = shape.vertices for i, vert in ipairs(vertices) do if func(vert, i, shape) then break end end return shape end local function makePlane(p1, p2, p3, p4) local s = Pre3d.Shape() s.vertices = {p1, p2, p3, p4} s.quads = {Pre3d.QuadFace(1, 2, 3, 4)} rebuildMeta(s) return s end -- Make a box with width (x) |w|, height (y) |h|, and depth (z) |d|. local function makeBox(w, h, d) local s = Pre3d.Shape() s.vertices = { {x= w, y= h, z= -d}, -- 0 {x= w, y= h, z= d}, -- 1 {x= w, y= -h, z= d}, -- 2 {x= w, y= -h, z= -d}, -- 3 {x= -w, y= h, z= -d}, -- 4 {x= -w, y= h, z= d}, -- 5 {x= -w, y= -h, z= d}, -- 6 {x= -w, y= -h, z= -d} -- 7 } -- 4 -- 0 -- /| /| +y -- 5 -- 1 | |__ +x -- | 7 -|-3 / -- |/ |/ +z -- 6 -- 2 s.quads = { Pre3d.QuadFace(1, 2, 3, 4), -- Right side Pre4d.QuadFace(2, 6, 7, 3), -- Front side Pre4d.QuadFace(6, 5, 8, 7), -- Left side Pre4d.QuadFace(5, 1, 4, 8), -- Back side Pre4d.QuadFace(1, 5, 6, 2), -- Top side Pre4d.QuadFace(3, 7, 8, 4) -- Bottom side } rebuildMeta(s) return s end -- Make a cube with width, height, and depth |whd|. local function makeCube(whd) return makeBox(whd, whd, whd) end local function makeBoxWithHole(w, h, d, hw, hh) local s = Pre3d.Shape() s.vertices = { {x= w, y= h, z= -d}, -- 0 {x= w, y= h, z= d}, -- 1 {x= w, y= -h, z= d}, -- 2 {x= w, y= -h, z= -d}, -- 3 {x= -w, y= h, z= -d}, -- 4 {x= -w, y= h, z= d}, -- 5 {x= -w, y= -h, z= d}, -- 6 {x= -w, y= -h, z= -d}, -- 7 -- The front new points ... {x= hw, y= h, z= d}, -- 8 {x= w, y= hh, z= d}, -- 9 {x= hw, y= hh, z= d}, -- 10 {x= hw, y= -h, z= d}, -- 11 {x= w, y= -hh, z= d}, -- 12 {x= hw, y= -hh, z= d}, -- 13 {x= -hw, y= h, z= d}, -- 14 {x= -w, y= hh, z= d}, -- 15 {x= -hw, y= hh, z= d}, -- 16 {x= -hw, y= -h, z= d}, -- 17 {x= -w, y= -hh, z= d}, -- 18 {x= -hw, y= -hh, z= d}, -- 19 -- The back new points ... {x= hw, y= h, z= -d}, -- 20 {x= w, y= hh, z= -d}, -- 21 {x= hw, y= hh, z= -d}, -- 22 {x= hw, y= -h, z= -d}, -- 23 {x= w, y= -hh, z= -d}, -- 24 {x= hw, y= -hh, z= -d}, -- 25 {x= -hw, y= h, z= -d}, -- 26 {x= -w, y= hh, z= -d}, -- 27 {x= -hw, y= hh, z= -d}, -- 28 {x= -hw, y= -h, z= -d}, -- 29 {x= -w, y= -hh, z= -d}, -- 30 {x= -hw, y= -hh, z= -d} -- 31 } -- Front Back (looking from front) -- 4 - - 0 05 14 08 01 04 26 20 00 -- /| /| -- 5 - - 1 | 15 16--10 09 27 28--22 21 -- | 7 - |-3 |////| |////| -- |/ |/ 18 19--13 12 30 31--25 24 -- 6 - - 2 -- 06 17 11 02 07 29 23 03 s.quads = { Pre3d.QuadFace( 2, 9, 11, 10), Pre3d.QuadFace( 9, 15, 17, 11), Pre3d.QuadFace(15, 6, 16, 17), Pre3d.QuadFace(17, 16, 19, 20), Pre3d.QuadFace(20, 19, 7, 18), Pre3d.QuadFace(14, 20, 18, 12), Pre3d.QuadFace(13, 14, 12, 3), Pre3d.QuadFace( 10, 11, 14, 13), -- Back side Pre3d.QuadFace( 5, 27, 29, 28), Pre3d.QuadFace(27, 21, 23, 29), Pre3d.QuadFace(21, 1, 22, 23), Pre3d.QuadFace(23, 22, 25, 26), Pre3d.QuadFace(26, 25, 4, 24), Pre3d.QuadFace(32, 26, 24, 30), Pre3d.QuadFace(31, 32, 30, 8), Pre3d.QuadFace(28, 29, 32, 31), -- The hole Pre3d.QuadFace(11, 17, 29, 23), Pre3d.QuadFace(20, 32, 29, 17), Pre3d.QuadFace(14, 26, 32, 20), Pre3d.QuadFace(11, 23, 26, 14), -- Bottom side Pre3d.QuadFace( 7, 8, 30, 18), Pre3d.QuadFace(18, 30, 24, 12), Pre3d.QuadFace(12, 24, 4, 3), -- Right side Pre3d.QuadFace( 2, 10, 22, 1), Pre3d.QuadFace( 10, 13, 25, 22), Pre3d.QuadFace(13, 3, 4, 25), -- Left side Pre3d.QuadFace( 6, 5, 28, 16), Pre3d.QuadFace(16, 28, 31, 19), Pre3d.QuadFace(19, 31, 8, 7), -- Top side Pre3d.QuadFace(15, 27, 5, 6), Pre3d.QuadFace( 9, 21, 27, 15), Pre3d.QuadFace( 2, 1, 21, 9) } rebuildMeta(s) return s end -- Tessellate a sphere. There will be |tess_y| + 2 vertices along the Y-axis -- (two extras are for zenith and azimuth). There will be |tess_x| vertices -- along the X-axis. It is centered on the Y-axis. It has a radius |r|. -- The implementation is probably still a bit convulted. We just handle the -- middle points like a grid, and special case zenith/aximuth, since we want -- them to share a vertex anyway. The math is pretty much standard spherical -- coordinates, except that we map {x, y, z} -> {z, x, y}. |tess_x| is phi, -- and |tess_y| is theta. -- TODO(deanm): This code could definitely be more efficent. local function makeSphere(r, tess_x, tess_y) -- TODO(deanm): Preallocate the arrays to the final size. local vertices = {} local quads = {} -- We walk theta 0 .. PI and phi from 0 .. 2PI. local theta_step = pi / (tess_y + 1) local phi_step = (k2PI) / tess_x -- Create all of the vertices for the middle grid portion. local theta = theta_step for i=0, tess_y-1 do theta = theta + theta_step local sin_theta = sin(theta) local cos_theta = cos(theta) for j=0, tess_x-1 do local phi = phi_step * j table.insert(vertices, { x= r * sin_theta * sin(phi), y= r * cos_theta, z= r * sin_theta * cos(phi) }) end end -- Generate the quads for the middle grid portion. for i=0, tess_y-2 do local stride = i * tess_x for j=1, tess_x do local n = j % tess_x + 1 table.insert(quads, Pre3d.QuadFace( stride + j, stride + tess_x + j, stride + tess_x + n, stride + n )) end end -- Special case the zenith / azimuth (top / bottom) portion of triangles. -- We make triangles (degenerated quads). local last_row = #vertices - tess_x local top_p_i = #vertices + 1 local bot_p_i = top_p_i + 1 table.insert(vertices, {x= 0, y= r, z= 0}) table.insert(vertices, {x= 0, y= -r, z= 0}) for i=1, tess_x do -- Top triangles... table.insert(quads, Pre3d.QuadFace( top_p_i, i, i % tess_x + 1)) -- Bottom triangles... table.insert(quads, Pre3d.QuadFace( bot_p_i, last_row + ((i + 1) % tess_x + 1), last_row + (i % tess_x + 1))) end local s = Pre3d.Shape() s.vertices = vertices s.quads = quads rebuildMeta(s) return s end local function makeOctahedron() local s = Pre3d.Shape() s.vertices = { {x= -1, y= 0, z= 0}, -- 0 {x= 0, y= 0, z= 1}, -- 1 {x= 1, y= 0, z= 0}, -- 2 {x= 0, y= 0, z= -1}, -- 3 {x= 0, y= 1, z= 0}, -- 4 {x= 0, y= -1, z= 0} -- 5 } -- Top 4 triangles: 5 0 1, 5 1 2, 5 2 3, 5 3 0 -- Bottom 4 triangles: 0 5 1, 1 5 2, 2 5 3, 3 5 0 local quads = {} for i=1, 4 do local i2 = i % 4 + 1 quads[i*2-1] = Pre3d.QuadFace(5, i, i2) quads[i*2] = Pre3d.QuadFace(i, 6, i2) end s.quads = quads rebuildMeta(s) return s end -- Smooth a Shape by averaging the vertices / faces. This is something like -- Catmull-Clark, but without the proper weighting. The |m| argument is the -- amount to smooth, between 0 and 1, 0 being no smoothing. local function averageSmooth(shape, m) -- TODO(deanm): Remove this old compat code for calling without arguments. if not m then m = 1 end local vertices = shape.vertices local psl = #vertices local new_ps = {} -- Build a connection mapping of vertex_index -> [ quad indexes ] local connections = {} for i=1, psl do connections[i] = {} end for i, qf in ipairs(shape.quads) do push(connections[qf.i0], i) push(connections[qf.i1], i) push(connections[qf.i2], i) if not qf:isTriangle() then push(connections[qf.i3], i) end end -- For every vertex, average the centroids of the faces it's a part of. for i, vert in ipairs(vertices) do local cs = connections[i] local avg = {x= 0, y= 0, z= 0} -- Sum together the centroids of each face. for j, csj in ipairs(cs) do local quad = shape.quads[csj] local p1 = vertices[quad.i0] local p2 = vertices[quad.i1] local p3 = vertices[quad.i2] local p4 = vertices[quad.i3] -- The centroid. TODO(deanm) can't shape just come from the QuadFace? -- That would handle triangles better and avoid some duplication. avg.x = avg.x + (p1.x + p2.x + p3.x + p4.x) / 4 avg.y = avg.y + (p1.y + p2.y + p3.y + p4.y) / 4 avg.z = avg.z + (p1.z + p2.z + p3.z + p4.z) / 4 -- TODO combine all the div / 4 into one divide? end -- We summed up all of the centroids, take the average for our new point. local f = 1 / jl avg.x = avg.x * f avg.y = avg.y * f avg.z = avg.z * f -- Interpolate between the average and the original based on |m|. new_ps[i] = linearInterpolatePoints3d(vertices[i], avg, m) end shape.vertices = new_ps rebuildMeta(shape) return shape end -- Small utility function like Array.prototype.map. Return a new array -- based on the result of the function on a current array. local function arrayMap(arr, func) local out = {} for i, v in ipairs(arr) do out[i] = func(v, i, arr) end return out end local function mySort(ls) table.sort(ls) return ls end -- Divide each face of a Shape into 4 equal new faces. -- TODO(deanm): Better document, doesn't support triangles, etc. local function linearSubdivide(shape) local share_points = {} local num_quads = #shape.quads for i=1, num_quads do local quad = shape.quads[i] local i0 = quad.i0 local i1 = quad.i1 local i2 = quad.i2 local i3 = quad.i3 local p0 = shape.vertices[i0] local p1 = shape.vertices[i1] local p2 = shape.vertices[i2] local p3 = shape.vertices[i3] -- p0 p1 p0 n0 p1 -- -> n3 n4 n1 -- p3 p2 p3 n2 p2 -- We end up with an array of vertex indices of the centroids of each -- side of the quad and the middle centroid. We start with the vertex -- indices that should be averaged. We cache centroids to make sure that -- we share vertices instead of creating two on top of each other. local ni = { mySort({i0, i1}), mySort({i1, i2}), mySort({i2, i3}), mySort({i3, i0}), mySort({i0, i1, i2, i3}) } for j, ps in ipairs(ni) do local key = table.concat(ps, '-') local centroid_index = share_points[key] if not centroid_index then -- hasn't been seen before centroid_index = #shape.vertices + 1 local s = shape push(shape.vertices, averagePoints( arrayMap(ps, function(x) return s.vertices[x] end))) share_points[key] = centroid_index end ni[j] = centroid_index end -- New quads ... local q0 = Pre3d.QuadFace( i0, ni[1], ni[5], ni[4]) local q1 = Pre3d.QuadFace(ni[1], i1, ni[2], ni[5]) local q2 = Pre3d.QuadFace(ni[5], ni[2], i2, ni[3]) local q3 = Pre3d.QuadFace(ni[4], ni[5], ni[3], i3) shape.quads[i] = q0 push(shape.quads, q1) push(shape.quads, q2) push(shape.quads, q3) end rebuildMeta(shape) return shape end -- Divide each triangle of a Shape into 4 new triangle faces. This is done -- by taking the mid point of each edge, and creating 4 new triangles. You -- can visualize it by inscribing a new upside-down triangle within the -- current triangle, which then defines 4 new sub-triangles. local function linearSubdivideTri(shape) local share_points = { } local num_quads = #shape.quads for i=1, num_quads do local tri = shape.quads[i] local i0 = tri.i0 local i1 = tri.i1 local i2 = tri.i2 local p0 = shape.vertices[i0] local p1 = shape.vertices[i1] local p2 = shape.vertices[i2] -- p0 p0 -- -> n0 n2 -- p1 p2 p1 n1 p2 -- We end up with an array of vertex indices of the centroids of each -- side of the triangle. We start with the vertex indices that should be -- averaged. We cache centroids to make sure that we share vertices -- instead of creating two on top of each other. local ni = { mySort({i0, i1}), mySort({i1, i2}), mySort({i2, i0}) } for j, ps in ipairs(ni) do local key = table.concat(ps, '-') local centroid_index = share_points[key] if not centroid_index then -- hasn't been seen before centroid_index = #shape.vertices + 1 local s = shape push(shape.vertices, averagePoints( arrayMap(ps, function(x) return s.vertices[x] end))) share_points[key] = centroid_index end ni[j] = centroid_index end -- New triangles ... local q0 = Pre3d.QuadFace( i0, ni[1], ni[3]) local q1 = Pre3d.QuadFace(ni[1], i1, ni[2]) local q2 = Pre3d.QuadFace(ni[3], ni[2], i2) local q3 = Pre3d.QuadFace(ni[1], ni[2], ni[3]) shape.quads[i] = q0 push(shape.quads, q1) push(shape.quads, q2) push(shape.quads, q3) end rebuildMeta(shape) return shape end local ExtruderMT = {} ExtruderMT.__index = ExtruderMT -- The Extruder implements extruding faces of a Shape. The class mostly -- exists as a place to hold all of the extrusion parameters. The properties -- are meant to be private, please use the getter/setter APIs. local function Extruder() local this = {} -- The total distance to extrude, if |count| > 1, then each segment will -- just be a portion of the distance, and together they will be |distance|. this.distance_ = 1.0 -- The number of segments / steps to perform. This is can be different -- than just running extrude multiple times, since we only operate on the -- originally faces, not our newly inserted faces. this.count_ = 1 -- Selection mechanism. Access these through the selection APIs. -- this.selector_ = nil this:selectAll() -- TODO(deanm): Need a bunch more settings, controlling which normal the -- extrusion is performed along, etc. -- Set scale and rotation. These are public, you can access them directly. -- TODO(deanm): It would be great to use a Transform here, but there are -- a few problems. Translate doesn't make sense, so it is not really an -- affine. The real problem is that we need to interpolate across the -- values, having them in a matrix is not helpful. this.scale = {x= 1, y= 1, z= 1} this.rotate = {x= 0, y= 0, z= 0} setmetatable(this, ExtruderMT) return this end -- Selection APIs, control which faces are extruded. function ExtruderMT.selectAll(this) this.selector_ = function(shape, vertex_index) return true end end -- Select faces based on the function select_func. For example: -- extruder.selectCustom(function(shape, quad_index) { -- return quad_index == 0 -- }) -- The above would select only the first face for extrusion. function ExtruderMT.selectCustom(this, select_func) this.selector_ = select_func end function ExtruderMT.distance(this) return this.distance_ end function ExtruderMT.set_distance(this, d) this.distance_ = d end function ExtruderMT.count(this) return this.count_ end function ExtruderMT.set_count(this, c) this.count_ = c end function ExtruderMT.extrude(this, shape) local distance = this:distance() local count = this:count() local rx = this.rotate.x local ry = this.rotate.y local rz = this.rotate.z local sx = this.scale.x local sy = this.scale.y local sz = this.scale.z local vertices = shape.vertices local quads = shape.quads local faces = {} for i=1, #quads do if this.selector_(shape, i) then push(faces, i) end end for i, face_index in ipairs(faces) do -- face_index is the index of the original face. It will eventually be -- replaced with the last iteration's outside face. -- As we proceed down a count, we always need to connect to the newest -- new face. We start |quad| as the original face, and it will be -- modified (in place) for each iteration, and then the next iteration -- will connect back to the previous iteration, etc. local qf = quads[face_index] local original_cent = qf.centroid -- This is the surface normal, used to project out the new face. It -- will be rotated, but never scaled. It should be a unit vector. local surface_normal = unitVector3d(addPoints3d(qf.normal1, qf.normal2)) local is_triangle = qf:isTriangle() -- These are the normals inside the face, from the centroid out to the -- vertices. They will be rotated and scaled to create the new faces. local inner_normal0 = subPoints3d(vertices[qf.i0], original_cent) local inner_normal1 = subPoints3d(vertices[qf.i1], original_cent) local inner_normal2 = subPoints3d(vertices[qf.i2], original_cent) local inner_normal3 if not is_triangle then inner_normal3 = subPoints3d(vertices[qf.i3], original_cent) end for z=1, count do local m = z / count local t = Pre3d.Transform() t:rotateX(rx * m) t:rotateY(ry * m) t:rotateZ(rz * m) -- For our new point, we simply want to rotate the original normal -- proportional to how many steps we're at. Then we want to just scale -- it out based on our steps, and add it to the original centorid. local new_cent = addPoints3d(original_cent, mulPoint3d(t:transformPoint(surface_normal), m * distance)) -- We multiplied the centroid, which should not have been affected by -- the scale. Now we want to scale the inner face normals. t:scalePre( linearInterpolate(1, sx, m), linearInterpolate(1, sy, m), linearInterpolate(1, sz, m)) local index_before = #vertices + 1 push(vertices, addPoints3d(new_cent, t:transformPoint(inner_normal0))) push(vertices, addPoints3d(new_cent, t.transformPoint(inner_normal1))) push(vertices, addPoints3d(new_cent, t.transformPoint(inner_normal2))) if not is_triangle then push(vertices, addPoints3d(new_cent, t:transformPoint(inner_normal3))) end -- Add the new faces. These faces will always be quads, even if we -- extruded a triangle. We will have 3 or 4 new side faces. push(quads, Pre3d.QuadFace( qf.i1, index_before + 1, index_before, qf.i0)) push(quads, Pre3d.QuadFace( qf.i2, index_before + 2, index_before + 1, qf.i1)) if is_triangle then push(quads, Pre3d.QuadFace( qf.i0, index_before, index_before + 2, qf.i2)) else push(quads, Pre3d.QuadFace( qf.i3, index_before + 3, index_before + 2, qf.i2)) push(quads, Pre3d.QuadFace( qf.i0, index_before, index_before + 3, qf.i3)) end -- Update (in place) the original face with the new extruded vertices. qf.i0 = index_before qf.i1 = index_before + 1 qf.i2 = index_before + 2 if not is_triangle then qf.i3 = index_before + 3 end end end rebuildMeta(shape) -- Compute all the new normals, etc. end local function makeXYFunction(f, xmin, ymin, xmax, ymax, nx, ny) local zmin, zmax local zmap = {} local s = Pre3d.Shape() for i=0, nx do local x = xmin + (xmax - xmin)*i/nx for j=0, ny do local y = ymin + (ymax - ymin)*j/ny local z = f(x, y) if not zmin or z < zmin then zmin = z end if not zmax or z > zmax then zmax = z end zmap[i * (ny+1) + j] = z end end local xscale, yscale, zscale = (xmax-xmin), (ymax-ymin), 2*(zmax-zmin) for i=0, nx do local x = xmin + (xmax - xmin)*i/nx for j=0, ny do local y = ymin + (ymax - ymin)*j/ny local z = zmap[i * (ny+1) + j] push(s.vertices, {x= (x-xmin)/xscale, y= (y-ymin)/yscale, z= (z-zmin)/zscale}) end end local quads = {} local i0 = 1 for i=1, nx do for j=1, ny do local i1, i2, i3 = i0+(ny+1), i0+(ny+1)+1, i0+1 push(quads, Pre3d.QuadFace(i0, i1, i2)) push(quads, Pre3d.QuadFace(i0, i2, i3)) i0 = i0+1 end i0 = i0+1 end s.quads = quads rebuildMeta(s) return s, (zmax - zmin) end local function makeUVSurface(x, y, z, umin, vmin, umax, vmax, nu, nv) local s = Pre3d.Shape() for i=0, nu do local u = umin + (umax - umin)*i/nu for j=0, nv do local v = vmin + (vmax - vmin)*j/nv local xp, yp, zp = x(u,v), y(u,v), z(u,v) push(s.vertices, {x= xp, y= yp, z= zp}) end end local quads = {} local i0 = 1 for i=1, nu do for j=1, nv do local i1, i2, i3 = i0+(nv+1), i0+(nv+1)+1, i0+1 push(quads, Pre3d.QuadFace(i0, i1, i2, i3)) i0 = i0+1 end i0 = i0+1 end s.quads = quads rebuildMeta(s) return s end return { rebuildMeta= rebuildMeta, triangulate= triangulate, forEachFace= forEachFace, forEachVertex= forEachVertex, makePlane= makePlane, makeCube= makeCube, makeBox= makeBox, makeBoxWithHole= makeBoxWithHole, makeSphere= makeSphere, makeOctahedron= makeOctahedron, makeXYFunction= makeXYFunction, makeUVSurface= makeUVSurface, averageSmooth= averageSmooth, linearSubdivide= linearSubdivide, linearSubdivideTri= linearSubdivideTri, Extruder= Extruder }
gpl-3.0
8devices/carambola2-luci
applications/luci-pbx/luasrc/model/cbi/pbx.lua
146
4360
--[[ Copyright 2011 Iordan Iordanov <iiordanov (AT) gmail.com> This file is part of luci-pbx. luci-pbx is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. luci-pbx is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with luci-pbx. If not, see <http://www.gnu.org/licenses/>. ]]-- modulename = "pbx" if nixio.fs.access("/etc/init.d/asterisk") then server = "asterisk" elseif nixio.fs.access("/etc/init.d/freeswitch") then server = "freeswitch" else server = "" end -- Returns formatted output of string containing only the words at the indices -- specified in the table "indices". function format_indices(string, indices) if indices == nil then return "Error: No indices to format specified.\n" end -- Split input into separate lines. lines = luci.util.split(luci.util.trim(string), "\n") -- Split lines into separate words. splitlines = {} for lpos,line in ipairs(lines) do splitlines[lpos] = luci.util.split(luci.util.trim(line), "%s+", nil, true) end -- For each split line, if the word at all indices specified -- to be formatted are not null, add the formatted line to the -- gathered output. output = "" for lpos,splitline in ipairs(splitlines) do loutput = "" for ipos,index in ipairs(indices) do if splitline[index] ~= nil then loutput = loutput .. string.format("%-40s", splitline[index]) else loutput = nil break end end if loutput ~= nil then output = output .. loutput .. "\n" end end return output end m = Map (modulename, translate("PBX Main Page"), translate("This configuration page allows you to configure a phone system (PBX) service which \ permits making phone calls through multiple Google and SIP (like Sipgate, \ SipSorcery, and Betamax) accounts and sharing them among many SIP devices. \ Note that Google accounts, SIP accounts, and local user accounts are configured in the \ \"Google Accounts\", \"SIP Accounts\", and \"User Accounts\" sub-sections. \ You must add at least one User Account to this PBX, and then configure a SIP device or \ softphone to use the account, in order to make and receive calls with your Google/SIP \ accounts. Configuring multiple users will allow you to make free calls between all users, \ and share the configured Google and SIP accounts. If you have more than one Google and SIP \ accounts set up, you should probably configure how calls to and from them are routed in \ the \"Call Routing\" page. If you're interested in using your own PBX from anywhere in the \ world, then visit the \"Remote Usage\" section in the \"Advanced Settings\" page.")) ----------------------------------------------------------------------------------------- s = m:section(NamedSection, "connection_status", "main", translate("PBX Service Status")) s.anonymous = true s:option (DummyValue, "status", translate("Service Status")) sts = s:option(DummyValue, "_sts") sts.template = "cbi/tvalue" sts.rows = 20 function sts.cfgvalue(self, section) if server == "asterisk" then regs = luci.sys.exec("asterisk -rx 'sip show registry' | sed 's/peer-//'") jabs = luci.sys.exec("asterisk -rx 'jabber show connections' | grep onnected") usrs = luci.sys.exec("asterisk -rx 'sip show users'") chan = luci.sys.exec("asterisk -rx 'core show channels'") return format_indices(regs, {1, 5}) .. format_indices(jabs, {2, 4}) .. "\n" .. format_indices(usrs, {1} ) .. "\n" .. chan elseif server == "freeswitch" then return "Freeswitch is not supported yet.\n" else return "Neither Asterisk nor FreeSwitch discovered, please install Asterisk, as Freeswitch is not supported yet.\n" end end return m
apache-2.0
Fenix-XI/Fenix
scripts/zones/Uleguerand_Range/npcs/HomePoint#3.lua
27
1258
----------------------------------- -- Area: Uleguerand_Range -- NPC: HomePoint#3 -- @pos ----------------------------------- package.loaded["scripts/zones/Uleguerand_Range/TextIDs"] = nil; require("scripts/globals/settings"); require("scripts/zones/Uleguerand_Range/TextIDs"); require("scripts/globals/homepoint"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) homepointMenu( player, 0x21fe, 78); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); if (csid == 0x21fe) then if (option == 1) then player:setHomePoint(); player:messageSpecial(HOMEPOINT_SET); else hpTeleport( player, option); end end end;
gpl-3.0
8devices/carambola2-luci
protocols/ppp/luasrc/model/cbi/admin_network/proto_pptp.lua
59
3379
--[[ LuCI - Lua Configuration Interface Copyright 2011-2012 Jo-Philipp Wich <xm@subsignal.org> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 ]]-- local map, section, net = ... local server, username, password local defaultroute, metric, peerdns, dns, keepalive_failure, keepalive_interval, demand, mtu server = section:taboption("general", Value, "server", translate("VPN Server")) server.datatype = "host" username = section:taboption("general", Value, "username", translate("PAP/CHAP username")) password = section:taboption("general", Value, "password", translate("PAP/CHAP password")) password.password = true defaultroute = section:taboption("advanced", Flag, "defaultroute", translate("Use default gateway"), translate("If unchecked, no default route is configured")) defaultroute.default = defaultroute.enabled metric = section:taboption("advanced", Value, "metric", translate("Use gateway metric")) metric.placeholder = "0" metric.datatype = "uinteger" metric:depends("defaultroute", defaultroute.enabled) peerdns = section:taboption("advanced", Flag, "peerdns", translate("Use DNS servers advertised by peer"), translate("If unchecked, the advertised DNS server addresses are ignored")) peerdns.default = peerdns.enabled dns = section:taboption("advanced", DynamicList, "dns", translate("Use custom DNS servers")) dns:depends("peerdns", "") dns.datatype = "ipaddr" dns.cast = "string" keepalive_failure = section:taboption("advanced", Value, "_keepalive_failure", translate("LCP echo failure threshold"), translate("Presume peer to be dead after given amount of LCP echo failures, use 0 to ignore failures")) function keepalive_failure.cfgvalue(self, section) local v = m:get(section, "keepalive") if v and #v > 0 then return tonumber(v:match("^(%d+)[ ,]+%d+") or v) end end function keepalive_failure.write() end function keepalive_failure.remove() end keepalive_failure.placeholder = "0" keepalive_failure.datatype = "uinteger" keepalive_interval = section:taboption("advanced", Value, "_keepalive_interval", translate("LCP echo interval"), translate("Send LCP echo requests at the given interval in seconds, only effective in conjunction with failure threshold")) function keepalive_interval.cfgvalue(self, section) local v = m:get(section, "keepalive") if v and #v > 0 then return tonumber(v:match("^%d+[ ,]+(%d+)")) end end function keepalive_interval.write(self, section, value) local f = tonumber(keepalive_failure:formvalue(section)) or 0 local i = tonumber(value) or 5 if i < 1 then i = 1 end if f > 0 then m:set(section, "keepalive", "%d %d" %{ f, i }) else m:del(section, "keepalive") end end keepalive_interval.remove = keepalive_interval.write keepalive_interval.placeholder = "5" keepalive_interval.datatype = "min(1)" demand = section:taboption("advanced", Value, "demand", translate("Inactivity timeout"), translate("Close inactive connection after the given amount of seconds, use 0 to persist connection")) demand.placeholder = "0" demand.datatype = "uinteger" mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU")) mtu.placeholder = "1500" mtu.datatype = "max(9200)"
apache-2.0
DarkstarProject/darkstar
scripts/globals/effects/prowess_killer.lua
12
2060
----------------------------------- -- -- dsp.effect.PROWESS : "Killer" effects bonus -- ----------------------------------- function onEffectGain(target,effect) target:addMod(dsp.mod.VERMIN_KILLER, effect:getPower()) target:addMod(dsp.mod.BIRD_KILLER, effect:getPower()) target:addMod(dsp.mod.AMORPH_KILLER, effect:getPower()) target:addMod(dsp.mod.LIZARD_KILLER, effect:getPower()) target:addMod(dsp.mod.AQUAN_KILLER, effect:getPower()) target:addMod(dsp.mod.PLANTOID_KILLER, effect:getPower()) target:addMod(dsp.mod.BEAST_KILLER, effect:getPower()) target:addMod(dsp.mod.UNDEAD_KILLER, effect:getPower()) target:addMod(dsp.mod.ARCANA_KILLER, effect:getPower()) target:addMod(dsp.mod.DRAGON_KILLER, effect:getPower()) target:addMod(dsp.mod.DEMON_KILLER, effect:getPower()) target:addMod(dsp.mod.EMPTY_KILLER, effect:getPower()) -- target:addMod(dsp.mod.HUMANOID_KILLER, effect:getPower()) target:addMod(dsp.mod.LUMORIAN_KILLER, effect:getPower()) target:addMod(dsp.mod.LUMINION_KILLER, effect:getPower()) end function onEffectTick(target,effect) end function onEffectLose(target,effect) target:delMod(dsp.mod.VERMIN_KILLER, effect:getPower()) target:delMod(dsp.mod.BIRD_KILLER, effect:getPower()) target:delMod(dsp.mod.AMORPH_KILLER, effect:getPower()) target:delMod(dsp.mod.LIZARD_KILLER, effect:getPower()) target:delMod(dsp.mod.AQUAN_KILLER, effect:getPower()) target:delMod(dsp.mod.PLANTOID_KILLER, effect:getPower()) target:delMod(dsp.mod.BEAST_KILLER, effect:getPower()) target:delMod(dsp.mod.UNDEAD_KILLER, effect:getPower()) target:delMod(dsp.mod.ARCANA_KILLER, effect:getPower()) target:delMod(dsp.mod.DRAGON_KILLER, effect:getPower()) target:delMod(dsp.mod.DEMON_KILLER, effect:getPower()) target:delMod(dsp.mod.EMPTY_KILLER, effect:getPower()) -- target:delMod(dsp.mod.HUMANOID_KILLER, effect:getPower()) target:delMod(dsp.mod.LUMORIAN_KILLER, effect:getPower()) target:delMod(dsp.mod.LUMINION_KILLER, effect:getPower()) end
gpl-3.0
DarkstarProject/darkstar
scripts/zones/Windurst_Waters/npcs/Yung_Yaam.lua
11
1123
----------------------------------- -- Area: Windurst Waters -- NPC: Yung Yaam -- Involved In Quest: Wondering Minstrel -- !pos -63 -4 27 238 ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/keyitems"); require("scripts/globals/quests"); require("scripts/globals/titles"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) --player:addFame(WINDURST,100) wonderingstatus = player:getQuestStatus(WINDURST,dsp.quest.id.windurst.WONDERING_MINSTREL); fame = player:getFameLevel(WINDURST) if (wonderingstatus <= 1 and fame >= 5) then player:startEvent(637); -- WONDERING_MINSTREL: Quest Available / Quest Accepted elseif (wonderingstatus == QUEST_COMPLETED and player:needToZone()) then player:startEvent(643); -- WONDERING_MINSTREL: Quest After else player:startEvent(609); -- Standard Conversation end end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) end;
gpl-3.0
DarkstarProject/darkstar
scripts/globals/items/pork_cutlet.lua
11
1447
----------------------------------------- -- ID: 6394 -- Item: pork_cutlet -- Food Effect: 180Min, All Races ----------------------------------------- -- HP +40 -- STR +7 -- INT -7 -- Fire resistance +20 -- Attack +20% (cap 120) -- Ranged Attack +20% (cap 120) ----------------------------------------- require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- function onItemCheck(target) local result = 0 if target:hasStatusEffect(dsp.effect.FOOD) or target:hasStatusEffect(dsp.effect.FIELD_SUPPORT_FOOD) then result = dsp.msg.basic.IS_FULL end return result end function onItemUse(target) target:addStatusEffect(dsp.effect.FOOD,0,0,10800,6394) end function onEffectGain(target,effect) target:addMod(dsp.mod.HP, 40) target:addMod(dsp.mod.STR, 7) target:addMod(dsp.mod.INT, -7) target:addMod(dsp.mod.FIRERES, 20) target:addMod(dsp.mod.FOOD_ATTP, 20) target:addMod(dsp.mod.FOOD_ATT_CAP, 120) target:addMod(dsp.mod.FOOD_RATTP, 20) target:addMod(dsp.mod.FOOD_RATT_CAP, 120) end function onEffectLose(target, effect) target:delMod(dsp.mod.HP, 40) target:delMod(dsp.mod.STR, 7) target:delMod(dsp.mod.INT, -7) target:delMod(dsp.mod.FIRERES, 20) target:delMod(dsp.mod.FOOD_ATTP, 20) target:delMod(dsp.mod.FOOD_ATT_CAP, 120) target:delMod(dsp.mod.FOOD_RATTP, 20) target:delMod(dsp.mod.FOOD_RATT_CAP, 120) end
gpl-3.0
Fenix-XI/Fenix
scripts/globals/weaponskills/blade_yu.lua
10
1564
----------------------------------- -- Blade Yu -- Katana weapon skill -- Skill Level: 290 -- Delivers a water elemental attack. Additional effect Poison. Durration varies with TP. -- Aligned with the Aqua Gorget & Soil Gorget. -- Aligned with the Aqua Belt & Soil Belt. -- Element: Water -- Modifiers: DEX:50% ; INT:50% -- 100%TP 200%TP 300%TP -- 2.25 2.25 2.25 ----------------------------------- require("scripts/globals/magic"); require("scripts/globals/status"); require("scripts/globals/settings"); require("scripts/globals/weaponskills"); ----------------------------------- function onUseWeaponSkill(player, target, wsID, tp, primary) local params = {}; params.ftp100 = 2.25; params.ftp200 = 2.25; params.ftp300 = 2.25; params.str_wsc = 0.0; params.dex_wsc = 0.5; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.5; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; params.ele = ELE_WATER; params.skill = SKILL_KAT; params.includemab = true; if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then params.ftp100 = 3; params.ftp200 = 3; params.ftp300 = 3; params.dex_wsc = 0.4; params.int_wsc = 0.4; end local damage, tpHits, extraHits = doMagicWeaponskill(player, target, wsID, params, tp, primary); if (damage > 0) then local duration = (tp/1000 * 15) + 75; if (target:hasStatusEffect(EFFECT_POISON) == false) then target:addStatusEffect(EFFECT_POISON, 10, 0, duration); end end return tpHits, extraHits, criticalHit, damage; end
gpl-3.0
Fenix-XI/Fenix
scripts/zones/Spire_of_Mea/npcs/_0l2.lua
39
1330
----------------------------------- -- Area: Spire_of_Mea -- NPC: web of regret ----------------------------------- package.loaded["scripts/zones/Spire_of_Mea/TextIDs"] = nil; ----------------------------------- require("scripts/globals/bcnm"); require("scripts/zones/Spire_of_Mea/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) if (TradeBCNM(player,player:getZoneID(),trade,npc)) then return; end end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) if (EventTriggerBCNM(player,npc)) then return 1; end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("onUpdate CSID: %u",csid); --printf("onUpdate RESULT: %u",option); if (EventUpdateBCNM(player,csid,option)) then return; end end; ----------------------------------- -- onEventFinish Action ----------------------------------- function onEventFinish(player,csid,option) --printf("onFinish CSID: %u",csid); --printf("onFinish RESULT: %u",option); if (EventFinishBCNM(player,csid,option)) then return; end end;
gpl-3.0
persianTDT/TDT_BOT
plugins/saveplug.lua
2
1692
local function plugin_enabled( name ) for k,v in pairs(_config.enabled_plugins) do if name == v then return k end end return false end local function disable_plugin( name, chat ) local k = plugin_enabled(name) if not k then return end table.remove(_config.enabled_plugins, k) save_config( ) end local function enable_plugin( plugin_name ) if plugin_enabled(plugin_name) then return disable_plugin( name, chat ) end table.insert(_config.enabled_plugins, plugin_name) save_config() end local function plugin_exists( name ) for k,v in pairs(plugins_names()) do if name..'.lua' == v then return true end end return false end local function reload_plugins( ) plugins = {} load_plugins() end local function saveplug(extra, success, result) local msg = extra.msg local name = extra.name local receiver = get_receiver(msg) if success then local file = 'plugins/'..name..'.lua' print('File saving to:', result) os.rename(result, file) print('File moved to:', file) enable_plugin(name) reload_plugins( ) else print('Error downloading: '..msg.id) send_large_msg(receiver, 'Failed, please try again!', ok_cb, false) end end local function run(msg,matches) local receiver = get_receiver(msg) local group = msg.to.id if msg.reply_id then local name = matches[2] if matches[1] == "save" and matches[2] and is_sudo(msg) then load_document(msg.reply_id, saveplug, {msg=msg,name=name}) return 'Plugin '..name..' has been saved.' end end end return { advan = { "", "", "", }, patterns = { "^[!/#](save) (.*)$", }, run = run, }
agpl-3.0
Fenix-XI/Fenix
scripts/zones/Southern_San_dOria/npcs/Atelloune.lua
1
2687
----------------------------------- -- Area: Southern San d'Oria -- NPC: Atelloune -- Starts and Finishes Quest: Atelloune's Lament -- @zone 230 -- @pos 122 0 82 ------------------------------------- package.loaded["scripts/zones/Southern_San_dOria/TextIDs"] = nil; ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/quests"); require("scripts/zones/Southern_San_dOria/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) -- "Flyers for Regine" conditional script FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE); if (FlyerForRegine == 1) then count = trade:getItemCount(); MagicFlyer = trade:hasItemQty(532,1); if (MagicFlyer == true and count == 1) then player:messageSpecial(FLYER_REFUSED); end end -----lady bug if (player:getQuestStatus(SANDORIA,ATELLOUNE_S_LAMENT) == QUEST_ACCEPTED) then if (trade:hasItemQty(2506,1) and trade:getItemCount() == 1) then player:startEvent(0x037b); end end end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) atellounesLament = player:getQuestStatus(SANDORIA,ATELLOUNE_S_LAMENT) sanFame = player:getFameLevel(SANDORIA); if (atellounesLament == QUEST_AVAILABLE and sanFame >= 2) then player:startEvent(0x037a); elseif (atellounesLament == QUEST_ACCEPTED) then player:startEvent(0x037c); elseif (atellounesLament == QUEST_COMPLETED) then player:startEvent(0x0374); -- im profesors research elseif (sanFame < 2) then player:startEvent(0x0374); end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); if (csid == 0x037a) then player:addQuest(SANDORIA,ATELLOUNE_S_LAMENT); elseif (csid == 0x037b) then if (player:getFreeSlotsCount() == 0) then player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,15008); -- Trainee Gloves else player:addItem(15008); player:messageSpecial(ITEM_OBTAINED,15008); -- Trainee Gloves player:addFame(SANDORIA,30); player:completeQuest(SANDORIA,ATELLOUNE_S_LAMENT); end end end;
gpl-3.0
DarkstarProject/darkstar
scripts/zones/Periqia/IDs.lua
12
8584
----------------------------------- -- Area: Periqia ----------------------------------- require("scripts/globals/zone") ----------------------------------- zones = zones or {} zones[dsp.zone.PERIQIA] = { text = { ITEM_CANNOT_BE_OBTAINED = 6382, -- You cannot obtain the <item>. Come back after sorting your inventory. FULL_INVENTORY_AFTER_TRADE = 6386, -- You cannot obtain the <item>. Try trading again after sorting your inventory. ITEM_OBTAINED = 6388, -- Obtained: <item>. GIL_OBTAINED = 6389, -- Obtained <number> gil. KEYITEM_OBTAINED = 6391, -- Obtained key item: <keyitem>. KEYITEM_LOST = 6392, -- Lost key item: <keyitem>. NOT_HAVE_ENOUGH_GIL = 6393, -- You do not have enough gil. ITEMS_OBTAINED = 6397, -- You obtain <number> <item>! ASSAULT_31_START = 7477, -- Commencing <assault>! Objective: Escort the prisoner ASSAULT_32_START = 7478, -- Commencing <assault>! Objective: Destroy the undead ASSAULT_33_START = 7479, -- Commencing <assault>! Objective: Find the survivors ASSAULT_34_START = 7480, -- Commencing <assault>! Objective: Eliminate the Black Baron ASSAULT_35_START = 7481, -- Commencing <assault>! Objective: Activate the bridge ASSAULT_36_START = 7482, -- Commencing <assault>! Objective: Exterminate the chigoes ASSAULT_37_START = 7483, -- Commencing <assault>! Objective: Clear the mine fields ASSAULT_38_START = 7484, -- Commencing <assault>! Objective: Locate the generals ASSAULT_39_START = 7485, -- Commencing <assault>! Objective: Retrieve the Mark-IIs ASSAULT_40_START = 7486, -- Commencing <assault>! Objective: Assassinate King Goldemar TIME_TO_COMPLETE = 7507, -- You have <number> [minute/minutes] (Earth time) to complete this mission. MISSION_FAILED = 7508, -- The mission has failed. Leaving area. RUNE_UNLOCKED_POS = 7509, -- ission objective completed. Unlocking Rune of Release ([A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z]-#). RUNE_UNLOCKED = 7510, -- ission objective completed. Unlocking Rune of Release. ASSAULT_POINTS_OBTAINED = 7511, -- You gain <number> [Assault point/Assault points]! TIME_REMAINING_MINUTES = 7512, -- ime remaining: <number> [minute/minutes] (Earth time). TIME_REMAINING_SECONDS = 7513, -- ime remaining: <number> [second/seconds] (Earth time). PARTY_FALLEN = 7515, -- ll party members have fallen in battle. Mission failure in <number> [minute/minutes]. EXCALIACE_START = 7524, -- Such a lot of trouble for one little corsair... Shall we be on our way? EXCALIACE_END1 = 7525, -- Yeah, I got it. Stay here and keep quiet. EXCALIACE_END2 = 7526, -- Hey... It was a short trip, but nothing is ever dull around you, huh? EXCALIACE_ESCAPE = 7527, -- Heh. The Immortals really must be having troubles finding troops if they sent this bunch of slowpokes to watch over me... EXCALIACE_PAIN1 = 7528, -- Oomph! EXCALIACE_PAIN2 = 7529, -- Ouch! EXCALIACE_PAIN3 = 7530, -- Youch! EXCALIACE_PAIN4 = 7531, -- Damn, that's gonna leave a mark! EXCALIACE_PAIN5 = 7532, -- Urggh! EXCALIACE_CRAB1 = 7533, -- Over to you. EXCALIACE_CRAB2 = 7534, -- What's this guy up to? EXCALIACE_CRAB3 = 7535, -- Uh-oh. EXCALIACE_DEBAUCHER1 = 7536, -- Wh-what the...!? EXCALIACE_DEBAUCHER2 = 7537, -- H-help!!! EXCALIACE_RUN = 7538, -- Now's my chance! EXCALIACE_TOO_CLOSE = 7539, -- Okay, okay, you got me! I promise I won't run again if you step back a bit...please. Someone's been eating too much garlic... EXCALIACE_TIRED = 7540, -- <Pant>...<wheeze>... EXCALIACE_CAUGHT = 7541, -- Damn... }, mob = { -- Seagull Grounded [31] = { CRAB1 = 17006594, CRAB2 = 17006595, CRAB3 = 17006596, CRAB4 = 17006597, CRAB5 = 17006598, CRAB6 = 17006599, CRAB7 = 17006600, CRAB8 = 17006601, CRAB9 = 17006602, DEBAUCHER1 = 17006603, PUGIL1 = 17006604, PUGIL2 = 17006605, PUGIL3 = 17006606, PUGIL4 = 17006607, PUGIL5 = 17006608, DEBAUCHER2 = 17006610, DEBAUCHER3 = 17006611, }, -- Requiem [32] = { PUTRID_IMMORTAL_GUARD1 = 17006612, PUTRID_IMMORTAL_GUARD2 = 17006613, BATTEILANT_BHOOT1 = 17006614, BATTEILANT_BHOOT2 = 17006615, DARKLING_DRAUGAR1 = 17006616, DRACONIC_DRAUGAR1 = 17006617, DARKLING_DRAUGAR2 = 17006619, DARKLING_DRAUGAR3 = 17006620, DRACONIC_DRAUGAR2 = 17006621, DRACONIC_DRAUGAR3 = 17006623, BATTEILANT_BHOOT3 = 17006625, BATTEILANT_BHOOT4 = 17006626, DARKLING_DRAUGAR4 = 17006627, DRACONIC_DRAUGAR4 = 17006628, DARKLING_DRAUGAR5 = 17006630, DRACONIC_DRAUGAR5 = 17006631, DARKLING_DRAUGAR6 = 17006633, DARKLING_DRAUGAR7 = 17006634, }, -- Shades of Vengeance [79] = { K23H1LAMIA1 = 17006754, K23H1LAMIA2 = 17006755, K23H1LAMIA3 = 17006756, K23H1LAMIA4 = 17006757, K23H1LAMIA5 = 17006758, K23H1LAMIA6 = 17006759, K23H1LAMIA7 = 17006760, K23H1LAMIA8 = 17006761, K23H1LAMIA9 = 17006762, K23H1LAMIA10 = 17006763, } }, npc = { EXCALIACE = 17006593, ANCIENT_LOCKBOX = 17006809, RUNE_OF_RELEASE = 17006810, _1K1 = 17006840, _1K2 = 17006841, _1K3 = 17006842, _1K4 = 17006843, _1K5 = 17006844, _1K6 = 17006845, _1K7 = 17006846, _1K8 = 17006847, _1K9 = 17006848, _1KA = 17006849, _1KB = 17006850, _1KC = 17006851, _1KD = 17006852, _1KE = 17006853, _1KF = 17006854, _1KG = 17006855, _1KH = 17006856, _1KI = 17006857, _1KJ = 17006858, _1KK = 17006859, _1KL = 17006860, _1KM = 17006861, _1KN = 17006862, _1KO = 17006863, _1KP = 17006864, _1KQ = 17006865, _1KR = 17006866, _1KS = 17006867, _1KT = 17006868, _1KU = 17006869, _1KV = 17006870, _1KW = 17006871, _1KX = 17006872, _1KY = 17006873, _1KZ = 17006874, _JK0 = 17006875, _JK1 = 17006876, _JK2 = 17006877, _JK3 = 17006878, _JK4 = 17006879, _JK5 = 17006880, _JK6 = 17006881, _JK7 = 17006882, _JK8 = 17006883, _JK9 = 17006884, _JKA = 17006885, _JKB = 17006886, _JKC = 17006887, _JKD = 17006888, _JKE = 17006889, _JKF = 17006890, _JKG = 17006891, _JKH = 17006892, _JKI = 17006893, _JKJ = 17006894, _JKK = 17006895, _JKL = 17006896, _JKM = 17006897, _JKN = 17006898, _JKO = 17006899, } } return zones[dsp.zone.PERIQIA]
gpl-3.0
DarkstarProject/darkstar
scripts/globals/abilities/shadowbind.lua
12
1949
----------------------------------- -- Ability: Shadowbind -- Roots enemy in place. -- Obtained: Ranger Level 40 -- Recast Time: 5:00 -- Duration: 00:30 ----------------------------------- require("scripts/globals/settings") require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------- function onAbilityCheck(player,target,ability) if ((player:getWeaponSkillType(dsp.slot.RANGED) == dsp.skill.MARKSMANSHIP and player:getWeaponSkillType(dsp.slot.AMMO) == dsp.skill.MARKSMANSHIP) or (player:getWeaponSkillType(dsp.slot.RANGED) == dsp.skill.ARCHERY and player:getWeaponSkillType(dsp.slot.AMMO) == dsp.skill.ARCHERY)) then return 0,0 end return 216,0 -- You do not have an appropriate ranged weapon equipped. end function onUseAbility(player,target,ability,action) if (player:getWeaponSkillType(dsp.slot.RANGED) == dsp.skill.MARKSMANSHIP) then -- can't have your crossbow/gun held like a bow, now can we? action:animation(target:getID(), action:animation(target:getID()) + 1) end local duration = 30 + player:getMod(dsp.mod.SHADOW_BIND_EXT) local recycleChance = player:getMod(dsp.mod.RECYCLE) + player:getMerit(dsp.merit.RECYCLE) if (player:hasStatusEffect(dsp.effect.UNLIMITED_SHOT)) then player:delStatusEffect(dsp.effect.UNLIMITED_SHOT) recycleChance = 100 end -- TODO: Acc penalty for /RNG, acc vs. mob level? if (math.random(0, 99) >= target:getMod(dsp.mod.BINDRES) and target:hasStatusEffect(dsp.effect.BIND) == false) then target:addStatusEffect(dsp.effect.BIND, 0, 0, duration) ability:setMsg(dsp.msg.basic.IS_EFFECT) -- Target is bound. else ability:setMsg(dsp.msg.basic.JA_MISS) -- Player uses Shadowbind, but misses. end if (math.random(0, 99) >= recycleChance) then player:removeAmmo() -- Shadowbind depletes one round of ammo. end return dsp.effect.BIND end
gpl-3.0
vsergeyev/sol
Sol/mission4.lua
1
2439
----------------------------------------------------------------------------------------- -- -- mission4.lua -- ----------------------------------------------------------------------------------------- local storyboard = require( "storyboard" ) local scene = storyboard.newScene() require "campaign" local physics = require "physics" physics.start(); physics.pause() physics.setGravity(0, 0) ----------------------------------------------------------------------------------------- -- BEGINNING OF YOUR IMPLEMENTATION -- -- NOTE: Code outside of listener functions (below) will only be executed once, -- unless storyboard.removeScene() is called. -- ----------------------------------------------------------------------------------------- -- Called when the scene's view does not exist: function scene:createScene( event ) gold = 300 levelNow = 4 gameStat = { money = 0, ships = 0, killed = 0 } local group = createLevel(self.view) -- Position camera on Earth group.x = -1700 group.y = 250 end -- Called immediately after scene has moved onscreen: function scene:enterScene( event ) physics.start() table.insert(gameTimers, timer.performWithDelay(500, addAlienStations, 1 )) enterLevel() end -- Called when scene is about to move offscreen: function scene:exitScene( event ) physics.stop() end -- If scene's view is removed, scene:destroyScene() will be called just prior to: function scene:destroyScene( event ) package.loaded[physics] = nil physics = nil end ----------------------------------------------------------------------------------------- -- END OF YOUR IMPLEMENTATION ----------------------------------------------------------------------------------------- -- "createScene" event is dispatched if scene's view does not exist scene:addEventListener( "createScene", scene ) -- "enterScene" event is dispatched whenever scene transition has finished scene:addEventListener( "enterScene", scene ) -- "exitScene" event is dispatched whenever before next scene's transition begins scene:addEventListener( "exitScene", scene ) -- "destroyScene" event is dispatched before view is unloaded, which can be -- automatically unloaded in low memory situations, or explicitly via a call to -- storyboard.purgeScene() or storyboard.removeScene(). scene:addEventListener( "destroyScene", scene ) ----------------------------------------------------------------------------------------- return scene
mit
eugeneia/snabbswitch
src/apps/lwaftr/lwdebug.lua
12
1898
module(..., package.seeall) local ethernet = require("lib.protocol.ethernet") local ipv6 = require("lib.protocol.ipv6") local bit = require("bit") local band, rshift = bit.band, bit.rshift function pp(t) for k,v in pairs(t) do print(k,v) end end function print_ethernet (addr) print(ethernet:ntop(addr)) end function print_ipv6 (addr) print(ipv6:ntop(addr)) end local function gen_hex_bytes(data, len) local fbytes = {} for i=0,len - 1 do table.insert(fbytes, string.format("0x%x", data[i])) end return fbytes end function print_hex(data, len) print(table.concat(gen_hex_bytes(data, len), " ")) end -- Formats packet in 'od' format: -- -- 000000 00 0e b6 00 00 02 00 0e b6 00 00 01 08 00 45 00 -- 000010 00 28 00 00 00 00 ff 01 37 d1 c0 00 02 01 c0 00 -- 000020 02 02 08 00 a6 2f 00 01 00 01 48 65 6c 6c 6f 20 -- 000030 57 6f 72 6c 64 21 -- -- A packet text dump in 'od' format can be easily converted into a pcap file: -- -- $ text2pcap pkt.txt pkt.pcap --- local function od_dump(pkt) local function column_index(i) return ("%.6x"):format(i) end local function column_value(val) return ("%.2x"):format(val) end local ret = {} for i=0, pkt.length-1 do if i == 0 then table.insert(ret, column_index(i)) elseif i % 16 == 0 then table.insert(ret, "\n"..column_index(i)) end table.insert(ret, column_value(pkt.data[i])) end return table.concat(ret, " ") end function print_pkt(pkt) print(("Len: %i, data:\n%s"):format(pkt.length, od_dump(pkt))) end function format_ipv4(uint32) return string.format("%i.%i.%i.%i", rshift(uint32, 24), rshift(band(uint32, 0xff0000), 16), rshift(band(uint32, 0xff00), 8), band(uint32, 0xff)) end function selftest () assert(format_ipv4(0xfffefdfc) == "255.254.253.252", "Bad conversion in format_ipv4") end
apache-2.0
DarkstarProject/darkstar
scripts/zones/The_Garden_of_RuHmet/mobs/Ixaern_DRGs_Wynav.lua
9
1196
----------------------------------- -- Area: The Garden of Ru'Hmet -- Mob: Ix'aern DRG's Wynav ----------------------------------- require("scripts/globals/status"); ----------------------------------- function onMobSpawn(mob) mob:setLocalVar("hpTrigger", math.random(10,75)); end; function onMobFight(mob,target) local hpTrigger = mob:getLocalVar("hpTrigger"); if (mob:getLocalVar("SoulVoice") == 0 and mob:getHPP() <= hpTrigger) then mob:setLocalVar("SoulVoice", 1); mob:useMobAbility(696); -- Soul Voice end end; function onMonsterMagicPrepare(mob,target) local spellList = { [1] = 382, [2] = 376, [3] = 372, [4] = 392, [5] = 397, [6] = 400, [7] = 422, [8] = 462, [9] = 466 -- Virelai (charm) }; if (mob:hasStatusEffect(dsp.effect.SOUL_VOICE)) then return spellList[math.random(1,9)]; -- Virelai possible. else return spellList[math.random(1,8)]; -- No Virelai! end end; function onMobDeath(mob, player, isKiller) end; function onMobDespawn(mob) mob:setLocalVar("repop", mob:getBattleTime()); -- This get erased on respawn automatic. end;
gpl-3.0
Fenix-XI/Fenix
scripts/zones/Norg/npcs/Vaultimand.lua
13
1036
----------------------------------- -- Area: Norg -- NPC: Vaultimand -- Type: Fame Checker -- @zone: 252 -- @pos -10.839 -1 18.730 -- ----------------------------------- package.loaded["scripts/zones/Norg/TextIDs"] = nil; ----------------------------------- ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) NorgFame = player:getFameLevel(NORG); player:startEvent(0x0064 + (NorgFame - 1)); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end;
gpl-3.0
DarkstarProject/darkstar
scripts/globals/weather.lua
14
1032
----------------------------------- -- Weather Conditions ----------------------------------- dsp = dsp or {} dsp.weather = { NONE = 0, SUNSHINE = 1, CLOUDS = 2, FOG = 3, HOT_SPELL = 4, HEAT_WAVE = 5, RAIN = 6, SQUALL = 7, DUST_STORM = 8, SAND_STORM = 9, WIND = 10, GALES = 11, SNOW = 12, BLIZZARDS = 13, THUNDER = 14, THUNDERSTORMS = 15, AURORAS = 16, STELLAR_GLARE = 17, GLOOM = 18, DARKNESS = 19, } dsp.day = { FIRESDAY = 0, EARTHSDAY = 1, WATERSDAY = 2, WINDSDAY = 3, ICEDAY = 4, LIGHTNINGDAY = 5, LIGHTSDAY = 6, DARKSDAY = 7, } dsp.time = { NONE = 0, MIDNIGHT = 1, NEW_DAY = 2, DAWN = 3, DAY = 4, DUSK = 5, EVENING = 6, NIGHT = 7, }
gpl-3.0
eugeneia/snabbswitch
src/lib/ptree/support/snabb-softwire-v2.lua
3
28126
-- Use of this source code is governed by the Apache 2.0 license; see COPYING. module(..., package.seeall) local ffi = require('ffi') local app = require('core.app') local corelib = require('core.lib') local equal = require('core.lib').equal local dirname = require('core.lib').dirname local data = require('lib.yang.data') local state = require('lib.yang.state') local ipv4_ntop = require('lib.yang.util').ipv4_ntop local ipv6 = require('lib.protocol.ipv6') local yang = require('lib.yang.yang') local ctable = require('lib.ctable') local cltable = require('lib.cltable') local path_mod = require('lib.yang.path') local path_data = require('lib.yang.path_data') local generic = require('lib.ptree.support').generic_schema_config_support local binding_table = require("apps.lwaftr.binding_table") local binding_table_instance local function get_binding_table_instance(conf) if binding_table_instance == nil then binding_table_instance = binding_table.load(conf) end return binding_table_instance end -- Packs snabb-softwire-v2 softwire entry into softwire and PSID blob -- -- The data plane stores a separate table of psid maps and softwires. It -- requires that we give it a blob it can quickly add. These look rather -- similar to snabb-softwire-v1 structures however it maintains the br-address -- on the softwire so are subtly different. local function pack_softwire(app_graph, entry) assert(app_graph.apps['lwaftr']) assert(entry.value.port_set, "Softwire lacks port-set definition") local key, value = entry.key, entry.value -- Get the binding table local bt_conf = app_graph.apps.lwaftr.arg.softwire_config.binding_table bt = get_binding_table_instance(bt_conf) local softwire_t = bt.softwires.entry_type() psid_map_t = bt.psid_map.entry_type() -- Now lets pack the stuff! local packed_softwire = ffi.new(softwire_t) packed_softwire.key.ipv4 = key.ipv4 packed_softwire.key.psid = key.psid packed_softwire.value.b4_ipv6 = value.b4_ipv6 packed_softwire.value.br_address = value.br_address local packed_psid_map = ffi.new(psid_map_t) packed_psid_map.key.addr = key.ipv4 if value.port_set.psid_length then packed_psid_map.value.psid_length = value.port_set.psid_length end return packed_softwire, packed_psid_map end local function add_softwire_entry_actions(app_graph, entries) assert(app_graph.apps['lwaftr']) local bt_conf = app_graph.apps.lwaftr.arg.softwire_config.binding_table local bt = get_binding_table_instance(bt_conf) local ret = {} for entry in entries:iterate() do local psoftwire, ppsid = pack_softwire(app_graph, entry) assert(bt:is_managed_ipv4_address(psoftwire.key.ipv4)) local softwire_args = {'lwaftr', 'add_softwire_entry', psoftwire} table.insert(ret, {'call_app_method_with_blob', softwire_args}) end table.insert(ret, {'commit', {}}) return ret end local softwire_grammar local function get_softwire_grammar() if not softwire_grammar then local schema = yang.load_schema_by_name('snabb-softwire-v2') local grammar = data.config_grammar_from_schema(schema) softwire_grammar = assert(grammar.members['softwire-config']. members['binding-table'].members['softwire']) end return softwire_grammar end local function remove_softwire_entry_actions(app_graph, path) assert(app_graph.apps['lwaftr']) path = path_mod.parse_path(path) local grammar = get_softwire_grammar() local key = path_data.prepare_table_lookup( grammar.keys, grammar.key_ctype, path[#path].query) local args = {'lwaftr', 'remove_softwire_entry', key} -- If it's the last softwire for the corresponding psid entry, remove it. -- TODO: check if last psid entry and then remove. return {{'call_app_method_with_blob', args}, {'commit', {}}} end local function compute_config_actions(old_graph, new_graph, to_restart, verb, path, arg) -- If the binding cable changes, remove our cached version. if path ~= nil and path:match("^/softwire%-config/binding%-table") then binding_table_instance = nil end if verb == 'add' and path == '/softwire-config/binding-table/softwire' then if to_restart == false then return add_softwire_entry_actions(new_graph, arg) end elseif (verb == 'remove' and path:match('^/softwire%-config/binding%-table/softwire')) then return remove_softwire_entry_actions(new_graph, path) elseif (verb == 'set' and path == '/softwire-config/name') then return {} end return generic.compute_config_actions( old_graph, new_graph, to_restart, verb, path, arg) end local function update_mutable_objects_embedded_in_app_initargs( in_place_dependencies, app_graph, schema_name, verb, path, arg) if verb == 'add' and path == '/softwire-config/binding-table/softwire' then return in_place_dependencies elseif (verb == 'remove' and path:match('^/softwire%-config/binding%-table/softwire')) then return in_place_dependencies else return generic.update_mutable_objects_embedded_in_app_initargs( in_place_dependencies, app_graph, schema_name, verb, path, arg) end end local function compute_apps_to_restart_after_configuration_update( schema_name, configuration, verb, path, in_place_dependencies, arg) if verb == 'add' and path == '/softwire-config/binding-table/softwire' then -- We need to check if the softwire defines a new port-set, if so we need to -- restart unfortunately. If not we can just add the softwire. local bt = get_binding_table_instance(configuration.softwire_config.binding_table) local to_restart = false for entry in arg:iterate() do to_restart = (bt:is_managed_ipv4_address(entry.key.ipv4) == false) or false end if to_restart == false then return {} end elseif (verb == 'remove' and path:match('^/softwire%-config/binding%-table/softwire')) then return {} elseif (verb == 'set' and path == '/softwire-config/name') then return {} end return generic.compute_apps_to_restart_after_configuration_update( schema_name, configuration, verb, path, in_place_dependencies, arg) end local function memoize1(f) local memoized_arg, memoized_result return function(arg) if arg == memoized_arg then return memoized_result end memoized_result = f(arg) memoized_arg = arg return memoized_result end end local function cltable_for_grammar(grammar) assert(grammar.key_ctype) assert(not grammar.value_ctype) local key_t = data.typeof(grammar.key_ctype) return cltable.new({key_type=key_t}), key_t end local ietf_br_instance_grammar local function get_ietf_br_instance_grammar() if not ietf_br_instance_grammar then local schema = yang.load_schema_by_name('ietf-softwire-br') local grammar = data.config_grammar_from_schema(schema) grammar = assert(grammar.members['br-instances']) grammar = assert(grammar.members['br-type']) grammar = assert(grammar.choices['binding'].binding) grammar = assert(grammar.members['br-instance']) ietf_br_instance_grammar = grammar end return ietf_br_instance_grammar end local ietf_softwire_grammar local function get_ietf_softwire_grammar() if not ietf_softwire_grammar then local grammar = get_ietf_br_instance_grammar() grammar = assert(grammar.values['binding-table']) grammar = assert(grammar.members['binding-entry']) ietf_softwire_grammar = grammar end return ietf_softwire_grammar end local function ietf_binding_table_from_native(bt) local ret, key_t = cltable_for_grammar(get_ietf_softwire_grammar()) for softwire in bt.softwire:iterate() do local k = key_t({ binding_ipv6info = softwire.value.b4_ipv6 }) local v = { binding_ipv4_addr = softwire.key.ipv4, port_set = { psid_offset = softwire.value.port_set.reserved_ports_bit_count, psid_len = softwire.value.port_set.psid_length, psid = softwire.key.psid }, br_ipv6_addr = softwire.value.br_address, } ret[k] = v end return ret end local function schema_getter(schema_name, path) local schema = yang.load_schema_by_name(schema_name) local grammar = data.config_grammar_from_schema(schema) return path_data.resolver(grammar, path) end local function snabb_softwire_getter(path) return schema_getter('snabb-softwire-v2', path) end local function ietf_softwire_br_getter(path) return schema_getter('ietf-softwire-br', path) end local function native_binding_table_from_ietf(ietf) local _, softwire_grammar = snabb_softwire_getter('/softwire-config/binding-table/softwire') local softwire_key_t = data.typeof(softwire_grammar.key_ctype) local softwire = cltable.new({key_type=softwire_key_t}) for k,v in cltable.pairs(ietf) do local softwire_key = softwire_key_t({ipv4=v.binding_ipv4_addr, psid=v.port_set.psid}) local softwire_value = { br_address=v.br_ipv6_addr, b4_ipv6=k.binding_ipv6info, port_set={ psid_length=v.port_set.psid_len, reserved_ports_bit_count=v.port_set.psid_offset } } cltable.set(softwire, softwire_key, softwire_value) end return {softwire=softwire} end local function serialize_binding_table(bt) local _, grammar = snabb_softwire_getter('/softwire-config/binding-table') local printer = data.data_printer_from_grammar(grammar) return printer(bt, yang.string_io_file()) end local uint64_ptr_t = ffi.typeof('uint64_t*') function ipv6_equals(a, b) local x, y = ffi.cast(uint64_ptr_t, a), ffi.cast(uint64_ptr_t, b) return x[0] == y[0] and x[1] == y[1] end local function ietf_softwire_br_translator () local ret = {} local instance_id_map = {} local cached_config local function instance_id_by_device(device) local last for id, pciaddr in ipairs(instance_id_map) do if pciaddr == device then return id end last = id end if last == nil then last = 1 else last = last + 1 end instance_id_map[last] = device return last end function ret.get_config(native_config) if cached_config ~= nil then return cached_config end local int = native_config.softwire_config.internal_interface local int_err = int.error_rate_limiting local ext = native_config.softwire_config.external_interface local br_instance, br_instance_key_t = cltable_for_grammar(get_ietf_br_instance_grammar()) for device, instance in pairs(native_config.softwire_config.instance) do br_instance[br_instance_key_t({id=instance_id_by_device(device)})] = { name = native_config.softwire_config.name, tunnel_payload_mtu = int.mtu, tunnel_path_mru = ext.mtu, -- FIXME: There's no equivalent of softwire-num-threshold in -- snabb-softwire-v1. softwire_num_threshold = 0xffffffff, enable_hairpinning = int.hairpinning, binding_table = { binding_entry = ietf_binding_table_from_native( native_config.softwire_config.binding_table) }, icmp_policy = { icmpv4_errors = { allow_incoming_icmpv4 = ext.allow_incoming_icmp, generate_icmpv4_errors = ext.generate_icmp_errors }, icmpv6_errors = { generate_icmpv6_errors = int.generate_icmp_errors, icmpv6_errors_rate = math.floor(int_err.packets / int_err.period) } } } end cached_config = { br_instances = { binding = { br_instance = br_instance } } } return cached_config end function ret.get_state(native_state) -- Even though this is a different br-instance node, it is a -- cltable with the same key type, so just re-use the key here. local br_instance, br_instance_key_t = cltable_for_grammar(get_ietf_br_instance_grammar()) for device, instance in pairs(native_state.softwire_config.instance) do local c = instance.softwire_state br_instance[br_instance_key_t({id=instance_id_by_device(device)})] = { traffic_stat = { sent_ipv4_packet = c.out_ipv4_packets, sent_ipv4_byte = c.out_ipv4_bytes, sent_ipv6_packet = c.out_ipv6_packets, sent_ipv6_byte = c.out_ipv6_bytes, rcvd_ipv4_packet = c.in_ipv4_packets, rcvd_ipv4_byte = c.in_ipv4_bytes, rcvd_ipv6_packet = c.in_ipv6_packets, rcvd_ipv6_byte = c.in_ipv6_bytes, dropped_ipv4_packet = c.drop_all_ipv4_iface_packets, dropped_ipv4_byte = c.drop_all_ipv4_iface_bytes, dropped_ipv6_packet = c.drop_all_ipv6_iface_packets, dropped_ipv6_byte = c.drop_all_ipv6_iface_bytes, dropped_ipv4_fragments = 0, -- FIXME dropped_ipv4_bytes = 0, -- FIXME ipv6_fragments_reassembled = c.in_ipv6_frag_reassembled, ipv6_fragments_bytes_reassembled = 0, -- FIXME out_icmpv4_error_packets = c.out_icmpv4_error_packets, out_icmpv6_error_packets = c.out_icmpv6_error_packets, hairpin_ipv4_bytes = c.hairpin_ipv4_bytes, hairpin_ipv4_packets = c.hairpin_ipv4_packets, active_softwire_num = 0, -- FIXME } } end return { br_instances = { binding = { br_instance = br_instance } } } end local function sets_whole_table(path, count) if #path > count then return false end if #path == count then for k,v in pairs(path[#path].query) do return false end end return true end function ret.set_config(native_config, path_str, arg) path = path_mod.parse_path(path_str) local br_instance_paths = {'br-instances', 'binding', 'br-instance'} local bt_paths = {'binding-table', 'binding-entry'} -- Can't actually set the instance itself. if #path <= #br_instance_paths then error("Unspported path: "..path_str) end -- Handle special br attributes (tunnel-payload-mtu, tunnel-path-mru, softwire-num-threshold). if #path > #br_instance_paths then local maybe_leaf = path[#path].name local path_tails = { ['tunnel-payload-mtu'] = 'internal-interface/mtu', ['tunnel-path-mtu'] = 'external-interface/mtu', ['name'] = 'name', ['enable-hairpinning'] = 'internal-interface/hairpinning', ['allow-incoming-icmpv4'] = 'external-interface/allow-incoming-icmp', ['generate-icmpv4-errors'] = 'external-interface/generate-icmp-errors', ['generate-icmpv6-errors'] = 'internal-interface/generate-icmp-errors' } local path_tail = path_tails[maybe_leaf] if path_tail then return {{'set', {schema='snabb-softwire-v2', path='/softwire-config/'..path_tail, config=tostring(arg)}}} elseif maybe_leaf == 'icmpv6-errors-rate' then local head = '/softwire-config/internal-interface/error-rate-limiting' return { {'set', {schema='snabb-softwire-v2', path=head..'/packets', config=tostring(arg * 2)}}, {'set', {schema='snabb-softwire-v2', path=head..'/period', config='2'}}} else error('unrecognized leaf: '..maybe_leaf) end end -- Two kinds of updates: setting the whole binding table, or -- updating one entry. if sets_whole_table(path, #br_instance_paths + #bt_paths) then -- Setting the whole binding table. if sets_whole_table(path, #br_instance_paths) then for i=#path+1,#br_instance_paths do arg = arg[data.normalize_id(br_instance_paths[i])] end local instance for k,v in cltable.pairs(arg) do if instance then error('multiple instances in config') end if k.id ~= 1 then error('instance id not 1: '..tostring(k.id)) end instance = v end if not instance then error('no instances in config') end arg = instance end for i=math.max(#path-#br_instance_paths,0)+1,#bt_paths do arg = arg[data.normalize_id(bt_paths[i])] end local bt = native_binding_table_from_ietf(arg) return {{'set', {schema='snabb-softwire-v2', path='/softwire-config/binding-table', config=serialize_binding_table(bt)}}} else -- An update to an existing entry. First, get the existing entry. local config = ret.get_config(native_config) local entry_path = path_str local entry_path_len = #br_instance_paths + #bt_paths for i=entry_path_len+1, #path do entry_path = dirname(entry_path) end local old = ietf_softwire_br_getter(entry_path)(config) -- Now figure out what the new entry should look like. local new if #path == entry_path_len then new = arg else new = { port_set = { psid_offset = old.port_set.psid_offset, psid_len = old.port_set.psid_len, psid = old.port_set.psid }, binding_ipv4_addr = old.binding_ipv4_addr, br_ipv6_addr = old.br_ipv6_addr } if path[entry_path_len + 1].name == 'port-set' then if #path == entry_path_len + 1 then new.port_set = arg else local k = data.normalize_id(path[#path].name) new.port_set[k] = arg end elseif path[#path].name == 'binding-ipv4-addr' then new.binding_ipv4_addr = arg elseif path[#path].name == 'br-ipv6-addr' then new.br_ipv6_addr = arg else error('bad path element: '..path[#path].name) end end -- Apply changes. Ensure that the port-set -- changes are compatible with the existing configuration. local updates = {} local softwire_path = '/softwire-config/binding-table/softwire' -- Lets remove this softwire entry and add a new one. local function q(ipv4, psid) return string.format('[ipv4=%s][psid=%s]', ipv4_ntop(ipv4), psid) end local old_query = q(old.binding_ipv4_addr, old.port_set.psid) -- FIXME: This remove will succeed but the add could fail if -- there's already a softwire with this IPv4 and PSID. We need -- to add a check here that the IPv4/PSID is not present in the -- binding table. table.insert(updates, {'remove', {schema='snabb-softwire-v2', path=softwire_path..old_query}}) local config_str = string.format([[{ ipv4 %s; psid %s; br-address %s; b4-ipv6 %s; port-set { psid-length %s; reserved-ports-bit-count %s; } }]], ipv4_ntop(new.binding_ipv4_addr), new.port_set.psid, ipv6:ntop(new.br_ipv6_addr), path[entry_path_len].query['binding-ipv6info'], new.port_set.psid_len, new.port_set.psid_offset) table.insert(updates, {'add', {schema='snabb-softwire-v2', path=softwire_path, config=config_str}}) return updates end end function ret.add_config(native_config, path_str, data) local binding_entry_path = {'br-instances', 'binding', 'br-instance', 'binding-table', 'binding-entry'} local path = path_mod.parse_path(path_str) if #path ~= #binding_entry_path then error('unsupported path: '..path) end local config = ret.get_config(native_config) local ietf_bt = ietf_softwire_br_getter(path_str)(config) local old_bt = native_config.softwire_config.binding_table local new_bt = native_binding_table_from_ietf(data) local updates = {} local softwire_path = '/softwire-config/binding-table/softwire' local psid_map_path = '/softwire-config/binding-table/psid-map' -- Add softwires. local additions = {} for entry in new_bt.softwire:iterate() do local key, value = entry.key, entry.value if old_bt.softwire:lookup_ptr(key) ~= nil then error('softwire already present in table: '.. inet_ntop(key.ipv4)..'/'..key.psid) end local config_str = string.format([[{ ipv4 %s; psid %s; br-address %s; b4-ipv6 %s; port-set { psid-length %s; reserved-ports-bit-count %s; } }]], ipv4_ntop(key.ipv4), key.psid, ipv6:ntop(value.br_address), ipv6:ntop(value.b4_ipv6), value.port_set.psid_length, value.port_set.reserved_ports_bit_count ) table.insert(additions, config_str) end table.insert(updates, {'add', {schema='snabb-softwire-v2', path=softwire_path, config=table.concat(additions, '\n')}}) return updates end function ret.remove_config(native_config, path_str) local path = path_mod.parse_path(path_str) local ietf_binding_table_path = {'softwire-config', 'binding', 'br', 'br-instances', 'br-instance', 'binding-table'} local ietf_instance_path = {'softwire-config', 'binding', 'br', 'br-instances', 'br-instance'} if #path == #ietf_instance_path then -- Remove appropriate instance local ietf_instance_id = tonumber(assert(path[5].query).id) local instance_path = "/softwire-config/instance" -- If it's not been populated in instance_id_map this is meaningless -- and dangerous as they have no mapping from snabb's "device". local function q(device) return string.format("[device=%s]", device) end local device = instance_id_map[ietf_instance_id] if device then return {{'remove', {schema='snabb-softwire-v2', path=instance_path..q(device)}}} else error(string.format( "Could not find '%s' in ietf instance mapping", ietf_instance_id )) end elseif #path == #ietf_binding_table_path then local softwire_path = '/softwire-config/binding-table/softwire' if path:sub(-1) ~= ']' then error('unsupported path: '..path_str) end local config = ret.get_config(native_config) local entry = ietf_softwire_getter(path_str)(config) local function q(ipv4, psid) return string.format('[ipv4=%s][psid=%s]', ipv4_ntop(ipv4), psid) end local query = q(entry.binding_ipv4_addr, entry.port_set.psid) return {{'remove', {schema='snabb-softwire-v2', path=softwire_path..query}}} else return error('unsupported path: '..path_str) end end function ret.pre_update(native_config, verb, path, data) -- Given the notification that the native config is about to be -- updated, make our cached config follow along if possible (and -- if we have one). Otherwise throw away our cached config; we'll -- re-make it next time. if cached_config == nil then return end local br_instance = cached_config.br_instances.binding.br_instance if (verb == 'remove' and path:match('^/softwire%-config/binding%-table/softwire')) then -- Remove a softwire. local value = snabb_softwire_getter(path)(native_config) for _,instance in cltable.pairs(br_instance) do local grammar = get_ietf_softwire_grammar() local key = path_data.prepare_table_lookup( grammar.keys, grammar.key_ctype, {['binding-ipv6info']='::'}) key.binding_ipv6info = value.b4_ipv6 assert(instance.binding_table.binding_entry[key] ~= nil) instance.binding_table.binding_entry[key] = nil end elseif (verb == 'add' and path == '/softwire-config/binding-table/softwire') then local bt = native_config.softwire_config.binding_table for k,v in cltable.pairs( ietf_binding_table_from_native({softwire = data})) do for _,instance in cltable.pairs(br_instance) do instance.binding_table.binding_entry[k] = v end end elseif (verb == 'set' and path == "/softwire-config/name") then local br = cached_config.softwire_config.binding.br for _, instance in cltable.pairs(br_instance) do instance.name = data end else cached_config = nil end end return ret end local function configuration_for_worker(worker, configuration) return worker.graph.apps.lwaftr.arg end local function compute_state_reader(schema_name) -- The schema has two lists which we want to look in. local schema = yang.load_schema_by_name(schema_name) local grammar = data.data_grammar_from_schema(schema, false) local instance_list_gmr = grammar.members["softwire-config"].members.instance local instance_state_gmr = instance_list_gmr.values["softwire-state"] local base_reader = state.state_reader_from_grammar(grammar) local instance_state_reader = state.state_reader_from_grammar(instance_state_gmr) return function(pid, data) local counters = state.counters_for_pid(pid) local ret = base_reader(counters) ret.softwire_config.instance = {} for device, instance in pairs(data.softwire_config.instance) do local instance_state = instance_state_reader(counters) ret.softwire_config.instance[device] = {} ret.softwire_config.instance[device].softwire_state = instance_state end return ret end end local function process_states(states) -- We need to create a summation of all the states as well as adding all the -- instance specific state data to create a total in software-state. local unified = { softwire_config = {instance = {}}, softwire_state = {} } local function total_counter(name, softwire_stats, value) if softwire_stats[name] == nil then return value else return softwire_stats[name] + value end end for _, inst_config in ipairs(states) do local name, instance = next(inst_config.softwire_config.instance) unified.softwire_config.instance[name] = instance for name, value in pairs(instance.softwire_state) do unified.softwire_state[name] = total_counter( name, unified.softwire_state, value) end end return unified end function get_config_support() return { compute_config_actions = compute_config_actions, update_mutable_objects_embedded_in_app_initargs = update_mutable_objects_embedded_in_app_initargs, compute_apps_to_restart_after_configuration_update = compute_apps_to_restart_after_configuration_update, compute_state_reader = compute_state_reader, process_states = process_states, configuration_for_worker = configuration_for_worker, translators = { ['ietf-softwire-br'] = ietf_softwire_br_translator () } } end
apache-2.0
DarkstarProject/darkstar
scripts/zones/Bastok_Markets/npcs/Zaira.lua
12
1150
----------------------------------- -- Area: Batok Markets -- NPC: Zaira -- Standard Merchant NPC -- !pos -217.316 -2.824 49.235 235 ----------------------------------- local ID = require("scripts/zones/Bastok_Markets/IDs") require("scripts/globals/shop") function onTrigger(player,npc) local stock = { 4862, 114, 1, -- Scroll of Blind 4838, 360, 2, -- Scroll of Bio 4828, 82, 2, -- Scroll of Poison 4861, 2250, 2, -- Scroll of Sleep 4767, 61, 3, -- Scroll of Stone 4777, 140, 3, -- Scroll of Water 4762, 324, 3, -- Scroll of Aero 4752, 837, 3, -- Scroll of Fire 4757, 1584, 3, -- Scroll of Blizzard 4772, 3261, 3, -- Scroll of Thunder 4847, 1363, 3, -- Scroll of Shock 4846, 1827, 3, -- Scroll of Rasp 4845, 2250, 3, -- Scroll of Choke 4844, 3688, 3, -- Scroll of Frost 4843, 4644, 3, -- Scroll of Burn 4848, 6366, 3, -- Scroll of Drown } player:showText(npc, ID.text.ZAIRA_SHOP_DIALOG) dsp.shop.nation(player, stock, dsp.nation.BASTOK) end
gpl-3.0
oTibia/UnderLight-AK47
data/actions/scripts/liquids/great_spirit.lua
2
1850
local HEALTH_REGEN = {200, 400} --min 200, max 400 local MANA_REGEN = {100, 200} --min 100, max 200 local EMPTY_POTION = 7635 local combatHealth = createCombatObject() setCombatParam(combatHealth, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combatHealth, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combatHealth, COMBAT_PARAM_TARGETCASTERORTOPMOST, true) setCombatParam(combatHealth, COMBAT_PARAM_AGGRESSIVE, false) setCombatParam(combatHealth, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) setCombatFormula(combatHealth, COMBAT_FORMULA_DAMAGE, HEALTH_REGEN[1], 0, HEALTH_REGEN[2], 0) local combatMana = createCombatObject() setCombatParam(combatMana, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN) setCombatParam(combatMana, COMBAT_PARAM_TARGETCASTERORTOPMOST, true) setCombatParam(combatMana, COMBAT_PARAM_AGGRESSIVE, false) setCombatFormula(combatMana, COMBAT_FORMULA_DAMAGE, MANA_REGEN[1], 0, MANA_REGEN[2], 0) local exhaust = createConditionObject(CONDITION_EXHAUST_POTION) setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('minactionexinterval')) function onUse(cid, item, frompos, item2, topos) if(isPlayer(item2.uid) == false)then return false end if(hasCondition(cid, CONDITION_EXHAUST_POTION) ) then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED) return true end if (not(isPaladin(cid)) or (getPlayerLevel(cid) < 80)) and not(getPlayerAccess(cid) > 0) then doCreatureSay(cid, "Only paladins of level 80 or above may drink this fluid.", TALKTYPE_ORANGE_1) return true end local var = numberToVariant(item2.uid) if not doCombat(cid, combatHealth, var) or not doCombat(cid, combatMana, var) then return false end doAddCondition(cid, exhaust) doCreatureSay(item2.uid, "Aaaah...", TALKTYPE_ORANGE_1) doRemoveItem(item.uid, 1) doPlayerAddItem(cid, EMPTY_POTION, 1) return true end
gpl-2.0
DarkstarProject/darkstar
scripts/zones/Mhaura/npcs/Dieh_Yamilsiah.lua
12
1612
----------------------------------- -- Area: Mhaura -- NPC: Dieh Yamilsiah -- Reports the time remaining before boat arrival. -- !pos 7.057 -2.364 2.489 249 ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) -- Each boat comes every 1152 seconds/8 game hours, 4 hour offset between Selbina and Aht Urghan -- Original timer: local timer = 1152 - ((os.time() - 1009810584)%1152); local timer = 1152 - ((os.time() - 1009810802)%1152); local destination = 0; -- Selbina, set to 1 for Al Zhabi local direction = 0; -- Arrive, 1 for depart local waiting = 216; -- Offset for Selbina -- Next ferry is Al Zhabi for higher values. if (timer >= 576) then destination = 1; timer = timer - 576; waiting = 193; end -- Logic to manipulate cutscene results. if (timer <= waiting) then direction = 1; -- Ship arrived, switch dialog from "arrive" to "depart" else timer = timer - waiting; -- Ship hasn't arrived, subtract waiting time to get time to arrival end player:startEvent(231,timer,direction,0,destination); -- timer arriving/departing ??? destination --[[Other cutscenes: 233 "This ship is headed for Selbina." 234 "The Selbina ferry will deparrrt soon! Passengers are to board the ship immediately!" Can't find a way to toggle the destination on 233 or 234, so they are not used. Users knowing which ferry is which > using all CSs.]] end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) end;
gpl-3.0
Fenix-XI/Fenix
scripts/zones/Carpenters_Landing/npcs/relic.lua
13
1860
----------------------------------- -- Area: Carpenter's Landing -- NPC: <this space intentionally left blank> -- @pos -99 -0 -514 2 ----------------------------------- package.loaded["scripts/zones/Carpenters_Landing/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Carpenters_Landing/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) -- Working on correct relic, 4 items, Stage 4 item, Shard, Necropsyche, currencypiece if (player:getVar("RELIC_IN_PROGRESS") == 15069 and trade:getItemCount() == 4 and trade:hasItemQty(15069,1) and trade:hasItemQty(1822,1) and trade:hasItemQty(1589,1) and trade:hasItemQty(1454,1)) then player:startEvent(44,15070); end end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) player:messageSpecial(NOTHING_OUT_OF_ORDINARY); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); if (csid == 44) then if (player:getFreeSlotsCount() < 2) then player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,15070); player:messageSpecial(FULL_INVENTORY_AFTER_TRADE,1453); else player:tradeComplete(); player:addItem(15070); player:addItem(1453,30); player:messageSpecial(ITEM_OBTAINED,15070); player:messageSpecial(ITEMS_OBTAINED,1453,30); player:setVar("RELIC_IN_PROGRESS",0); end end end;
gpl-3.0
Fenix-XI/Fenix
scripts/globals/spells/bluemagic/heat_breath.lua
25
1751
----------------------------------------- -- Spell: Heat Breath -- Deals fire damage to enemies within a fan-shaped area originating from the caster -- Spell cost: 169 MP -- Monster Type: Beasts -- Spell Type: Magical (Fire) -- Blue Magic Points: 4 -- Stat Bonus: STR+3 -- Level: 71 -- Casting Time: 7.5 seconds -- Recast Time: 49 seconds -- Magic Bursts on: Liquefaction, Fusion, Light -- Combos: Magic Attack Bonus ----------------------------------------- require("scripts/globals/magic"); require("scripts/globals/status"); require("scripts/globals/bluemagic"); ----------------------------------------- -- OnMagicCastingCheck ----------------------------------------- function onMagicCastingCheck(caster,target,spell) return 0; end; ----------------------------------------- -- OnSpellCast ----------------------------------------- function onSpellCast(caster,target,spell) local multi = 6.38; local resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT) - target:getStat(MOD_INT),BLUE_SKILL,1.0); local params = {}; -- This data should match information on http://wiki.ffxiclopedia.org/wiki/Calculating_Blue_Magic_Damage params.multiplier = multi; params.tMultiplier = 1.5; params.duppercap = 69; params.str_wsc = 0.0; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.3; params.chr_wsc = 0.0; damage = BlueMagicalSpell(caster, target, spell, params, MND_BASED); damage = BlueFinalAdjustments(caster, target, spell, damage, params); if (caster:hasStatusEffect(EFFECT_AZURE_LORE)) then multi = multi + 0.50; end return damage; end;
gpl-3.0
alonikomax/RocketUp
rocket/rocket.lua
1
2310
-- rocket.lua require "rocket/tank" require "rocket/engine" local anim8 = require "liberies/anim8" -- Properties -- Static -- image => the rocket image -- dynamic -- x,y => cords -- xyvel = 0 Rocket = {} Rocket.__index = Rocket local ANGACCEL = 4 setmetatable(Rocket, { __call = function (cls, ...) local self = setmetatable({}, cls) self:_init(...) return self end, }) -- -- image = love.image type == default is nil -- x,y of top left == default is 0 -- function Rocket:_init(image, x, y, world, firePNG) self.image = image self.firePNG =firePNG self.body = love.physics.newBody( world, x, y, "dynamic" ) self.shape = love.physics.newRectangleShape( self.image:getWidth(), self.image:getHeight() ) self.fixture = love.physics.newFixture( self.body, self.shape, 1 ) self.tank = Tank() self.engine = Engine() local g16 = anim8.newGrid(16, 16, firePNG:getWidth(), firePNG:getHeight()) self.fireAnimation = anim8.newAnimation(g16('1-5',1), 0.1) end function Rocket:update(dt) velx, vely = self.body:getLinearVelocity( ) if vely <= 25 then accs = self.engine:use(self.tank) local angle = self.body:getAngle() local xf = math.cos(angle) * accs local yf = math.sin(angle) * accs self.body:applyForce(yf, -xf) end if self.tank then self.tank:update() end if self.needToTurnLeft then self:left(dt) end if self.needToTurnRight then self:right(dt) end self.fireAnimation:update(dt) end function Rocket:right(dt) -- rotate clockwise self.body:applyTorque(10000) end function Rocket:left(dt) -- rotate unclockwise self.body:applyTorque(-10000) end function Rocket:touchpressed(id, x) width = love.graphics.getWidth() if x <= width/2 then self.needToTurnLeft = true else self.needToTurnRight = true end end function Rocket:touchreleased(id) self.needToTurnLeft = false self.needToTurnRight = false end function Rocket:draw() love.graphics.setColor(255, 255, 255, 255) add1,add2 = self.body:getWorldCenter() love.graphics.draw(self.image,add1,add2,self.body:getAngle(),1,1,self.image:getWidth()/2,self.image:getHeight()/2) self.fireAnimation:draw(self.firePNG,add1,add2,self.body:getAngle(),2,2,self.image:getWidth()/8-2,-(self.image:getHeight()/4-4)) if self.tank then self.tank:draw() end end
mit
DarkstarProject/darkstar
scripts/zones/Windurst_Walls/npcs/Rutango-Botango.lua
9
1992
----------------------------------- -- Area: Windurst Walls -- Location: X:-92 Y:-9 Z:107 -- NPC: Rutango-Botango -- Working 100% -- Involved in Quest: To Bee or Not to Bee? ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/quests"); ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) local ToBee = player:getQuestStatus(WINDURST,dsp.quest.id.windurst.TO_BEE_OR_NOT_TO_BEE); local ToBeeOrNotStatus = player:getCharVar("ToBeeOrNot_var"); if (ToBeeOrNotStatus == 10) then player:startEvent(65); -- During Too Bee quest before honey given to Zayhi: "Oh Crumb...lost his voice" elseif (ToBee == QUEST_ACCEPTED and ToBeeOrNotStatus > 0) then player:startEvent(71); -- During Too Bee quest after some honey was given to Zayhi: "lap up more honey" elseif (ToBee == QUEST_COMPLETED and player:needToZone()) then player:startEvent(76); -- After Too Bee quest but before zone: "master let me speak for you" else player:startEvent(297); -- Standard Conversation end end; -- CS/Event ID List for NPC -- *Rutango-Botango CS 443 - player:startEvent(443); -- Long Star Sybil CS -- Rutango-Botango CS 297 - player:startEvent(297); -- Standard Conversation -- *Rutango-Botango CS 64 - player:startEvent(64); -- Zayhi Coughing -- Rutango-Botango CS 65 - player:startEvent(65); -- During Too Bee quest before honey given to Zayhi: "Oh Crumb...lost his voice" -- Rutango-Botango CS 71 - player:startEvent(71); -- During Too Bee quest after some honey was given to Zayhi: "lap up more honey" -- *Rutango-Botango CS 75 - player:startEvent(75); -- Combo CS: During Too Bee quest, kicked off from Zayhi -- Rutango-Botango CS 76 - player:startEvent(76); -- After Too Bee quest but before zone: "master let me speak for you" function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) end;
gpl-3.0
Fenix-XI/Fenix
scripts/globals/items/serving_of_monastic_sautee.lua
18
1312
----------------------------------------- -- ID: 4293 -- Item: serving_of_monastic_sautee -- Food Effect: 240Min, All Races ----------------------------------------- -- Agility 1 -- Ranged ACC % 7 -- Ranged ACC Cap 20 ----------------------------------------- require("scripts/globals/status"); ----------------------------------------- -- OnItemCheck ----------------------------------------- function onItemCheck(target) local result = 0; if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then result = 246; end return result; end; ----------------------------------------- -- OnItemUse ----------------------------------------- function onItemUse(target) target:addStatusEffect(EFFECT_FOOD,0,0,14400,4293); end; ----------------------------------- -- onEffectGain Action ----------------------------------- function onEffectGain(target,effect) target:addMod(MOD_AGI, 1); target:addMod(MOD_FOOD_RACCP, 7); target:addMod(MOD_FOOD_RACC_CAP, 20); end; ----------------------------------------- -- onEffectLose Action ----------------------------------------- function onEffectLose(target,effect) target:delMod(MOD_AGI, 1); target:delMod(MOD_FOOD_RACCP, 7); target:delMod(MOD_FOOD_RACC_CAP, 20); end;
gpl-3.0
Fenix-XI/Fenix
scripts/zones/Wajaom_Woodlands/npcs/qm4.lua
30
1337
----------------------------------- -- Area: Wajaom Woodlands -- NPC: ??? (Spawn Tinnin(ZNM T4)) -- @pos 278 0 -703 51 ----------------------------------- package.loaded["scripts/zones/Wajaom_Woodlands/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Wajaom_Woodlands/TextIDs"); require("scripts/globals/status"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) local mobID = 16986431; if (trade:hasItemQty(2573,1) and trade:getItemCount() == 1) then -- Trade Monkey wine if (GetMobAction(mobID) == ACTION_NONE) then player:tradeComplete(); SpawnMob(mobID):updateClaim(player); end end end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) player:messageSpecial(NOTHING_HAPPENS); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end;
gpl-3.0
Fenix-XI/Fenix
scripts/zones/Bastok_Mines/npcs/Gumbah.lua
13
2134
----------------------------------- -- Area: Bastok Mines -- NPC: Gumbah -- Finishes Quest: Blade of Darkness ----------------------------------- package.loaded["scripts/zones/Bastok_Mines/TextIDs"] = nil; ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/keyitems"); require("scripts/globals/quests"); require("scripts/zones/Bastok_Mines/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) local bladeDarkness = player:getQuestStatus(BASTOK, BLADE_OF_DARKNESS); if (player:getMainLvl() >= ADVANCED_JOB_LEVEL and bladeDarkness == QUEST_AVAILABLE) then --DARK KNIGHT QUEST player:startEvent(0x0063); elseif (bladeDarkness == QUEST_COMPLETED and player:getQuestStatus(BASTOK,BLADE_OF_DEATH) == QUEST_AVAILABLE) then player:startEvent(0x0082); elseif ((player:hasCompletedMission(BASTOK, ON_MY_WAY) == true) or ((player:getCurrentMission(BASTOK) == ON_MY_WAY) and (player:getVar("MissionStatus") == 3))) and (player:getVar("[B7-2]Werei") == 0) then player:startEvent(0x00b1); else --DEFAULT player:startEvent(0x0034); end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); if (csid == 0x0063) then player:addQuest(BASTOK, BLADE_OF_DARKNESS); elseif (csid == 0x0082) then player:addQuest(BASTOK, BLADE_OF_DEATH); player:addKeyItem(LETTER_FROM_ZEID); player:messageSpecial(KEYITEM_OBTAINED,LETTER_FROM_ZEID); elseif (csid == 0x00b1) then player:setVar("[B7-2]Werei", 1); end end;
gpl-3.0
L3E8S0S6E5N1OA5N6D3T8W5O/4568584657657
plugins/stats.lua
49
3698
do local NUM_MSG_MAX = 4 local TIME_CHECK = 4 -- seconds local function user_print_name(user) if user.print_name then return user.print_name end local text = '' if user.first_name then text = user.last_name..' ' end if user.lastname then text = text..user.last_name end return text end -- Returns a table with `name` and `msgs` local function get_msgs_user_chat(user_id, chat_id) local user_info = {} local uhash = 'user:'..user_id local user = redis:hgetall(uhash) local um_hash = 'msgs:'..user_id..':'..chat_id user_info.msgs = tonumber(redis:get(um_hash) or 0) user_info.name = user_print_name(user)..'👤|'..user_id..'|🗣' return user_info end local function chat_stats(chat_id) -- Users on chat local hash = 'chat:'..chat_id..':users' local users = redis:smembers(hash) local users_info = {} -- Get user info for i = 1, #users do local user_id = users[i] local user_info = get_msgs_user_chat(user_id, chat_id) table.insert(users_info, user_info) end -- Sort users by msgs number table.sort(users_info, function(a, b) if a.msgs and b.msgs then return a.msgs > b.msgs end end) local text = '' for k,user in pairs(users_info) do text = text..user.name..' => '..user.msgs..'\n-----------' end return text end -- Save stats, ban user local function pre_process(msg) -- Ignore service msg if msg.service then print('Service message') return msg end -- Save user on Redis if msg.from.type == 'user' then local hash = 'user:'..msg.from.id print('Saving user', hash) if msg.from.print_name then redis:hset(hash, 'print_name', msg.from.print_name) end if msg.from.first_name then redis:hset(hash, 'first_name', msg.from.first_name) end if msg.from.last_name then redis:hset(hash, 'last_name', msg.from.last_name) end end -- Save stats on Redis if msg.to.type == 'chat' then -- User is on chat local hash = 'chat:'..msg.to.id..':users' redis:sadd(hash, msg.from.id) end -- Total user msgs local hash = 'msgs:'..msg.from.id..':'..msg.to.id redis:incr(hash) -- Check flood local kick = chat_del_user(chat_id , user_id, ok_cb, true) vardump(kick) if msg.from.type == 'user' then local hash = 'user:'..msg.from.id..':msgs' local msgs = tonumber(redis:get(hash) or 0) if msgs > NUM_MSG_MAX then chat_del_user('chat#id'..msg.to.id,'user#id'..msg.from.id,ok_cb,false) print('User '..msg.from.id..'is flooding '..msgs) msg = nil end redis:setex(hash, TIME_CHECK, msgs+1) end return msg end local function bot_stats() local redis_scan = [[ local cursor = '0' local count = 0 repeat local r = redis.call("SCAN", cursor, "MATCH", KEYS[1]) cursor = r[1] count = count + #r[2] until cursor == '0' return count]] -- Users local hash = 'msgs:*:'..our_id local r = redis:eval(redis_scan, 1, hash) local text = 'Users: '..r hash = 'chat:*:users' r = redis:eval(redis_scan, 1, hash) text = text..'\nChats: '..r return text end local function run(msg, matches) if matches[1]:lower() == "stats" then if not matches[2] then if msg.to.type == 'chat' then local chat_id = msg.to.id return chat_stats(chat_id) else return 'Stats works only on chats' end end if matches[2] == "bot" then if not is_sudo(msg) then return "Bot stats requires privileged user" else return bot_stats() end end if matches[2] == "chat" then if not is_sudo(msg) then return "This command requires privileged user" else return chat_stats(matches[3]) end end end end return { description = "Plugin to update user stats.", usage = { "!stats: Returns a list of Username [telegram_id]: msg_num", "!stats chat <chat_id>: Show stats for chat_id", "!stats bot: Shows bot stats (sudo users)" }, patterns = { "^!([Ss]tats)$", "^!([Ss]tats) (chat) (%d+)", "^!([Ss]tats) (bot)" }, run = run, pre_process = pre_process } end
gpl-2.0
ld-test/bump
bump.lua
15
21321
local bump = { _VERSION = 'bump v3.1.5', _URL = 'https://github.com/kikito/bump.lua', _DESCRIPTION = 'A collision detection library for Lua', _LICENSE = [[ MIT LICENSE Copyright (c) 2014 Enrique García Cota Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ]] } ------------------------------------------ -- Auxiliary functions ------------------------------------------ local DELTA = 1e-10 -- floating-point margin of error local abs, floor, ceil, min, max = math.abs, math.floor, math.ceil, math.min, math.max local function sign(x) if x > 0 then return 1 end if x == 0 then return 0 end return -1 end local function nearest(x, a, b) if abs(a - x) < abs(b - x) then return a else return b end end local function assertType(desiredType, value, name) if type(value) ~= desiredType then error(name .. ' must be a ' .. desiredType .. ', but was ' .. tostring(value) .. '(a ' .. type(value) .. ')') end end local function assertIsPositiveNumber(value, name) if type(value) ~= 'number' or value <= 0 then error(name .. ' must be a positive integer, but was ' .. tostring(value) .. '(' .. type(value) .. ')') end end local function assertIsRect(x,y,w,h) assertType('number', x, 'x') assertType('number', y, 'y') assertIsPositiveNumber(w, 'w') assertIsPositiveNumber(h, 'h') end local defaultFilter = function() return 'slide' end ------------------------------------------ -- Rectangle functions ------------------------------------------ local function rect_getNearestCorner(x,y,w,h, px, py) return nearest(px, x, x+w), nearest(py, y, y+h) end -- This is a generalized implementation of the liang-barsky algorithm, which also returns -- the normals of the sides where the segment intersects. -- Returns nil if the segment never touches the rect -- Notice that normals are only guaranteed to be accurate when initially ti1, ti2 == -math.huge, math.huge local function rect_getSegmentIntersectionIndices(x,y,w,h, x1,y1,x2,y2, ti1,ti2) ti1, ti2 = ti1 or 0, ti2 or 1 local dx, dy = x2-x1, y2-y1 local nx, ny local nx1, ny1, nx2, ny2 = 0,0,0,0 local p, q, r for side = 1,4 do if side == 1 then nx,ny,p,q = -1, 0, -dx, x1 - x -- left elseif side == 2 then nx,ny,p,q = 1, 0, dx, x + w - x1 -- right elseif side == 3 then nx,ny,p,q = 0, -1, -dy, y1 - y -- top else nx,ny,p,q = 0, 1, dy, y + h - y1 -- bottom end if p == 0 then if q <= 0 then return nil end else r = q / p if p < 0 then if r > ti2 then return nil elseif r > ti1 then ti1,nx1,ny1 = r,nx,ny end else -- p > 0 if r < ti1 then return nil elseif r < ti2 then ti2,nx2,ny2 = r,nx,ny end end end end return ti1,ti2, nx1,ny1, nx2,ny2 end -- Calculates the minkowsky difference between 2 rects, which is another rect local function rect_getDiff(x1,y1,w1,h1, x2,y2,w2,h2) return x2 - x1 - w1, y2 - y1 - h1, w1 + w2, h1 + h2 end local function rect_containsPoint(x,y,w,h, px,py) return px - x > DELTA and py - y > DELTA and x + w - px > DELTA and y + h - py > DELTA end local function rect_isIntersecting(x1,y1,w1,h1, x2,y2,w2,h2) return x1 < x2+w2 and x2 < x1+w1 and y1 < y2+h2 and y2 < y1+h1 end local function rect_getSquareDistance(x1,y1,w1,h1, x2,y2,w2,h2) local dx = x1 - x2 + (w1 - w2)/2 local dy = y1 - y2 + (h1 - h2)/2 return dx*dx + dy*dy end local function rect_detectCollision(x1,y1,w1,h1, x2,y2,w2,h2, goalX, goalY) goalX = goalX or x1 goalY = goalY or y1 local dx, dy = goalX - x1, goalY - y1 local x,y,w,h = rect_getDiff(x1,y1,w1,h1, x2,y2,w2,h2) local overlaps, ti, nx, ny if rect_containsPoint(x,y,w,h, 0,0) then -- item was intersecting other local px, py = rect_getNearestCorner(x,y,w,h, 0, 0) local wi, hi = min(w1, abs(px)), min(h1, abs(py)) -- area of intersection ti = -wi * hi -- ti is the negative area of intersection overlaps = true else local ti1,ti2,nx1,ny1 = rect_getSegmentIntersectionIndices(x,y,w,h, 0,0,dx,dy, -math.huge, math.huge) -- item tunnels into other if ti1 and ti1 < 1 and (0 < ti1 + DELTA or 0 == ti1 and ti2 > 0) then ti, nx, ny = ti1, nx1, ny1 overlaps = false end end if not ti then return end local tx, ty if overlaps then if dx == 0 and dy == 0 then -- intersecting and not moving - use minimum displacement vector local px, py = rect_getNearestCorner(x,y,w,h, 0,0) if abs(px) < abs(py) then py = 0 else px = 0 end nx, ny = sign(px), sign(py) tx, ty = x1 + px, y1 + py else -- intersecting and moving - move in the opposite direction local ti1, _ ti1,_,nx,ny = rect_getSegmentIntersectionIndices(x,y,w,h, 0,0,dx,dy, -math.huge, 1) if not ti1 then return end tx, ty = x1 + dx * ti1, y1 + dy * ti1 end else -- tunnel tx, ty = x1 + dx * ti, y1 + dy * ti end return { overlaps = overlaps, ti = ti, move = {x = dx, y = dy}, normal = {x = nx, y = ny}, touch = {x = tx, y = ty}, itemRect = {x = x1, y = y1, w = w1, h = h1}, otherRect = {x = x2, y = y2, w = w2, h = h2} } end ------------------------------------------ -- Grid functions ------------------------------------------ local function grid_toWorld(cellSize, cx, cy) return (cx - 1)*cellSize, (cy-1)*cellSize end local function grid_toCell(cellSize, x, y) return floor(x / cellSize) + 1, floor(y / cellSize) + 1 end -- grid_traverse* functions are based on "A Fast Voxel Traversal Algorithm for Ray Tracing", -- by John Amanides and Andrew Woo - http://www.cse.yorku.ca/~amana/research/grid.pdf -- It has been modified to include both cells when the ray "touches a grid corner", -- and with a different exit condition local function grid_traverse_initStep(cellSize, ct, t1, t2) local v = t2 - t1 if v > 0 then return 1, cellSize / v, ((ct + v) * cellSize - t1) / v elseif v < 0 then return -1, -cellSize / v, ((ct + v - 1) * cellSize - t1) / v else return 0, math.huge, math.huge end end local function grid_traverse(cellSize, x1,y1,x2,y2, f) local cx1,cy1 = grid_toCell(cellSize, x1,y1) local cx2,cy2 = grid_toCell(cellSize, x2,y2) local stepX, dx, tx = grid_traverse_initStep(cellSize, cx1, x1, x2) local stepY, dy, ty = grid_traverse_initStep(cellSize, cy1, y1, y2) local cx,cy = cx1,cy1 f(cx, cy) -- The default implementation had an infinite loop problem when -- approaching the last cell in some occassions. We finish iterating -- when we are *next* to the last cell while abs(cx - cx2) + abs(cy - cy2) > 1 do if tx < ty then tx, cx = tx + dx, cx + stepX f(cx, cy) else -- Addition: include both cells when going through corners if tx == ty then f(cx + stepX, cy) end ty, cy = ty + dy, cy + stepY f(cx, cy) end end -- If we have not arrived to the last cell, use it if cx ~= cx2 or cy ~= cy2 then f(cx2, cy2) end end local function grid_toCellRect(cellSize, x,y,w,h) local cx,cy = grid_toCell(cellSize, x, y) local cr,cb = ceil((x+w) / cellSize), ceil((y+h) / cellSize) return cx, cy, cr - cx + 1, cb - cy + 1 end ------------------------------------------ -- Responses ------------------------------------------ local touch = function(world, col, x,y,w,h, goalX, goalY, filter) return col.touch.x, col.touch.y, {}, 0 end local cross = function(world, col, x,y,w,h, goalX, goalY, filter) local cols, len = world:project(col.item, x,y,w,h, goalX, goalY, filter) return goalX, goalY, cols, len end local slide = function(world, col, x,y,w,h, goalX, goalY, filter) goalX = goalX or x goalY = goalY or y local tch, move = col.touch, col.move local sx, sy = tch.x, tch.y if move.x ~= 0 or move.y ~= 0 then if col.normal.x == 0 then sx = goalX else sy = goalY end end col.slide = {x = sx, y = sy} x,y = tch.x, tch.y goalX, goalY = sx, sy local cols, len = world:project(col.item, x,y,w,h, goalX, goalY, filter) return goalX, goalY, cols, len end local bounce = function(world, col, x,y,w,h, goalX, goalY, filter) goalX = goalX or x goalY = goalY or y local tch, move = col.touch, col.move local tx, ty = tch.x, tch.y local bx, by = tx, ty if move.x ~= 0 or move.y ~= 0 then local bnx, bny = goalX - tx, goalY - ty if col.normal.x == 0 then bny = -bny else bnx = -bnx end bx, by = tx + bnx, ty + bny end col.bounce = {x = bx, y = by} x,y = tch.x, tch.y goalX, goalY = bx, by local cols, len = world:project(col.item, x,y,w,h, goalX, goalY, filter) return goalX, goalY, cols, len end ------------------------------------------ -- World ------------------------------------------ local World = {} local World_mt = {__index = World} -- Private functions and methods local function sortByWeight(a,b) return a.weight < b.weight end local function sortByTiAndDistance(a,b) if a.ti == b.ti then local ir, ar, br = a.itemRect, a.otherRect, b.otherRect local ad = rect_getSquareDistance(ir.x,ir.y,ir.w,ir.h, ar.x,ar.y,ar.w,ar.h) local bd = rect_getSquareDistance(ir.x,ir.y,ir.w,ir.h, br.x,br.y,br.w,br.h) return ad < bd end return a.ti < b.ti end local function addItemToCell(self, item, cx, cy) self.rows[cy] = self.rows[cy] or setmetatable({}, {__mode = 'v'}) local row = self.rows[cy] row[cx] = row[cx] or {itemCount = 0, x = cx, y = cy, items = setmetatable({}, {__mode = 'k'})} local cell = row[cx] self.nonEmptyCells[cell] = true if not cell.items[item] then cell.items[item] = true cell.itemCount = cell.itemCount + 1 end end local function removeItemFromCell(self, item, cx, cy) local row = self.rows[cy] if not row or not row[cx] or not row[cx].items[item] then return false end local cell = row[cx] cell.items[item] = nil cell.itemCount = cell.itemCount - 1 if cell.itemCount == 0 then self.nonEmptyCells[cell] = nil end return true end local function getDictItemsInCellRect(self, cl,ct,cw,ch) local items_dict = {} for cy=ct,ct+ch-1 do local row = self.rows[cy] if row then for cx=cl,cl+cw-1 do local cell = row[cx] if cell and cell.itemCount > 0 then -- no cell.itemCount > 1 because tunneling for item,_ in pairs(cell.items) do items_dict[item] = true end end end end end return items_dict end local function getCellsTouchedBySegment(self, x1,y1,x2,y2) local cells, cellsLen, visited = {}, 0, {} grid_traverse(self.cellSize, x1,y1,x2,y2, function(cx, cy) local row = self.rows[cy] if not row then return end local cell = row[cx] if not cell or visited[cell] then return end visited[cell] = true cellsLen = cellsLen + 1 cells[cellsLen] = cell end) return cells, cellsLen end local function getInfoAboutItemsTouchedBySegment(self, x1,y1, x2,y2, filter) local cells, len = getCellsTouchedBySegment(self, x1,y1,x2,y2) local cell, rect, l,t,w,h, ti1,ti2, tii0,tii1 local visited, itemInfo, itemInfoLen = {},{},0 for i=1,len do cell = cells[i] for item in pairs(cell.items) do if not visited[item] then visited[item] = true if (not filter or filter(item)) then rect = self.rects[item] l,t,w,h = rect.x,rect.y,rect.w,rect.h ti1,ti2 = rect_getSegmentIntersectionIndices(l,t,w,h, x1,y1, x2,y2, 0, 1) if ti1 and ((0 < ti1 and ti1 < 1) or (0 < ti2 and ti2 < 1)) then -- the sorting is according to the t of an infinite line, not the segment tii0,tii1 = rect_getSegmentIntersectionIndices(l,t,w,h, x1,y1, x2,y2, -math.huge, math.huge) itemInfoLen = itemInfoLen + 1 itemInfo[itemInfoLen] = {item = item, ti1 = ti1, ti2 = ti2, weight = min(tii0,tii1)} end end end end end table.sort(itemInfo, sortByWeight) return itemInfo, itemInfoLen end local function getResponseByName(self, name) local response = self.responses[name] if not response then error(('Unknown collision type: %s (%s)'):format(name, type(name))) end return response end -- Misc Public Methods function World:addResponse(name, response) self.responses[name] = response end function World:project(item, x,y,w,h, goalX, goalY, filter) assertIsRect(x,y,w,h) goalX = goalX or x goalY = goalY or y filter = filter or defaultFilter local collisions, len = {}, 0 local visited = {} if item ~= nil then visited[item] = true end -- This could probably be done with less cells using a polygon raster over the cells instead of a -- bounding rect of the whole movement. Conditional to building a queryPolygon method local tl, tt = min(goalX, x), min(goalY, y) local tr, tb = max(goalX + w, x+w), max(goalY + h, y+h) local tw, th = tr-tl, tb-tt local cl,ct,cw,ch = grid_toCellRect(self.cellSize, tl,tt,tw,th) local dictItemsInCellRect = getDictItemsInCellRect(self, cl,ct,cw,ch) for other,_ in pairs(dictItemsInCellRect) do if not visited[other] then visited[other] = true local responseName = filter(item, other) if responseName then local ox,oy,ow,oh = self:getRect(other) local col = rect_detectCollision(x,y,w,h, ox,oy,ow,oh, goalX, goalY) if col then col.other = other col.item = item col.type = responseName len = len + 1 collisions[len] = col end end end end table.sort(collisions, sortByTiAndDistance) return collisions, len end function World:countCells() local count = 0 for _,row in pairs(self.rows) do for _,_ in pairs(row) do count = count + 1 end end return count end function World:hasItem(item) return not not self.rects[item] end function World:getItems() local items, len = {}, 0 for item,_ in pairs(self.rects) do len = len + 1 items[len] = item end return items, len end function World:countItems() local len = 0 for _ in pairs(self.rects) do len = len + 1 end return len end function World:getRect(item) local rect = self.rects[item] if not rect then error('Item ' .. tostring(item) .. ' must be added to the world before getting its rect. Use world:add(item, x,y,w,h) to add it first.') end return rect.x, rect.y, rect.w, rect.h end function World:toWorld(cx, cy) return grid_toWorld(self.cellSize, cx, cy) end function World:toCell(x,y) return grid_toCell(self.cellSize, x, y) end --- Query methods function World:queryRect(x,y,w,h, filter) local cl,ct,cw,ch = grid_toCellRect(self.cellSize, x,y,w,h) local dictItemsInCellRect = getDictItemsInCellRect(self, cl,ct,cw,ch) local items, len = {}, 0 local rect for item,_ in pairs(dictItemsInCellRect) do rect = self.rects[item] if (not filter or filter(item)) and rect_isIntersecting(x,y,w,h, rect.x, rect.y, rect.w, rect.h) then len = len + 1 items[len] = item end end return items, len end function World:queryPoint(x,y, filter) local cx,cy = self:toCell(x,y) local dictItemsInCellRect = getDictItemsInCellRect(self, cx,cy,1,1) local items, len = {}, 0 local rect for item,_ in pairs(dictItemsInCellRect) do rect = self.rects[item] if (not filter or filter(item)) and rect_containsPoint(rect.x, rect.y, rect.w, rect.h, x, y) then len = len + 1 items[len] = item end end return items, len end function World:querySegment(x1, y1, x2, y2, filter) local itemInfo, len = getInfoAboutItemsTouchedBySegment(self, x1, y1, x2, y2, filter) local items = {} for i=1, len do items[i] = itemInfo[i].item end return items, len end function World:querySegmentWithCoords(x1, y1, x2, y2, filter) local itemInfo, len = getInfoAboutItemsTouchedBySegment(self, x1, y1, x2, y2, filter) local dx, dy = x2-x1, y2-y1 local info, ti1, ti2 for i=1, len do info = itemInfo[i] ti1 = info.ti1 ti2 = info.ti2 info.weight = nil info.x1 = x1 + dx * ti1 info.y1 = y1 + dy * ti1 info.x2 = x1 + dx * ti2 info.y2 = y1 + dy * ti2 end return itemInfo, len end --- Main methods function World:add(item, x,y,w,h) local rect = self.rects[item] if rect then error('Item ' .. tostring(item) .. ' added to the world twice.') end assertIsRect(x,y,w,h) self.rects[item] = {x=x,y=y,w=w,h=h} local cl,ct,cw,ch = grid_toCellRect(self.cellSize, x,y,w,h) for cy = ct, ct+ch-1 do for cx = cl, cl+cw-1 do addItemToCell(self, item, cx, cy) end end return item end function World:remove(item) local x,y,w,h = self:getRect(item) self.rects[item] = nil local cl,ct,cw,ch = grid_toCellRect(self.cellSize, x,y,w,h) for cy = ct, ct+ch-1 do for cx = cl, cl+cw-1 do removeItemFromCell(self, item, cx, cy) end end end function World:update(item, x2,y2,w2,h2) local x1,y1,w1,h1 = self:getRect(item) w2,h2 = w2 or w1, h2 or h1 assertIsRect(x2,y2,w2,h2) if x1 ~= x2 or y1 ~= y2 or w1 ~= w2 or h1 ~= h2 then local cellSize = self.cellSize local cl1,ct1,cw1,ch1 = grid_toCellRect(cellSize, x1,y1,w1,h1) local cl2,ct2,cw2,ch2 = grid_toCellRect(cellSize, x2,y2,w2,h2) if cl1 ~= cl2 or ct1 ~= ct2 or cw1 ~= cw2 or ch1 ~= ch2 then local cr1, cb1 = cl1+cw1-1, ct1+ch1-1 local cr2, cb2 = cl2+cw2-1, ct2+ch2-1 local cyOut for cy = ct1, cb1 do cyOut = cy < ct2 or cy > cb2 for cx = cl1, cr1 do if cyOut or cx < cl2 or cx > cr2 then removeItemFromCell(self, item, cx, cy) end end end for cy = ct2, cb2 do cyOut = cy < ct1 or cy > cb1 for cx = cl2, cr2 do if cyOut or cx < cl1 or cx > cr1 then addItemToCell(self, item, cx, cy) end end end end local rect = self.rects[item] rect.x, rect.y, rect.w, rect.h = x2,y2,w2,h2 end end function World:move(item, goalX, goalY, filter) local actualX, actualY, cols, len = self:check(item, goalX, goalY, filter) self:update(item, actualX, actualY) return actualX, actualY, cols, len end function World:check(item, goalX, goalY, filter) filter = filter or defaultFilter local visited = {[item] = true} local visitedFilter = function(itm, other) if visited[other] then return false end return filter(itm, other) end local cols, len = {}, 0 local x,y,w,h = self:getRect(item) local projected_cols, projected_len = self:project(item, x,y,w,h, goalX,goalY, visitedFilter) while projected_len > 0 do local col = projected_cols[1] len = len + 1 cols[len] = col visited[col.other] = true local response = getResponseByName(self, col.type) goalX, goalY, projected_cols, projected_len = response( self, col, x, y, w, h, goalX, goalY, visitedFilter ) end return goalX, goalY, cols, len end -- Public library functions bump.newWorld = function(cellSize) cellSize = cellSize or 64 assertIsPositiveNumber(cellSize, 'cellSize') local world = setmetatable({ cellSize = cellSize, rects = {}, rows = {}, nonEmptyCells = {}, responses = {} }, World_mt) world:addResponse('touch', touch) world:addResponse('cross', cross) world:addResponse('slide', slide) world:addResponse('bounce', bounce) return world end bump.rect = { getNearestCorner = rect_getNearestCorner, getSegmentIntersectionIndices = rect_getSegmentIntersectionIndices, getDiff = rect_getDiff, containsPoint = rect_containsPoint, isIntersecting = rect_isIntersecting, getSquareDistance = rect_getSquareDistance, detectCollision = rect_detectCollision } bump.responses = { touch = touch, cross = cross, slide = slide, bounce = bounce } return bump
mit
Fenix-XI/Fenix
scripts/zones/Sauromugue_Champaign/npcs/qm2.lua
11
3923
----------------------------------- -- Area: Sauromugue Champaign -- NPC: qm2 (???) (Tower 2) -- Involved in Quest: THF AF "As Thick As Thieves" -- @pos 196.830 31.300 206.078 120 ----------------------------------- package.loaded["scripts/zones/Sauromugue_Champaign/TextIDs"] = nil; ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/quests"); require("scripts/globals/keyitems"); require("scripts/globals/status"); require("scripts/zones/Sauromugue_Champaign/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) local thickAsThievesGrapplingCS = player:getVar("thickAsThievesGrapplingCS"); if (thickAsThievesGrapplingCS >= 2 and thickAsThievesGrapplingCS <= 7) then if (trade:hasItemQty(17474,1) and trade:getItemCount() == 1) then -- Trade grapel if (player:getEquipID(SLOT_MAIN) == 0 and player:getEquipID(SLOT_SUB) == 0 and player:getEquipID(SLOT_RANGED) == 0 and player:getEquipID(SLOT_AMMO) == 0 and player:getEquipID(SLOT_HEAD) == 0 and player:getEquipID(SLOT_BODY) == 0 and player:getEquipID(SLOT_HANDS) == 0 and player:getEquipID(SLOT_LEGS) == 0 and player:getEquipID(SLOT_FEET) == 0 and player:getEquipID(SLOT_NECK) == 0 and player:getEquipID(SLOT_WAIST) == 0 and player:getEquipID(SLOT_EAR1) == 0 and player:getEquipID(SLOT_EAR2) == 0 and player:getEquipID(SLOT_RING1) == 0 and player:getEquipID(SLOT_RING2) == 0 and player:getEquipID(SLOT_BACK) == 0) then player:startEvent(0x0002); -- complete grappling part of the quest else player:messageSpecial(THF_AF_WALL_OFFSET+2,0,17474); -- You try climbing the wall using the [Grapnel], but you are too heavy. end end end end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) local thickAsThieves = player:getQuestStatus(WINDURST,AS_THICK_AS_THIEVES); local thickAsThievesGrapplingCS = player:getVar("thickAsThievesGrapplingCS"); if (thickAsThieves == QUEST_ACCEPTED) then if (thickAsThievesGrapplingCS == 2) then player:messageSpecial(THF_AF_MOB); GetMobByID(17269107):setSpawn(193,32,211); SpawnMob(17269107,120):updateClaim(player); -- Climbpix Highrise elseif (thickAsThievesGrapplingCS == 0 or thickAsThievesGrapplingCS == 1 or thickAsThievesGrapplingCS == 3 or thickAsThievesGrapplingCS == 4 or thickAsThievesGrapplingCS == 5 or thickAsThievesGrapplingCS == 6 or thickAsThievesGrapplingCS == 7) then player:messageSpecial(THF_AF_WALL_OFFSET); -- It is impossible to climb this wall with your bare hands. elseif (thickAsThievesGrapplingCS == 8) then player:messageSpecial(THF_AF_WALL_OFFSET+1); -- There is no longer any need to climb the tower. end else player:messageSpecial(NOTHING_OUT_OF_ORDINARY); end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 0x0002) then player:setVar("thickAsThievesGrapplingCS",8); player:delKeyItem(FIRST_FORGED_ENVELOPE); player:addKeyItem(FIRST_SIGNED_FORGED_ENVELOPE); player:messageSpecial(KEYITEM_OBTAINED,FIRST_SIGNED_FORGED_ENVELOPE); player:tradeComplete(); end end;
gpl-3.0
synthein/synthein
src/callList.lua
2
2361
local CallList = {} CallList.__index = CallList function CallList.create(reference, options) local self = {} setmetatable(self, CallList) -- The table that these functions will be called on or a function that -- returns said table. self.reference = reference -- Options -- isObject --Set to true if reference is a object. -- objectTypeString -- String for the error message. Error is ignored if nil -- returnInformation -- Value or reference returned each time a call is added or a -- function that generates a new value or reference for each call. -- update -- Function that is called after processing each call. for k, v in pairs(options) do self[k] = v end local returnInformation = self.returnInformation self.returnInformation = nil local addIndex = function(t, key) return CallList.addIndex(t, key, returnInformation) end self.list = setmetatable({}, {__index = addIndex}) return self end function CallList.addIndex(t, key, returnInformation) local updateInformation if type(returnInformation) == "function" then returnInformation, updateInformation = returnInformation() end local info = debug.getinfo(2) local codeLocation = info.short_src .. ":" .. info.currentline .. ":"-- in function '" .. name .. "'" local reference = {key, nil, updateInformation, codeLocation} table.insert(t, reference) return function(...) reference[2] = {...} return returnInformation end end function CallList:process() local list = self.list local reference = self.reference local objectTypeString = self.objectTypeString local update = self.update if type(reference) == "function" then reference = reference() end for i, call in ipairs(list) do list[i] = nil local key, inputs, updateInformation, codeLocation = unpack(call, 1, 4) -- Get the function local f = reference[key] if not f then if objectTypeString then local message = "There is no function called '" .. tostring(key) .. "' in " .. objectTypeString .. "." if codeLocation then message = message .. "\n\nCheck\n\n" .. codeLocation end error(message) end else if self.isObject then inputs[1] = reference end local returnValue = f(unpack(inputs)) if update then update(reference, returnValue, updateInformation) end end end end return CallList
gpl-3.0
Fenix-XI/Fenix
scripts/zones/The_Shrine_of_RuAvitau/Zone.lua
12
5750
----------------------------------- -- -- Zone: The_Shrine_of_RuAvitau (178) -- ----------------------------------- package.loaded["scripts/zones/The_Shrine_of_RuAvitau/TextIDs"] = nil; ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/missions"); require("scripts/globals/keyitems"); require("scripts/globals/zone"); require("scripts/zones/The_Shrine_of_RuAvitau/TextIDs"); ----------------------------------- -- onInitialize ----------------------------------- function onInitialize(zone) local tomes = {17506822,17506823,17506824,17506825,17506826,17506827,17506828}; SetGroundsTome(tomes); -- MAP 1 ------------------------ zone:registerRegion(1, -21, 29, -61, -16, 31, -57); --> F (H-10) zone:registerRegion(2, 16, 29, 57, 21, 31, 61); --> E (H-7) -- MAP 3 ------------------------ zone:registerRegion(3, -89, -19, 83, -83, -15, 89); --> L (F-5) zone:registerRegion(3, -143, -19, -22, -137, -15, -16); --> L (D-8) zone:registerRegion(4, -143, -19, 55, -137, -15, 62); --> G (D-6) zone:registerRegion(4, 83, -19, -89, 89, -15, -83); --> G (J-10) zone:registerRegion(5, -89, -19, -89, -83, -15, -83); --> J (F-10) zone:registerRegion(6, 137, -19, -22, 143, -15, -16); --> H (L-8) zone:registerRegion(7, 136, -19, 56, 142, -15, 62); --> I (L-6) zone:registerRegion(8, 83, -19, 83, 89, -15, 89); --> K (J-5) -- MAP 4 ------------------------ zone:registerRegion(9, 723, 96, 723, 729, 100, 729); --> L'(F-5) zone:registerRegion(10, 870, 96, 723, 876, 100, 729); --> O (J-5) zone:registerRegion(6, 870, 96, 470, 876, 100, 476); --> H (J-11) zone:registerRegion(11, 723, 96, 470, 729, 100, 476); --> N (F-11) -- MAP 5 ------------------------ zone:registerRegion(12, 817, -3, 57, 823, 1, 63); --> D (I-7) zone:registerRegion(13, 736, -3, 16, 742, 1, 22); --> P (F-8) zone:registerRegion(14, 857, -3, -23, 863, 1, -17); --> M (J-9) zone:registerRegion(15, 776, -3, -63, 782, 1, -57); --> C (G-10) -- MAP 6 ------------------------ zone:registerRegion(2, 777, -103, -503, 783, -99, -497); --> E (G-6) zone:registerRegion(1, 816, -103, -503, 822, -99, -497); --> F (I-6) end; ----------------------------------- -- onZoneIn ----------------------------------- function onZoneIn(player,prevZone) local cs = -1; local xPos = player:getXPos(); local yPos = player:getYPos(); local zPos = player:getZPos(); local ZilartMission = player:getCurrentMission(ZILART); -- Checked here to be fair to new players local DMEarrings = 0; for i=14739, 14743 do if (player:hasItem(i)) then DMEarrings = DMEarrings + 1; end end -- ZM 15 -> ZM 16 if (ZilartMission == THE_SEALED_SHRINE and player:getVar("ZilartStatus") == 1 and xPos >= -45 and yPos >= -4 and zPos >= -240 and xPos <= -33 and yPos <= 0 and zPos <= -226 and DMEarrings <= NUMBER_OF_DM_EARRINGS) then -- Entered through main gate cs = 51; end if ((xPos == 0) and (yPos == 0) and (zPos == 0)) then player:setPos(-3.38,46.326,60,122); end return cs; end; ----------------------------------- -- onConquestUpdate ----------------------------------- function onConquestUpdate(zone, updatetype) local players = zone:getPlayers(); for name, player in pairs(players) do conquestUpdate(zone, player, updatetype, CONQUEST_BASE); end end; ----------------------------------- -- onRegionEnter ----------------------------------- function onRegionEnter(player,region) switch (region:GetRegionID()): caseof { [1] = function (x) player:startEvent(17); --> F end, [2] = function (x) player:startEvent(16); --> E end, [3] = function (x) player:startEvent(5); --> L --> Kirin ! end, [4] = function (x) player:startEvent(4); --> G end, [5] = function (x) player:startEvent(1); --> J end, [6] = function (x) player:startEvent(3); --> H end, [7] = function (x) player:startEvent(7); --> I end, [8] = function (x) player:startEvent(6); --> K end, [9] = function (x) player:startEvent(10); --> L' end, [10] = function (x) player:startEvent(11); end, [11] = function (x) player:startEvent(8); end, [12] = function (x) player:startEvent(15); --> D end, [13] = function (x) player:startEvent(14); --> P end, [14] = function (x) player:startEvent(13); --> M end, [15] = function (x) player:startEvent(12); --> C end, default = function (x) end, } end; ----------------------------------- -- onRegionLeave ----------------------------------- function onRegionLeave(player,region) end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); if (csid == 51) then player:completeMission(ZILART,THE_SEALED_SHRINE); player:addMission(ZILART,THE_CELESTIAL_NEXUS); player:setVar("ZilartStatus",0); end end;
gpl-3.0
Fenix-XI/Fenix
scripts/zones/Aht_Urhgan_Whitegate/npcs/Porter_Moogle.lua
41
1553
----------------------------------- -- Area: Aht Urhgan Whitegate -- NPC: Porter Moogle -- Type: Storage Moogle -- @zone 50 -- @pos TODO ----------------------------------- package.loaded["scripts/zones/Aht_Urhgan_Whitegate/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Aht_Urhgan_Whitegate/TextIDs"); require("scripts/globals/porter_moogle_util"); local e = { TALK_EVENT_ID = 957, STORE_EVENT_ID = 958, RETRIEVE_EVENT_ID = 959, ALREADY_STORED_ID = 960, MAGIAN_TRIAL_ID = 963 }; ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) porterMoogleTrade(player, trade, e); end ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) -- No idea what the params are, other than event ID and gil. player:startEvent(e.TALK_EVENT_ID, 0x6FFFFF, 0x01, 0x06DD, 0x27, 0x7C7E, 0x15, player:getGil(), 0x03E8); end ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) porterEventUpdate(player, csid, option, e.RETRIEVE_EVENT_ID, RETRIEVE_DIALOG_ID, ITEM_CANNOT_BE_OBTAINED); end ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) porterEventFinish(player, csid, option, e.TALK_EVENT_ID, ITEM_CANNOT_BE_OBTAINED, ITEM_OBTAINED, NOT_HAVE_ENOUGH_GIL); end
gpl-3.0
Fenix-XI/Fenix
scripts/zones/Port_San_dOria/npcs/Perdiouvilet.lua
13
1735
----------------------------------- -- Area: Port San d'Oria -- NPC: Perdiouvilet -- Involved in Quest: Lure of the Wildcat (San d'Oria) -- @pos -59 -5 -29 232 ----------------------------------- package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil; ----------------------------------- require("scripts/globals/quests"); require("scripts/zones/Northern_San_dOria/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) if (player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE) == QUEST_ACCEPTED) then if (trade:hasItemQty(532,1) and trade:getItemCount() == 1) then -- Trade Magicmart_flyer player:messageSpecial(FLYER_REFUSED); end end end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) local WildcatSandy = player:getVar("WildcatSandy"); if (player:getQuestStatus(SANDORIA,LURE_OF_THE_WILDCAT_SAN_D_ORIA) == QUEST_ACCEPTED and player:getMaskBit(WildcatSandy,10) == false) then player:startEvent(0x02ee); else player:startEvent(0x02fa); end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); if (csid == 0x02ee) then player:setMaskBit(player:getVar("WildcatSandy"),"WildcatSandy",10,true); end end;
gpl-3.0
sina021/bottg
plugins/inpm.lua
1114
3008
do local function pairsByKeys (t, f) local a = {} for n in pairs(t) do table.insert(a, n) end table.sort(a, f) local i = 0 -- iterator variable local iter = function () -- iterator function i = i + 1 if a[i] == nil then return nil else return a[i], t[a[i]] end end return iter end local function chat_list(msg) local data = load_data(_config.moderation.data) local groups = 'groups' if not data[tostring(groups)] then return 'No groups at the moment' end local message = 'List of Groups:\n*Use /join (ID) to join*\n\n ' for k,v in pairs(data[tostring(groups)]) do local settings = data[tostring(v)]['settings'] for m,n in pairsByKeys(settings) do if m == 'set_name' then name = n end end message = message .. '👥 '.. name .. ' (ID: ' .. v .. ')\n\n ' end local file = io.open("./groups/lists/listed_groups.txt", "w") file:write(message) file:flush() file:close() return message end local function run(msg, matches) if msg.to.type ~= 'chat' or is_sudo(msg) or is_admin(msg) and is_realm(msg) then local data = load_data(_config.moderation.data) if matches[1] == 'join' and data[tostring(matches[2])] then if is_banned(msg.from.id, matches[2]) then return 'You are banned.' end if is_gbanned(msg.from.id) then return 'You are globally banned.' end if data[tostring(matches[2])]['settings']['lock_member'] == 'yes' and not is_owner2(msg.from.id, matches[2]) then return 'Group is private.' end local chat_id = "chat#id"..matches[2] local user_id = "user#id"..msg.from.id chat_add_user(chat_id, user_id, ok_cb, false) local group_name = data[tostring(matches[2])]['settings']['set_name'] return "Added you to chat:\n\n👥"..group_name.." (ID:"..matches[2]..")" elseif matches[1] == 'join' and not data[tostring(matches[2])] then return "Chat not found." end if matches[1] == 'chats'then if is_admin(msg) and msg.to.type == 'chat' then return chat_list(msg) elseif msg.to.type ~= 'chat' then return chat_list(msg) end end if matches[1] == 'chatlist'then if is_admin(msg) and msg.to.type == 'chat' then send_document("chat#id"..msg.from.id, "./groups/lists/listed_groups.txt", ok_cb, false) elseif msg.to.type ~= 'chat' then send_document("user#id"..msg.from.id, "./groups/lists/listed_groups.txt", ok_cb, false) end end end end return { patterns = { "^[/!](chats)$", "^[/!](chatlist)$", "^[/!](join) (.*)$", "^[/!](kickme) (.*)$", "^!!tgservice (chat_add_user)$" }, run = run, } end
gpl-2.0
DarkstarProject/darkstar
scripts/zones/Kazham/npcs/Toji_Mumosulah.lua
12
1113
----------------------------------- -- Area: Kazham -- NPC: Toji Mumosulah -- Standard Merchant NPC ----------------------------------- local ID = require("scripts/zones/Kazham/IDs") require("scripts/globals/shop") function onTrade(player,npc,trade) end function onTrigger(player,npc) local stock = { 112, 456, -- Yellow Jar 13199, 95, -- Blood Stone 13076, 3510, -- Fang Necklace 13321, 1667, -- Bone Earring 17351, 4747, -- Gemshorn 16993, 69, -- Peeled Crayfish 16998, 36, -- Insect Paste 17876, 165, -- Fish Broth 17880, 695, -- Seedbed Soil 1021, 450, -- Hatchet 4987, 328, -- Scroll of Army's Paeon II 5079, 64528, -- Scroll of Foe Lullaby II 4988, 3312, -- Scroll of Army's Paeon III 4964, 8726, -- Scroll of Monomi: Ichi } player:showText(npc,ID.text.TOJIMUMOSULAH_SHOP_DIALOG) dsp.shop.general(player, stock) end function onEventUpdate(player,csid,option) end function onEventFinish(player,csid,option) end
gpl-3.0
eugeneia/snabbswitch
lib/luajit/dynasm/dasm_x86.lua
32
71256
------------------------------------------------------------------------------ -- DynASM x86/x64 module. -- -- Copyright (C) 2005-2017 Mike Pall. All rights reserved. -- See dynasm.lua for full copyright notice. ------------------------------------------------------------------------------ local x64 = x64 -- Module information: local _info = { arch = x64 and "x64" or "x86", description = "DynASM x86/x64 module", version = "1.4.0", vernum = 10400, release = "2015-10-18", author = "Mike Pall", license = "MIT", } -- Exported glue functions for the arch-specific module. local _M = { _info = _info } -- Cache library functions. local type, tonumber, pairs, ipairs = type, tonumber, pairs, ipairs local assert, unpack, setmetatable = assert, unpack or table.unpack, setmetatable local _s = string local sub, format, byte, char = _s.sub, _s.format, _s.byte, _s.char local find, match, gmatch, gsub = _s.find, _s.match, _s.gmatch, _s.gsub local concat, sort, remove = table.concat, table.sort, table.remove local bit = bit or require("bit") local band, bxor, shl, shr = bit.band, bit.bxor, bit.lshift, bit.rshift -- Inherited tables and callbacks. local g_opt, g_arch local wline, werror, wfatal, wwarn -- Action name list. -- CHECK: Keep this in sync with the C code! local action_names = { -- int arg, 1 buffer pos: "DISP", "IMM_S", "IMM_B", "IMM_W", "IMM_D", "IMM_WB", "IMM_DB", -- action arg (1 byte), int arg, 1 buffer pos (reg/num): "VREG", "SPACE", -- ptrdiff_t arg, 1 buffer pos (address): !x64 "SETLABEL", "REL_A", -- action arg (1 byte) or int arg, 2 buffer pos (link, offset): "REL_LG", "REL_PC", -- action arg (1 byte) or int arg, 1 buffer pos (link): "IMM_LG", "IMM_PC", -- action arg (1 byte) or int arg, 1 buffer pos (offset): "LABEL_LG", "LABEL_PC", -- action arg (1 byte), 1 buffer pos (offset): "ALIGN", -- action args (2 bytes), no buffer pos. "EXTERN", -- action arg (1 byte), no buffer pos. "ESC", -- no action arg, no buffer pos. "MARK", -- action arg (1 byte), no buffer pos, terminal action: "SECTION", -- no args, no buffer pos, terminal action: "STOP" } -- Maximum number of section buffer positions for dasm_put(). -- CHECK: Keep this in sync with the C code! local maxsecpos = 25 -- Keep this low, to avoid excessively long C lines. -- Action name -> action number (dynamically generated below). local map_action = {} -- First action number. Everything below does not need to be escaped. local actfirst = 256-#action_names -- Action list buffer and string (only used to remove dupes). local actlist = {} local actstr = "" -- Argument list for next dasm_put(). Start with offset 0 into action list. local actargs = { 0 } -- Current number of section buffer positions for dasm_put(). local secpos = 1 -- VREG kind encodings, pre-shifted by 5 bits. local map_vreg = { ["modrm.rm.m"] = 0x00, ["modrm.rm.r"] = 0x20, ["opcode"] = 0x20, ["sib.base"] = 0x20, ["sib.index"] = 0x40, ["modrm.reg"] = 0x80, ["vex.v"] = 0xa0, ["imm.hi"] = 0xc0, } -- Current number of VREG actions contributing to REX/VEX shrinkage. local vreg_shrink_count = 0 ------------------------------------------------------------------------------ -- Compute action numbers for action names. for n,name in ipairs(action_names) do local num = actfirst + n - 1 map_action[name] = num end -- Dump action names and numbers. local function dumpactions(out) out:write("DynASM encoding engine action codes:\n") for n,name in ipairs(action_names) do local num = map_action[name] out:write(format(" %-10s %02X %d\n", name, num, num)) end out:write("\n") end -- Write action list buffer as a huge static C array. local function writeactions(out, name) local nn = #actlist local last = actlist[nn] or 255 actlist[nn] = nil -- Remove last byte. if nn == 0 then nn = 1 end out:write("static const unsigned char ", name, "[", nn, "] = {\n") local s = " " for n,b in ipairs(actlist) do s = s..b.."," if #s >= 75 then assert(out:write(s, "\n")) s = " " end end out:write(s, last, "\n};\n\n") -- Add last byte back. end ------------------------------------------------------------------------------ -- Add byte to action list. local function wputxb(n) assert(n >= 0 and n <= 255 and n % 1 == 0, "byte out of range") actlist[#actlist+1] = n end -- Add action to list with optional arg. Advance buffer pos, too. local function waction(action, a, num) wputxb(assert(map_action[action], "bad action name `"..action.."'")) if a then actargs[#actargs+1] = a end if a or num then secpos = secpos + (num or 1) end end -- Optionally add a VREG action. local function wvreg(kind, vreg, psz, sk, defer) if not vreg then return end waction("VREG", vreg) local b = assert(map_vreg[kind], "bad vreg kind `"..vreg.."'") if b < (sk or 0) then vreg_shrink_count = vreg_shrink_count + 1 end if not defer then b = b + vreg_shrink_count * 8 vreg_shrink_count = 0 end wputxb(b + (psz or 0)) end -- Add call to embedded DynASM C code. local function wcall(func, args) wline(format("dasm_%s(Dst, %s);", func, concat(args, ", ")), true) end -- Delete duplicate action list chunks. A tad slow, but so what. local function dedupechunk(offset) local al, as = actlist, actstr local chunk = char(unpack(al, offset+1, #al)) local orig = find(as, chunk, 1, true) if orig then actargs[1] = orig-1 -- Replace with original offset. for i=offset+1,#al do al[i] = nil end -- Kill dupe. else actstr = as..chunk end end -- Flush action list (intervening C code or buffer pos overflow). local function wflush(term) local offset = actargs[1] if #actlist == offset then return end -- Nothing to flush. if not term then waction("STOP") end -- Terminate action list. dedupechunk(offset) wcall("put", actargs) -- Add call to dasm_put(). actargs = { #actlist } -- Actionlist offset is 1st arg to next dasm_put(). secpos = 1 -- The actionlist offset occupies a buffer position, too. end -- Put escaped byte. local function wputb(n) if n >= actfirst then waction("ESC") end -- Need to escape byte. wputxb(n) end ------------------------------------------------------------------------------ -- Global label name -> global label number. With auto assignment on 1st use. local next_global = 10 local map_global = setmetatable({}, { __index = function(t, name) if not match(name, "^[%a_][%w_@]*$") then werror("bad global label") end local n = next_global if n > 246 then werror("too many global labels") end next_global = n + 1 t[name] = n return n end}) -- Dump global labels. local function dumpglobals(out, lvl) local t = {} for name, n in pairs(map_global) do t[n] = name end out:write("Global labels:\n") for i=10,next_global-1 do out:write(format(" %s\n", t[i])) end out:write("\n") end -- Write global label enum. local function writeglobals(out, prefix) local t = {} for name, n in pairs(map_global) do t[n] = name end out:write("enum {\n") for i=10,next_global-1 do out:write(" ", prefix, gsub(t[i], "@.*", ""), ",\n") end out:write(" ", prefix, "_MAX\n};\n") end -- Write global label names. local function writeglobalnames(out, name) local t = {} for name, n in pairs(map_global) do t[n] = name end out:write("static const char *const ", name, "[] = {\n") for i=10,next_global-1 do out:write(" \"", t[i], "\",\n") end out:write(" (const char *)0\n};\n") end ------------------------------------------------------------------------------ -- Extern label name -> extern label number. With auto assignment on 1st use. local next_extern = -1 local map_extern = setmetatable({}, { __index = function(t, name) -- No restrictions on the name for now. local n = next_extern if n < -256 then werror("too many extern labels") end next_extern = n - 1 t[name] = n return n end}) -- Dump extern labels. local function dumpexterns(out, lvl) local t = {} for name, n in pairs(map_extern) do t[-n] = name end out:write("Extern labels:\n") for i=1,-next_extern-1 do out:write(format(" %s\n", t[i])) end out:write("\n") end -- Write extern label names. local function writeexternnames(out, name) local t = {} for name, n in pairs(map_extern) do t[-n] = name end out:write("static const char *const ", name, "[] = {\n") for i=1,-next_extern-1 do out:write(" \"", t[i], "\",\n") end out:write(" (const char *)0\n};\n") end ------------------------------------------------------------------------------ -- Arch-specific maps. local map_archdef = {} -- Ext. register name -> int. name. local map_reg_rev = {} -- Int. register name -> ext. name. local map_reg_num = {} -- Int. register name -> register number. local map_reg_opsize = {} -- Int. register name -> operand size. local map_reg_valid_base = {} -- Int. register name -> valid base register? local map_reg_valid_index = {} -- Int. register name -> valid index register? local map_reg_needrex = {} -- Int. register name -> need rex vs. no rex. local reg_list = {} -- Canonical list of int. register names. local map_type = {} -- Type name -> { ctype, reg } local ctypenum = 0 -- Type number (for _PTx macros). local addrsize = x64 and "q" or "d" -- Size for address operands. -- Helper functions to fill register maps. local function mkrmap(sz, cl, names) local cname = format("@%s", sz) reg_list[#reg_list+1] = cname map_archdef[cl] = cname map_reg_rev[cname] = cl map_reg_num[cname] = -1 map_reg_opsize[cname] = sz if sz == addrsize or sz == "d" then map_reg_valid_base[cname] = true map_reg_valid_index[cname] = true end if names then for n,name in ipairs(names) do local iname = format("@%s%x", sz, n-1) reg_list[#reg_list+1] = iname map_archdef[name] = iname map_reg_rev[iname] = name map_reg_num[iname] = n-1 map_reg_opsize[iname] = sz if sz == "b" and n > 4 then map_reg_needrex[iname] = false end if sz == addrsize or sz == "d" then map_reg_valid_base[iname] = true map_reg_valid_index[iname] = true end end end for i=0,(x64 and sz ~= "f") and 15 or 7 do local needrex = sz == "b" and i > 3 local iname = format("@%s%x%s", sz, i, needrex and "R" or "") if needrex then map_reg_needrex[iname] = true end local name if sz == "o" or sz == "y" then name = format("%s%d", cl, i) elseif sz == "f" then name = format("st%d", i) else name = format("r%d%s", i, sz == addrsize and "" or sz) end map_archdef[name] = iname if not map_reg_rev[iname] then reg_list[#reg_list+1] = iname map_reg_rev[iname] = name map_reg_num[iname] = i map_reg_opsize[iname] = sz if sz == addrsize or sz == "d" then map_reg_valid_base[iname] = true map_reg_valid_index[iname] = true end end end reg_list[#reg_list+1] = "" end -- Integer registers (qword, dword, word and byte sized). if x64 then mkrmap("q", "Rq", {"rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi"}) end mkrmap("d", "Rd", {"eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi"}) mkrmap("w", "Rw", {"ax", "cx", "dx", "bx", "sp", "bp", "si", "di"}) mkrmap("b", "Rb", {"al", "cl", "dl", "bl", "ah", "ch", "dh", "bh"}) map_reg_valid_index[map_archdef.esp] = false if x64 then map_reg_valid_index[map_archdef.rsp] = false end if x64 then map_reg_needrex[map_archdef.Rb] = true end map_archdef["Ra"] = "@"..addrsize -- FP registers (internally tword sized, but use "f" as operand size). mkrmap("f", "Rf") -- SSE registers (oword sized, but qword and dword accessible). mkrmap("o", "xmm") -- AVX registers (yword sized, but oword, qword and dword accessible). mkrmap("y", "ymm") -- Operand size prefixes to codes. local map_opsize = { byte = "b", word = "w", dword = "d", qword = "q", oword = "o", yword = "y", tword = "t", aword = addrsize, } -- Operand size code to number. local map_opsizenum = { b = 1, w = 2, d = 4, q = 8, o = 16, y = 32, t = 10, } -- Operand size code to name. local map_opsizename = { b = "byte", w = "word", d = "dword", q = "qword", o = "oword", y = "yword", t = "tword", f = "fpword", } -- Valid index register scale factors. local map_xsc = { ["1"] = 0, ["2"] = 1, ["4"] = 2, ["8"] = 3, } -- Condition codes. local map_cc = { o = 0, no = 1, b = 2, nb = 3, e = 4, ne = 5, be = 6, nbe = 7, s = 8, ns = 9, p = 10, np = 11, l = 12, nl = 13, le = 14, nle = 15, c = 2, nae = 2, nc = 3, ae = 3, z = 4, nz = 5, na = 6, a = 7, pe = 10, po = 11, nge = 12, ge = 13, ng = 14, g = 15, } -- Reverse defines for registers. function _M.revdef(s) return gsub(s, "@%w+", map_reg_rev) end -- Dump register names and numbers local function dumpregs(out) out:write("Register names, sizes and internal numbers:\n") for _,reg in ipairs(reg_list) do if reg == "" then out:write("\n") else local name = map_reg_rev[reg] local num = map_reg_num[reg] local opsize = map_opsizename[map_reg_opsize[reg]] out:write(format(" %-5s %-8s %s\n", name, opsize, num < 0 and "(variable)" or num)) end end end ------------------------------------------------------------------------------ -- Put action for label arg (IMM_LG, IMM_PC, REL_LG, REL_PC). local function wputlabel(aprefix, imm, num) if type(imm) == "number" then if imm < 0 then waction("EXTERN") wputxb(aprefix == "IMM_" and 0 or 1) imm = -imm-1 else waction(aprefix.."LG", nil, num); end wputxb(imm) else waction(aprefix.."PC", imm, num) end end -- Put signed byte or arg. local function wputsbarg(n) if type(n) == "number" then if n < -128 or n > 127 then werror("signed immediate byte out of range") end if n < 0 then n = n + 256 end wputb(n) else waction("IMM_S", n) end end -- Put unsigned byte or arg. local function wputbarg(n) if type(n) == "number" then if n < 0 or n > 255 then werror("unsigned immediate byte out of range") end wputb(n) else waction("IMM_B", n) end end -- Put unsigned word or arg. local function wputwarg(n) if type(n) == "number" then if shr(n, 16) ~= 0 then werror("unsigned immediate word out of range") end wputb(band(n, 255)); wputb(shr(n, 8)); else waction("IMM_W", n) end end -- Put signed or unsigned dword or arg. local function wputdarg(n) local tn = type(n) if tn == "number" then wputb(band(n, 255)) wputb(band(shr(n, 8), 255)) wputb(band(shr(n, 16), 255)) wputb(shr(n, 24)) elseif tn == "table" then wputlabel("IMM_", n[1], 1) else waction("IMM_D", n) end end -- Put operand-size dependent number or arg (defaults to dword). local function wputszarg(sz, n) if not sz or sz == "d" or sz == "q" then wputdarg(n) elseif sz == "w" then wputwarg(n) elseif sz == "b" then wputbarg(n) elseif sz == "s" then wputsbarg(n) else werror("bad operand size") end end -- Put multi-byte opcode with operand-size dependent modifications. local function wputop(sz, op, rex, vex, vregr, vregxb) local psz, sk = 0, nil if vex then local tail if vex.m == 1 and band(rex, 11) == 0 then if x64 and vregxb then sk = map_vreg["modrm.reg"] else wputb(0xc5) tail = shl(bxor(band(rex, 4), 4), 5) psz = 3 end end if not tail then wputb(0xc4) wputb(shl(bxor(band(rex, 7), 7), 5) + vex.m) tail = shl(band(rex, 8), 4) psz = 4 end local reg, vreg = 0, nil if vex.v then reg = vex.v.reg if not reg then werror("bad vex operand") end if reg < 0 then reg = 0; vreg = vex.v.vreg end end if sz == "y" or vex.l then tail = tail + 4 end wputb(tail + shl(bxor(reg, 15), 3) + vex.p) wvreg("vex.v", vreg) rex = 0 if op >= 256 then werror("bad vex opcode") end else if rex ~= 0 then if not x64 then werror("bad operand size") end elseif (vregr or vregxb) and x64 then rex = 0x10 sk = map_vreg["vex.v"] end end local r if sz == "w" then wputb(102) end -- Needs >32 bit numbers, but only for crc32 eax, word [ebx] if op >= 4294967296 then r = op%4294967296 wputb((op-r)/4294967296) op = r end if op >= 16777216 then wputb(shr(op, 24)); op = band(op, 0xffffff) end if op >= 65536 then if rex ~= 0 then local opc3 = band(op, 0xffff00) if opc3 == 0x0f3a00 or opc3 == 0x0f3800 then wputb(64 + band(rex, 15)); rex = 0; psz = 2 end end wputb(shr(op, 16)); op = band(op, 0xffff); psz = psz + 1 end if op >= 256 then local b = shr(op, 8) if b == 15 and rex ~= 0 then wputb(64 + band(rex, 15)); rex = 0; psz = 2 end wputb(b); op = band(op, 255); psz = psz + 1 end if rex ~= 0 then wputb(64 + band(rex, 15)); psz = 2 end if sz == "b" then op = op - 1 end wputb(op) return psz, sk end -- Put ModRM or SIB formatted byte. local function wputmodrm(m, s, rm, vs, vrm) assert(m < 4 and s < 16 and rm < 16, "bad modrm operands") wputb(shl(m, 6) + shl(band(s, 7), 3) + band(rm, 7)) end -- Put ModRM/SIB plus optional displacement. local function wputmrmsib(t, imark, s, vsreg, psz, sk) local vreg, vxreg local reg, xreg = t.reg, t.xreg if reg and reg < 0 then reg = 0; vreg = t.vreg end if xreg and xreg < 0 then xreg = 0; vxreg = t.vxreg end if s < 0 then s = 0 end -- Register mode. if sub(t.mode, 1, 1) == "r" then wputmodrm(3, s, reg) wvreg("modrm.reg", vsreg, psz+1, sk, vreg) wvreg("modrm.rm.r", vreg, psz+1, sk) return end local disp = t.disp local tdisp = type(disp) -- No base register? if not reg then local riprel = false if xreg then -- Indexed mode with index register only. -- [xreg*xsc+disp] -> (0, s, esp) (xsc, xreg, ebp) wputmodrm(0, s, 4) if imark == "I" then waction("MARK") end wvreg("modrm.reg", vsreg, psz+1, sk, vxreg) wputmodrm(t.xsc, xreg, 5) wvreg("sib.index", vxreg, psz+2, sk) else -- Pure 32 bit displacement. if x64 and tdisp ~= "table" then wputmodrm(0, s, 4) -- [disp] -> (0, s, esp) (0, esp, ebp) wvreg("modrm.reg", vsreg, psz+1, sk) if imark == "I" then waction("MARK") end wputmodrm(0, 4, 5) else riprel = x64 wputmodrm(0, s, 5) -- [disp|rip-label] -> (0, s, ebp) wvreg("modrm.reg", vsreg, psz+1, sk) if imark == "I" then waction("MARK") end end end if riprel then -- Emit rip-relative displacement. if match("UWSiI", imark) then werror("NYI: rip-relative displacement followed by immediate") end -- The previous byte in the action buffer cannot be 0xe9 or 0x80-0x8f. wputlabel("REL_", disp[1], 2) else wputdarg(disp) end return end local m if tdisp == "number" then -- Check displacement size at assembly time. if disp == 0 and band(reg, 7) ~= 5 then -- [ebp] -> [ebp+0] (in SIB, too) if not vreg then m = 0 end -- Force DISP to allow [Rd(5)] -> [ebp+0] elseif disp >= -128 and disp <= 127 then m = 1 else m = 2 end elseif tdisp == "table" then m = 2 end -- Index register present or esp as base register: need SIB encoding. if xreg or band(reg, 7) == 4 then wputmodrm(m or 2, s, 4) -- ModRM. if m == nil or imark == "I" then waction("MARK") end wvreg("modrm.reg", vsreg, psz+1, sk, vxreg or vreg) wputmodrm(t.xsc or 0, xreg or 4, reg) -- SIB. wvreg("sib.index", vxreg, psz+2, sk, vreg) wvreg("sib.base", vreg, psz+2, sk) else wputmodrm(m or 2, s, reg) -- ModRM. if (imark == "I" and (m == 1 or m == 2)) or (m == nil and (vsreg or vreg)) then waction("MARK") end wvreg("modrm.reg", vsreg, psz+1, sk, vreg) wvreg("modrm.rm.m", vreg, psz+1, sk) end -- Put displacement. if m == 1 then wputsbarg(disp) elseif m == 2 then wputdarg(disp) elseif m == nil then waction("DISP", disp) end end ------------------------------------------------------------------------------ -- Return human-readable operand mode string. local function opmodestr(op, args) local m = {} for i=1,#args do local a = args[i] m[#m+1] = sub(a.mode, 1, 1)..(a.opsize or "?") end return op.." "..concat(m, ",") end -- Convert number to valid integer or nil. local function toint(expr) local n = tonumber(expr) if n then if n % 1 ~= 0 or n < -2147483648 or n > 4294967295 then werror("bad integer number `"..expr.."'") end return n end end -- Parse immediate expression. local function immexpr(expr) -- &expr (pointer) if sub(expr, 1, 1) == "&" then return "iPJ", format("(ptrdiff_t)(%s)", sub(expr,2)) end local prefix = sub(expr, 1, 2) -- =>expr (pc label reference) if prefix == "=>" then return "iJ", sub(expr, 3) end -- ->name (global label reference) if prefix == "->" then return "iJ", map_global[sub(expr, 3)] end -- [<>][1-9] (local label reference) local dir, lnum = match(expr, "^([<>])([1-9])$") if dir then -- Fwd: 247-255, Bkwd: 1-9. return "iJ", lnum + (dir == ">" and 246 or 0) end local extname = match(expr, "^extern%s+(%S+)$") if extname then return "iJ", map_extern[extname] end -- expr (interpreted as immediate) return "iI", expr end -- Parse displacement expression: +-num, +-expr, +-opsize*num local function dispexpr(expr) local disp = expr == "" and 0 or toint(expr) if disp then return disp end local c, dispt = match(expr, "^([+-])%s*(.+)$") if c == "+" then expr = dispt elseif not c then werror("bad displacement expression `"..expr.."'") end local opsize, tailops = match(dispt, "^(%w+)%s*%*%s*(.+)$") local ops, imm = map_opsize[opsize], toint(tailops) if ops and imm then if c == "-" then imm = -imm end return imm*map_opsizenum[ops] end local mode, iexpr = immexpr(dispt) if mode == "iJ" then if c == "-" then werror("cannot invert label reference") end return { iexpr } end return expr -- Need to return original signed expression. end -- Parse register or type expression. local function rtexpr(expr) if not expr then return end local tname, ovreg = match(expr, "^([%w_]+):(@[%w_]+)$") local tp = map_type[tname or expr] if tp then local reg = ovreg or tp.reg local rnum = map_reg_num[reg] if not rnum then werror("type `"..(tname or expr).."' needs a register override") end if not map_reg_valid_base[reg] then werror("bad base register override `"..(map_reg_rev[reg] or reg).."'") end return reg, rnum, tp end return expr, map_reg_num[expr] end -- Parse operand and return { mode, opsize, reg, xreg, xsc, disp, imm }. local function parseoperand(param) local t = {} local expr = param local opsize, tailops = match(param, "^(%w+)%s*(.+)$") if opsize then t.opsize = map_opsize[opsize] if t.opsize then expr = tailops end end local br = match(expr, "^%[%s*(.-)%s*%]$") repeat if br then t.mode = "xm" -- [disp] t.disp = toint(br) if t.disp then t.mode = x64 and "xm" or "xmO" break end -- [reg...] local tp local reg, tailr = match(br, "^([@%w_:]+)%s*(.*)$") reg, t.reg, tp = rtexpr(reg) if not t.reg then -- [expr] t.mode = x64 and "xm" or "xmO" t.disp = dispexpr("+"..br) break end if t.reg == -1 then t.vreg, tailr = match(tailr, "^(%b())(.*)$") if not t.vreg then werror("bad variable register expression") end end -- [xreg*xsc] or [xreg*xsc+-disp] or [xreg*xsc+-expr] local xsc, tailsc = match(tailr, "^%*%s*([1248])%s*(.*)$") if xsc then if not map_reg_valid_index[reg] then werror("bad index register `"..map_reg_rev[reg].."'") end t.xsc = map_xsc[xsc] t.xreg = t.reg t.vxreg = t.vreg t.reg = nil t.vreg = nil t.disp = dispexpr(tailsc) break end if not map_reg_valid_base[reg] then werror("bad base register `"..map_reg_rev[reg].."'") end -- [reg] or [reg+-disp] t.disp = toint(tailr) or (tailr == "" and 0) if t.disp then break end -- [reg+xreg...] local xreg, tailx = match(tailr, "^+%s*([@%w_:]+)%s*(.*)$") xreg, t.xreg, tp = rtexpr(xreg) if not t.xreg then -- [reg+-expr] t.disp = dispexpr(tailr) break end if not map_reg_valid_index[xreg] then werror("bad index register `"..map_reg_rev[xreg].."'") end if t.xreg == -1 then t.vxreg, tailx = match(tailx, "^(%b())(.*)$") if not t.vxreg then werror("bad variable register expression") end end -- [reg+xreg*xsc...] local xsc, tailsc = match(tailx, "^%*%s*([1248])%s*(.*)$") if xsc then t.xsc = map_xsc[xsc] tailx = tailsc end -- [...] or [...+-disp] or [...+-expr] t.disp = dispexpr(tailx) else -- imm or opsize*imm local imm = toint(expr) if not imm and sub(expr, 1, 1) == "*" and t.opsize then imm = toint(sub(expr, 2)) if imm then imm = imm * map_opsizenum[t.opsize] t.opsize = nil end end if imm then if t.opsize then werror("bad operand size override") end local m = "i" if imm == 1 then m = m.."1" end if imm >= 4294967168 and imm <= 4294967295 then imm = imm-4294967296 end if imm >= -128 and imm <= 127 then m = m.."S" end t.imm = imm t.mode = m break end local tp local reg, tailr = match(expr, "^([@%w_:]+)%s*(.*)$") reg, t.reg, tp = rtexpr(reg) if t.reg then if t.reg == -1 then t.vreg, tailr = match(tailr, "^(%b())(.*)$") if not t.vreg then werror("bad variable register expression") end end -- reg if tailr == "" then if t.opsize then werror("bad operand size override") end t.opsize = map_reg_opsize[reg] if t.opsize == "f" then t.mode = t.reg == 0 and "fF" or "f" else if reg == "@w4" or (x64 and reg == "@d4") then wwarn("bad idea, try again with `"..(x64 and "rsp'" or "esp'")) end t.mode = t.reg == 0 and "rmR" or (reg == "@b1" and "rmC" or "rm") end t.needrex = map_reg_needrex[reg] break end -- type[idx], type[idx].field, type->field -> [reg+offset_expr] if not tp then werror("bad operand `"..param.."'") end t.mode = "xm" t.disp = format(tp.ctypefmt, tailr) else t.mode, t.imm = immexpr(expr) if sub(t.mode, -1) == "J" then if t.opsize and t.opsize ~= addrsize then werror("bad operand size override") end t.opsize = addrsize end end end until true return t end ------------------------------------------------------------------------------ -- x86 Template String Description -- =============================== -- -- Each template string is a list of [match:]pattern pairs, -- separated by "|". The first match wins. No match means a -- bad or unsupported combination of operand modes or sizes. -- -- The match part and the ":" is omitted if the operation has -- no operands. Otherwise the first N characters are matched -- against the mode strings of each of the N operands. -- -- The mode string for each operand type is (see parseoperand()): -- Integer register: "rm", +"R" for eax, ax, al, +"C" for cl -- FP register: "f", +"F" for st0 -- Index operand: "xm", +"O" for [disp] (pure offset) -- Immediate: "i", +"S" for signed 8 bit, +"1" for 1, -- +"I" for arg, +"P" for pointer -- Any: +"J" for valid jump targets -- -- So a match character "m" (mixed) matches both an integer register -- and an index operand (to be encoded with the ModRM/SIB scheme). -- But "r" matches only a register and "x" only an index operand -- (e.g. for FP memory access operations). -- -- The operand size match string starts right after the mode match -- characters and ends before the ":". "dwb" or "qdwb" is assumed, if empty. -- The effective data size of the operation is matched against this list. -- -- If only the regular "b", "w", "d", "q", "t" operand sizes are -- present, then all operands must be the same size. Unspecified sizes -- are ignored, but at least one operand must have a size or the pattern -- won't match (use the "byte", "word", "dword", "qword", "tword" -- operand size overrides. E.g.: mov dword [eax], 1). -- -- If the list has a "1" or "2" prefix, the operand size is taken -- from the respective operand and any other operand sizes are ignored. -- If the list contains only ".", all operand sizes are ignored. -- If the list has a "/" prefix, the concatenated (mixed) operand sizes -- are compared to the match. -- -- E.g. "rrdw" matches for either two dword registers or two word -- registers. "Fx2dq" matches an st0 operand plus an index operand -- pointing to a dword (float) or qword (double). -- -- Every character after the ":" is part of the pattern string: -- Hex chars are accumulated to form the opcode (left to right). -- "n" disables the standard opcode mods -- (otherwise: -1 for "b", o16 prefix for "w", rex.w for "q") -- "X" Force REX.W. -- "r"/"R" adds the reg. number from the 1st/2nd operand to the opcode. -- "m"/"M" generates ModRM/SIB from the 1st/2nd operand. -- The spare 3 bits are either filled with the last hex digit or -- the result from a previous "r"/"R". The opcode is restored. -- "u" Use VEX encoding, vvvv unused. -- "v"/"V" Use VEX encoding, vvvv from 1st/2nd operand (the operand is -- removed from the list used by future characters). -- "L" Force VEX.L -- -- All of the following characters force a flush of the opcode: -- "o"/"O" stores a pure 32 bit disp (offset) from the 1st/2nd operand. -- "s" stores a 4 bit immediate from the last register operand, -- followed by 4 zero bits. -- "S" stores a signed 8 bit immediate from the last operand. -- "U" stores an unsigned 8 bit immediate from the last operand. -- "W" stores an unsigned 16 bit immediate from the last operand. -- "i" stores an operand sized immediate from the last operand. -- "I" dito, but generates an action code to optionally modify -- the opcode (+2) for a signed 8 bit immediate. -- "J" generates one of the REL action codes from the last operand. -- ------------------------------------------------------------------------------ -- Template strings for x86 instructions. Ordered by first opcode byte. -- Unimplemented opcodes (deliberate omissions) are marked with *. local map_op = { -- 00-05: add... -- 06: *push es -- 07: *pop es -- 08-0D: or... -- 0E: *push cs -- 0F: two byte opcode prefix -- 10-15: adc... -- 16: *push ss -- 17: *pop ss -- 18-1D: sbb... -- 1E: *push ds -- 1F: *pop ds -- 20-25: and... es_0 = "26", -- 27: *daa -- 28-2D: sub... cs_0 = "2E", -- 2F: *das -- 30-35: xor... ss_0 = "36", -- 37: *aaa -- 38-3D: cmp... ds_0 = "3E", -- 3F: *aas inc_1 = x64 and "m:FF0m" or "rdw:40r|m:FF0m", dec_1 = x64 and "m:FF1m" or "rdw:48r|m:FF1m", push_1 = (x64 and "rq:n50r|rw:50r|mq:nFF6m|mw:FF6m" or "rdw:50r|mdw:FF6m").."|S.:6AS|ib:n6Ai|i.:68i", pop_1 = x64 and "rq:n58r|rw:58r|mq:n8F0m|mw:8F0m" or "rdw:58r|mdw:8F0m", -- 60: *pusha, *pushad, *pushaw -- 61: *popa, *popad, *popaw -- 62: *bound rdw,x -- 63: x86: *arpl mw,rw movsxd_2 = x64 and "rm/qd:63rM", fs_0 = "64", gs_0 = "65", o16_0 = "66", a16_0 = not x64 and "67" or nil, a32_0 = x64 and "67", -- 68: push idw -- 69: imul rdw,mdw,idw -- 6A: push ib -- 6B: imul rdw,mdw,S -- 6C: *insb -- 6D: *insd, *insw -- 6E: *outsb -- 6F: *outsd, *outsw -- 70-7F: jcc lb -- 80: add... mb,i -- 81: add... mdw,i -- 82: *undefined -- 83: add... mdw,S test_2 = "mr:85Rm|rm:85rM|Ri:A9ri|mi:F70mi", -- 86: xchg rb,mb -- 87: xchg rdw,mdw -- 88: mov mb,r -- 89: mov mdw,r -- 8A: mov r,mb -- 8B: mov r,mdw -- 8C: *mov mdw,seg lea_2 = "rx1dq:8DrM", -- 8E: *mov seg,mdw -- 8F: pop mdw nop_0 = "90", xchg_2 = "Rrqdw:90R|rRqdw:90r|rm:87rM|mr:87Rm", cbw_0 = "6698", cwde_0 = "98", cdqe_0 = "4898", cwd_0 = "6699", cdq_0 = "99", cqo_0 = "4899", -- 9A: *call iw:idw wait_0 = "9B", fwait_0 = "9B", pushf_0 = "9C", pushfd_0 = not x64 and "9C", pushfq_0 = x64 and "9C", popf_0 = "9D", popfd_0 = not x64 and "9D", popfq_0 = x64 and "9D", sahf_0 = "9E", lahf_0 = "9F", mov_2 = "OR:A3o|RO:A1O|mr:89Rm|rm:8BrM|rib:nB0ri|ridw:B8ri|mi:C70mi", movsb_0 = "A4", movsw_0 = "66A5", movsd_0 = "A5", cmpsb_0 = "A6", cmpsw_0 = "66A7", cmpsd_0 = "A7", -- A8: test Rb,i -- A9: test Rdw,i stosb_0 = "AA", stosw_0 = "66AB", stosd_0 = "AB", lodsb_0 = "AC", lodsw_0 = "66AD", lodsd_0 = "AD", scasb_0 = "AE", scasw_0 = "66AF", scasd_0 = "AF", -- B0-B7: mov rb,i -- B8-BF: mov rdw,i -- C0: rol... mb,i -- C1: rol... mdw,i ret_1 = "i.:nC2W", ret_0 = "C3", -- C4: *les rdw,mq -- C5: *lds rdw,mq -- C6: mov mb,i -- C7: mov mdw,i -- C8: *enter iw,ib leave_0 = "C9", -- CA: *retf iw -- CB: *retf int3_0 = "CC", int_1 = "i.:nCDU", into_0 = "CE", -- CF: *iret -- D0: rol... mb,1 -- D1: rol... mdw,1 -- D2: rol... mb,cl -- D3: rol... mb,cl -- D4: *aam ib -- D5: *aad ib -- D6: *salc -- D7: *xlat -- D8-DF: floating point ops -- E0: *loopne -- E1: *loope -- E2: *loop -- E3: *jcxz, *jecxz -- E4: *in Rb,ib -- E5: *in Rdw,ib -- E6: *out ib,Rb -- E7: *out ib,Rdw call_1 = x64 and "mq:nFF2m|J.:E8nJ" or "md:FF2m|J.:E8J", jmp_1 = x64 and "mq:nFF4m|J.:E9nJ" or "md:FF4m|J.:E9J", -- short: EB -- EA: *jmp iw:idw -- EB: jmp ib -- EC: *in Rb,dx -- ED: *in Rdw,dx -- EE: *out dx,Rb -- EF: *out dx,Rdw lock_0 = "F0", int1_0 = "F1", repne_0 = "F2", repnz_0 = "F2", rep_0 = "F3", repe_0 = "F3", repz_0 = "F3", -- F4: *hlt cmc_0 = "F5", -- F6: test... mb,i; div... mb -- F7: test... mdw,i; div... mdw clc_0 = "F8", stc_0 = "F9", -- FA: *cli cld_0 = "FC", std_0 = "FD", -- FE: inc... mb -- FF: inc... mdw -- misc ops not_1 = "m:F72m", neg_1 = "m:F73m", mul_1 = "m:F74m", imul_1 = "m:F75m", div_1 = "m:F76m", idiv_1 = "m:F77m", imul_2 = "rmqdw:0FAFrM|rIqdw:69rmI|rSqdw:6BrmS|riqdw:69rmi", imul_3 = "rmIqdw:69rMI|rmSqdw:6BrMS|rmiqdw:69rMi", movzx_2 = "rm/db:0FB6rM|rm/qb:|rm/wb:0FB6rM|rm/dw:0FB7rM|rm/qw:", movsx_2 = "rm/db:0FBErM|rm/qb:|rm/wb:0FBErM|rm/dw:0FBFrM|rm/qw:", bswap_1 = "rqd:0FC8r", bsf_2 = "rmqdw:0FBCrM", bsr_2 = "rmqdw:0FBDrM", bt_2 = "mrqdw:0FA3Rm|miqdw:0FBA4mU", btc_2 = "mrqdw:0FBBRm|miqdw:0FBA7mU", btr_2 = "mrqdw:0FB3Rm|miqdw:0FBA6mU", bts_2 = "mrqdw:0FABRm|miqdw:0FBA5mU", shld_3 = "mriqdw:0FA4RmU|mrC/qq:0FA5Rm|mrC/dd:|mrC/ww:", shrd_3 = "mriqdw:0FACRmU|mrC/qq:0FADRm|mrC/dd:|mrC/ww:", rdtsc_0 = "0F31", -- P1+ rdpmc_0 = "0F33", -- P6+ cpuid_0 = "0FA2", -- P1+ -- floating point ops fst_1 = "ff:DDD0r|xd:D92m|xq:nDD2m", fstp_1 = "ff:DDD8r|xd:D93m|xq:nDD3m|xt:DB7m", fld_1 = "ff:D9C0r|xd:D90m|xq:nDD0m|xt:DB5m", fpop_0 = "DDD8", -- Alias for fstp st0. fist_1 = "xw:nDF2m|xd:DB2m", fistp_1 = "xw:nDF3m|xd:DB3m|xq:nDF7m", fild_1 = "xw:nDF0m|xd:DB0m|xq:nDF5m", fxch_0 = "D9C9", fxch_1 = "ff:D9C8r", fxch_2 = "fFf:D9C8r|Fff:D9C8R", fucom_1 = "ff:DDE0r", fucom_2 = "Fff:DDE0R", fucomp_1 = "ff:DDE8r", fucomp_2 = "Fff:DDE8R", fucomi_1 = "ff:DBE8r", -- P6+ fucomi_2 = "Fff:DBE8R", -- P6+ fucomip_1 = "ff:DFE8r", -- P6+ fucomip_2 = "Fff:DFE8R", -- P6+ fcomi_1 = "ff:DBF0r", -- P6+ fcomi_2 = "Fff:DBF0R", -- P6+ fcomip_1 = "ff:DFF0r", -- P6+ fcomip_2 = "Fff:DFF0R", -- P6+ fucompp_0 = "DAE9", fcompp_0 = "DED9", fldenv_1 = "x.:D94m", fnstenv_1 = "x.:D96m", fstenv_1 = "x.:9BD96m", fldcw_1 = "xw:nD95m", fstcw_1 = "xw:n9BD97m", fnstcw_1 = "xw:nD97m", fstsw_1 = "Rw:n9BDFE0|xw:n9BDD7m", fnstsw_1 = "Rw:nDFE0|xw:nDD7m", fclex_0 = "9BDBE2", fnclex_0 = "DBE2", fnop_0 = "D9D0", -- D9D1-D9DF: unassigned fchs_0 = "D9E0", fabs_0 = "D9E1", -- D9E2: unassigned -- D9E3: unassigned ftst_0 = "D9E4", fxam_0 = "D9E5", -- D9E6: unassigned -- D9E7: unassigned fld1_0 = "D9E8", fldl2t_0 = "D9E9", fldl2e_0 = "D9EA", fldpi_0 = "D9EB", fldlg2_0 = "D9EC", fldln2_0 = "D9ED", fldz_0 = "D9EE", -- D9EF: unassigned f2xm1_0 = "D9F0", fyl2x_0 = "D9F1", fptan_0 = "D9F2", fpatan_0 = "D9F3", fxtract_0 = "D9F4", fprem1_0 = "D9F5", fdecstp_0 = "D9F6", fincstp_0 = "D9F7", fprem_0 = "D9F8", fyl2xp1_0 = "D9F9", fsqrt_0 = "D9FA", fsincos_0 = "D9FB", frndint_0 = "D9FC", fscale_0 = "D9FD", fsin_0 = "D9FE", fcos_0 = "D9FF", -- SSE, SSE2 andnpd_2 = "rmo:660F55rM", andnps_2 = "rmo:0F55rM", andpd_2 = "rmo:660F54rM", andps_2 = "rmo:0F54rM", clflush_1 = "x.:0FAE7m", cmppd_3 = "rmio:660FC2rMU", cmpps_3 = "rmio:0FC2rMU", cmpsd_3 = "rrio:F20FC2rMU|rxi/oq:", cmpss_3 = "rrio:F30FC2rMU|rxi/od:", comisd_2 = "rro:660F2FrM|rx/oq:", comiss_2 = "rro:0F2FrM|rx/od:", cvtdq2pd_2 = "rro:F30FE6rM|rx/oq:", cvtdq2ps_2 = "rmo:0F5BrM", cvtpd2dq_2 = "rmo:F20FE6rM", cvtpd2ps_2 = "rmo:660F5ArM", cvtpi2pd_2 = "rx/oq:660F2ArM", cvtpi2ps_2 = "rx/oq:0F2ArM", cvtps2dq_2 = "rmo:660F5BrM", cvtps2pd_2 = "rro:0F5ArM|rx/oq:", cvtsd2si_2 = "rr/do:F20F2DrM|rr/qo:|rx/dq:|rxq:", cvtsd2ss_2 = "rro:F20F5ArM|rx/oq:", cvtsi2sd_2 = "rm/od:F20F2ArM|rm/oq:F20F2ArXM", cvtsi2ss_2 = "rm/od:F30F2ArM|rm/oq:F30F2ArXM", cvtss2sd_2 = "rro:F30F5ArM|rx/od:", cvtss2si_2 = "rr/do:F30F2DrM|rr/qo:|rxd:|rx/qd:", cvttpd2dq_2 = "rmo:660FE6rM", cvttps2dq_2 = "rmo:F30F5BrM", cvttsd2si_2 = "rr/do:F20F2CrM|rr/qo:|rx/dq:|rxq:", cvttss2si_2 = "rr/do:F30F2CrM|rr/qo:|rxd:|rx/qd:", fxsave_1 = "x.:0FAE0m", fxrstor_1 = "x.:0FAE1m", ldmxcsr_1 = "xd:0FAE2m", lfence_0 = "0FAEE8", maskmovdqu_2 = "rro:660FF7rM", mfence_0 = "0FAEF0", movapd_2 = "rmo:660F28rM|mro:660F29Rm", movaps_2 = "rmo:0F28rM|mro:0F29Rm", movd_2 = "rm/od:660F6ErM|rm/oq:660F6ErXM|mr/do:660F7ERm|mr/qo:", movdqa_2 = "rmo:660F6FrM|mro:660F7FRm", movdqu_2 = "rmo:F30F6FrM|mro:F30F7FRm", movhlps_2 = "rro:0F12rM", movhpd_2 = "rx/oq:660F16rM|xr/qo:n660F17Rm", movhps_2 = "rx/oq:0F16rM|xr/qo:n0F17Rm", movlhps_2 = "rro:0F16rM", movlpd_2 = "rx/oq:660F12rM|xr/qo:n660F13Rm", movlps_2 = "rx/oq:0F12rM|xr/qo:n0F13Rm", movmskpd_2 = "rr/do:660F50rM", movmskps_2 = "rr/do:0F50rM", movntdq_2 = "xro:660FE7Rm", movnti_2 = "xrqd:0FC3Rm", movntpd_2 = "xro:660F2BRm", movntps_2 = "xro:0F2BRm", movq_2 = "rro:F30F7ErM|rx/oq:|xr/qo:n660FD6Rm", movsd_2 = "rro:F20F10rM|rx/oq:|xr/qo:nF20F11Rm", movss_2 = "rro:F30F10rM|rx/od:|xr/do:F30F11Rm", movupd_2 = "rmo:660F10rM|mro:660F11Rm", movups_2 = "rmo:0F10rM|mro:0F11Rm", orpd_2 = "rmo:660F56rM", orps_2 = "rmo:0F56rM", pause_0 = "F390", pextrw_3 = "rri/do:660FC5rMU|xri/wo:660F3A15nRmU", -- Mem op: SSE4.1 only. pinsrw_3 = "rri/od:660FC4rMU|rxi/ow:", pmovmskb_2 = "rr/do:660FD7rM", prefetchnta_1 = "xb:n0F180m", prefetcht0_1 = "xb:n0F181m", prefetcht1_1 = "xb:n0F182m", prefetcht2_1 = "xb:n0F183m", pshufd_3 = "rmio:660F70rMU", pshufhw_3 = "rmio:F30F70rMU", pshuflw_3 = "rmio:F20F70rMU", pslld_2 = "rmo:660FF2rM|rio:660F726mU", pslldq_2 = "rio:660F737mU", psllq_2 = "rmo:660FF3rM|rio:660F736mU", psllw_2 = "rmo:660FF1rM|rio:660F716mU", psrad_2 = "rmo:660FE2rM|rio:660F724mU", psraw_2 = "rmo:660FE1rM|rio:660F714mU", psrld_2 = "rmo:660FD2rM|rio:660F722mU", psrldq_2 = "rio:660F733mU", psrlq_2 = "rmo:660FD3rM|rio:660F732mU", psrlw_2 = "rmo:660FD1rM|rio:660F712mU", rcpps_2 = "rmo:0F53rM", rcpss_2 = "rro:F30F53rM|rx/od:", rsqrtps_2 = "rmo:0F52rM", rsqrtss_2 = "rmo:F30F52rM", sfence_0 = "0FAEF8", shufpd_3 = "rmio:660FC6rMU", shufps_3 = "rmio:0FC6rMU", stmxcsr_1 = "xd:0FAE3m", ucomisd_2 = "rro:660F2ErM|rx/oq:", ucomiss_2 = "rro:0F2ErM|rx/od:", unpckhpd_2 = "rmo:660F15rM", unpckhps_2 = "rmo:0F15rM", unpcklpd_2 = "rmo:660F14rM", unpcklps_2 = "rmo:0F14rM", xorpd_2 = "rmo:660F57rM", xorps_2 = "rmo:0F57rM", -- SSE3 ops fisttp_1 = "xw:nDF1m|xd:DB1m|xq:nDD1m", addsubpd_2 = "rmo:660FD0rM", addsubps_2 = "rmo:F20FD0rM", haddpd_2 = "rmo:660F7CrM", haddps_2 = "rmo:F20F7CrM", hsubpd_2 = "rmo:660F7DrM", hsubps_2 = "rmo:F20F7DrM", lddqu_2 = "rxo:F20FF0rM", movddup_2 = "rmo:F20F12rM", movshdup_2 = "rmo:F30F16rM", movsldup_2 = "rmo:F30F12rM", -- SSSE3 ops pabsb_2 = "rmo:660F381CrM", pabsd_2 = "rmo:660F381ErM", pabsw_2 = "rmo:660F381DrM", palignr_3 = "rmio:660F3A0FrMU", phaddd_2 = "rmo:660F3802rM", phaddsw_2 = "rmo:660F3803rM", phaddw_2 = "rmo:660F3801rM", phsubd_2 = "rmo:660F3806rM", phsubsw_2 = "rmo:660F3807rM", phsubw_2 = "rmo:660F3805rM", pmaddubsw_2 = "rmo:660F3804rM", pmulhrsw_2 = "rmo:660F380BrM", pshufb_2 = "rmo:660F3800rM", psignb_2 = "rmo:660F3808rM", psignd_2 = "rmo:660F380ArM", psignw_2 = "rmo:660F3809rM", -- SSE4.1 ops blendpd_3 = "rmio:660F3A0DrMU", blendps_3 = "rmio:660F3A0CrMU", blendvpd_3 = "rmRo:660F3815rM", blendvps_3 = "rmRo:660F3814rM", dppd_3 = "rmio:660F3A41rMU", dpps_3 = "rmio:660F3A40rMU", extractps_3 = "mri/do:660F3A17RmU|rri/qo:660F3A17RXmU", insertps_3 = "rrio:660F3A41rMU|rxi/od:", movntdqa_2 = "rxo:660F382ArM", mpsadbw_3 = "rmio:660F3A42rMU", packusdw_2 = "rmo:660F382BrM", pblendvb_3 = "rmRo:660F3810rM", pblendw_3 = "rmio:660F3A0ErMU", pcmpeqq_2 = "rmo:660F3829rM", pextrb_3 = "rri/do:660F3A14nRmU|rri/qo:|xri/bo:", pextrd_3 = "mri/do:660F3A16RmU", pextrq_3 = "mri/qo:660F3A16RmU", -- pextrw is SSE2, mem operand is SSE4.1 only phminposuw_2 = "rmo:660F3841rM", pinsrb_3 = "rri/od:660F3A20nrMU|rxi/ob:", pinsrd_3 = "rmi/od:660F3A22rMU", pinsrq_3 = "rmi/oq:660F3A22rXMU", pmaxsb_2 = "rmo:660F383CrM", pmaxsd_2 = "rmo:660F383DrM", pmaxud_2 = "rmo:660F383FrM", pmaxuw_2 = "rmo:660F383ErM", pminsb_2 = "rmo:660F3838rM", pminsd_2 = "rmo:660F3839rM", pminud_2 = "rmo:660F383BrM", pminuw_2 = "rmo:660F383ArM", pmovsxbd_2 = "rro:660F3821rM|rx/od:", pmovsxbq_2 = "rro:660F3822rM|rx/ow:", pmovsxbw_2 = "rro:660F3820rM|rx/oq:", pmovsxdq_2 = "rro:660F3825rM|rx/oq:", pmovsxwd_2 = "rro:660F3823rM|rx/oq:", pmovsxwq_2 = "rro:660F3824rM|rx/od:", pmovzxbd_2 = "rro:660F3831rM|rx/od:", pmovzxbq_2 = "rro:660F3832rM|rx/ow:", pmovzxbw_2 = "rro:660F3830rM|rx/oq:", pmovzxdq_2 = "rro:660F3835rM|rx/oq:", pmovzxwd_2 = "rro:660F3833rM|rx/oq:", pmovzxwq_2 = "rro:660F3834rM|rx/od:", pmuldq_2 = "rmo:660F3828rM", pmulld_2 = "rmo:660F3840rM", ptest_2 = "rmo:660F3817rM", roundpd_3 = "rmio:660F3A09rMU", roundps_3 = "rmio:660F3A08rMU", roundsd_3 = "rrio:660F3A0BrMU|rxi/oq:", roundss_3 = "rrio:660F3A0ArMU|rxi/od:", -- SSE4.2 ops crc32_2 = "rmqd:F20F38F1rM|rm/dw:66F20F38F1rM|rm/db:F20F38F0rM|rm/qb:", pcmpestri_3 = "rmio:660F3A61rMU", pcmpestrm_3 = "rmio:660F3A60rMU", pcmpgtq_2 = "rmo:660F3837rM", pcmpistri_3 = "rmio:660F3A63rMU", pcmpistrm_3 = "rmio:660F3A62rMU", popcnt_2 = "rmqdw:F30FB8rM", -- SSE4a extrq_2 = "rro:660F79rM", extrq_3 = "riio:660F780mUU", insertq_2 = "rro:F20F79rM", insertq_4 = "rriio:F20F78rMUU", lzcnt_2 = "rmqdw:F30FBDrM", movntsd_2 = "xr/qo:nF20F2BRm", movntss_2 = "xr/do:F30F2BRm", -- popcnt is also in SSE4.2 -- AES-NI aesdec_2 = "rmo:660F38DErM", aesdeclast_2 = "rmo:660F38DFrM", aesenc_2 = "rmo:660F38DCrM", aesenclast_2 = "rmo:660F38DDrM", aesimc_2 = "rmo:660F38DBrM", aeskeygenassist_3 = "rmio:660F3ADFrMU", pclmulqdq_3 = "rmio:660F3A44rMU", -- AVX FP ops vaddsubpd_3 = "rrmoy:660FVD0rM", vaddsubps_3 = "rrmoy:F20FVD0rM", vandpd_3 = "rrmoy:660FV54rM", vandps_3 = "rrmoy:0FV54rM", vandnpd_3 = "rrmoy:660FV55rM", vandnps_3 = "rrmoy:0FV55rM", vblendpd_4 = "rrmioy:660F3AV0DrMU", vblendps_4 = "rrmioy:660F3AV0CrMU", vblendvpd_4 = "rrmroy:660F3AV4BrMs", vblendvps_4 = "rrmroy:660F3AV4ArMs", vbroadcastf128_2 = "rx/yo:660F38u1ArM", vcmppd_4 = "rrmioy:660FVC2rMU", vcmpps_4 = "rrmioy:0FVC2rMU", vcmpsd_4 = "rrrio:F20FVC2rMU|rrxi/ooq:", vcmpss_4 = "rrrio:F30FVC2rMU|rrxi/ood:", vcomisd_2 = "rro:660Fu2FrM|rx/oq:", vcomiss_2 = "rro:0Fu2FrM|rx/od:", vcvtdq2pd_2 = "rro:F30FuE6rM|rx/oq:|rm/yo:", vcvtdq2ps_2 = "rmoy:0Fu5BrM", vcvtpd2dq_2 = "rmoy:F20FuE6rM", vcvtpd2ps_2 = "rmoy:660Fu5ArM", vcvtps2dq_2 = "rmoy:660Fu5BrM", vcvtps2pd_2 = "rro:0Fu5ArM|rx/oq:|rm/yo:", vcvtsd2si_2 = "rr/do:F20Fu2DrM|rx/dq:|rr/qo:|rxq:", vcvtsd2ss_3 = "rrro:F20FV5ArM|rrx/ooq:", vcvtsi2sd_3 = "rrm/ood:F20FV2ArM|rrm/ooq:F20FVX2ArM", vcvtsi2ss_3 = "rrm/ood:F30FV2ArM|rrm/ooq:F30FVX2ArM", vcvtss2sd_3 = "rrro:F30FV5ArM|rrx/ood:", vcvtss2si_2 = "rr/do:F30Fu2DrM|rxd:|rr/qo:|rx/qd:", vcvttpd2dq_2 = "rmo:660FuE6rM|rm/oy:660FuLE6rM", vcvttps2dq_2 = "rmoy:F30Fu5BrM", vcvttsd2si_2 = "rr/do:F20Fu2CrM|rx/dq:|rr/qo:|rxq:", vcvttss2si_2 = "rr/do:F30Fu2CrM|rxd:|rr/qo:|rx/qd:", vdppd_4 = "rrmio:660F3AV41rMU", vdpps_4 = "rrmioy:660F3AV40rMU", vextractf128_3 = "mri/oy:660F3AuL19RmU", vextractps_3 = "mri/do:660F3Au17RmU", vhaddpd_3 = "rrmoy:660FV7CrM", vhaddps_3 = "rrmoy:F20FV7CrM", vhsubpd_3 = "rrmoy:660FV7DrM", vhsubps_3 = "rrmoy:F20FV7DrM", vinsertf128_4 = "rrmi/yyo:660F3AV18rMU", vinsertps_4 = "rrrio:660F3AV21rMU|rrxi/ood:", vldmxcsr_1 = "xd:0FuAE2m", vmaskmovps_3 = "rrxoy:660F38V2CrM|xrroy:660F38V2ERm", vmaskmovpd_3 = "rrxoy:660F38V2DrM|xrroy:660F38V2FRm", vmovapd_2 = "rmoy:660Fu28rM|mroy:660Fu29Rm", vmovaps_2 = "rmoy:0Fu28rM|mroy:0Fu29Rm", vmovd_2 = "rm/od:660Fu6ErM|rm/oq:660FuX6ErM|mr/do:660Fu7ERm|mr/qo:", vmovq_2 = "rro:F30Fu7ErM|rx/oq:|xr/qo:660FuD6Rm", vmovddup_2 = "rmy:F20Fu12rM|rro:|rx/oq:", vmovhlps_3 = "rrro:0FV12rM", vmovhpd_2 = "xr/qo:660Fu17Rm", vmovhpd_3 = "rrx/ooq:660FV16rM", vmovhps_2 = "xr/qo:0Fu17Rm", vmovhps_3 = "rrx/ooq:0FV16rM", vmovlhps_3 = "rrro:0FV16rM", vmovlpd_2 = "xr/qo:660Fu13Rm", vmovlpd_3 = "rrx/ooq:660FV12rM", vmovlps_2 = "xr/qo:0Fu13Rm", vmovlps_3 = "rrx/ooq:0FV12rM", vmovmskpd_2 = "rr/do:660Fu50rM|rr/dy:660FuL50rM", vmovmskps_2 = "rr/do:0Fu50rM|rr/dy:0FuL50rM", vmovntpd_2 = "xroy:660Fu2BRm", vmovntps_2 = "xroy:0Fu2BRm", vmovsd_2 = "rx/oq:F20Fu10rM|xr/qo:F20Fu11Rm", vmovsd_3 = "rrro:F20FV10rM", vmovshdup_2 = "rmoy:F30Fu16rM", vmovsldup_2 = "rmoy:F30Fu12rM", vmovss_2 = "rx/od:F30Fu10rM|xr/do:F30Fu11Rm", vmovss_3 = "rrro:F30FV10rM", vmovupd_2 = "rmoy:660Fu10rM|mroy:660Fu11Rm", vmovups_2 = "rmoy:0Fu10rM|mroy:0Fu11Rm", vorpd_3 = "rrmoy:660FV56rM", vorps_3 = "rrmoy:0FV56rM", vpermilpd_3 = "rrmoy:660F38V0DrM|rmioy:660F3Au05rMU", vpermilps_3 = "rrmoy:660F38V0CrM|rmioy:660F3Au04rMU", vperm2f128_4 = "rrmiy:660F3AV06rMU", vptestpd_2 = "rmoy:660F38u0FrM", vptestps_2 = "rmoy:660F38u0ErM", vrcpps_2 = "rmoy:0Fu53rM", vrcpss_3 = "rrro:F30FV53rM|rrx/ood:", vrsqrtps_2 = "rmoy:0Fu52rM", vrsqrtss_3 = "rrro:F30FV52rM|rrx/ood:", vroundpd_3 = "rmioy:660F3AV09rMU", vroundps_3 = "rmioy:660F3AV08rMU", vroundsd_4 = "rrrio:660F3AV0BrMU|rrxi/ooq:", vroundss_4 = "rrrio:660F3AV0ArMU|rrxi/ood:", vshufpd_4 = "rrmioy:660FVC6rMU", vshufps_4 = "rrmioy:0FVC6rMU", vsqrtps_2 = "rmoy:0Fu51rM", vsqrtss_2 = "rro:F30Fu51rM|rx/od:", vsqrtpd_2 = "rmoy:660Fu51rM", vsqrtsd_2 = "rro:F20Fu51rM|rx/oq:", vstmxcsr_1 = "xd:0FuAE3m", vucomisd_2 = "rro:660Fu2ErM|rx/oq:", vucomiss_2 = "rro:0Fu2ErM|rx/od:", vunpckhpd_3 = "rrmoy:660FV15rM", vunpckhps_3 = "rrmoy:0FV15rM", vunpcklpd_3 = "rrmoy:660FV14rM", vunpcklps_3 = "rrmoy:0FV14rM", vxorpd_3 = "rrmoy:660FV57rM", vxorps_3 = "rrmoy:0FV57rM", vzeroall_0 = "0FuL77", vzeroupper_0 = "0Fu77", -- AVX2 FP ops vbroadcastss_2 = "rx/od:660F38u18rM|rx/yd:|rro:|rr/yo:", vbroadcastsd_2 = "rx/yq:660F38u19rM|rr/yo:", -- *vgather* (!vsib) vpermpd_3 = "rmiy:660F3AuX01rMU", vpermps_3 = "rrmy:660F38V16rM", -- AVX, AVX2 integer ops -- In general, xmm requires AVX, ymm requires AVX2. vaesdec_3 = "rrmo:660F38VDErM", vaesdeclast_3 = "rrmo:660F38VDFrM", vaesenc_3 = "rrmo:660F38VDCrM", vaesenclast_3 = "rrmo:660F38VDDrM", vaesimc_2 = "rmo:660F38uDBrM", vaeskeygenassist_3 = "rmio:660F3AuDFrMU", vlddqu_2 = "rxoy:F20FuF0rM", vmaskmovdqu_2 = "rro:660FuF7rM", vmovdqa_2 = "rmoy:660Fu6FrM|mroy:660Fu7FRm", vmovdqu_2 = "rmoy:F30Fu6FrM|mroy:F30Fu7FRm", vmovntdq_2 = "xroy:660FuE7Rm", vmovntdqa_2 = "rxoy:660F38u2ArM", vmpsadbw_4 = "rrmioy:660F3AV42rMU", vpabsb_2 = "rmoy:660F38u1CrM", vpabsd_2 = "rmoy:660F38u1ErM", vpabsw_2 = "rmoy:660F38u1DrM", vpackusdw_3 = "rrmoy:660F38V2BrM", vpalignr_4 = "rrmioy:660F3AV0FrMU", vpblendvb_4 = "rrmroy:660F3AV4CrMs", vpblendw_4 = "rrmioy:660F3AV0ErMU", vpclmulqdq_4 = "rrmio:660F3AV44rMU", vpcmpeqq_3 = "rrmoy:660F38V29rM", vpcmpestri_3 = "rmio:660F3Au61rMU", vpcmpestrm_3 = "rmio:660F3Au60rMU", vpcmpgtq_3 = "rrmoy:660F38V37rM", vpcmpistri_3 = "rmio:660F3Au63rMU", vpcmpistrm_3 = "rmio:660F3Au62rMU", vpextrb_3 = "rri/do:660F3Au14nRmU|rri/qo:|xri/bo:", vpextrw_3 = "rri/do:660FuC5rMU|xri/wo:660F3Au15nRmU", vpextrd_3 = "mri/do:660F3Au16RmU", vpextrq_3 = "mri/qo:660F3Au16RmU", vphaddw_3 = "rrmoy:660F38V01rM", vphaddd_3 = "rrmoy:660F38V02rM", vphaddsw_3 = "rrmoy:660F38V03rM", vphminposuw_2 = "rmo:660F38u41rM", vphsubw_3 = "rrmoy:660F38V05rM", vphsubd_3 = "rrmoy:660F38V06rM", vphsubsw_3 = "rrmoy:660F38V07rM", vpinsrb_4 = "rrri/ood:660F3AV20rMU|rrxi/oob:", vpinsrw_4 = "rrri/ood:660FVC4rMU|rrxi/oow:", vpinsrd_4 = "rrmi/ood:660F3AV22rMU", vpinsrq_4 = "rrmi/ooq:660F3AVX22rMU", vpmaddubsw_3 = "rrmoy:660F38V04rM", vpmaxsb_3 = "rrmoy:660F38V3CrM", vpmaxsd_3 = "rrmoy:660F38V3DrM", vpmaxuw_3 = "rrmoy:660F38V3ErM", vpmaxud_3 = "rrmoy:660F38V3FrM", vpminsb_3 = "rrmoy:660F38V38rM", vpminsd_3 = "rrmoy:660F38V39rM", vpminuw_3 = "rrmoy:660F38V3ArM", vpminud_3 = "rrmoy:660F38V3BrM", vpmovmskb_2 = "rr/do:660FuD7rM|rr/dy:660FuLD7rM", vpmovsxbw_2 = "rroy:660F38u20rM|rx/oq:|rx/yo:", vpmovsxbd_2 = "rroy:660F38u21rM|rx/od:|rx/yq:", vpmovsxbq_2 = "rroy:660F38u22rM|rx/ow:|rx/yd:", vpmovsxwd_2 = "rroy:660F38u23rM|rx/oq:|rx/yo:", vpmovsxwq_2 = "rroy:660F38u24rM|rx/od:|rx/yq:", vpmovsxdq_2 = "rroy:660F38u25rM|rx/oq:|rx/yo:", vpmovzxbw_2 = "rroy:660F38u30rM|rx/oq:|rx/yo:", vpmovzxbd_2 = "rroy:660F38u31rM|rx/od:|rx/yq:", vpmovzxbq_2 = "rroy:660F38u32rM|rx/ow:|rx/yd:", vpmovzxwd_2 = "rroy:660F38u33rM|rx/oq:|rx/yo:", vpmovzxwq_2 = "rroy:660F38u34rM|rx/od:|rx/yq:", vpmovzxdq_2 = "rroy:660F38u35rM|rx/oq:|rx/yo:", vpmuldq_3 = "rrmoy:660F38V28rM", vpmulhrsw_3 = "rrmoy:660F38V0BrM", vpmulld_3 = "rrmoy:660F38V40rM", vpshufb_3 = "rrmoy:660F38V00rM", vpshufd_3 = "rmioy:660Fu70rMU", vpshufhw_3 = "rmioy:F30Fu70rMU", vpshuflw_3 = "rmioy:F20Fu70rMU", vpsignb_3 = "rrmoy:660F38V08rM", vpsignw_3 = "rrmoy:660F38V09rM", vpsignd_3 = "rrmoy:660F38V0ArM", vpslldq_3 = "rrioy:660Fv737mU", vpsllw_3 = "rrmoy:660FVF1rM|rrioy:660Fv716mU", vpslld_3 = "rrmoy:660FVF2rM|rrioy:660Fv726mU", vpsllq_3 = "rrmoy:660FVF3rM|rrioy:660Fv736mU", vpsraw_3 = "rrmoy:660FVE1rM|rrioy:660Fv714mU", vpsrad_3 = "rrmoy:660FVE2rM|rrioy:660Fv724mU", vpsrldq_3 = "rrioy:660Fv733mU", vpsrlw_3 = "rrmoy:660FVD1rM|rrioy:660Fv712mU", vpsrld_3 = "rrmoy:660FVD2rM|rrioy:660Fv722mU", vpsrlq_3 = "rrmoy:660FVD3rM|rrioy:660Fv732mU", vptest_2 = "rmoy:660F38u17rM", -- AVX2 integer ops vbroadcasti128_2 = "rx/yo:660F38u5ArM", vinserti128_4 = "rrmi/yyo:660F3AV38rMU", vextracti128_3 = "mri/oy:660F3AuL39RmU", vpblendd_4 = "rrmioy:660F3AV02rMU", vpbroadcastb_2 = "rro:660F38u78rM|rx/ob:|rr/yo:|rx/yb:", vpbroadcastw_2 = "rro:660F38u79rM|rx/ow:|rr/yo:|rx/yw:", vpbroadcastd_2 = "rro:660F38u58rM|rx/od:|rr/yo:|rx/yd:", vpbroadcastq_2 = "rro:660F38u59rM|rx/oq:|rr/yo:|rx/yq:", vpermd_3 = "rrmy:660F38V36rM", vpermq_3 = "rmiy:660F3AuX00rMU", -- *vpgather* (!vsib) vperm2i128_4 = "rrmiy:660F3AV46rMU", vpmaskmovd_3 = "rrxoy:660F38V8CrM|xrroy:660F38V8ERm", vpmaskmovq_3 = "rrxoy:660F38VX8CrM|xrroy:660F38VX8ERm", vpsllvd_3 = "rrmoy:660F38V47rM", vpsllvq_3 = "rrmoy:660F38VX47rM", vpsravd_3 = "rrmoy:660F38V46rM", vpsrlvd_3 = "rrmoy:660F38V45rM", vpsrlvq_3 = "rrmoy:660F38VX45rM", -- Intel ADX adcx_2 = "rmqd:660F38F6rM", adox_2 = "rmqd:F30F38F6rM", } ------------------------------------------------------------------------------ -- Arithmetic ops. for name,n in pairs{ add = 0, ["or"] = 1, adc = 2, sbb = 3, ["and"] = 4, sub = 5, xor = 6, cmp = 7 } do local n8 = shl(n, 3) map_op[name.."_2"] = format( "mr:%02XRm|rm:%02XrM|mI1qdw:81%XmI|mS1qdw:83%XmS|Ri1qdwb:%02Xri|mi1qdwb:81%Xmi", 1+n8, 3+n8, n, n, 5+n8, n) end -- Shift ops. for name,n in pairs{ rol = 0, ror = 1, rcl = 2, rcr = 3, shl = 4, shr = 5, sar = 7, sal = 4 } do map_op[name.."_2"] = format("m1:D1%Xm|mC1qdwb:D3%Xm|mi:C1%XmU", n, n, n) end -- Conditional ops. for cc,n in pairs(map_cc) do map_op["j"..cc.."_1"] = format("J.:n0F8%XJ", n) -- short: 7%X map_op["set"..cc.."_1"] = format("mb:n0F9%X2m", n) map_op["cmov"..cc.."_2"] = format("rmqdw:0F4%XrM", n) -- P6+ end -- FP arithmetic ops. for name,n in pairs{ add = 0, mul = 1, com = 2, comp = 3, sub = 4, subr = 5, div = 6, divr = 7 } do local nc = 0xc0 + shl(n, 3) local nr = nc + (n < 4 and 0 or (n % 2 == 0 and 8 or -8)) local fn = "f"..name map_op[fn.."_1"] = format("ff:D8%02Xr|xd:D8%Xm|xq:nDC%Xm", nc, n, n) if n == 2 or n == 3 then map_op[fn.."_2"] = format("Fff:D8%02XR|Fx2d:D8%XM|Fx2q:nDC%XM", nc, n, n) else map_op[fn.."_2"] = format("Fff:D8%02XR|fFf:DC%02Xr|Fx2d:D8%XM|Fx2q:nDC%XM", nc, nr, n, n) map_op[fn.."p_1"] = format("ff:DE%02Xr", nr) map_op[fn.."p_2"] = format("fFf:DE%02Xr", nr) end map_op["fi"..name.."_1"] = format("xd:DA%Xm|xw:nDE%Xm", n, n) end -- FP conditional moves. for cc,n in pairs{ b=0, e=1, be=2, u=3, nb=4, ne=5, nbe=6, nu=7 } do local nc = 0xdac0 + shl(band(n, 3), 3) + shl(band(n, 4), 6) map_op["fcmov"..cc.."_1"] = format("ff:%04Xr", nc) -- P6+ map_op["fcmov"..cc.."_2"] = format("Fff:%04XR", nc) -- P6+ end -- SSE / AVX FP arithmetic ops. for name,n in pairs{ sqrt = 1, add = 8, mul = 9, sub = 12, min = 13, div = 14, max = 15 } do map_op[name.."ps_2"] = format("rmo:0F5%XrM", n) map_op[name.."ss_2"] = format("rro:F30F5%XrM|rx/od:", n) map_op[name.."pd_2"] = format("rmo:660F5%XrM", n) map_op[name.."sd_2"] = format("rro:F20F5%XrM|rx/oq:", n) if n ~= 1 then map_op["v"..name.."ps_3"] = format("rrmoy:0FV5%XrM", n) map_op["v"..name.."ss_3"] = format("rrro:F30FV5%XrM|rrx/ood:", n) map_op["v"..name.."pd_3"] = format("rrmoy:660FV5%XrM", n) map_op["v"..name.."sd_3"] = format("rrro:F20FV5%XrM|rrx/ooq:", n) end end -- SSE2 / AVX / AVX2 integer arithmetic ops (66 0F leaf). for name,n in pairs{ paddb = 0xFC, paddw = 0xFD, paddd = 0xFE, paddq = 0xD4, paddsb = 0xEC, paddsw = 0xED, packssdw = 0x6B, packsswb = 0x63, packuswb = 0x67, paddusb = 0xDC, paddusw = 0xDD, pand = 0xDB, pandn = 0xDF, pavgb = 0xE0, pavgw = 0xE3, pcmpeqb = 0x74, pcmpeqd = 0x76, pcmpeqw = 0x75, pcmpgtb = 0x64, pcmpgtd = 0x66, pcmpgtw = 0x65, pmaddwd = 0xF5, pmaxsw = 0xEE, pmaxub = 0xDE, pminsw = 0xEA, pminub = 0xDA, pmulhuw = 0xE4, pmulhw = 0xE5, pmullw = 0xD5, pmuludq = 0xF4, por = 0xEB, psadbw = 0xF6, psubb = 0xF8, psubw = 0xF9, psubd = 0xFA, psubq = 0xFB, psubsb = 0xE8, psubsw = 0xE9, psubusb = 0xD8, psubusw = 0xD9, punpckhbw = 0x68, punpckhwd = 0x69, punpckhdq = 0x6A, punpckhqdq = 0x6D, punpcklbw = 0x60, punpcklwd = 0x61, punpckldq = 0x62, punpcklqdq = 0x6C, pxor = 0xEF } do map_op[name.."_2"] = format("rmo:660F%02XrM", n) map_op["v"..name.."_3"] = format("rrmoy:660FV%02XrM", n) end ------------------------------------------------------------------------------ local map_vexarg = { u = false, v = 1, V = 2 } -- Process pattern string. local function dopattern(pat, args, sz, op, needrex) local digit, addin, vex local opcode = 0 local szov = sz local narg = 1 local rex = 0 -- Limit number of section buffer positions used by a single dasm_put(). -- A single opcode needs a maximum of 6 positions. if secpos+6 > maxsecpos then wflush() end -- Process each character. for c in gmatch(pat.."|", ".") do if match(c, "%x") then -- Hex digit. digit = byte(c) - 48 if digit > 48 then digit = digit - 39 elseif digit > 16 then digit = digit - 7 end opcode = opcode*16 + digit addin = nil elseif c == "n" then -- Disable operand size mods for opcode. szov = nil elseif c == "X" then -- Force REX.W. rex = 8 elseif c == "L" then -- Force VEX.L. vex.l = true elseif c == "r" then -- Merge 1st operand regno. into opcode. addin = args[1]; opcode = opcode + (addin.reg % 8) if narg < 2 then narg = 2 end elseif c == "R" then -- Merge 2nd operand regno. into opcode. addin = args[2]; opcode = opcode + (addin.reg % 8) narg = 3 elseif c == "m" or c == "M" then -- Encode ModRM/SIB. local s if addin then s = addin.reg opcode = opcode - band(s, 7) -- Undo regno opcode merge. else s = band(opcode, 15) -- Undo last digit. opcode = shr(opcode, 4) end local nn = c == "m" and 1 or 2 local t = args[nn] if narg <= nn then narg = nn + 1 end if szov == "q" and rex == 0 then rex = rex + 8 end if t.reg and t.reg > 7 then rex = rex + 1 end if t.xreg and t.xreg > 7 then rex = rex + 2 end if s > 7 then rex = rex + 4 end if needrex then rex = rex + 16 end local psz, sk = wputop(szov, opcode, rex, vex, s < 0, t.vreg or t.vxreg) opcode = nil local imark = sub(pat, -1) -- Force a mark (ugly). -- Put ModRM/SIB with regno/last digit as spare. wputmrmsib(t, imark, s, addin and addin.vreg, psz, sk) addin = nil elseif map_vexarg[c] ~= nil then -- Encode using VEX prefix local b = band(opcode, 255); opcode = shr(opcode, 8) local m = 1 if b == 0x38 then m = 2 elseif b == 0x3a then m = 3 end if m ~= 1 then b = band(opcode, 255); opcode = shr(opcode, 8) end if b ~= 0x0f then werror("expected `0F', `0F38', or `0F3A' to precede `"..c.. "' in pattern `"..pat.."' for `"..op.."'") end local v = map_vexarg[c] if v then v = remove(args, v) end b = band(opcode, 255) local p = 0 if b == 0x66 then p = 1 elseif b == 0xf3 then p = 2 elseif b == 0xf2 then p = 3 end if p ~= 0 then opcode = shr(opcode, 8) end if opcode ~= 0 then wputop(nil, opcode, 0); opcode = 0 end vex = { m = m, p = p, v = v } else if opcode then -- Flush opcode. if szov == "q" and rex == 0 then rex = rex + 8 end if needrex then rex = rex + 16 end if addin and addin.reg == -1 then local psz, sk = wputop(szov, opcode - 7, rex, vex, true) wvreg("opcode", addin.vreg, psz, sk) else if addin and addin.reg > 7 then rex = rex + 1 end wputop(szov, opcode, rex, vex) end opcode = nil end if c == "|" then break end if c == "o" then -- Offset (pure 32 bit displacement). wputdarg(args[1].disp); if narg < 2 then narg = 2 end elseif c == "O" then wputdarg(args[2].disp); narg = 3 else -- Anything else is an immediate operand. local a = args[narg] narg = narg + 1 local mode, imm = a.mode, a.imm if mode == "iJ" and not match("iIJ", c) then werror("bad operand size for label") end if c == "S" then wputsbarg(imm) elseif c == "U" then wputbarg(imm) elseif c == "W" then wputwarg(imm) elseif c == "i" or c == "I" then if mode == "iJ" then wputlabel("IMM_", imm, 1) elseif mode == "iI" and c == "I" then waction(sz == "w" and "IMM_WB" or "IMM_DB", imm) else wputszarg(sz, imm) end elseif c == "J" then if mode == "iPJ" then waction("REL_A", imm) -- !x64 (secpos) else wputlabel("REL_", imm, 2) end elseif c == "s" then local reg = a.reg if reg < 0 then wputb(0) wvreg("imm.hi", a.vreg) else wputb(shl(reg, 4)) end else werror("bad char `"..c.."' in pattern `"..pat.."' for `"..op.."'") end end end end end ------------------------------------------------------------------------------ -- Mapping of operand modes to short names. Suppress output with '#'. local map_modename = { r = "reg", R = "eax", C = "cl", x = "mem", m = "mrm", i = "imm", f = "stx", F = "st0", J = "lbl", ["1"] = "1", I = "#", S = "#", O = "#", } -- Return a table/string showing all possible operand modes. local function templatehelp(template, nparams) if nparams == 0 then return "" end local t = {} for tm in gmatch(template, "[^%|]+") do local s = map_modename[sub(tm, 1, 1)] s = s..gsub(sub(tm, 2, nparams), ".", function(c) return ", "..map_modename[c] end) if not match(s, "#") then t[#t+1] = s end end return t end -- Match operand modes against mode match part of template. local function matchtm(tm, args) for i=1,#args do if not match(args[i].mode, sub(tm, i, i)) then return end end return true end -- Handle opcodes defined with template strings. map_op[".template__"] = function(params, template, nparams) if not params then return templatehelp(template, nparams) end local args = {} -- Zero-operand opcodes have no match part. if #params == 0 then dopattern(template, args, "d", params.op, nil) return end -- Determine common operand size (coerce undefined size) or flag as mixed. local sz, szmix, needrex for i,p in ipairs(params) do args[i] = parseoperand(p) local nsz = args[i].opsize if nsz then if sz and sz ~= nsz then szmix = true else sz = nsz end end local nrex = args[i].needrex if nrex ~= nil then if needrex == nil then needrex = nrex elseif needrex ~= nrex then werror("bad mix of byte-addressable registers") end end end -- Try all match:pattern pairs (separated by '|'). local gotmatch, lastpat for tm in gmatch(template, "[^%|]+") do -- Split off size match (starts after mode match) and pattern string. local szm, pat = match(tm, "^(.-):(.*)$", #args+1) if pat == "" then pat = lastpat else lastpat = pat end if matchtm(tm, args) then local prefix = sub(szm, 1, 1) if prefix == "/" then -- Exactly match leading operand sizes. for i = #szm,1,-1 do if i == 1 then dopattern(pat, args, sz, params.op, needrex) -- Process pattern. return elseif args[i-1].opsize ~= sub(szm, i, i) then break end end else -- Match common operand size. local szp = sz if szm == "" then szm = x64 and "qdwb" or "dwb" end -- Default sizes. if prefix == "1" then szp = args[1].opsize; szmix = nil elseif prefix == "2" then szp = args[2].opsize; szmix = nil end if not szmix and (prefix == "." or match(szm, szp or "#")) then dopattern(pat, args, szp, params.op, needrex) -- Process pattern. return end end gotmatch = true end end local msg = "bad operand mode" if gotmatch then if szmix then msg = "mixed operand size" else msg = sz and "bad operand size" or "missing operand size" end end werror(msg.." in `"..opmodestr(params.op, args).."'") end ------------------------------------------------------------------------------ -- x64-specific opcode for 64 bit immediates and displacements. if x64 then function map_op.mov64_2(params) if not params then return { "reg, imm", "reg, [disp]", "[disp], reg" } end if secpos+2 > maxsecpos then wflush() end local opcode, op64, sz, rex, vreg local op64 = match(params[1], "^%[%s*(.-)%s*%]$") if op64 then local a = parseoperand(params[2]) if a.mode ~= "rmR" then werror("bad operand mode") end sz = a.opsize rex = sz == "q" and 8 or 0 opcode = 0xa3 else op64 = match(params[2], "^%[%s*(.-)%s*%]$") local a = parseoperand(params[1]) if op64 then if a.mode ~= "rmR" then werror("bad operand mode") end sz = a.opsize rex = sz == "q" and 8 or 0 opcode = 0xa1 else if sub(a.mode, 1, 1) ~= "r" or a.opsize ~= "q" then werror("bad operand mode") end op64 = params[2] if a.reg == -1 then vreg = a.vreg opcode = 0xb8 else opcode = 0xb8 + band(a.reg, 7) end rex = a.reg > 7 and 9 or 8 end end local psz, sk = wputop(sz, opcode, rex, nil, vreg) wvreg("opcode", vreg, psz, sk) waction("IMM_D", format("(unsigned int)(%s)", op64)) waction("IMM_D", format("(unsigned int)((%s)>>32)", op64)) end end ------------------------------------------------------------------------------ -- Pseudo-opcodes for data storage. local function op_data(params) if not params then return "imm..." end local sz = sub(params.op, 2, 2) if sz == "a" then sz = addrsize end for _,p in ipairs(params) do local a = parseoperand(p) if sub(a.mode, 1, 1) ~= "i" or (a.opsize and a.opsize ~= sz) then werror("bad mode or size in `"..p.."'") end if a.mode == "iJ" then wputlabel("IMM_", a.imm, 1) else wputszarg(sz, a.imm) end if secpos+2 > maxsecpos then wflush() end end end map_op[".byte_*"] = op_data map_op[".sbyte_*"] = op_data map_op[".word_*"] = op_data map_op[".dword_*"] = op_data map_op[".aword_*"] = op_data ------------------------------------------------------------------------------ -- Pseudo-opcode to mark the position where the action list is to be emitted. map_op[".actionlist_1"] = function(params) if not params then return "cvar" end local name = params[1] -- No syntax check. You get to keep the pieces. wline(function(out) writeactions(out, name) end) end -- Pseudo-opcode to mark the position where the global enum is to be emitted. map_op[".globals_1"] = function(params) if not params then return "prefix" end local prefix = params[1] -- No syntax check. You get to keep the pieces. wline(function(out) writeglobals(out, prefix) end) end -- Pseudo-opcode to mark the position where the global names are to be emitted. map_op[".globalnames_1"] = function(params) if not params then return "cvar" end local name = params[1] -- No syntax check. You get to keep the pieces. wline(function(out) writeglobalnames(out, name) end) end -- Pseudo-opcode to mark the position where the extern names are to be emitted. map_op[".externnames_1"] = function(params) if not params then return "cvar" end local name = params[1] -- No syntax check. You get to keep the pieces. wline(function(out) writeexternnames(out, name) end) end ------------------------------------------------------------------------------ -- Label pseudo-opcode (converted from trailing colon form). map_op[".label_2"] = function(params) if not params then return "[1-9] | ->global | =>pcexpr [, addr]" end if secpos+2 > maxsecpos then wflush() end local a = parseoperand(params[1]) local mode, imm = a.mode, a.imm if type(imm) == "number" and (mode == "iJ" or (imm >= 1 and imm <= 9)) then -- Local label (1: ... 9:) or global label (->global:). waction("LABEL_LG", nil, 1) wputxb(imm) elseif mode == "iJ" then -- PC label (=>pcexpr:). waction("LABEL_PC", imm) else werror("bad label definition") end -- SETLABEL must immediately follow LABEL_LG/LABEL_PC. local addr = params[2] if addr then local a = parseoperand(addr) if a.mode == "iPJ" then waction("SETLABEL", a.imm) else werror("bad label assignment") end end end map_op[".label_1"] = map_op[".label_2"] ------------------------------------------------------------------------------ -- Alignment pseudo-opcode. map_op[".align_1"] = function(params) if not params then return "numpow2" end if secpos+1 > maxsecpos then wflush() end local align = tonumber(params[1]) or map_opsizenum[map_opsize[params[1]]] if align then local x = align -- Must be a power of 2 in the range (2 ... 256). for i=1,8 do x = x / 2 if x == 1 then waction("ALIGN", nil, 1) wputxb(align-1) -- Action byte is 2**n-1. return end end end werror("bad alignment") end -- Spacing pseudo-opcode. map_op[".space_2"] = function(params) if not params then return "num [, filler]" end if secpos+1 > maxsecpos then wflush() end waction("SPACE", params[1]) local fill = params[2] if fill then fill = tonumber(fill) if not fill or fill < 0 or fill > 255 then werror("bad filler") end end wputxb(fill or 0) end map_op[".space_1"] = map_op[".space_2"] ------------------------------------------------------------------------------ -- Pseudo-opcode for (primitive) type definitions (map to C types). map_op[".type_3"] = function(params, nparams) if not params then return nparams == 2 and "name, ctype" or "name, ctype, reg" end local name, ctype, reg = params[1], params[2], params[3] if not match(name, "^[%a_][%w_]*$") then werror("bad type name `"..name.."'") end local tp = map_type[name] if tp then werror("duplicate type `"..name.."'") end if reg and not map_reg_valid_base[reg] then werror("bad base register `"..(map_reg_rev[reg] or reg).."'") end -- Add #type to defines. A bit unclean to put it in map_archdef. map_archdef["#"..name] = "sizeof("..ctype..")" -- Add new type and emit shortcut define. local num = ctypenum + 1 map_type[name] = { ctype = ctype, ctypefmt = format("Dt%X(%%s)", num), reg = reg, } wline(format("#define Dt%X(_V) (int)(ptrdiff_t)&(((%s *)0)_V)", num, ctype)) ctypenum = num end map_op[".type_2"] = map_op[".type_3"] -- Dump type definitions. local function dumptypes(out, lvl) local t = {} for name in pairs(map_type) do t[#t+1] = name end sort(t) out:write("Type definitions:\n") for _,name in ipairs(t) do local tp = map_type[name] local reg = tp.reg and map_reg_rev[tp.reg] or "" out:write(format(" %-20s %-20s %s\n", name, tp.ctype, reg)) end out:write("\n") end ------------------------------------------------------------------------------ -- Set the current section. function _M.section(num) waction("SECTION") wputxb(num) wflush(true) -- SECTION is a terminal action. end ------------------------------------------------------------------------------ -- Dump architecture description. function _M.dumparch(out) out:write(format("DynASM %s version %s, released %s\n\n", _info.arch, _info.version, _info.release)) dumpregs(out) dumpactions(out) end -- Dump all user defined elements. function _M.dumpdef(out, lvl) dumptypes(out, lvl) dumpglobals(out, lvl) dumpexterns(out, lvl) end ------------------------------------------------------------------------------ -- Pass callbacks from/to the DynASM core. function _M.passcb(wl, we, wf, ww) wline, werror, wfatal, wwarn = wl, we, wf, ww return wflush end -- Setup the arch-specific module. function _M.setup(arch, opt) g_arch, g_opt = arch, opt end -- Merge the core maps and the arch-specific maps. function _M.mergemaps(map_coreop, map_def) setmetatable(map_op, { __index = map_coreop }) setmetatable(map_def, { __index = map_archdef }) return map_op, map_def end return _M ------------------------------------------------------------------------------
apache-2.0
marcel-sch/luci
applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/tcpconns.lua
68
1143
-- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. m = Map("luci_statistics", translate("TCPConns Plugin Configuration"), translate( "The tcpconns plugin collects informations about open tcp " .. "connections on selected ports." )) -- collectd_tcpconns config section s = m:section( NamedSection, "collectd_tcpconns", "luci_statistics" ) -- collectd_tcpconns.enable enable = s:option( Flag, "enable", translate("Enable this plugin") ) enable.default = 0 -- collectd_tcpconns.listeningports (ListeningPorts) listeningports = s:option( Flag, "ListeningPorts", translate("Monitor all local listen ports") ) listeningports.default = 1 listeningports:depends( "enable", 1 ) -- collectd_tcpconns.localports (LocalPort) localports = s:option( Value, "LocalPorts", translate("Monitor local ports") ) localports.optional = true localports:depends( "enable", 1 ) -- collectd_tcpconns.remoteports (RemotePort) remoteports = s:option( Value, "RemotePorts", translate("Monitor remote ports") ) remoteports.optional = true remoteports:depends( "enable", 1 ) return m
apache-2.0
eugeneia/snabbswitch
src/lib/protocol/ipv6.lua
7
5307
-- Use of this source code is governed by the Apache 2.0 license; see COPYING. module(..., package.seeall) local ffi = require("ffi") local C = ffi.C local lib = require("core.lib") local header = require("lib.protocol.header") local htons, ntohs = lib.htons, lib.ntohs local AF_INET6 = 10 local INET6_ADDRSTRLEN = 48 local defaults = { traffic_class = 0, flow_label = 0, next_header = 59, -- no next header hop_limit = 64, } local ipv6hdr_pseudo_t = ffi.typeof[[ struct { char src_ip[16]; char dst_ip[16]; uint16_t ulp_zero; uint16_t ulp_length; uint8_t zero[3]; uint8_t next_header; } __attribute__((packed)) ]] local ipv6_addr_t = ffi.typeof("uint16_t[8]") local ipv6 = subClass(header) -- Class variables ipv6._name = "ipv6" ipv6._ulp = { class_map = { [6] = "lib.protocol.tcp", [17] = "lib.protocol.udp", [47] = "lib.protocol.gre", [58] = "lib.protocol.icmp.header", [115] = "lib.protocol.keyed_ipv6_tunnel", }, method = 'next_header' } header.init(ipv6, { [1] = ffi.typeof[[ struct { uint32_t v_tc_fl; // version, tc, flow_label uint16_t payload_length; uint8_t next_header; uint8_t hop_limit; uint8_t src_ip[16]; uint8_t dst_ip[16]; } __attribute__((packed)) ]] }) -- Class methods function ipv6:new (config) local o = ipv6:superClass().new(self) if not o._recycled then o._ph = ipv6hdr_pseudo_t() end o:version(6) o:traffic_class(config.traffic_class or defaults.traffic_class) o:flow_label(config.flow_label or defaults.flow_label) o:next_header(config.next_header or defaults.next_header) o:hop_limit(config.hop_limit or defaults.hop_limit) o:src(config.src) o:dst(config.dst) return o end function ipv6:new_from_mem(mem, size) local o = ipv6:superClass().new_from_mem(self, mem, size) if o == nil then return nil end if not o._recycled then o._ph = ipv6hdr_pseudo_t() end return o end function ipv6:pton (p) local in_addr = ffi.new("uint8_t[16]") local result = C.inet_pton(AF_INET6, p, in_addr) if result ~= 1 then return false, "malformed IPv6 address: " .. p end return in_addr end function ipv6:ntop (n) local p = ffi.new("char[?]", INET6_ADDRSTRLEN) local c_str = C.inet_ntop(AF_INET6, n, p, INET6_ADDRSTRLEN) return ffi.string(c_str) end function ipv6:get() return self:ntop(self) end function ipv6:set(addr) self:pton(addr) end -- Construct the solicited-node multicast address from the given -- unicast address by appending the last 24 bits to ff02::1:ff00:0/104 function ipv6:solicited_node_mcast (n) local n = ffi.cast("uint8_t *", n) local result = self:pton("ff02:0:0:0:0:1:ff00:0") ffi.copy(ffi.cast("uint8_t *", result)+13, n+13, 3) return result end -- Instance methods function ipv6:version (v) return lib.bitfield(32, self:header(), 'v_tc_fl', 0, 4, v) end function ipv6:traffic_class (tc) return lib.bitfield(32, self:header(), 'v_tc_fl', 4, 8, tc) end function ipv6:dscp (dscp) return lib.bitfield(32, self:header(), 'v_tc_fl', 4, 6, dscp) end function ipv6:ecn (ecn) return lib.bitfield(32, self:header(), 'v_tc_fl', 10, 2, ecn) end function ipv6:flow_label (fl) return lib.bitfield(32, self:header(), 'v_tc_fl', 12, 20, fl) end function ipv6:payload_length (length) if length ~= nil then self:header().payload_length = htons(length) else return(ntohs(self:header().payload_length)) end end function ipv6:next_header (nh) if nh ~= nil then self:header().next_header = nh else return(self:header().next_header) end end function ipv6:hop_limit (limit) if limit ~= nil then self:header().hop_limit = limit else return(self:header().hop_limit) end end function ipv6:src (ip) if ip ~= nil then ffi.copy(self:header().src_ip, ip, 16) else return self:header().src_ip end end function ipv6:src_eq (ip) return C.memcmp(ip, self:header().src_ip, 16) == 0 end function ipv6:dst (ip) if ip ~= nil then ffi.copy(self:header().dst_ip, ip, 16) else return self:header().dst_ip end end function ipv6:dst_eq (ip) return C.memcmp(ip, self:header().dst_ip, 16) == 0 end -- Return a pseudo header for checksum calculation in a upper-layer -- protocol (e.g. icmp). Note that the payload length and next-header -- values in the pseudo-header refer to the effective upper-layer -- protocol. They differ from the respective values of the ipv6 -- header if extension headers are present. function ipv6:pseudo_header (plen, nh) local ph = self._ph ffi.fill(ph, ffi.sizeof(ph)) local h = self:header() ffi.copy(ph, h.src_ip, 32) -- Copy source and destination ph.ulp_length = htons(plen) ph.next_header = nh return(ph) end function selftest() local ipv6_address = "2001:620:0:c101::2" assert(ipv6_address == ipv6:ntop(ipv6:pton(ipv6_address)), 'ipv6 text to binary conversion failed.') end ipv6.selftest = selftest return ipv6
apache-2.0
Fenix-XI/Fenix
scripts/globals/abilities/high_jump.lua
6
2215
----------------------------------- -- Ability: High Jump -- Performs a high jumping attack on enemy. -- Obtained: Dragoon Level 35 -- Recast Time: 2:00 -- Duration: Instant ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/status"); require("scripts/globals/weaponskills"); ----------------------------------- -- onAbilityCheck ----------------------------------- function onAbilityCheck(player,target,ability) return 0,0; end; ----------------------------------- -- onUseAbility ----------------------------------- function onUseAbility(player,target,ability,action) local params = {}; params.numHits = 1; local ftp = 1 params.ftp100 = ftp; params.ftp200 = ftp; params.ftp300 = ftp; params.str_wsc = 0.0; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0; if (player:getMod(MOD_FORCE_JUMP_CRIT) > 0) then params.crit100 = 1.0; params.crit200 = 1.0; params.crit300 = 1.0; end params.canCrit = true; params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0; params.atkmulti = 1; params.bonusTP = player:getMod(MOD_JUMP_TP_BONUS) params.targetTPMult = 0 if (target:isMob()) then local enmityShed = 50; if player:getMainJob() ~= JOB_DRG then enmityShed = 30; end target:lowerEnmity(player, enmityShed + player:getMod(MOD_HIGH_JUMP_ENMITY_REDUCTION)); -- reduce total accumulated enmity end local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, 0, params, 0, true) if (tpHits + extraHits > 0) then -- Under Spirit Surge, High Jump reduces TP of target if (player:hasStatusEffect(EFFECT_SPIRIT_SURGE) == true) then target:delTP(damage * 0.2) end if (criticalHit) then action:speceffect(target:getID(), 38) end action:speceffect(target:getID(), 32) else ability:setMsg(MSGBASIC_USES_BUT_MISSES) action:speceffect(target:getID(), 0) end return damage; end;
gpl-3.0
Fenix-XI/Fenix
scripts/globals/spells/light_carol.lua
27
1535
----------------------------------------- -- Spell: Light Carol -- Increases light resistance for party members within the area of effect. ----------------------------------------- require("scripts/globals/status"); require("scripts/globals/magic"); ----------------------------------------- -- OnSpellCast ----------------------------------------- function onMagicCastingCheck(caster,target,spell) return 0; end; function onSpellCast(caster,target,spell) local sLvl = caster:getSkillLevel(SKILL_SNG); -- Gets skill level of Singing local iLvl = caster:getWeaponSkillLevel(SLOT_RANGED); local power = 20; if (sLvl+iLvl > 200) then power = power + math.floor((sLvl+iLvl-200) / 10); end if (power >= 40) then power = 40; end local iBoost = caster:getMod(MOD_CAROL_EFFECT) + caster:getMod(MOD_ALL_SONGS_EFFECT); power = power + iBoost*5; if (caster:hasStatusEffect(EFFECT_SOUL_VOICE)) then power = power * 2; elseif (caster:hasStatusEffect(EFFECT_MARCATO)) then power = power * 1.5; end caster:delStatusEffect(EFFECT_MARCATO); local duration = 120; duration = duration * ((iBoost * 0.1) + (caster:getMod(MOD_SONG_DURATION_BONUS)/100) + 1); if (caster:hasStatusEffect(EFFECT_TROUBADOUR)) then duration = duration * 2; end if not (target:addBardSong(caster,EFFECT_CAROL,power,0,duration,caster:getID(), ELE_LIGHT, 1)) then spell:setMsg(75); end return EFFECT_CAROL; end;
gpl-3.0
Fenix-XI/Fenix
scripts/zones/Northern_San_dOria/npcs/Villion.lua
13
1480
----------------------------------- -- Area: Northern San d'Oria -- NPC: Villion -- Type: Adventurer's Assistant NPC -- Involved in Quest: Flyers for Regine -- @zone: 231 -- @pos -157.524 4.000 263.818 -- ----------------------------------- ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) if (player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE) ==QUEST_ACCEPTED) then if (trade:hasItemQty(532,1) and trade:getItemCount() == 1 and player:getVar("tradeVilion") == 0) then player:messageSpecial(VILLION_DIALOG); player:setVar("FFR",player:getVar("FFR") - 1); player:setVar("tradeVilion",1); player:messageSpecial(FLYER_ACCEPTED); player:tradeComplete(); elseif (player:getVar("tradeVilion") ==1) then player:messageSpecial(FLYER_ALREADY); end end end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) player:startEvent(0x0278); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end;
gpl-3.0
Fenix-XI/Fenix
scripts/zones/Apollyon/mobs/Fir_Bholg.lua
7
1266
----------------------------------- -- Area: Apollyon SW -- NPC: Fir Bholg ----------------------------------- package.loaded["scripts/zones/Apollyon/TextIDs"] = nil; ----------------------------------- require("scripts/globals/limbus"); require("scripts/zones/Apollyon/TextIDs"); ----------------------------------- -- onMobSpawn Action ----------------------------------- function onMobSpawn(mob) end; ----------------------------------- -- onMobEngaged ----------------------------------- function onMobEngaged(mob,target) end; ----------------------------------- -- onMobDeath ----------------------------------- function onMobDeath(mob,killer,ally) local mobID = mob:getID(); -- print(mobID); local mobX = mob:getXPos(); local mobY = mob:getYPos(); local mobZ = mob:getZPos(); if (mobID ==16932869) then -- time GetNPCByID(16932864+14):setPos(mobX,mobY,mobZ); GetNPCByID(16932864+14):setStatus(STATUS_NORMAL); elseif (mobID ==16932871) then -- recover GetNPCByID(16932864+16):setPos(mobX,mobY,mobZ); GetNPCByID(16932864+16):setStatus(STATUS_NORMAL); elseif (mobID ==16932874) then -- item GetNPCByID(16932864+15):setPos(mobX,mobY,mobZ); GetNPCByID(16932864+15):setStatus(STATUS_NORMAL); end end;
gpl-3.0
Fenix-XI/Fenix
scripts/globals/spells/bluemagic/mandibular_bite.lua
33
1716
----------------------------------------- -- Spell: Mandibular Bite -- Damage varies with TP -- Spell cost: 38 MP -- Monster Type: Vermin -- Spell Type: Physical (Slashing) -- Blue Magic Points: 2 -- Stat Bonus: INT+1 -- Level: 44 -- Casting Time: 0.5 seconds -- Recast Time: 19.25 seconds -- Skillchain property(ies): Induration (can open Impaction, Compression, or Fragmentation) -- Combos: Plantoid Killer ----------------------------------------- require("scripts/globals/magic"); require("scripts/globals/status"); require("scripts/globals/bluemagic"); ----------------------------------------- -- OnMagicCastingCheck ----------------------------------------- function onMagicCastingCheck(caster,target,spell) return 0; end; ----------------------------------------- -- OnSpellCast ----------------------------------------- function onSpellCast(caster,target,spell) local params = {}; -- This data should match information on http://wiki.ffxiclopedia.org/wiki/Calculating_Blue_Magic_Damage params.tpmod = TPMOD_ATTACK; params.dmgtype = DMGTYPE_SLASH; params.scattr = SC_INDURATION; params.numhits = 1; params.multiplier = 2.0; params.tp150 = 1.2; params.tp300 = 1.4; params.azuretp = 1.5; params.duppercap = 45; --guesstimated attack % bonuses params.str_wsc = 0.2; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.2; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; damage = BluePhysicalSpell(caster, target, spell, params); damage = BlueFinalAdjustments(caster, target, spell, damage, params); return damage; end;
gpl-3.0
spamn/lain
util/separators.lua
2
2438
--[[ Licensed under GNU General Public License v2 * (c) 2015, Luke Bonham * (c) 2015, plotnikovanton --]] local wibox = require("wibox") local gears = require("gears") -- Lain Cairo separators util submodule -- lain.util.separators local separators = { height = 0, width = 9 } -- [[ Arrow -- Right function separators.arrow_right(col1, col2) local widget = wibox.widget.base.make_widget() widget.fit = function(m, w, h) return separators.width, separators.height end widget.draw = function(mycross, wibox, cr, width, height) if col2 ~= "alpha" then cr:set_source_rgb(gears.color.parse_color(col2)) cr:new_path() cr:move_to(0, 0) cr:line_to(width, height/2) cr:line_to(width, 0) cr:close_path() cr:fill() cr:new_path() cr:move_to(0, height) cr:line_to(width, height/2) cr:line_to(width, height) cr:close_path() cr:fill() end if col1 ~= "alpha" then cr:set_source_rgb(gears.color.parse_color(col1)) cr:new_path() cr:move_to(0, 0) cr:line_to(width, height/2) cr:line_to(0, height) cr:close_path() cr:fill() end end return widget end -- Left function separators.arrow_left(col1, col2) local widget = wibox.widget.base.make_widget() widget.fit = function(m, w, h) return separators.width, separators.height end widget.draw = function(mycross, wibox, cr, width, height) if col1 ~= "alpha" then cr:set_source_rgb(gears.color.parse_color(col1)) cr:new_path() cr:move_to(width, 0) cr:line_to(0, height/2) cr:line_to(0, 0) cr:close_path() cr:fill() cr:new_path() cr:move_to(width, height) cr:line_to(0, height/2) cr:line_to(0, height) cr:close_path() cr:fill() end if col2 ~= "alpha" then cr:new_path() cr:move_to(width, 0) cr:line_to(0, height/2) cr:line_to(width, height) cr:close_path() cr:set_source_rgb(gears.color.parse_color(col2)) cr:fill() end end return widget end -- ]] return separators
gpl-2.0
marcel-sch/luci
applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/olsrd.lua
43
1470
-- Copyright 2011 Manuel Munz <freifunk at somakoma dot de> -- Licensed to the public under the Apache License 2.0. m = Map("luci_statistics", translate("OLSRd Plugin Configuration"), translate("The OLSRd plugin reads information about meshed networks from the txtinfo plugin of OLSRd.")) s = m:section(NamedSection, "collectd_olsrd", "luci_statistics" ) enable = s:option(Flag, "enable", translate("Enable this plugin")) enable.default = 0 host = s:option(Value, "Host", translate("Host"), translate("IP or hostname where to get the txtinfo output from")) host.placeholder = "127.0.0.1" host.datatype = "host" host.rmempty = true port = s:option(Value, "Port", translate("Port")) port.placeholder = "2006" port.datatype = "range(0,65535)" port.rmempty = true port.cast = "string" cl = s:option(ListValue, "CollectLinks", translate("CollectLinks"), translate("Specifies what information to collect about links.")) cl:value("No") cl:value("Summary") cl:value("Detail") cl.default = "Detail" cr = s:option(ListValue, "CollectRoutes", translate("CollectRoutes"), translate("Specifies what information to collect about routes.")) cr:value("No") cr:value("Summary") cr:value("Detail") cr.default = "Summary" ct = s:option(ListValue, "CollectTopology", translate("CollectTopology"), translate("Specifies what information to collect about the global topology.")) ct:value("No") ct:value("Summary") ct:value("Detail") ct.default = "Summary" return m
apache-2.0
Fenix-XI/Fenix
scripts/zones/West_Sarutabaruta/npcs/Stone_Monument.lua
13
1284
----------------------------------- -- Area: West Sarutabaruta -- NPC: Stone Monument -- Involved in quest "An Explorer's Footsteps" -- @pos -205.593 -23.210 -119.670 115 ----------------------------------- package.loaded["scripts/zones/West_Sarutabaruta/TextIDs"] = nil; ----------------------------------- require("scripts/zones/West_Sarutabaruta/TextIDs"); ----------------------------------- -- onTrigger ----------------------------------- function onTrigger(player,npc) player:startEvent(0x0384); end; ----------------------------------- -- onTrade ----------------------------------- function onTrade(player,npc,trade) if (trade:getItemCount() == 1 and trade:hasItemQty(571,1)) then player:tradeComplete(); player:addItem(570); player:messageSpecial(ITEM_OBTAINED,570); player:setVar("anExplorer-CurrentTablet",0x00400); end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end;
gpl-3.0
Fenix-XI/Fenix
scripts/globals/spells/bluemagic/queasyshroom.lua
31
1990
----------------------------------------- -- Spell: Queasyshroom -- Additional effect: Poison. Duration of effect varies with TP -- Spell cost: 20 MP -- Monster Type: Plantoids -- Spell Type: Physical (Piercing) -- Blue Magic Points: 2 -- Stat Bonus: HP-5, MP+5 -- Level: 8 -- Casting Time: 2 seconds -- Recast Time: 15 seconds -- Skillchain Element(s): Dark (can open Transfixion or Detonation; can close Compression or Gravitation) -- Combos: None ----------------------------------------- require("scripts/globals/magic"); require("scripts/globals/status"); require("scripts/globals/bluemagic"); ----------------------------------------- -- OnMagicCastingCheck ----------------------------------------- function onMagicCastingCheck(caster,target,spell) return 0; end; ----------------------------------------- -- OnSpellCast ----------------------------------------- function onSpellCast(caster,target,spell) local params = {}; -- This data should match information on http://wiki.ffxiclopedia.org/wiki/Calculating_Blue_Magic_Damage params.tpmod = TPMOD_CRITICAL; params.dmgtype = DMGTYPE_PIERCE; params.scattr = SC_DARK; params.numhits = 1; params.multiplier = 1.25; params.tp150 = 1.25; params.tp300 = 1.25; params.azuretp = 1.25; params.duppercap = 8; params.str_wsc = 0.0; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.20; params.mnd_wsc = 0.0; params.chr_wsc = 0.0; damage = BluePhysicalSpell(caster, target, spell, params); damage = BlueFinalAdjustments(caster, target, spell, damage, params); local chance = math.random(); if (damage > 0 and chance > 10) then local typeEffect = EFFECT_POISON; target:delStatusEffect(typeEffect); target:addStatusEffect(typeEffect,3,0,getBlueEffectDuration(caster,resist,typeEffect)); end return damage; end;
gpl-3.0
DarkstarProject/darkstar
scripts/globals/mobskills/pl_tidal_slash.lua
11
1158
--------------------------------------------- -- Tidal Slash -- -- Description: Deals Water damage in a threefold -- attack to targets in a fan-shaped area of effect. -- Type: Physical? -- Utsusemi/Blink absorb: 2-3 shadows -- Range: Melee? -- Notes: Used only by Merrows equipped with a spear. -- If they lost their spear, they'll use Hysteric Barrage instead. --------------------------------------------- require("scripts/globals/settings") require("scripts/globals/status") require("scripts/globals/monstertpmoves") --------------------------------------------- function onMobSkillCheck(target,mob,skill) local mobSkin = mob:getModelId() if (mobSkin == 1643) then return 0 else return 1 end end function onMobWeaponSkill(target, mob, skill) local numhits = 3 local accmod = 1 local dmgmod = 1 local info = MobPhysicalMove(mob,target,skill,numhits,accmod,dmgmod,TP_NO_EFFECT) local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,dsp.attackType.PHYSICAL,dsp.damageType.SLASHING,info.hitslanded) target:takeDamage(dmg, mob, dsp.attackType.PHYSICAL, dsp.damageType.SLASHING) return dmg end
gpl-3.0
lemboyz/lua8583
iso8583.lua
1
21685
local _M = {} local function bcdunzip(str) return ({str:gsub(".", function(c) return string.format("%02X", c:byte(1)) end)})[1] end local function bcdzip(str) return ({str:gsub("..", function(x) return string.char(tonumber(x, 16)) end)})[1] end local MSG_TYPE = 0 local BITMAP = 1 local TYPE = 1 local LEN = 2 local ALIGN = 3 local PADDING= 4 local ZIP = 5 local _fields = { -- idx: 索引 -- type: 字段类型 -- len: 长度 -- align: 对齐方式 -- padding: 填充字符 -- zip: 是否bcd压缩 -- idx type len align padding zip [0 ] = {"fix" , 4, 'R', '0', 'Z'}, -- Message Type n 4 [1 ] = {"fix" , 1, 'L', 'D', 'U'}, -- BIT MAP EXTENDED b 1 [2 ] = {"llvar" , 19, 'L', 'F', 'Z'}, -- PRIMARY ACC. NUM n 19 llvar [3 ] = {"fix" , 6, 'R', '0', 'Z'}, -- PROCESSING CODE n 6 [4 ] = {"fix" , 12, 'R', '0', 'Z'}, -- AMOUNT, TRANS. n 12 [5 ] = {"fix" , 12, 'R', '0', 'Z'}, -- AMOUNT, SETTLEMENT n 12 [6 ] = {"fix" , 12, 'R', '0', 'Z'}, -- AMOUNT,CardHolder bill n 12 [7 ] = {"fix" , 10, 'R', '0', 'Z'}, -- TRANSMISSION D & T n 10 mmddhhmmss [8 ] = {"fix" , 8, 'R', '0', 'Z'}, -- AMN., CH BILLING FEE n 8 [9 ] = {"fix" , 8, 'R', '0', 'Z'}, -- CONV RATE,SET'T n 8 [10 ] = {"fix" , 8, 'R', '0', 'Z'}, -- CONV RATE, CH billing n 8 [11 ] = {"fix" , 6, 'R', '0', 'Z'}, -- SYSTEM TRACE # n 6 [12 ] = {"fix" , 6, 'R', '0', 'Z'}, -- TIME, LOCAL TRAN n 6 hhmmss [13 ] = {"fix" , 4, 'R', '0', 'Z'}, -- DATE, LOCAL TRAN n 4 mmdd [14 ] = {"fix" , 4, 'R', '0', 'Z'}, -- DATE, EXPIRATION n 4 yymm [15 ] = {"fix" , 4, 'R', '0', 'Z'}, -- DATE, SETTLEMENT n 4 mmdd [16 ] = {"fix" , 4, 'R', '0', 'Z'}, -- DATE, CONVERSION n 4 mmdd [17 ] = {"fix" , 4, 'R', '0', 'Z'}, -- DATE, CAPTURE n 4 mmdd [18 ] = {"fix" , 4, 'R', '0', 'Z'}, -- MERCHANT'S TYPE n 4 [19 ] = {"fix" , 3, 'R', '0', 'Z'}, -- AI COUNTRY CODE n 3 [20 ] = {"fix" , 3, 'L', 'F', 'Z'}, -- PAN EXT.,CO'Y CODE n 3 [21 ] = {"fix" , 3, 'R', '0', 'Z'}, -- FI COUNTRY CODE n 3 [22 ] = {"fix" , 3, 'L', 'D', 'Z'}, -- POS ENTRY MODE n 3 -- [23 ] = {"fix" , 3, 'L', 'F', 'Z'}, -- CARD SEQUECE NUM. n 3 [23 ] = {"fix" , 3, 'R', '0', 'Z'}, -- CARD SEQUECE NUM. n 3 [24 ] = {"fix" , 3, 'L', 'D', 'Z'}, -- NETWORK INT'L ID n 3 [25 ] = {"fix" , 2, 'R', 'D', 'Z'}, -- POS COND. CODE n 2 [26 ] = {"fix" , 2, 'L', 'D', 'Z'}, -- POS PIN CAP. CODE n 2 [27 ] = {"fix" , 1, 'R', '0', 'Z'}, -- AUTH ID RES. LEN n 1 [28 ] = {"fix" , 8, 'R', '0', 'Z'}, -- AMT. TRANS FEE n 8 [29 ] = {"fix" , 8, 'R', '0', 'Z'}, -- AMT. SETT. FEE n 8 [30 ] = {"fix" , 8, 'R', '0', 'Z'}, -- AMT. TRAN PROC FEE n 8 [31 ] = {"fix" , 8, 'R', '0', 'Z'}, -- AMT. SET PROC FEE n 8 [32 ] = {"llvar" , 11, 'L', '0', 'Z'}, -- ACOUIR. INST. ID n 11 llvar [33 ] = {"llvar" , 11, 'L', 'F', 'Z'}, -- FI ID n 11 llvar [34 ] = {"llvar" , 11, 'L', 'F', 'Z'}, -- PAN EXTENDED n 28 llvar [35 ] = {"llvar" , 37, 'L', 'F', 'Z'}, -- TRACK 2 DATA z 37 llvar [36 ] = {"lllvar", 104, 'L', 'F', 'Z'}, -- TRACK 3 DATA z 104 lllvar [37 ] = {"fix" , 12, 'L', 'D', 'U'}, -- RETR. REF. NUM an 12 [38 ] = {"fix" , 6, 'R', 'D', 'U'}, -- AUTH. ID. RESP an 6 [39 ] = {"fix" , 2, 'R', 'D', 'U'}, -- RESPONSE CODE an 2 [40 ] = {"fix" , 3, 'L', 'D', 'U'}, -- SERV. REST'N CODE an 3 [41 ] = {"fix" , 8, 'R', 'D', 'U'}, -- TERMINAL ID ans 8 [42 ] = {"fix" , 15, 'L', 'F', 'U'}, -- CARD ACC. ID ans 15 [43 ] = {"fix" , 40, 'L', ' ', 'U'}, -- CARD ACC. NAME ans 40 [44 ] = {"llvar" , 25, 'R', '0', 'U'}, -- ADD. RESP DATA an 25 llvar [45 ] = {"llvar" , 76, 'L', 'F', 'U'}, -- TRACK 1 DATA an 76 llvar [46 ] = {"lllvar", 999, 'L', 'F', 'U'}, -- ADD. DATA - ISO an 999 lllvar [47 ] = {"lllvar", 999, 'L', 'F', 'U'}, -- ADD. DATA - NATI. an 999 lllvar -- [48 ] = {"lllvar", 999, 'L', 'F', 'U'}, -- ADD. DATA - PRI. an 999 lllvar [48 ] = {"lllvar", 999, 'L', 'F', 'Z'}, -- ADD. DATA - PRI. an 999 lllvar [49 ] = {"fix" , 3, 'L', ' ', 'U'}, -- CC, TRANSACTION a 3 [50 ] = {"fix" , 3, 'L', '0', 'U'}, -- CC, SETTLEMENT an 3 [51 ] = {"fix" , 3, 'L', '0', 'U'}, -- CC, CH. BILLING a 3 [52 ] = {"fix" , 8, 'R', 'D', 'U'}, -- PIN DATA b 8 [53 ] = {"fix" , 16, 'L', '0', 'Z'}, -- SECU. CONT. INFO. n 16 [54 ] = {"lllvar", 120, 'R', 'F', 'U'}, -- ADDITIONAL AMTS an 120 LLLVAR [55 ] = {"lllvar", 999, 'L', 'F', 'U'}, -- REVERVED ISO ans 999 lllvar [56 ] = {"lllvar", 999, 'L', 'F', 'U'}, -- REVERVED ISO ans 999 lllvar [57 ] = {"lllvar", 999, 'L', 'F', 'U'}, -- REVERVED NATIONAL ans 999 lllvar [58 ] = {"lllvar", 999, 'L', 'F', 'U'}, -- REVERVED NATIONAL ans 999 lllvar [59 ] = {"lllvar", 999, 'L', 'F', 'U'}, -- REVERVED NATIONAL ans 999 lllvar [60 ] = {"lllvar", 999, 'L', 'F', 'Z'}, -- RESERVED - PRIV1 ans 999 lllvar -- [61 ] = {"lllvar", 999, 'L', 'F', 'U'}, -- RESERVED - PRIV2 ans 999 lllvar [61 ] = {"lllvar", 999, 'L', 'F', 'Z'}, -- RESERVED - PRIV2 ans 999 lllvar [62 ] = {"lllvar", 999, 'L', 'F', 'U'}, -- RESERVED - PRIV3 ans 999 lllvar [63 ] = {"lllvar", 999, 'L', 'F', 'U'}, -- RESERVED - PRIV4 ans 999 lllvar [64 ] = {"fix" , 8, 'L', 'D', 'U'}, -- MSG. AUTH. CODE b 8 [65 ] = {"fix" , 8, 'L', 'D', 'U'}, -- BIT MAP, EXTENDED b 8 [66 ] = {"fix" , 1, 'L', 'D', 'U'}, -- SETTLEMENT CODE n 1 [67 ] = {"fix" , 2, 'L', 'D', 'U'}, -- EXT. PAYMENT CODE n 2 [68 ] = {"fix" , 3, 'L', 'D', 'U'}, -- RECE. INST. CN. n 3 [69 ] = {"fix" , 3, 'L', 'D', 'U'}, -- SETTLEMENT ICN. n 3 [70 ] = {"fix" , 3, 'L', 'D', 'U'}, -- NET MAN IC n 3 [71 ] = {"fix" , 4, 'L', 'D', 'U'}, -- MESSAGE NUMBER n 4 [72 ] = {"fix" , 4, 'L', 'D', 'U'}, -- MESSAGE NUM. LAST n 4 [73 ] = {"fix" , 6, 'L', 'D', 'U'}, -- DATE, ACTION n 6 yymmdd [74 ] = {"fix" , 10, 'L', 'D', 'U'}, -- CREDIT NUMBER n 10 [75 ] = {"fix" , 10, 'L', 'D', 'U'}, -- CRED REVERSAL NUM n 10 [76 ] = {"fix" , 10, 'L', 'D', 'U'}, -- DEBITS NUMBER n 10 [77 ] = {"fix" , 10, 'L', 'D', 'U'}, -- DEBT REVERSAL NUM n 10 [78 ] = {"fix" , 10, 'L', 'D', 'U'}, -- TRANSFER NUMBER n 10 [79 ] = {"fix" , 10, 'L', 'D', 'U'}, -- TRANS REVERSAL NUM n 10 [80 ] = {"fix" , 10, 'L', 'D', 'U'}, -- INQUERIES NUMBER n 10 [81 ] = {"fix" , 10, 'L', 'D', 'U'}, -- AUTHORIZE NUMBER n 10 [82 ] = {"fix" , 12, 'L', 'D', 'U'}, -- CRED.PROC.FEE.AMT n 12 [83 ] = {"fix" , 12, 'L', 'D', 'U'}, -- CRED.TRANS.FEE.AMT n 12 [84 ] = {"fix" , 12, 'L', 'D', 'U'}, -- DEBT.PROC.FEE.AMT n 12 [85 ] = {"fix" , 12, 'L', 'D', 'U'}, -- DEBT.TRANS.FEE.AMT n 12 [86 ] = {"fix" , 15, 'L', 'D', 'U'}, -- CRED AMT n 16 [87 ] = {"fix" , 15, 'L', 'D', 'U'}, -- CRED REVERSAL AMT n 16 [88 ] = {"fix" , 15, 'L', 'D', 'U'}, -- DEBIT AMT n 16 [89 ] = {"fix" , 15, 'L', 'D', 'U'}, -- DEBIT REVERSAL AMT n 16 [90 ] = {"fix" , 42, 'L', '0', 'U'}, -- ORIGIN DATA ELEMNT n 42 [91 ] = {"fix" , 1, 'L', 'D', 'U'}, -- FILE UPDATE CODE an 1 [92 ] = {"fix" , 2, 'L', 'D', 'U'}, -- FILE SECURITY CODE n 2 [93 ] = {"fix" , 5, 'L', 'D', 'U'}, -- RESPONSE INDICATOR n 5 [94 ] = {"fix" , 7, 'L', 'D', 'U'}, -- SERVICE INDICATOR an 7 [95 ] = {"fix" , 42, 'L', 'D', 'U'}, -- REPLACEMENT AMOUNT an 42 [96 ] = {"fix" , 8, 'L', 'D', 'U'}, -- MESSAGE SECUR CODE an 8 [97 ] = {"fix" , 16, 'L', 'D', 'U'}, -- AMT.NET SETTLEMENT n 16 [98 ] = {"fix" , 25, 'L', 'D', 'U'}, -- PAYEE ans 25 [99 ] = {"llvar" , 11, 'L', 'D', 'U'}, -- SETTLE.INST.IC n 11 llvar [100] = {"llvar" , 11, 'L', 'D', 'U'}, -- RECE.INST.IC n 11 llvar [101] = {"fix" , 17, 'L', 'D', 'U'}, -- FILE NAME ans 17 [102] = {"llvar" , 28, 'L', 'D', 'U'}, -- ACCOUNT ID 1 ans 28 llvar [103] = {"llvar" , 28, 'L', 'D', 'U'}, -- ACCOUNT ID 2 ans 28 llvar [104] = {"lllvar", 100, 'L', 'D', 'U'}, -- TRANS.DESCRIPTION ans 100 lllvar [105] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR ISO ans 999 lllvar [106] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR ISO ans 999 lllvar [107] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR ISO ans 999 lllvar [108] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR ISO ans 999 lllvar [109] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR ISO ans 999 lllvar [110] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR ISO ans 999 lllvar [111] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR ISO ans 999 lllvar [112] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR NATIO ans 999 lllvar [113] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR NATIO ans 999 lllvar [114] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR NATIO ans 999 lllvar [115] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR NATIO ans 999 lllvar [116] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR NATIO ans 999 lllvar [117] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR NATIO ans 999 lllvar [118] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR NATIO ans 999 lllvar [119] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR NATIO ans 999 lllvar [120] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR PRIVA ans 999 lllvar [121] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR PRIVA ans 999 lllvar [122] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR PRIVA ans 999 lllvar [123] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR PRIVA ans 999 lllvar [124] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR PRIVA ans 999 lllvar [125] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR PRIVA ans 999 lllvar [126] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR PRIVA ans 999 lllvar [127] = {"lllvar", 999, 'L', 'D', 'U'}, -- RESERVED FOR PRIVA ans 999 lllvar [128] = {"fix" , 8, 'L', 'D', 'U'}, -- MESS AUTHEN.CODE b 8 } -- 返回长度前缀 local function prefix(field_type, value) if not value or value=="" then return "" end local str = "" if field_type == "fix" then str = "" elseif field_type == "lllvar" then str = tostring(string.len(value)) if #str < 3 then -- 不足三位数, 要在左边补0 local padding = string.rep("0", 3 - #str) str = padding .. str end elseif field_type == "llvar" then str = tostring(#value) if #str < 2 then local padding = string.rep("0", 2 - #str) str = padding .. str end end return str end local function prefix64(field_type, value) if not value or value=="" then return "" end local str = "" if field_type == "fix" then str = "" elseif field_type == "lllvar" then str = tostring(string.len(value)) if #str < 4 then local padding = string.rep("0", 4 - #str) str = padding .. str end elseif field_type == "llvar" then str = tostring(#value) if #str < 2 then local padding = string.rep("0", 2 - #str) str = padding .. str end end str = bcdzip(str) return str end function _M.set_field(idx, field_type, field_len, align_type, padding, zip_flag) _fields[idx] = {field_type, field_len, align_type, padding, zip_flag} end local function change_value_by_field(idx, value) if not value or #value==0 then return "" end local val = value local field_type = _fields[idx][TYPE] local len = _fields[idx][LEN] local align = _fields[idx][ALIGN] local padding = _fields[idx][PADDING] --local zip = _fields[idx][ZIP] if #val > len then val = string.sub(val, 1, len) end if field_type == "fix" then local padding_str = string.rep(padding, len - #val) if align == "L" then val = val .. padding_str else val = padding_str .. val end end --if idx == 35 or idx == 36 then -- f35:track2 f36:track3 -- val = string.gsub(val, "D", "=") --end return val end -- len must be 64 or 128 local function create_bitmap(len) local bitmap = {} for i=1,len do table.insert(bitmap, 0) end return bitmap end local function pack_bitmap(tab_bitmap) -- tab_bitmap = {0,0,0,0,0,0,0,1, ...} local bitmap = "" local str_binary = table.concat(tab_bitmap, "") --print("str_binary: ["..str_binary.."]") local count = #str_binary / 8 for i=1, count do local p = (i-1)*8 + 1 local str8 = string.sub(str_binary, p, p+7) local ch = string.char(tonumber(str8, 2)) bitmap = bitmap .. ch end return bitmap end local function show_bitmap(table_bitmap) local str = "" for i=1,#table_bitmap do str = str .. table_bitmap[i] if math.mod(i, 8) == 0 and i~=#table_bitmap then str = str .. " " end end io.write(str) end local hex_tab = { ["0"] = {0,0,0,0}, ["1"] = {0,0,0,1}, ["2"] = {0,0,1,0}, ["3"] = {0,0,1,1}, ["4"] = {0,1,0,0}, ["5"] = {0,1,0,1}, ["6"] = {0,1,1,0}, ["7"] = {0,1,1,1}, ["8"] = {1,0,0,0}, ["9"] = {1,0,0,1}, ["A"] = {1,0,1,0}, ["B"] = {1,0,1,1}, ["C"] = {1,1,0,0}, ["D"] = {1,1,0,1}, ["E"] = {1,1,1,0}, ["F"] = {1,1,1,1}, } local function hex_to_binary(ch) -- ch: a single char in 0123456789ABCDEF return hex_tab[ch] end local function unpack_bitmap(str_bitmap) local bitmap = {} local str = bcdunzip(str_bitmap) for i=1,#str do local ch = str:sub(i,i) local binary = hex_to_binary(ch) table.insert(bitmap, binary[1]) table.insert(bitmap, binary[2]) table.insert(bitmap, binary[3]) table.insert(bitmap, binary[4]) end return bitmap end function _M.show8583(tab8583) if tab8583[MSG_TYPE] then print("F0: ["..tab8583[0].."]") end local bitmap = tab8583[BITMAP] if bitmap then io.write("F1: ["); show_bitmap(bitmap); print("]") end for i=2, #bitmap do if bitmap[i] == 1 then if i == 52 then print("F52: [" .. bcdunzip(tab8583[i]) .. "] unzipped") else print("F"..i..": [" ..tostring(tab8583[i]).."]") end end end end -- 把table中所有值打包为8583包字符串 -- 128个域 -- tab8583 = { -- [0] = "0200", -- [2] = "6225881234567890", -- [3] = "000000", -- [4] = "000000346500", -- [7] = "1013151952", -- [11]= "365799", -- [12]= "151952", -- [13]= "1013", -- [18]= "9498", -- [22]= "021", -- [25]= "00", -- [26]= "12", -- ... -- } function _M.pack128(tab8583) local bitmap = create_bitmap(128) bitmap[1] = 1 local msg_type = tab8583[0] or "" local str8583 = "" for i=2, #bitmap do local value = tab8583[i] local field_type = _fields[i][TYPE] if value and value~="" then bitmap[i] = 1 value = change_value_by_field(i, value) str8583 = str8583 .. prefix(field_type, value) .. value end end bitmap = pack_bitmap(bitmap) return msg_type .. bitmap .. str8583 end -- 把8583包字符串解析为table -- 128个域 function _M.unpack128(str8583) local tab8583 = {} local msg_type = str8583:sub(1,4) tab8583[MSG_TYPE] = msg_type local n = 1 -- 当前位置 local bitmap1 = str8583:sub(5,5) -- 第一段bitmap的第一个字节 n = n + 4 local tab_bitmap = unpack_bitmap(bitmap1) local bitmap_len = 8 if tab_bitmap[1] == 1 then bitmap_len = 16 end n = n + bitmap_len local bitmap = str8583:sub(5, 5+bitmap_len-1) -- 字符串 bitmap = unpack_bitmap(bitmap) -- {1,0,1,1,......} tab8583[1] = bitmap local nLen = 0 -- 某个域的长度 for i=2,#bitmap do if bitmap[i] == 1 then local field_def = _fields[i] -- type len align padding zip local field_type = field_def[TYPE] local field_len = field_def[LEN] if field_type == "fix" then nLen = field_len elseif field_type == "lllvar" then nLen = tonumber(str8583:sub(n,n+2)) n = n + 3 elseif field_type == "llvar" then nLen = tonumber(str8583:sub(n,n+1)) n = n + 2 end local value = str8583:sub(n, n+nLen-1) tab8583[i] = value n = n + nLen end end return tab8583 end -- 把table中所有值打包为8583包字符串 -- 64个域 function _M.pack64(tab8583) local bitmap = create_bitmap(64) local msg_type = tab8583[MSG_TYPE] or "" if msg_type and #msg_type == 4 then msg_type = bcdzip(msg_type) end local str8583 = "" for i=2, #bitmap do local value = tab8583[i] if value and value~="" then bitmap[i] = 1 value = change_value_by_field(i, value) --print("value: " .. value) local field_type = _fields[i][TYPE] local pf = prefix64(field_type, value) if _fields[i][ZIP] == "Z" then local padding = _fields[i][PADDING] local align = _fields[i][ALIGN] -- R, L if align == "L" and math.mod(#value,2)~=0 then value = value .. padding elseif align == "R" and math.mod(#value,2)~=0 then value = padding .. value end value = bcdzip(value) end str8583 = str8583 .. pf .. value end end bitmap = pack_bitmap(bitmap) return msg_type .. bitmap .. str8583 end -- 把8583包字符串解析为table -- 64个域 function _M.unpack64(str8583) local tab8583 = {} local msg_type = string.sub(str8583, 1, 2) msg_type = bcdunzip(msg_type) tab8583[0] = msg_type --print("F0: Z[" .. tab8583[0] .. "]") local n = 1 -- 当前位置 local bitmap1 = str8583:sub(3,3) -- 第一段bitmap的第一个字节 n = n + 2 local tab_bitmap = unpack_bitmap(bitmap1) local bitmap_len = 8 if tab_bitmap[1] == 1 then bitmap_len = 16 end n = n + bitmap_len local bitmap = str8583:sub(3, 3+bitmap_len-1) -- 字符串 bitmap = unpack_bitmap(bitmap) -- {1,0,1,1,......} --io.write("F1: [");show_bitmap(bitmap); print("]") tab8583[1] = bitmap local nLen = 0 -- 某个域值的长度 for i=2,#bitmap do if bitmap[i] == 1 then local field_def = _fields[i] -- type len align padding zip local field_type = field_def[TYPE] local field_len = field_def[LEN] if field_type == "fix" then nLen = field_len elseif field_type == "lllvar" then nLen = tonumber(bcdunzip(str8583:sub(n,n+1))) n = n + 2 elseif field_type == "llvar" then nLen = tonumber(bcdunzip(str8583:sub(n,n))) n = n + 1 end local value local zip = field_def[ZIP] if zip == "Z" then local len = math.floor((nLen+1)/2) value = str8583:sub(n, n+len-1) value = bcdunzip(value) n = n + len -- print("F" .. i .. ": Z[" .. value.."]") else value = str8583:sub(n, n+nLen-1) n = n + nLen -- print("F" .. i .. ": ["..value.."]") end if #value > nLen then if field_def[ALIGN] == "L" then value = value:sub(1, nLen) else value = value:sub(-nLen) end end tab8583[i] = value or "" end end return tab8583 end return _M
apache-2.0
Fenix-XI/Fenix
scripts/zones/Cloister_of_Flames/npcs/Fire_Protocrystal.lua
27
1942
----------------------------------- -- Area: Cloister of Flames -- NPC: Fire Protocrystal -- Involved in Quests: Trial by Fire, Trial Size Trial by Fire -- @pos -721 0 -598 207 ----------------------------------- package.loaded["scripts/zones/Cloister_of_Flames/TextIDs"] = nil; ----------------------------------- require("scripts/globals/keyitems"); require("scripts/globals/bcnm"); require("scripts/zones/Cloister_of_Flames/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) if (TradeBCNM(player,player:getZoneID(),trade,npc)) then return; end end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) if (player:getCurrentMission(ASA) == SUGAR_COATED_DIRECTIVE and player:getVar("ASA4_Scarlet") == 1) then player:startEvent(0x0002); elseif (EventTriggerBCNM(player,npc)) then return; else player:messageSpecial(PROTOCRYSTAL); end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("onUpdate CSID: %u",csid); --printf("onUpdate RESULT: %u",option); if (EventUpdateBCNM(player,csid,option)) then return; end end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("onFinish CSID: %u",csid); --printf("onFinish RESULT: %u",option); if (csid==0x0002) then player:delKeyItem(DOMINAS_SCARLET_SEAL); player:addKeyItem(SCARLET_COUNTERSEAL); player:messageSpecial(KEYITEM_OBTAINED,SCARLET_COUNTERSEAL); player:setVar("ASA4_Scarlet","2"); elseif (EventFinishBCNM(player,csid,option)) then return; end end;
gpl-3.0
Fenix-XI/Fenix
scripts/zones/The_Garden_of_RuHmet/mobs/Kf_ghrah_whm.lua
1
1888
----------------------------------- -- Area: Grand Palace of Hu'Xzoi -- MOB: Kf'ghrah WHM ----------------------------------- require("scripts/globals/status"); require("scripts/globals/magic"); -- no spells are currently set due to lack of info ----------------------------------- -- onMobSpawn -- Set core Skin and mob elemental bonus ----------------------------------- function onMobSpawn(mob) mob:AnimationSub(0); mob:setLocalVar("roamTime", os.time()); mob:setModelId(1167); -- light end; ----------------------------------- -- onMobRoam -- AutochangeForm ----------------------------------- function onMobRoam(mob) local roamTime = mob:getLocalVar("roamTime"); local roamForm; if (os.time() - roamTime > 60) then roamForm = math.random(1,3) -- forms 2 and 3 are spider and bird; can change forms at will if (roamForm == 1) then roamForm = 0; -- We don't want form 1 as that's humanoid - make it 0 for ball end; mob:AnimationSub(roamForm); mob:setLocalVar("roamTime", os.time()); end; end; ----------------------------------- -- onMobEngage ----------------------------------- function onMobEngage(mob,target) end; ----------------------------------- -- onMobFight -- Free form change between ball, spider, and bird. ----------------------------------- function onMobFight(mob,target) local changeTime = mob:getLocalVar("changeTime"); local battleForm; if (mob:getBattleTime() - changeTime > 60) then battleForm = math.random(1,3) -- same deal as above if (battleForm == 1) then battleForm = 0; end; mob:AnimationSub(battleForm); mob:setLocalVar("changeTime", mob:getBattleTime()); end; end; ----------------------------------- -- onMobDeath ----------------------------------- function onMobDeath(mob, killer, ally) end;
gpl-3.0
Fizzadar/Luawa
template/debug.lua
2
105702
local template = [[<!-- __ | | __ _______ __ _ _______ | | | | \__ \\ \/ \/ /\__ \ | |_| | // __ \\ / / __ \_ |____/____/(____ /\/\_/ (____ / \/ \/ debug site: luawa.com documentation: doc.luawa.com --> <div id="luawa_debug"> <!--style--> <style type="text/css"> /* button */ a#luawa_debug_button { position: fixed; bottom: 0px; right: 10px; font-size: 20px; z-index: 99999; font-family: Arial; color: green; font-weight: bold; text-decoration: none; border: none; background: #F7F7F7; padding: 5px; } /* colors */ .luawa_debug_red { color: red; } .luawa_debug_green { color: green; } .luawa_debug_orange { color: orange; } /* layout */ a#luawa_img { position: fixed; top: 20px; left: 20px; width: 200px; z-index: 99; text-decoration: none; border: none; z-index: 99998; display: none; } a#luawa_img img { width: 100%; } div#luawa_debug { width: 100%; bottom: 0; left: 0; left: 0; top: 60%; overflow: hidden; background: #F7F7F7; border-top: 1px solid #D7D7D7; position: fixed; z-index: 99998; display: none; box-sizing: border-box; color: black; font-family: Arial; font-size: 14px; line-height: 24px; } div#luawa_debug table { width: 100%; border-collapse: collapse; border-spacing: 0; } div#luawa_debug table th { text-align: left; background: #D7D7D7; padding: 5px; } div#luawa_debug table td { padding: 5px; } div#luawa_debug table tr:hover { background: #F7F7F7; } #luawa_debug_resizer { cursor: pointer; text-align: center; } .luawa_block { position: absolute; overflow: hidden; margin: 0; padding-top: 30px; z-index: 97; height: 100%; } .luawa_twothird { width: 64%; } .luawa_third { width: 36%; } .luawa_block div { float: left; width: 100%; padding: 0px; } .luawa_block h4 { margin: 0; width: 100%; background: #FFF; padding: 5px; border-bottom: 1px solid #D7D7D7; border-top: 1px solid #D7D7D7; margin-top: -30px; z-index: 97; } .luawa_block h4 a { float: right; box-sizing: border-box; border: none; background: #F1F1F1; border: 1px solid #D7D7D7; border-width: 0 1px; margin-top: -5px; margin-right: -5px; padding-top: 5px; padding: 5px 15px 29px 10px; height: 24px; position: relative; cursor: pointer; } .luawa_block h4 a:hover { color: #333; } .luawa_block h4 a.active { background: #FFF; color: #333; } .luawa_block h4 a.luawa_external { background: white; border-right: none; color: rgb(40, 40, 137); padding-right: 5px; } .luawa_block h4 a.luawa_external:hover { color: rgb(0, 0, 17); } .luawa_block .luawa_sublock { top: 35px; bottom: 0; position: absolute; overflow-x: hidden; overflow-y: auto; } .luawa_top .luawa_sublock { bottom: 25px; } div#luawa_app_data { left: 0; background: #FFF; word-wrap: break-word; } div.luawa_data, div.luawa_messages, div.luawa_status { display: none; } div#luawa_request_data { right: 0; background: #FFF; border-left: 1px solid #D7D7D7; } div.luawa_stack { bottom: 0; } div.luawa_stack h4 { color: black; } div.luawa_stack table th { background: orange; } div.luawa_stack table tr td { background: rgb(40, 40, 137); color: white; cursor: pointer; vertical-align: top; border-top: 3px solid black; } div.luawa_stack table tr:hover td { background: rgb(0, 0, 117); } div.luawa_stack table tr.luawa_small { display: none; } div.luawa_stack table tr.luawa_small td { font-size: 13px; padding: 1px 5px; background: #FFFECC; color: black; border: none; } div.luawa_stack table tr.luawa_small td { cursor: default; } div.luawa_stack table tr.luawa_small table tr:hover td { background: #EEEDBB; } div#luawa_internal_data { bottom: 0; right: 0; background: #EFEFEF; border-right: 1px solid #D7D7D7; } </style> <div id="luawa_debug_resizer">&uarr; resize &darr;</div> <div id="luawa_app_data" class="luawa_block luawa_twothird luawa_top"> <h4> Serverside Messages <a href="http://doc.luawa.com" class="luawa_external">Luawa Documentation</a> <a id="luawa_show_data" data-tab-id="luawa_data">show template data</a> <a id="luawa_show_messages" data-tab-id="luawa_messages">show messages</a> <a id="luawa_show_stack" data-tab-id="luawa_stack" class="active">show stack/profiler</a> </h4> <div class="luawa_messages luawa_sublock"> <? for key, log in pairs(self:get('debug_logs')) do ?> <? for k, message in pairs(log) do ?> <strong><?=key ?></strong>: <pre><?=message.text ?></pre><br /> <? if message.stack then ?> <pre><?=message.stack ?></pre> <? end ?> <? end ?> <? end ?> </div> <div class="luawa_data luawa_sublock"> <pre><?=luawa.utils.table_string(self:get('debug_data')) ?></pre> </div> <div class="luawa_stack luawa_sublock"> <table> <thead><tr> <th>File</th> <th>Time</th> <th>Lines</th> </tr></thead> <tbody> <? for k, v in pairs(self:get('debug_stack')) do ?> <tr data-stack="<?=k ?>"> <td><?=v.file ?></td> <td><?=v.data.time ?>ms</td> <td><?=v.data.lines ?></td> </tr> <tr class="luawa_small luawa_stack_<?=k ?>"> <td><table> <tr> <th>Function</th> <th>Time</th> <th>Lines</th> </tr> <? for c, d in pairs(v.data.funcs) do ?> <tr> <td><?=d.name ?></td> <td><?=d.time ?>ms</td> <td><?=d.lines ?></td> </tr> <? end ?> </table></td> <td colspan="2"><table> <tr> <th>Line</th> <th>Time</th> <th>Count</th> </tr> <? for c, d in pairs(v.data.line_counts) do ?> <tr> <td><?=d.line ?></td> <td><?=d.time ?>ms</td> <td><?=d.count ?></td> </tr> <? end ?> </table></td> </tr> <? end ?> </tbody > </table> </div> </div> <div id="luawa_request_data" class="luawa_block luawa_third luawa_top"> <h4> Request Data <a id="luawa_show_status" data-tab-id="luawa_status">show status</a> <a id="luawa_show_request_data" data-tab-id="luawa_request_data" class="active">show request data</a> </h4> <div class="luawa_request_data luawa_sublock"> <table> <tbody> <tr> <td>Request Time<br /><small>(app + luawa)</small></td> <td><span><?=self:get('debug_request_time') ?>ms</span></td> </tr><tr> <td>App Time</td> <td><span><?=self:get('debug_app_time') ?>ms</span></td> </tr><tr> <td>Luawa Time</td> <td><span><?=self:get('debug_luawa_time') ?>ms</span></td> </tr><tr> <td>Debug Time</td> <td><span><?=self:get('debug_debug_time') ?>ms</span></td> </tr><tr> <td>Hostname</td> <td><?=luawa.request.hostname ?>:<?=luawa.request.hostport ?></td> </tr><tr> <td>Method</td> <td><?=luawa.request.method ?></td> </tr><tr> <td>Remote IP</td> <td><?=luawa.request.remote_addr ?></td> </tr> <tr> <th colspan="2">Cookies</th> </tr> <? for k, v in pairs(luawa.request.cookie) do ?> <tr> <td><?=k ?></td> <td><?=v ?></td> </tr> <? end ?> <tr> <th colspan="2">GET Data</th> </tr> <? for k, v in pairs(luawa.request.get) do ?> <tr> <td><?=k ?></td> <td><?=v ?></td> </tr> <? end ?> <tr> <th colspan="2">POST data</th> </tr> <? for k, v in pairs(luawa.request.post) do ?> <tr> <td><?=k ?></td> <td><?=v ?></td> </tr> <? end ?> <tr> <th colspan="2">Headers</th> </tr> <? for k, v in pairs(luawa.request.header) do ?> <tr> <td><?=k ?></td> <td><?=v ?></td> </tr> <? end ?> </tbody> </table> </div> <div class="luawa_status luawa_sublock"> <table> <tbody> <tr> <td>Luawa Root</td> <td><span><?=luawa.root ?></span></td> </tr><tr> <td>Luawa Version</td> <td><span><?=luawa.version ?></span></td> </tr><tr> <td>Nginx Version</td> <td><span><?=self:get('nginx_version') ?></span></td> </tr><tr> <td>Nginx-Lua Version</td> <td><span><?=self:get('nginx_lua_version') ?></span></td> </tr><tr> <th colspan="2">Cache</th> </tr><tr> <td>Enabled</td> <td><span><? if luawa.caching then ?>true<? else ?>false<? end ?></span></td> </tr><tr> <td>App Files</td> <td><?=self:get('debug_cached_files') ?></td> </tr><tr> <td>Template</td> <td><?=self:get('debug_cached_templates') ?></td> </tr><tr> <th colspan="2">Session Objects</th> </tr><tr> <td>Requests Served</td> <td><span><?=luawa.requests:get('success') ?></span></td> </tr><tr> <td>Errors Served</td> <td><span><?=luawa.requests:get('error') ?></span></td> </tr><tr> <td>Session</td> <td><?=#ngx.shared[luawa.shm_prefix .. 'session']:get_keys(0) ?></td> </tr><tr> <td>User</td> <td><?=#ngx.shared[luawa.shm_prefix .. 'user']:get_keys(0) ?></td> </tr> </tbody> </table> </div> </div> </div><!--end debug--> <a id="luawa_debug_button" href="#">debug &uarr;</a> <!--script--> <script type="text/javascript"> window.addEventListener('load', (function() { 'use strict'; //core var html = document.querySelector('html'), debug = document.querySelector('#luawa_debug'), debug_img = document.querySelector('#luawa_img'), debug_button = document.querySelector('#luawa_debug_button'), debug_resizer = document.querySelector('#luawa_debug_resizer'), visible, height; //toggle the debug function debug_toggle() { //if displayed if(debug.style.display == 'block') { debug.style.display = 'none'; debug_img.style.display = 'none'; sessionStorage.setItem('luawa_debug', 'false'); debug_button.innerHTML = 'debug &uarr;'; html.style.marginBottom = '0px'; visible = false; //if not displayed } else { debug.style.display = 'block'; debug_img.style.display = 'block'; sessionStorage.setItem('luawa_debug', 'true'); debug_button.innerHTML = 'debug &darr;'; html.style.marginBottom = (window.innerHeight - height) + 'px'; visible = true; } return false; } //toggle if saved if(sessionStorage.getItem('luawa_debug') == 'true') { debug_toggle(); } //stop scrolling when over debug (annoying) debug.addEventListener('mouseover', function() { document.body.style.overflow = 'hidden'; }); debug.addEventListener('mouseout', function() { document.body.style.overflow = 'auto'; }); //resize if saved if(sessionStorage.getItem('luawa_debug_top')) { debug.style.top = sessionStorage.getItem('luawa_debug_top') + 'px'; } var start_height = debug.offsetTop; //hacky- but we need the height if(!visible) { debug_toggle(); start_height = debug.offsetTop; debug_toggle(); } //resize debug var mouse_y; var mouseMove = function(ev) { ev.preventDefault(); if(!mouse_y) { mouse_y = ev.clientY; } var diff = ev.clientY - mouse_y; var top = start_height + diff; if(top < 0) top = 0; debug.style.top = top + 'px'; html.style.marginBottom = (window.innerHeight - top) + 'px'; height = top; sessionStorage.setItem('luawa_debug_top', top); }; debug_resizer.addEventListener('mousedown', function(ev) { window.addEventListener('mousemove', mouseMove); }); window.addEventListener('mouseup', function(ev) { window.removeEventListener('mousemove', mouseMove); }); if(visible) { html.style.marginBottom = (window.innerHeight - start_height) + 'px'; height = start_height; } //toggle debug debug_button.addEventListener('click', function(ev) { ev.preventDefault(); debug_toggle(); }); //tab buttons var app_data_buttons = document.querySelectorAll('#luawa_debug h4 a[data-tab-id]'); //button clicks for(var i=0; i<app_data_buttons.length; i++) { app_data_buttons[i].addEventListener('click', function(ev) { ev.preventDefault(); var buttons = this.parentNode.querySelectorAll('a'); for(var i =0; i<buttons.length; i++) { buttons[i].classList.remove('active'); } this.className = 'active'; var sub_block = this.parentNode.parentNode; var tabs = sub_block.querySelectorAll('.luawa_sublock'); for(var i=0; i<tabs.length; i++) { tabs[i].style.display = 'none'; } var tab = document.querySelector('.' + this.getAttribute('data-tab-id')); tab.style.display = 'block'; var open_tabs = JSON.parse(sessionStorage.getItem('luawa_tabs')) || {}; if(typeof open_tabs != 'object') open_tabs = {}; open_tabs[sub_block.id] = this.getAttribute('data-tab-id'); sessionStorage.setItem('luawa_tabs', JSON.stringify(open_tabs)); }); } //remember open tabs var tabs = JSON.parse(sessionStorage.getItem('luawa_tabs')) || {}; if(typeof tabs != 'object') tabs = {}; for(var key in tabs) { var $el = document.querySelector('#' + key + ' h4 a[data-tab-id=' + tabs[key] + ']'); $el.click(); } //profiler var files = document.querySelectorAll('.luawa_stack tbody tr[data-stack]'); for(var i=0; i<files.length; i++) { files[i].addEventListener('click', function(ev) { var rows = document.querySelector('.luawa_stack tbody .luawa_stack_' + this.getAttribute('data-stack')); if(this.open) { rows.style.display = 'none'; this.open = false; } else { rows.style.display = 'table-row'; this.open = true; } }); } })); </script> <a id="luawa_img" href="http://luawa.com"> <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAw8AAAJQCAYAAADIc1hAAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zL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4Qk5o5bq/v79Jpmm56vMjfXL58uVAqUhUUVERqK8HydQzuS7rBCZNmnSkC14j+adPn24xKMh/wsLCiiQsSFUu3XJc+fkAABAeANiQaSWWqSVGmJCRCTlR7Yq/u7S0NFhdH/UwLhsaGuQE2mh2GCewEiYkSOhWLfPqJVhI6OnVq1eNXMrO2tbj/v37l3d1v5aVlflKlaLa2lrvmpoa3+ZNAoH+t3pVVVUFmEymAH3pZxkFUsrOlCF90v5IFwVMa3hIljAn05CkhK9MZWNnaAAA4QGA7YmjTB3qkulD+gQ7qB1/zDixlmk10i5dunSrxycvW7bsD5397fj69etnnDx5MqGln7WjyChEVzwvd911V6YOXiMkRHRH8AIAgPAA4CbFxcWhXfH3dMW0mh49ejSqzilvek1XjQhJCVXdTvAKBQA4Ik+6AHBPZWVlwV1wUt8lpUFlmlRn/x1dFR4AACA8AHA4ljUPnUrWPXTFv0XWBnT239HY2OhZWVnJaC0AwK3xQQi4qXnz5qWUlJTIXhTB0qTKkMzrl2/Y5URZdcA0IBcJD8YicVkgLlWYevfuXcGrBwBAeADgViIjI8ultXSfyWTy1EFipaVcaWBlZWWgVCWSk2e5tF63hAxlL2h0VXjw8fGpa28okJ8xICDAJBWk5FKaBAUpUSvlaqV0rey/wCsGAADCA4AWyCJn3dq0cVxxcbFfTU3NyitXrvjZlkaVYzn57oqfV/4eHYSekrUPsnja29u7TkYjLOViq+WyeZOwoP9cA882AABt9/8FGAD5FoUgFedfoQAAAABJRU5ErkJggg==" /> </a>]] return template
mit
DarkstarProject/darkstar
scripts/globals/mobskills/grim_halo.lua
11
1124
--------------------------------------------------- -- Grim Halo -- Deals damage to a all targets. Additional effect: Knockback -- Only used by Fomors that wield a two-handed weapon (principally WAR, BLM, DRK, SAM, DRG, and SMN fomors). --------------------------------------------- require("scripts/globals/monstertpmoves") require("scripts/globals/settings") require("scripts/globals/status") --------------------------------------------- function onMobSkillCheck(target,mob,skill) local job = mob:getMainJob() if (job == dsp.job.WAR or job == dsp.job.BLM or job == dsp.job.DRK or job == dsp.job.SAM or job == dsp.job.DRG or job == dsp.job.SMN) then return 0 end return 1 end function onMobWeaponSkill(target, mob, skill) local numhits = 1 local accmod = 1 local dmgmod = 2.5 local info = MobPhysicalMove(mob,target,skill,numhits,accmod,dmgmod,TP_NO_EFFECT) local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,dsp.attackType.PHYSICAL,dsp.damageType.BLUNT,info.hitslanded) target:takeDamage(dmg, mob, dsp.attackType.PHYSICAL, dsp.damageType.BLUNT) return dmg end
gpl-3.0
blackops97/boty.lua
tg/test.lua
210
2571
started = 0 our_id = 0 function vardump(value, depth, key) local linePrefix = "" local spaces = "" if key ~= nil then linePrefix = "["..key.."] = " end if depth == nil then depth = 0 else depth = depth + 1 for i=1, depth do spaces = spaces .. " " end end if type(value) == 'table' then mTable = getmetatable(value) if mTable == nil then print(spaces ..linePrefix.."(table) ") else print(spaces .."(metatable) ") value = mTable end for tableKey, tableValue in pairs(value) do vardump(tableValue, depth, tableKey) end elseif type(value) == 'function' or type(value) == 'thread' or type(value) == 'userdata' or value == nil then print(spaces..tostring(value)) else print(spaces..linePrefix.."("..type(value)..") "..tostring(value)) end end print ("HI, this is lua script") function ok_cb(extra, success, result) end -- Notification code {{{ function get_title (P, Q) if (Q.type == 'user') then return P.first_name .. " " .. P.last_name elseif (Q.type == 'chat') then return Q.title elseif (Q.type == 'encr_chat') then return 'Secret chat with ' .. P.first_name .. ' ' .. P.last_name else return '' end end local lgi = require ('lgi') local notify = lgi.require('Notify') notify.init ("Telegram updates") local icon = os.getenv("HOME") .. "/.telegram-cli/telegram-pics/telegram_64.png" function do_notify (user, msg) local n = notify.Notification.new(user, msg, icon) n:show () end -- }}} function on_msg_receive (msg) if started == 0 then return end if msg.out then return end do_notify (get_title (msg.from, msg.to), msg.text) if (msg.text == 'ping') then if (msg.to.id == our_id) then send_msg (msg.from.print_name, 'pong', ok_cb, false) else send_msg (msg.to.print_name, 'pong', ok_cb, false) end return end if (msg.text == 'PING') then if (msg.to.id == our_id) then fwd_msg (msg.from.print_name, msg.id, ok_cb, false) else fwd_msg (msg.to.print_name, msg.id, ok_cb, false) end return end end function on_our_id (id) our_id = id end function on_user_update (user, what) --vardump (user) end function on_chat_update (chat, what) --vardump (chat) end function on_secret_chat_update (schat, what) --vardump (schat) end function on_get_difference_end () end function cron() -- do something postpone (cron, false, 1.0) end function on_binlog_replay_end () started = 1 postpone (cron, false, 1.0) end
gpl-2.0
Giorox/AngelionOT-Repo
data/actions/scripts/other/nexus.lua
1
1080
function onUse(cid, item, fromPosition, itemEx, toPosition) local tilepos1 = {x=33114, y=31703, z=12} local tilepos2 = {x=33116, y=31703, z=12} local tilepos5 = {x=33115, y=31702, z=12} local tilepos3 = {x=33114, y=31700, z=12} local tilepos4 = {x=33115, y=31700, z=12} local tilepos6 = {x=33116, y=31700, z=12} local tilepos7 = {x=33114, y=31701, z=12} local tilepos8 = {x=33115, y=31701, z=12} local tilepos9 = {x=33116, y=31701, z=12} if(itemEx.uid == 6669) and (itemEx.itemid == 8759) then if getPlayerStorageValue(cid, 1996) == 1 then doPlayerRemoveItem(cid, 7494, 1) doSendMagicEffect(tilepos5,15) doSendMagicEffect(tilepos1,5) doSendMagicEffect(tilepos2,5) doSendMagicEffect(tilepos3,5) doSendMagicEffect(tilepos4,5) doSendMagicEffect(tilepos6,5) doSendMagicEffect(tilepos7,5) doSendMagicEffect(tilepos8,5) doSendMagicEffect(tilepos9,5) setPlayerStorageValue(cid, 1883, 1) doCreatureSay(cid, 'You succesfully destroyed the Shadow Nexus', TALKTYPE_ORANGE_1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You arent a inquisition member") end return TRUE end end
gpl-3.0
Fenix-XI/Fenix
scripts/zones/Sea_Serpent_Grotto/npcs/qm2.lua
13
1471
----------------------------------- -- Area: Sea Serpent Grotto -- NPC: ??? Used for Norg quest "The Sahagin's Stash" -- @zone 176 -- @pos 295.276 27.129 213.043 ----------------------------------- package.loaded["scripts/zones/Sea_Serpent_Grotto/TextIDs"] = nil; ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/keyitems"); require("scripts/globals/quests"); require("scripts/zones/Sea_Serpent_Grotto/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) SahaginStash = player:getQuestStatus(OUTLANDS,THE_SAHAGINS_STASH); if (SahaginStash == QUEST_ACCEPTED and player:hasKeyItem(296) == false) then player:startEvent(0x0001); end end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); if (csid == 0x0001) then player:addKeyItem(296); player:messageSpecial(KEYITEM_OBTAINED,296); end end;
gpl-3.0
DarkstarProject/darkstar
scripts/globals/abilities/pets/heavenly_strike.lua
11
1407
--------------------------------------------------- -- Geocrush --------------------------------------------------- require("scripts/globals/settings") require("scripts/globals/status") require("scripts/globals/monstertpmoves") require("scripts/globals/magic") --------------------------------------------------- function onAbilityCheck(player, target, ability) return 0,0 end function onPetAbility(target, pet, skill) local dINT = math.floor(pet:getStat(dsp.mod.INT) - target:getStat(dsp.mod.INT)) local tp = skill:getTP() / 10 local master = pet:getMaster() local merits = 0 if (master ~= nil and master:isPC()) then merits = master:getMerit(dsp.merit.HEAVENLY_STRIKE) end tp = tp + (merits - 40) if (tp > 300) then tp = 300 end --note: this formula is only accurate for level 75 - 76+ may have a different intercept and/or slope local damage = math.floor(512 + 1.72*(tp+1)) damage = damage + (dINT * 1.5) damage = MobMagicalMove(pet,target,skill,damage,dsp.magic.ele.ICE,1,TP_NO_EFFECT,0) damage = mobAddBonuses(pet, nil, target, damage.dmg, dsp.magic.ele.ICE) damage = AvatarFinalAdjustments(damage,pet,skill,target,dsp.attackType.MAGICAL,dsp.damageType.ICE,1) target:takeDamage(damage, pet, dsp.attackType.MAGICAL, dsp.damageType.ICE) target:updateEnmityFromDamage(pet,damage) return damage end
gpl-3.0
DarkstarProject/darkstar
scripts/globals/spells/tornado_ii.lua
6
1200
----------------------------------------- -- Spell: Tornado II -- Deals wind damage to an enemy and lowers its resistance against ice. ----------------------------------------- require("scripts/globals/status") require("scripts/globals/magic") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) return 0 end function onSpellCast(caster, target, spell) local spellParams = {} spellParams.hasMultipleTargetReduction = false spellParams.resistBonus = 1.0 spellParams.V = 710 spellParams.V0 = 800 spellParams.V50 = 900 spellParams.V100 = 1000 spellParams.V200 = 1200 spellParams.M = 2 spellParams.M0 = 2 spellParams.M50 = 2 spellParams.M100 = 2 spellParams.M200 = 2 spellParams.I = 780 spellParams.bonusmab = caster:getMerit(dsp.merit.ANCIENT_MAGIC_ATK_BONUS) spellParams.AMIIburstBonus = caster:getMerit(dsp.merit.ANCIENT_MAGIC_BURST_DMG)/100 -- no point in making a separate function for this if the only thing they won't have in common is the name handleNinjutsuDebuff(caster,target,spell,30,10,dsp.mod.ICERES) return doElementalNuke(caster, spell, target, spellParams) end
gpl-3.0
DarkstarProject/darkstar
scripts/globals/abilities/drachen_roll.lua
12
2883
----------------------------------- -- Ability: Drachen Roll -- Enhances pet accuracy for party members within area of effect -- Optimal Job: Dragoon -- Lucky Number: 4 -- Unlucky Number: 8 -- Level: 23 -- Phantom Roll +1 Value: 5 -- -- Die Roll |No DRG |With DRG -- -------- ------- ----------- -- 1 |+10 |+25 -- 2 |+13 |+28 -- 3 |+15 |+30 -- 4 |+40 |+55 -- 5 |+18 |+33 -- 6 |+20 |+35 -- 7 |+25 |+40 -- 8 |+5 |+20 -- 9 |+28 |+43 -- 10 |+30 |+45 -- 11 |+50 |+65 -- Bust |-15 |-15 ----------------------------------- require("scripts/globals/settings") require("scripts/globals/ability") require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------- function onAbilityCheck(player,target,ability) local effectID = dsp.effect.DRACHEN_ROLL ability:setRange(ability:getRange() + player:getMod(dsp.mod.ROLL_RANGE)) if (player:hasStatusEffect(effectID)) then return dsp.msg.basic.ROLL_ALREADY_ACTIVE,0 elseif atMaxCorsairBusts(player) then return dsp.msg.basic.CANNOT_PERFORM,0 else return 0,0 end end function onUseAbility(caster,target,ability,action) if (caster:getID() == target:getID()) then corsairSetup(caster, ability, action, dsp.effect.DRACHEN_ROLL, dsp.job.DRG) end local total = caster:getLocalVar("corsairRollTotal") return applyRoll(caster,target,ability,action,total) end function applyRoll(caster,target,ability,action,total) local duration = 300 + caster:getMerit(dsp.merit.WINNING_STREAK) + caster:getMod(dsp.mod.PHANTOM_DURATION) local effectpowers = {10, 13, 15, 40, 18, 20, 25, 5, 28, 30, 50, 15} local effectpower = effectpowers[total] if (caster:getLocalVar("corsairRollBonus") == 1 and total < 12) then effectpower = effectpower + 15 end -- Apply Additional Phantom Roll+ Buff local phantomBase = 5 -- Base increment buff local effectpower = effectpower + (phantomBase * phantombuffMultiple(caster)) -- Check if COR Main or Sub if (caster:getMainJob() == dsp.job.COR and caster:getMainLvl() < target:getMainLvl()) then effectpower = effectpower * (caster:getMainLvl() / target:getMainLvl()) elseif (caster:getSubJob() == dsp.job.COR and caster:getSubLvl() < target:getMainLvl()) then effectpower = effectpower * (caster:getSubLvl() / target:getMainLvl()) end if (target:addCorsairRoll(caster:getMainJob(), caster:getMerit(dsp.merit.BUST_DURATION), dsp.effect.DRACHEN_ROLL, effectpower, 0, duration, caster:getID(), total, MOD_PET_ACC) == false) then ability:setMsg(dsp.msg.basic.ROLL_MAIN_FAIL) elseif total > 11 then ability:setMsg(dsp.msg.basic.DOUBLEUP_BUST) end return total end
gpl-3.0
Fenix-XI/Fenix
scripts/zones/Nashmau/npcs/Mamaroon.lua
13
1504
----------------------------------- -- Area: Nashmau -- NPC: Mamaroon -- Standard Merchant NPC ----------------------------------- package.loaded["scripts/zones/Nashmau/TextIDs"] = nil; ----------------------------------- require("scripts/zones/Nashmau/TextIDs"); require("scripts/globals/shop"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) player:showText(npc,MAMAROON_SHOP_DIALOG); stock = { 0x12FC,27000, -- Scroll of Stun 0x1264,5160, -- Scroll of Enfire 0x1265,4098, -- Scroll of Enblizzard 0x1266,2500, -- Scroll of Enaero 0x1267,2030, -- Scroll of Entone 0x1268,1515, -- Scroll of Enthunder 0x1269,7074, -- Scroll of Enwater 0x1262,100800, -- Scroll of Enlight 0x12FB,9000, -- Scroll of Shock Spikes 0x09C5,29950, -- Black Puppet Turban 0x09C6,29950 -- White Puppet Turban } showShop(player, STATIC, stock); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end;
gpl-3.0
Fenix-XI/Fenix
scripts/zones/Dynamis-Xarcabard/mobs/Effigy_Prototype.lua
1
1095
----------------------------------- -- Area: Dynamis Xarcabard -- MOB: Effigy Prototype ----------------------------------- package.loaded["scripts/zones/Dynamis-Xarcabard/TextIDs"] = nil; ----------------------------------- require("scripts/globals/status"); require("scripts/globals/dynamis"); require("scripts/zones/Dynamis-Xarcabard/TextIDs"); ----------------------------------- -- onMobInitialize Action ----------------------------------- function onMobInitialize(mob,target) end; ----------------------------------- -- onMobSpawn Action ----------------------------------- function onMobSpawn(mob) end; ----------------------------------- -- onMobEngaged ----------------------------------- function onMobEngaged(mob,target) end; ----------------------------------- -- onMobDeath ----------------------------------- function onMobDeath(mob,killer,ally) local mobID = mob:getID(); -- HP Bonus: 112 142 if (mobID == 17330532 or mobID == 17330911) then ally:restoreHP(2000); ally:messageBasic(024,(ally:getMaxHP()-ally:getHP())); end end;
gpl-3.0
DarkstarProject/darkstar
scripts/globals/moghouse.lua
9
12198
-- -- Mog House related functions -- require("scripts/globals/npc_util") require("scripts/globals/quests"); require("scripts/globals/settings") require("scripts/globals/status") require("scripts/globals/titles") require("scripts/globals/zone") ------------------------------------ -- Mog Locker constants ------------------------------------ MOGLOCKER_START_TS = 1009810800 -- unix timestamp for 2001/12/31 15:00 MOGLOCKER_ALZAHBI_VALID_DAYS = 7 MOGLOCKER_ALLAREAS_VALID_DAYS = 5 MOGLOCKER_ACCESS_TYPE_ALZAHBI = 0 MOGLOCKER_ACCESS_TYPE_ALLAREAS = 1 MOGLOCKER_PLAYERVAR_ACCESS_TYPE = "mog-locker-access-type" MOGLOCKER_PLAYERVAR_EXPIRY_TIMESTAMP = "mog-locker-expiry-timestamp" function isInMogHouseInHomeNation(player) if not player:isInMogHouse() then return false end local currentZone = player:getZoneID() local nation = player:getNation() if nation == dsp.nation.BASTOK then if currentZone >= dsp.zone.BASTOK_MINES and currentZone <= dsp.zone.METALWORKS then return true end elseif nation == dsp.nation.SANDORIA then if currentZone >= dsp.zone.SOUTHERN_SAN_DORIA and currentZone <= dsp.zone.CHATEAU_DORAGUILLE then return true end else -- Windurst if currentZone >= dsp.zone.WINDURST_WATERS and currentZone <= dsp.zone.WINDURST_WOODS then return true end end return false end function moogleTrade(player,npc,trade) if player:isInMogHouse() then local numBronze = trade:getItemQty(2184) if numBronze > 0 then if addMogLockerExpiryTime(player, numBronze) then -- remove bronze player:tradeComplete() -- send event player:messageSpecial(zones[player:getZoneID()].text.MOG_LOCKER_OFFSET + 2, getMogLockerExpiryTimestamp(player)) end end local giveMoogleABreak = player:getQuestStatus(OTHER_AREAS_LOG, dsp.quest.id.otherAreas.GIVE_A_MOOGLE_A_BREAK) local theMooglePicnic = player:getQuestStatus(OTHER_AREAS_LOG, dsp.quest.id.otherAreas.THE_MOOGLE_PICNIC) local moogleInTheWild = player:getQuestStatus(OTHER_AREAS_LOG, dsp.quest.id.otherAreas.MOOGLES_IN_THE_WILD) if giveMoogleABreak == QUEST_ACCEPTED and npcUtil.tradeHas(trade, {17161, 13457}) then player:startEvent(30007) elseif theMooglePicnic == QUEST_ACCEPTED and npcUtil.tradeHas(trade, {17402, 615}) then player:startEvent(30011) elseif moogleInTheWild == QUEST_ACCEPTED and npcUtil.tradeHas(trade, {13593, 12474}) then player:startEvent(30015) end if isInMogHouseInHomeNation(player) and player:getCurrentMission(AMK) == dsp.mission.id.amk.DRENCHED_IT_BEGAN_WITH_A_RAINDROP and npcUtil.tradeHas(trade, {2757, 2758, 2759}) then player:startEvent(30024) end return true end return false end function moogleTrigger(player,npc) if player:isInMogHouse() then local lockerTs = getMogLockerExpiryTimestamp(player) if lockerTs ~= nil then if lockerTs == -1 then -- expired player:messageSpecial(zones[player:getZoneID()].text.MOG_LOCKER_OFFSET + 1, 2184) -- 2184 is imperial bronze piece item id else player:messageSpecial(zones[player:getZoneID()].text.MOG_LOCKER_OFFSET, lockerTs) end end local homeNationFameLevel = player:getFameLevel(player:getNation()) local giveMoogleABreak = player:getQuestStatus(OTHER_AREAS_LOG, dsp.quest.id.otherAreas.GIVE_A_MOOGLE_A_BREAK) local theMooglePicnic = player:getQuestStatus(OTHER_AREAS_LOG, dsp.quest.id.otherAreas.THE_MOOGLE_PICNIC) local moogleInTheWild = player:getQuestStatus(OTHER_AREAS_LOG, dsp.quest.id.otherAreas.MOOGLES_IN_THE_WILD) if player:getCharVar("MoghouseExplication") == 1 then player:startEvent(30000) -- A Moogle Kupo d'Etat elseif ENABLE_AMK and isInMogHouseInHomeNation(player) and player:getMainLvl() >= 10 and player:getCurrentMission(AMK) == dsp.mission.id.amk.A_MOOGLE_KUPO_DETAT then player:startEvent(30023) elseif player:getLocalVar("QuestSeen") == 0 and giveMoogleABreak == QUEST_AVAILABLE and homeNationFameLevel >= 3 and player:getCharVar("[MS1]BedPlaced") == 1 then player:startEvent(30005,0,0,0,5,0,17161,13457) elseif player:getLocalVar("QuestSeen") == 0 and giveMoogleABreak == QUEST_ACCEPTED and player:getCharVar("MogSafeProgress") == 1 then player:startEvent(30006,0,0,0,0,0,17161,13457) elseif player:getLocalVar("QuestSeen") == 0 and giveMoogleABreak == QUEST_ACCEPTED and player:getCharVar("MogSafeProgress") == 2 then player:startEvent(30008) elseif player:getLocalVar("QuestSeen") == 0 and theMooglePicnic == QUEST_AVAILABLE and homeNationFameLevel >= 5 and giveMoogleABreak == QUEST_COMPLETED and player:getCharVar("[MS2]BedPlaced") == 1 then player:startEvent(30009,0,0,0,4,0,17402,615) elseif player:getLocalVar("QuestSeen") == 0 and theMooglePicnic == QUEST_ACCEPTED and player:getCharVar("MogSafeProgress") == 1 then player:startEvent(30010,0,0,0,0,0,17402,615) elseif player:getLocalVar("QuestSeen") == 0 and theMooglePicnic == QUEST_ACCEPTED and player:getCharVar("MogSafeProgress") == 2 then player:startEvent(30012) elseif player:getLocalVar("QuestSeen") == 0 and moogleInTheWild == QUEST_AVAILABLE and homeNationFameLevel >= 7 and theMooglePicnic == QUEST_COMPLETED and player:getCharVar("[MS3]BedPlaced") == 1 then player:startEvent(30013,0,0,0,6,0,13593,12474) elseif player:getLocalVar("QuestSeen") == 0 and moogleInTheWild == QUEST_ACCEPTED and player:getCharVar("MogSafeProgress") == 1 then player:startEvent(30014,0,0,0,0,0,13593,12474) elseif player:getLocalVar("QuestSeen") == 0 and moogleInTheWild == QUEST_ACCEPTED and player:getCharVar("MogSafeProgress") == 2 then player:startEvent(30016) else player:sendMenu(1) end return true end return false end function moogleEventUpdate(player,csid,option) if player:isInMogHouse() then return true end return false end function moogleEventFinish(player,csid,option) if player:isInMogHouse() then if csid == 30000 then player:setCharVar("MoghouseExplication", 0) elseif csid == 30023 then player:completeMission(AMK,dsp.mission.id.amk.A_MOOGLE_KUPO_DETAT) player:addMission(AMK,dsp.mission.id.amk.DRENCHED_IT_BEGAN_WITH_A_RAINDROP) elseif csid == 30024 then player:completeMission(AMK,dsp.mission.id.amk.DRENCHED_IT_BEGAN_WITH_A_RAINDROP) player:addMission(AMK,dsp.mission.id.amk.HASTEN_IN_A_JAM_IN_JEUNO) elseif csid == 30005 and option == 1 then player:addQuest(OTHER_AREAS_LOG, dsp.quest.id.otherAreas.GIVE_A_MOOGLE_A_BREAK) player:setLocalVar("QuestSeen", 1) player:setCharVar("[MS1]BedPlaced", 0) player:setCharVar("MogSafeProgress", 1) elseif csid == 30005 and option == 2 then player:setLocalVar("QuestSeen", 1) elseif csid == 30006 then player:setLocalVar("QuestSeen", 1) elseif csid == 30007 then player:tradeComplete() player:setCharVar("MogSafeProgress", 2) elseif csid == 30008 then player:completeQuest(OTHER_AREAS_LOG, dsp.quest.id.otherAreas.GIVE_A_MOOGLE_A_BREAK) player:changeContainerSize(dsp.inv.MOGSAFE, 10) player:addTitle(dsp.title.MOGS_KIND_MASTER) player:setCharVar("MogSafeProgress", 0) elseif csid == 30009 and option == 1 then player:addQuest(OTHER_AREAS_LOG, dsp.quest.id.otherAreas.THE_MOOGLE_PICNIC) player:setLocalVar("QuestSeen", 1) player:setCharVar("[MS2]BedPlaced", 0) player:setCharVar("MogSafeProgress", 1) elseif csid == 30009 and option == 2 then player:setLocalVar("QuestSeen", 1) elseif csid == 30010 then player:setLocalVar("QuestSeen", 1) elseif csid == 30011 then player:tradeComplete() player:setCharVar("MogSafeProgress", 2) elseif csid == 30012 then player:completeQuest(OTHER_AREAS_LOG, dsp.quest.id.otherAreas.THE_MOOGLE_PICNIC) player:changeContainerSize(dsp.inv.MOGSAFE, 10) player:addTitle(dsp.title.MOGS_EXCEPTIONALLY_KIND_MASTER) player:setCharVar("MogSafeProgress", 0) elseif csid == 30013 and option == 1 then player:addQuest(OTHER_AREAS_LOG, dsp.quest.id.otherAreas.MOOGLES_IN_THE_WILD) player:setLocalVar("QuestSeen", 1) player:setCharVar("[MS3]BedPlaced", 0) player:setCharVar("MogSafeProgress", 1) elseif csid == 30013 and option == 2 then player:setLocalVar("QuestSeen", 1) elseif csid == 30014 then player:setLocalVar("QuestSeen", 1) elseif csid == 30015 then player:tradeComplete() player:setCharVar("MogSafeProgress", 2) elseif csid == 30016 then player:completeQuest(OTHER_AREAS_LOG, dsp.quest.id.otherAreas.MOOGLES_IN_THE_WILD) player:changeContainerSize(dsp.inv.MOGSAFE, 10) player:addTitle(dsp.title.MOGS_LOVING_MASTER) player:setCharVar("MogSafeProgress", 0) end return true end return false end -- Unlocks a mog locker for a player. Returns the 'expired' timestamp (-1) function unlockMogLocker(player) player:setCharVar(MOGLOCKER_PLAYERVAR_EXPIRY_TIMESTAMP, -1) local currentSize = player:getContainerSize(dsp.inv.MOGLOCKER) if currentSize == 0 then -- we do this check in case some servers auto-set 80 slots for mog locker items player:changeContainerSize(dsp.inv.MOGLOCKER, 30) end return -1 end -- Sets the mog locker access type (all area or alzahbi only). Returns the new access type. function setMogLockerAccessType(player, accessType) player:setCharVar(MOGLOCKER_PLAYERVAR_ACCESS_TYPE, accessType) return accessType end -- Gets the mog locker access type (all area or alzahbi only). Returns the new access type. function getMogLockerAccessType(player) return player:getCharVar(MOGLOCKER_PLAYERVAR_ACCESS_TYPE) end -- Adds time to your mog locker, given the number of bronze coins. -- The amount of time per bronze is affected by the access type -- The expiry time itself is the number of seconds past 2001/12/31 15:00 -- Returns true if time was added successfully, false otherwise. function addMogLockerExpiryTime(player, numBronze) local accessType = getMogLockerAccessType(player) local numDaysPerBronze = 5 if accessType == MOGLOCKER_ACCESS_TYPE_ALZAHBI then numDaysPerBronze = 7 end local currentTs = getMogLockerExpiryTimestamp(player) if currentTs == nil then -- print("Unable to add time: player hasn't unlocked mog locker."); return false end if currentTs == -1 then currentTs = os.time() - MOGLOCKER_START_TS end local timeIncrease = 60 * 60 * 24 * numDaysPerBronze * numBronze local newTs = currentTs + timeIncrease player:setCharVar(MOGLOCKER_PLAYERVAR_EXPIRY_TIMESTAMP, newTs) -- send an invent size packet to enable the items if they weren't player:changeContainerSize(dsp.inv.MOGLOCKER, 0) return true end -- Gets the expiry time for your locker. A return value of -1 is expired. A return value of nil means mog locker hasn't been unlocked. function getMogLockerExpiryTimestamp(player) local expiryTime = player:getCharVar(MOGLOCKER_PLAYERVAR_EXPIRY_TIMESTAMP) if (expiryTime == 0) then return nil end local now = os.time() - MOGLOCKER_START_TS if now > expiryTime then player:setCharVar(MOGLOCKER_PLAYERVAR_EXPIRY_TIMESTAMP, -1) return -1 end return expiryTime end
gpl-3.0
SamuelePilleri/sysdig
userspace/sysdig/chisels/iobytes_net.lua
18
1667
--[[ Copyright (C) 2013-2014 Draios inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. --]] -- Chisel description description = "Counts the total bytes read from and written to the network, and prints the result every second"; short_description = "Show total network I/O bytes"; category = "Net"; -- Chisel argument list args = {} tot = 0 totin = 0 totout = 0 -- Initialization callback function on_init() -- Request the fields fbytes = chisel.request_field("evt.rawarg.res") ftime = chisel.request_field("evt.time.s") fisread = chisel.request_field("evt.is_io_read") -- set the filter chisel.set_filter("evt.is_io=true and (fd.type=ipv4 or fd.type=ipv6)") chisel.set_interval_s(1) return true end -- Event parsing callback function on_event() bytes = evt.field(fbytes) isread = evt.field(fisread) if bytes ~= nil and bytes > 0 then tot = tot + bytes if isread then totin = totin + bytes else totout = totout + bytes end end return true end function on_interval(delta) etime = evt.field(ftime) print(etime .. " in:" .. totin .. " out:" .. totout .. " tot:" .. tot) tot = 0 totin = 0 totout = 0 return true end
gpl-2.0
maikerumine/extreme_survival_mini
mods/flowers/mapgen.lua
3
3803
-- -- Mgv6 -- local function register_mgv6_flower(name) minetest.register_decoration({ deco_type = "simple", place_on = {"default:dirt_with_grass"}, sidelen = 16, noise_params = { offset = 0, scale = 0.006, spread = {x = 100, y = 100, z = 100}, seed = 436, octaves = 3, persist = 0.6 }, y_min = 1, y_max = 30, decoration = "flowers:"..name, }) end local function register_mgv6_mushroom(name) minetest.register_decoration({ deco_type = "simple", place_on = {"default:dirt_with_grass"}, sidelen = 16, noise_params = { offset = 0, scale = 0.04, spread = {x = 100, y = 100, z = 100}, seed = 7133, octaves = 3, persist = 0.6 }, y_min = 1, y_max = 30, decoration = "flowers:"..name, spawn_by = "default:tree", num_spawn_by = 1, }) end local function register_mgv6_waterlily() minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt"}, sidelen = 16, noise_params = { offset = -0.12, scale = 0.3, spread = {x = 100, y = 100, z = 100}, seed = 33, octaves = 3, persist = 0.7 }, y_min = 0, y_max = 0, schematic = minetest.get_modpath("flowers").."/schematics/waterlily.mts", rotation = "random", }) end function flowers.register_mgv6_decorations() register_mgv6_flower("rose") register_mgv6_flower("tulip") register_mgv6_flower("dandelion_yellow") register_mgv6_flower("geranium") register_mgv6_flower("viola") register_mgv6_flower("dandelion_white") register_mgv6_mushroom("mushroom_brown") register_mgv6_mushroom("mushroom_red") register_mgv6_waterlily() end -- -- All other biome API mapgens -- local function register_flower(seed, name) minetest.register_decoration({ deco_type = "simple", place_on = {"default:dirt_with_grass"}, sidelen = 16, noise_params = { offset = -0.015, scale = 0.025, spread = {x = 200, y = 200, z = 200}, seed = seed, octaves = 3, persist = 0.6 }, biomes = {"stone_grassland", "sandstone_grassland", "deciduous_forest", "coniferous_forest"}, y_min = 1, y_max = 31000, decoration = "flowers:"..name, }) end local function register_mushroom(name) minetest.register_decoration({ deco_type = "simple", place_on = {"default:dirt_with_grass"}, sidelen = 16, noise_params = { offset = 0, scale = 0.006, spread = {x = 200, y = 200, z = 200}, seed = 2, octaves = 3, persist = 0.66 }, biomes = {"deciduous_forest", "coniferous_forest"}, y_min = 1, y_max = 31000, decoration = "flowers:"..name, }) end local function register_waterlily() minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt"}, sidelen = 16, noise_params = { offset = -0.12, scale = 0.3, spread = {x = 200, y = 200, z = 200}, seed = 33, octaves = 3, persist = 0.7 }, biomes = {"rainforest_swamp", "savanna_swamp", "deciduous_forest_swamp"}, y_min = 0, y_max = 0, schematic = minetest.get_modpath("flowers").."/schematics/waterlily.mts", rotation = "random", }) end function flowers.register_decorations() register_flower(436, "rose") register_flower(19822, "tulip") register_flower(1220999, "dandelion_yellow") register_flower(36662, "geranium") register_flower(1133, "viola") register_flower(73133, "dandelion_white") register_mushroom("mushroom_brown") register_mushroom("mushroom_red") register_waterlily() end -- -- Detect mapgen to select functions -- -- Mods using singlenode mapgen can call these functions to enable -- the use of minetest.generate_ores or minetest.generate_decorations local mg_params = minetest.get_mapgen_params() if mg_params.mgname == "v6" then flowers.register_mgv6_decorations() elseif mg_params.mgname ~= "singlenode" then flowers.register_decorations() end
lgpl-2.1
Fenix-XI/Fenix
scripts/zones/Northern_San_dOria/npcs/Pepigort.lua
13
1042
----------------------------------- -- Area: Northern San d'Oria -- NPC: Pepigort -- Type: Standard Dialogue NPC -- @zone: 231 -- @pos -126.739 11.999 262.757 -- ----------------------------------- package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil; require("scripts/zones/Northern_San_dOria/TextIDs"); ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) player:showText(npc,PEPIGORT_DIALOG); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) -- printf("CSID: %u",csid); -- printf("RESULT: %u",option); end;
gpl-3.0
DarkstarProject/darkstar
scripts/globals/mobskills/impact_stream.lua
11
1048
--------------------------------------------- -- Impact Stream -- -- Description: 50% Defense Down, Stun -- Type: Magical -- Wipe Shadows -- Range: 10.0' AoE -- Notes: --------------------------------------------- require("scripts/globals/settings") require("scripts/globals/status") require("scripts/globals/monstertpmoves") --------------------------------------------- function onMobSkillCheck(target,mob,skill) return 0 end function onMobWeaponSkill(target, mob, skill) local typeEffect1 = dsp.effect.STUN local typeEffect2 = dsp.effect.DEFENSE_DOWN MobStatusEffectMove(mob, target, typeEffect1, 1, 0, 4) MobStatusEffectMove(mob, target, typeEffect2, 50, 0, 60) local dmgmod = 1 local info = MobMagicalMove(mob,target,skill,mob:getWeaponDmg()*2.5,dsp.magic.ele.LIGHT,dmgmod,0,1) local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,dsp.attackType.MAGICAL,dsp.damageType.EARTH,MOBPARAM_WIPE_SHADOWS) target:takeDamage(dmg, mob, dsp.attackType.MAGICAL, dsp.damageType.EARTH) return dmg end
gpl-3.0
DarkstarProject/darkstar
scripts/globals/weaponskills/combo.lua
10
1459
----------------------------------- -- Combo -- Hand-to-Hand weapon skill -- Skill level: 5 -- Delivers a threefold attack. Damage varies with TP. -- Will stack with Sneak Attack. -- Aligned with the Thunder Gorget. -- Aligned with the Thunder Belt. -- Element: None -- Modifiers: STR:20% DEX:20% -- 100%TP 200%TP 300%TP -- 1.00 1.50 2.00 ----------------------------------- require("scripts/globals/status") require("scripts/globals/settings") require("scripts/globals/weaponskills") ----------------------------------- function onUseWeaponSkill(player, target, wsID, tp, primary, action, taChar) local params = {} params.numHits = 3 params.ftp100 = 1 params.ftp200 = 1.5 params.ftp300 = 2 params.str_wsc = 0.2 params.dex_wsc = 0.2 params.vit_wsc = 0.0 params.agi_wsc = 0.0 params.int_wsc = 0.0 params.mnd_wsc = 0.0 params.chr_wsc = 0.0 params.crit100 = 0.0 params.crit200 = 0.0 params.crit300 = 0.0 params.canCrit = false params.acc100 = 0.0 params.acc200= 0.0 params.acc300= 0.0 params.atk100 = 1; params.atk200 = 1; params.atk300 = 1; if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then params.ftp100 = 1 params.ftp200 = 3.75 params.ftp300 = 5.5 params.str_wsc = 0.3 params.dex_wsc = 0.3 end local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, params, tp, action, primary, taChar) return tpHits, extraHits, criticalHit, damage end
gpl-3.0
gwlim/openwrt_mr3420_8M
feeds/xwrt/webif-iw-lua-chillispot/files/usr/lib/lua/lua-xwrt/chillispot.lua
19
24512
require("lua-xwrt.addon.string") require("lua-xwrt.addon.uci") require("lua-xwrt.html.form") require("lua-xwrt.xwrt.translator") require("lua-xwrt.html.messages") local string = string local io = io local os = os local pairs, ipairs = pairs, ipairs local table = table local uci = uci local util = util local tr = tr local formClass = formClass local string = string local type = type local print = print local tostring, tonumber = tostring, tonumber -- Save upload configuration file --[[ if type(__FORM.upload_config) == "table" then local file if uci.get("chillispot","service","config") == "uci" then file = io.open("/etc/config/chillispot","w") else file = io.open("/etc/chilli.conf","w") end if file then file:write(__FORM.upload_config.data) file:close() end end ]] local newMenu = htmlhmenuClass.new("submenu") newMenu:add(tr("chilli_menu_service#Service"),"chillispot.sh") newMenu:add(tr("chilli_menu_tun#TUN"),"chillispot.sh?option=tun") newMenu:add(tr("chilli_menu_radiuis#Radius"),"chillispot.sh?option=radius") newMenu:add(tr("chilli_menu_proxy#Proxy"),"chillispot.sh?option=proxy") newMenu:add(tr("chilli_menu_dhcp#DHCP"),"chillispot.sh?option=dhcp") newMenu:add(tr("chilli_menu_uam#UAM"),"chillispot.sh?option=uam") newMenu:add(tr("chilli_menu_uam#MAC Authentication"),"chillispot.sh?option=mac") newMenu:add(tr("chilli_menu_socket#Remote Access"),"chillispot.sh?option=socket") if uci.get("chillispot","service","config") == "uci" then if __MENU[__FORM.cat].len > 1 then __MENU[__FORM.cat]["ChilliSpot"] = newMenu else __MENU[__FORM.cat]= newMenu end end uci.check_set("chillispot","service","chillispot") uci.save("chillispot") module("lua-xwrt.chillispot") local tiface = {} function iface(t) tiface[t[".name"]] = t.ifname end function interfaces() local str = "" local savedir = uci.get_savedir() uci.set_savedir("/var/state") local interfaces = uci.foreach("network","interface",iface) uci.set_savedir(savedir) return tiface end function service() local forms = {} forms[#forms+1] = formClass.new("Config") forms[#forms]:Add("service","chillispot.service.enable","/usr/sbin/chilli",tr("chillispot_var_service#Service"),"") forms[#forms]["chillispot.service.enable"].options:Add("service","chilli") forms[#forms]["chillispot.service.enable"].options:Add("init","chilli") -- forms[#forms]:Add("select","chillispot.service.enable",uci.get("chillispot","service","enable",0),tr("chilli_var_enable#Service"),"string") -- forms[#forms]["chillispot.service.enable"].options:Add("0","Disable") -- forms[#forms]["chillispot.service.enable"].options:Add("1","Enable") forms[#forms]:Add("select","chillispot.service.config",uci.get("chillispot","service","config","UCI"),tr("chilli_var_config#Config type"),"string") forms[#forms]["chillispot.service.config"].options:Add("uci","UCI") forms[#forms]["chillispot.service.config"].options:Add("/etc/chilli.conf","/etc/chilli.conf") forms[#forms]:Add_help(tr("chillispot_var_enable#Service"),tr("chilli_help_enable#Enable or disable service.")) forms[#forms]:Add("file","upload_config","",tr("chillispot_var_uploadconf#Upload Conf"),"") if uci.get("chillispot","service","config") ~= "uci" then local conf_data, len = util.file_load("/etc/chilli.conf") forms[#forms+1] = formClass.new("Configuration File",true) forms[#forms]:Add("text_area", "chilli_conf", conf_data, "/etc/chilli.conf", "string", "float:right;width:100%;height:200px;") else forms[#forms+1] = formClass.new("Service Settings") forms[#forms]:Add("text", "chillispot.settings.interval", uci.get("chillispot","settings","interval"),tr("chilli_var_interval#Interval"), "string") -- forms[#forms]:Add("text", "chillispot.settings.pidfile", uci.get("chillispot","settings","pidfile"),tr("chilli_var_pidfile#PID file"), "string") end return forms end function tun() local forms = {} forms[#forms+1] = formClass.new("TUN - Settings") forms[#forms]:Add("text", "chillispot.settings.net", uci.get("chillispot","settings","net"),tr("chilli_var_net#Chilli subnet"), "string") forms[#forms]:Add("text", "chillispot.settings.dynip", uci.get("chillispot","settings","dynip"),tr("chilli_var_dynip#Dynamics IPs"), "string") forms[#forms]:Add("text", "chillispot.settings.statip", uci.get("chillispot","settings","statip"),tr("chilli_var_statip#Statics IPs"), "string") forms[#forms]:Add("text", "chillispot.settings.dns1", uci.get("chillispot","settings","dns1"),tr("chilli_var_dns1#Primary DNS"), "string") forms[#forms]:Add("text", "chillispot.settings.dns2", uci.get("chillispot","settings","dns2"),tr("chilli_var_dns2#Secondary DNS"), "string") forms[#forms]:Add("text", "chillispot.settings.domain", uci.get("chillispot","settings","domain"),tr("chilli_var_domain#Domain"), "string") forms[#forms]:Add("text", "chillispot.settings.ipup", uci.get("chillispot","settings","ipup"),tr("chilli_var_ipup#IP Up Script"), "string") forms[#forms]:Add("text", "chillispot.settings.ipdown", uci.get("chillispot","settings","ipdown"),tr("chilli_var_dns2#IP Down Script"), "string") forms[#forms]:Add("text", "chillispot.settings.conup", uci.get("chillispot","settings","conup"),tr("chilli_var_conup#Conn.Up Script"), "string") forms[#forms]:Add("text", "chillispot.settings.condown", uci.get("chillispot","settings","condown"),tr("chilli_var_condown#Conn.Down Script"), "string") --[[ # TUN parameters # TAG: net # IP network address of external packet data network # Used to allocate dynamic IP addresses and set up routing. # Normally you do not need to uncomment this tag. # option 'net' '192.168.182.0/24' # TAG: dynip # Dynamic IP address pool # Used to allocate dynamic IP addresses to clients. # If not set it defaults to the net tag. # Do not uncomment this tag unless you are an experienced user! # option 'dynip' '192.168.182.0/24' # TAG: statip # Static IP address pool # Used to allocate static IP addresses to clients. # Do not uncomment this tag unless you are an experienced user! # option 'statip' '192.168.182.0/24' # TAG: dns1 # Primary DNS server. # Will be suggested to the client. # If omitted the system default will be used. # Normally you do not need to uncomment this tag. # option 'dns1' '172.16.1.1' option 'dns1' '192.168.61.1' # TAG: dns2 # Secondary DNS server. # Will be suggested to the client. # If omitted the system default will be used. # Normally you do not need to uncomment this tag. option 'dns2' '172.16.1.2' # TAG: domain # Domain name # Will be suggested to the client. # Normally you do not need to uncomment this tag. # option 'domain' 'key.chillispot.org' # TAG: ipup # Script executed after network interface has been brought up. # Executed with the following parameters: <devicename> <ip address> # <mask> # Normally you do not need to uncomment this tag. # option 'ipup' '/etc/chilli.ipup' # TAG: ipdown # Script executed after network interface has been taken down. # Executed with the following parameters: <devicename> <ip address> # <mask> # Normally you do not need to uncomment this tag. # option 'ipdown' '/etc/chilli.ipdown' # TAG: conup # Script executed after a user has been authenticated. # Executed with the following parameters: <devicename> <ip address> # <mask> <user ip address> <user mac address> <filter ID> # Normally you do not need to uncomment this tag. # option 'conup' '/etc/chilli.conup' # TAG: condown # Script executed after a user has disconnected. # Executed with the following parameters: <devicename> <ip address> # <mask> <user ip address> <user mac address> <filter ID> # Normally you do not need to uncomment this tag. # option 'condown' '/etc/chilli.condown' ]] return forms end function radius() local forms = {} forms[#forms+1] = formClass.new("Config") forms[#forms]:Add("text", "chillispot.settings.radiuslisten", uci.get("chillispot","settings","radiuslisten"),tr("chilli_var_radiuslisten#Radius Listen"), "string") forms[#forms]:Add("text", "chillispot.settings.radiusserver1", uci.get("chillispot","settings","radiusserver1"),tr("chilli_var_radiusserver1#Primary Radius Server"), "string") forms[#forms]:Add("text", "chillispot.settings.radiusserver2", uci.get("chillispot","settings","radiusserver2"),tr("chilli_var_radiusserver2#Secondary Radius Server"), "string") forms[#forms]:Add("text", "chillispot.settings.radiusauthport", uci.get("chillispot","settings","radiusauthport"),tr("chilli_var_radiusauthport#Authentication Port"), "string") forms[#forms]:Add("text", "chillispot.settings.radiusacctport", uci.get("chillispot","settings","radiusacctport"),tr("chilli_var_radiusacctport#Accounting Port"), "string") forms[#forms]:Add("text", "chillispot.settings.radiussecret", uci.get("chillispot","settings","radiussecret"),tr("chilli_var_radiussecret#Radius Secret"), "string") forms[#forms]:Add("text", "chillispot.settings.radiusnasid", uci.get("chillispot","settings","radiusnasid"),tr("chilli_var_radiusnasid#NAS Id"), "string") forms[#forms]:Add("text", "chillispot.settings.radiusnasip", uci.get("chillispot","settings","radiusnasip"),tr("chilli_var_radiusnasip#NAS Ip"), "string") forms[#forms]:Add("text", "chillispot.settings.radiuscalled", uci.get("chillispot","settings","radiuscalled"),tr("chilli_var_radiuscalled#Radius Called"), "string") forms[#forms]:Add("text", "chillispot.settings.radiuslocationid", uci.get("chillispot","settings","radiuslocationid"),tr("chilli_var_radiuslocationid#Radius Location Id"), "string") forms[#forms]:Add("text", "chillispot.settings.radiuslocationname", uci.get("chillispot","settings","radiuslocationname"),tr("chilli_var_radiuslocationname#Radius Location Name"), "string") forms[#forms]:Add("text", "chillispot.settings.radiusnasporttype", uci.get("chillispot","settings","radiusnasporttype"),tr("chilli_var_radiusnasporttype#Radius Port Type"), "string") forms[#forms]:Add("text", "chillispot.settings.coaport", uci.get("chillispot","settings","coaport"),tr("chilli_var_coaport#COA Port"), "string") forms[#forms]:Add("text", "chillispot.settings.coanoipcheck", uci.get("chillispot","settings","coanoipcheck"),tr("chilli_var_coanoipcheck#COA Ip Check"), "string") --[[ # Radius parameters # TAG: radiuslisten # IP address to listen to # Normally you do not need to uncomment this tag. # option 'radiuslisten' '127.0.0.1' # TAG: radiusserver1 # IP address of radius server 1 # For most installations you need to modify this tag. # option 'radiusserver1' 'rad01.chillispot.org' option 'radiusserver1' '172.16.1.2' # TAG: radiusserver2 # IP address of radius server 2 # If you have only one radius server you should set radiusserver2 to the # same value as radiusserver1. # For most installations you need to modify this tag. # option 'radiusserver2' 'rad02.chillispot.org' # option 'radiusserver2' '172.16.1.2' # TAG: radiusauthport # Radius authentication port # The UDP port number to use for radius authentication requests. # The same port number is used for both radiusserver1 and radiusserver2. # Normally you do not need to uncomment this tag. # option 'radiusauthport' '1812' # TAG: radiusacctport # Radius accounting port # The UDP port number to use for radius accounting requests. # The same port number is used for both radiusserver1 and radiusserver2. # Normally you do not need to uncomment this tag. # option 'radiusacctport' '1813' # TAG: radiussecret # Radius shared secret for both servers # For all installations you should modify this tag. option 'radiussecret' 'InternetWifi' # TAG: radiusnasid # Radius NAS-Identifier # Normally you do not need to uncomment this tag. # option 'radiusnasid' 'nas01' # TAG: radiusnasip # Radius NAS-IP-Address # Normally you do not need to uncomment this tag. # option 'radiusnasip' '127.0.0.1' # TAG: radiuscalled # Radius Called-Station-ID # Normally you do not need to uncomment this tag. # option 'radiuscalled' '00133300' # TAG: radiuslocationid # WISPr Location ID. Should be in the format: isocc=<ISO_Country_Code>, # cc=<E.164_Country_Code>,ac=<E.164_Area_Code>,network=<ssid/ZONE> # Normally you do not need to uncomment this tag. # option 'radiuslocationid' 'isocc=us,cc=1,ac=408,network=ACMEWISP_NewarkAirport' # TAG: radiuslocationname # WISPr Location Name. Should be in the format: # <HOTSPOT_OPERATOR_NAME>,<LOCATION> # Normally you do not need to uncomment this tag. # option 'radiuslocationname' 'ACMEWISP,Gate_14_Terminal_C_of_Newark_Airport' # TAG: radiusnasporttype # Value of NAS-Port-Type attribute. Defaults to 19 (Wireless-IEEE-802.11). # option 'radiusnasporttype' '19' # TAG: coaport # UDP port to listen to for accepting radius disconnect requests. # option 'coaport' 'port' # TAG: coanoipcheck # If this option is given no check is performed on the source IP address of radius disconnect requests. Otherwise it is checked that radius disconnect requests originate from radiusserver1 or radiusserver2. # option 'coanoipcheck' '0' ]] return forms end function proxy() local forms = {} forms[#forms+1] = formClass.new("Proxy Settings") forms[#forms]:Add("text", "chillispot.settings.proxylisten", uci.get("chillispot","settings","proxylisten"),tr("chilli_var_proxylisten#Proxy Listen"), "string") forms[#forms]:Add("text", "chillispot.settings.proxyport", uci.get("chillispot","settings","proxyport"),tr("chilli_var_proxyport#Proxy Port"), "string") forms[#forms]:Add("text", "chillispot.settings.proxyclient", uci.get("chillispot","settings","proxyclient"),tr("chilli_var_proxyclient#Proxy Client"), "string") forms[#forms]:Add("text", "chillispot.settings.proxysecret", uci.get("chillispot","settings","proxysecret"),tr("chilli_var_proxysecret#Proxy Secret"), "string") forms[#forms]:Add("text", "chillispot.settings.confusername", uci.get("chillispot","settings","confusername"),tr("chilli_var_confusername#Conf Username"), "string") forms[#forms]:Add("text", "chillispot.settings.confpassword", uci.get("chillispot","settings","confpassword"),tr("chilli_var_confpassword#Conf Password"), "string") --[[ # Radius proxy parameters # TAG: proxylisten # IP address to listen to # Normally you do not need to uncomment this tag. # option 'proxylisten' '10.0.0.1' # TAG: proxyport # UDP port to listen to. # If not specified a port will be selected by the system # Normally you do not need to uncomment this tag. # option 'proxyport' '1645' # TAG: proxyclient # Client(s) from which we accept radius requests # Normally you do not need to uncomment this tag. # option 'proxyclient' '10.0.0.1/24' # TAG: proxysecret # Radius proxy shared secret for all clients # If not specified defaults to radiussecret # Normally you do not need to uncomment this tag. # option 'proxysecret' 'testing123' # TAG: confusername # If confusername is specified together with confpassword chillispot # will at regular intervals specified by the interval option query the # radius server for configuration information. # The reply from the radius server must have the Service-Type attribute set to # ChilliSpot-Authorize-Only in order to have any effect. # Currently ChilliSpot-UAM-Allowed, ChilliSpot-MAC-Allowed and # ChilliSpot-Interval is supported. These attributes override the uamallowed , # macallowed and interval options respectively. # Normally you do not need to uncomment this tag. # option 'confusername' 'conf' # TAG: confpassword # If confusername is specified together with confpassword chillispot # will at regular intervals specified by the interval option query the # radius server for configuration information. # Normally you do not need to uncomment this tag. # option 'confpassword' 'secret' ]] return forms end function dhcp() local forms = {} forms[#forms+1] = formClass.new("DHCP Settings") forms[#forms]:Add("select","chillispot.settings.dhcpif",uci.get("chillispot","settings","dhcpif"),tr("chilli_var_dhcpif#Chilli Interface"),"string") for k, v in pairs(interfaces()) do forms[#forms]["chillispot.settings.dhcpif"].options:Add(v,k) end forms[#forms]:Add("text", "chillispot.settings.dhcpmac", uci.get("chillispot","settings","dhcpmac"),tr("chilli_var_dhcpmac#DHCP MAC"), "string") forms[#forms]:Add("text", "chillispot.settings.lease", uci.get("chillispot","settings","lease"),tr("chilli_var_lease#Lease Time"), "string") forms[#forms]:Add("text", "chillispot.settings.eapolenable", uci.get("chillispot","settings","eapolenable"),tr("chilli_var_eapolenable#IEEE 802.1x authentication"), "string") forms[#forms]:Add("select","chillispot.settings.eapolenable",uci.get("chillispot","settings","eapolenable"),tr("chilli_var_eapolenable#IEEE 802.1x authentication"),"string") forms[#forms]["chillispot.settings.eapolenable"].options:Add("0","Disable") forms[#forms]["chillispot.settings.eapolenable"].options:Add("1","Enable") --[[ # DHCP Parameters # TAG: dhcpif # Ethernet interface to listen to. # This is the network interface which is connected to the access points. # In a typical configuration this tag should be set to eth1. option 'dhcpif' 'br-wifi' # TAG: dhcpmac # Use specified MAC address. # MAC address to listen to. If not specified the MAC address of the interface # will be used. The MAC address should be chosen so that it does not conflict # with other addresses on the LAN. # An address in the range 00:00:5E:00:02:00 - 00:00:5E:FF:FF:FF falls # within the IANA range of addresses and is not allocated for other purposes. # The --dhcpmac option can be used in conjunction with access filters in the # access points, or with access points which supports packet forwarding to a # specific MAC address. Thus it is possible at the MAC level to separate access # point management traffic from user traffic for improved system security. # # The --dhcpmac option will set the interface in promisc mode. # Normally you do not need to uncomment this tag. # option 'dhcpmac' '00:00:5E:00:02:00' # TAG: lease # Time before DHCP lease expires # Normally you do not need to uncomment this tag. # option 'lease' '600' # TAG: eapolenable # If this option is given IEEE 802.1x authentication is enabled. # ChilliSpot will listen for EAP authentication requests on the interface # specified by --dhcpif. # EAP messages received on this interface are forwarded to the radius server. # option 'eapolenable' '0' ]] return forms end function uam() local forms = {} forms[#forms+1] = formClass.new("UAM Settings") forms[#forms]:Add("text", "chillispot.settings.uamserver", uci.get("chillispot","settings","uamserver"),tr("chilli_var_uamserver#Server"), "string") forms[#forms]:Add("text", "chillispot.settings.uamhomepage", uci.get("chillispot","settings","uamhomepage"),tr("chilli_var_uamhomepage#Home Page"), "string") forms[#forms]:Add("text", "chillispot.settings.uamsecret", uci.get("chillispot","settings","uamsecret"),tr("chilli_var_uamsecret#Secret"), "string") forms[#forms]:Add("text", "chillispot.settings.uamlisten", uci.get("chillispot","settings","uamlisten"),tr("chilli_var_uamlisten#Listen"), "string") forms[#forms]:Add("text", "chillispot.settings.uamport", uci.get("chillispot","settings","uamport"),tr("chilli_var_uamport#Port"), "string") -- forms[#forms]:Add("text", "chillispot.settings.uamallowed", uci.get("chillispot","settings","uamallowed"),tr("chilli_var_uamallowed#Allowed"), "string") forms[#forms]:Add("list_add", "chillispot.settings.uamallowed", uci.get("chillispot","settings","uamallowed"),tr("chilli_var_uamallowed#Allowed"), "string", "width: 100%") forms[#forms]:Add("select","chillispot.settings.uamanydns",uci.get("chillispot","settings","uamanydns"),tr("chilli_var_uamanydns#Any DNS"),"string") forms[#forms]["chillispot.settings.uamanydns"].options:Add("0","Disable") forms[#forms]["chillispot.settings.uamanydns"].options:Add("1","Enable") --[[ # Universal access method (UAM) parameters # TAG: uamserver # URL of web server handling authentication. # option 'uamserver' 'https://radius.chillispot.org/hotspotlogin' # option 'uamserver' 'http://192.168.182.1/cgi-bin/login/login' option 'uamserver' 'http://www.internet-wifi.com.ar/hotspotlogin_m.php' # TAG: uamhomepage # URL of welcome homepage. # Unauthenticated users will be redirected to this URL. If not specified # users will be redirected to the uamserver instead. # Normally you do not need to uncomment this tag. # option 'uamhomepage' 'http://192.168.182.1/welcome.html' # TAG: uamsecret # Shared between chilli and authentication web server # option 'uamsecret' 'ht2eb8ej6s4et3rg1ulp' option 'uamsecret' 'InternetWifi' # TAG: uamlisten # IP address to listen to for authentication requests # Do not uncomment this tag unless you are an experienced user! # option 'uamlisten' '192.168.182.1' # TAG: uamport # TCP port to listen to for authentication requests # Do not uncomment this tag unless you are an experienced user! # option 'uamport' '3990' # TAG: uamallowed # Comma separated list of domain names, IP addresses or network segments # the client can access without first authenticating. # Normally you do not need to uncomment this tag. # option 'uamallowed' 'www.chillispot.org,10.11.12.0/24' option 'uamallowed' '172.16.1.2,172.16.1.2,www.google.com,10.0.0.0/8' # TAG: uamanydns # If this flag is given unauthenticated users are allowed to use # any DNS server. # Normally you do not need to uncomment this tag. # option 'uamanydns' '0' ]] return forms end function mac() local forms = {} forms[#forms+1] = formClass.new("MAC Authentication Settings") forms[#forms]:Add("select","chillispot.settings.macauth",uci.get("chillispot","settings","macauth"),tr("chilli_var_macauth#MAC Authentication"),"string") forms[#forms]["chillispot.settings.macauth"].options:Add("0","Disable") forms[#forms]["chillispot.settings.macauth"].options:Add("1","Enable") forms[#forms]:Add("list_add", "chillispot.settings.macallowed", uci.get("chillispot","settings","macallowed"),tr("chilli_var_macallowed#MAC Allowed"), "string") forms[#forms]:Add("text", "chillispot.settings.macpassword", uci.get("chillispot","settings","macpassword"),tr("chilli_var_macpassword#Mac Password"), "string") forms[#forms]:Add("text", "chillispot.settings.macsuffix", uci.get("chillispot","settings","macsuffix"),tr("chilli_var_macsuffix#Mac Suffix"), "string") --[[ # MAC authentication # TAG: macauth # If this flag is given users will be authenticated only on their MAC # address. # Normally you do not need to uncomment this tag. # option 'macauth' '0' # TAG: macallowed # List of MAC addresses. # The MAC addresses specified in this list will be authenticated only on # their MAC address. # The User-Name sent to the radius server will consist of the MAC address and # an optional suffix which is specified by the macsuffix option. # If the macauth option is specified the macallowed option is ignored. # It is possible to specify the macallowed option several times. # This is useful if many mac addresses has to be specified. # This tag is ignored if the macauth tag is given. # Normally you do not need to uncomment this tag. # option 'macallowed' '00-0A-5E-AC-BE-51,00-30-1B-3C-32-E9,00-18-DE-26-E8-35' # TAG: macpasswd # Password to use for MAC authentication. # Normally you do not need to uncomment this tag. # option 'macpasswd' 'password' # TAG: macsuffix # Suffix to add to MAC address in order to form the User-Name, # which is sent to the radius server. # Normally you do not need to uncomment this tag. # option 'macsuffix' 'suffix' ]] return forms end function socket() local forms = {} forms[#forms+1] = formClass.new("Socket Setting") forms[#forms]:Add("text", "chillispot.settings.rmtlisten", uci.get("chillispot","settings","rmtlisten"),tr("chilli_var_rmtlisten#Listen"), "string") forms[#forms]:Add("text", "chillispot.settings.rmtport", uci.get("chillispot","settings","rmtport"),tr("chilli_var_rmtport#Port"), "string") forms[#forms]:Add("text", "chillispot.settings.rmtpassword", uci.get("chillispot","settings","rmtpassword"),tr("chilli_var_rmtpassword#Password"), "string") --[[ # TAG: rmtlisten # IP address to listen to for remote monitor and config # Do not uncomment this tag unless you are an experienced user! # option 'rmtlisten' '127.0.0.1' # TAG: rmtport # TCP port to listen to for remote monitor and config # Do not uncomment this tag unless you are an experienced user! option 'rmtport' '3991' # TAG: rmtpasswd # Password to use for remote config by socket. # Normally you do not need to uncomment this tag. # option 'rmtpasswd' 'rmtpassword' ]] return forms end
gpl-2.0
fc0426/gittest
src/GameLayer.lua
3
5366
local GameLayer = class("GameLayer", function() return cc.Layer:create() end) local HeartBar = require "HeartBar" local Food = require "Food" local Barrier = require "Barrier" local Snake = require "Snake" local math = require "math" local GameOver = require "GameOver" local MapLevel = require "MapLevel" local mapBg = { grass = "res/map_grass.png" } local scheduler = cc.Director:getInstance():getScheduler() function GameLayer:init(map, level) self._map = map self._level = level local levelData = MapLevel[map][level] self._levelData = levelData local winSize = cc.Director:getInstance():getWinSize() local bg = cc.Sprite:create(levelData.background) bg:setPosition(winSize.width/2,winSize.height/2) self:addChild(bg, G.lowest) -- 生命条 local heartBar = HeartBar.new() heartBar:init(levelData.heartNum, levelData.heartBg) heartBar:setPosition(heartBar:getContentSize().width / 2, winSize.height - heartBar:getContentSize().height/2) self:addChild(heartBar, G.high) self._heartBar = heartBar -- 添加蛇 self._snake = Snake:new() self._snake:init(levelData.snake.size, levelData.snake.direction, levelData.snake.x, levelData.snake.y) self:addChild(self._snake, G.middle) -- 添加障碍物 self._barriers = {} for i = 1, #levelData.barriers do local barrier = Barrier.new() barrier:init(levelData.barriers[i].direction, levelData.barriers[i].x, levelData.barriers[i].y) self:addChild(barrier) self._barriers[#self._barriers + 1] = barrier end -- 添加食物 self._foods = {} self._eated = 0 for i = 1, levelData.foods.num do self:addFood() end -- 更新函数 function update() self:logic() end self._updateId = scheduler:scheduleScriptFunc(update, G.updateTime, false) -- 关闭按钮 self._closeButton = ccui.Button:create("res/close.png") self._closeButton:setPosition(self:getContentSize().width - self._closeButton:getContentSize().width/2, self:getContentSize().height - self._closeButton:getContentSize().height/2) self._closeButton:addTouchEventListener(function() scheduler:unscheduleScriptEntry(self._updateId) cc.Director:getInstance():replaceScene(require("MapSelectScene").scene()) end) self:addChild(self._closeButton, G.high) -- 点击屏幕 function onTouch(touch, event) if self._isGameOver and self._isGameOver == true then return end if self._stop and self._stop == true then self._updateId = scheduler:scheduleScriptFunc(update, G.updateTime, false) self._stop = false end local location = touch:getLocation() self._snake:onTouch(location) end local listener = cc.EventListenerTouchOneByOne:create() listener:registerScriptHandler(onTouch,cc.Handler.EVENT_TOUCH_BEGAN ) local eventDispatcher = self:getEventDispatcher() eventDispatcher:addEventListenerWithSceneGraphPriority(listener, self) end function GameLayer:logic() self._snake:step{ foods = self._foods, barriers = self._barriers, onEatFood = function(index) self:removeChild(self._foods[index],true) table.remove(self._foods,index) self:addFood() self._eated = self._eated + 1 end, onCollision = function() self:onCollision() end, onEatItself = function() self:decreaseHeart() end } end function GameLayer:addFood() math.randomseed(os.time()) function generateXY() return math.random(1, G.maxX-2), math.random(1, G.maxY-2) end function containsInBarriers(x, y) for i, barrier in ipairs(self._barriers) do if barrier:containsXY(x, y) then return true end end return false end local x, y = 0, 0 repeat x, y = generateXY() until not self._snake:containsXY(x, y) and not containsInBarriers(x,y) local food = Food.new() food:init(1, x, y) self:addChild(food, G.low) self._foods[#self._foods + 1] = food end function GameLayer:onCollision() self._stop = true scheduler:unscheduleScriptEntry(self._updateId) self:decreaseHeart() end function GameLayer:decreaseHeart() self._heartBar:decrease() if self._heartBar:getHeartNum() == 0 then scheduler:unscheduleScriptEntry(self._updateId) self:saveScore() local gameOver = GameOver.create{ score = self._score, isNewScore = self._isNewScore, create = function() local GameScene = require "GameScene" local gameScene = GameScene.scene(self._map, self._level) return gameScene end, } self:addChild(gameOver, G.highest) self._isGameOver = true end end function GameLayer:saveScore() local score = self._eated * 10 + self._snake:getSize() * 20 self._isNewScore = false self._score = score local oldScore = cc.UserDefault:getInstance():getIntegerForKey("score",0) if score > oldScore then cc.UserDefault:getInstance():setIntegerForKey("score",score) self._isNewScore = true end end return GameLayer
mit
Fenix-XI/Fenix
scripts/globals/items/coffeecake_muffin_+1.lua
18
1364
----------------------------------------- -- ID: 5656 -- Item: coffeecake_muffin_+1 -- Food Effect: 1Hr, All Races ----------------------------------------- -- Mind 2 -- Strength -1 -- MP % 10 (cap 90) ----------------------------------------- require("scripts/globals/status"); ----------------------------------------- -- OnItemCheck ----------------------------------------- function onItemCheck(target) local result = 0; if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then result = 246; end return result; end; ----------------------------------------- -- OnItemUse ----------------------------------------- function onItemUse(target) target:addStatusEffect(EFFECT_FOOD,0,0,3600,5656); end; ----------------------------------------- -- onEffectGain Action ----------------------------------------- function onEffectGain(target,effect) target:addMod(MOD_MND, 2); target:addMod(MOD_STR, -1); target:addMod(MOD_FOOD_MPP, 10); target:addMod(MOD_FOOD_MP_CAP, 90); end; ----------------------------------------- -- onEffectLose Action ----------------------------------------- function onEffectLose(target,effect) target:delMod(MOD_MND, 2); target:delMod(MOD_STR, -1); target:delMod(MOD_FOOD_MPP, 10); target:delMod(MOD_FOOD_MP_CAP, 90); end;
gpl-3.0
DarkstarProject/darkstar
scripts/zones/Rabao/npcs/Leodarion.lua
9
3252
----------------------------------- -- Area: Rabao -- NPC: Leodarion -- Involved in Quest: 20 in Pirate Years, I'll Take the Big Box, True Will -- !pos -50 8 40 247 ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/keyitems"); require("scripts/globals/shop"); require("scripts/globals/quests"); local ID = require("scripts/zones/Rabao/IDs"); ----------------------------------- function onTrade(player,npc,trade) if (player:getQuestStatus(OUTLANDS,dsp.quest.id.outlands.I_LL_TAKE_THE_BIG_BOX) == QUEST_ACCEPTED and player:getCharVar("illTakeTheBigBoxCS") == 2) then if (trade:hasItemQty(17098,1) and trade:getItemCount() == 1) then -- Trade Oak Pole player:startEvent(92); end end end; function onTrigger(player,npc) if (player:getQuestStatus(OUTLANDS,dsp.quest.id.outlands.I_LL_TAKE_THE_BIG_BOX) == QUEST_ACCEPTED) then illTakeTheBigBoxCS = player:getCharVar("illTakeTheBigBoxCS"); if (illTakeTheBigBoxCS == 1) then player:startEvent(90); elseif (illTakeTheBigBoxCS == 2) then player:startEvent(91); elseif (illTakeTheBigBoxCS == 3 and VanadielDayOfTheYear() == player:getCharVar("illTakeTheBigBox_Timer")) then player:startEvent(93); elseif (illTakeTheBigBoxCS == 3) then player:startEvent(94); elseif (illTakeTheBigBoxCS == 4) then player:startEvent(95); end elseif (player:getQuestStatus(OUTLANDS,dsp.quest.id.outlands.TRUE_WILL) == QUEST_ACCEPTED) then trueWillCS = player:getCharVar("trueWillCS"); if (trueWillCS == 1) then player:startEvent(97); elseif (trueWillCS == 2 and player:hasKeyItem(dsp.ki.LARGE_TRICK_BOX) == false) then player:startEvent(98); elseif (player:hasKeyItem(dsp.ki.LARGE_TRICK_BOX)) then player:startEvent(99); end else player:startEvent(89); end end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) if (csid == 90) then player:setCharVar("illTakeTheBigBoxCS",2); elseif (csid == 92) then player:tradeComplete(); player:setCharVar("illTakeTheBigBox_Timer",VanadielDayOfTheYear()); player:setCharVar("illTakeTheBigBoxCS",3); elseif (csid == 94) then player:setCharVar("illTakeTheBigBox_Timer",0); player:setCharVar("illTakeTheBigBoxCS",4); player:addKeyItem(dsp.ki.SEANCE_STAFF); player:messageSpecial(ID.text.KEYITEM_OBTAINED,dsp.ki.SEANCE_STAFF); elseif (csid == 97) then player:delKeyItem(dsp.ki.OLD_TRICK_BOX); player:setCharVar("trueWillCS",2); elseif (csid == 99) then if (player:getFreeSlotsCount() < 1) then player:messageSpecial(ID.text.ITEM_CANNOT_BE_OBTAINED,13782); else player:delKeyItem(dsp.ki.LARGE_TRICK_BOX); player:addItem(13782); player:messageSpecial(ID.text.ITEM_OBTAINED,13782); -- Ninja Chainmail player:setCharVar("trueWillCS",0); player:addFame(NORG,30); player:completeQuest(OUTLANDS,dsp.quest.id.outlands.TRUE_WILL); end end end;
gpl-3.0
MartinFrancu/BETS
BtEvaluator/command.lua
1
9221
local Logger = Utils.Debug.Logger local dump = Utils.Debug.dump local ProjectManager = Utils.ProjectManager local CustomEnvironment = Utils.CustomEnvironment local currentlyExecutingCommand = nil local unitToOrderIssueingCommandMap = {} local Results = require("results") local commandEnvironment = CustomEnvironment:New({ SUCCESS = Results.SUCCESS, FAILURE = Results.FAILURE, RUNNING = Results.RUNNING, -- alters certain tables that are available from within the instance Spring = setmetatable({ GiveOrderToUnit = function(unitID, ...) unitToOrderIssueingCommandMap[unitID] = currentlyExecutingCommand return Spring.GiveOrderToUnit(unitID, ...) end, GiveOrderToUnitMap = function(unitMap, ...) for unitID in pairs(unitMap) do unitToOrderIssueingCommandMap[unitID] = currentlyExecutingCommand end return Spring.GiveOrderToUnitMap(unitMap, ...) end, GiveOrderToUnitArray = function(unitArray, ...) for _, unitID in ipairs(unitArray) do unitToOrderIssueingCommandMap[unitID] = currentlyExecutingCommand end return Spring.GiveOrderToUnitArray(unitArray, ...) end, GiveOrderArrayToUnitMap = function(unitMap, ...) for unitID in pairs(unitMap) do unitToOrderIssueingCommandMap[unitID] = currentlyExecutingCommand end return Spring.GiveOrderArrayToUnitMap(unitMap, ...) end, GiveOrderArrayToUnitArray = function(unitArray, ...) for _, unitID in ipairs(unitArray) do unitToOrderIssueingCommandMap[unitID] = currentlyExecutingCommand end return Spring.GiveOrderArrayToUnitArray(unitArray, ...) end, }, { __index = Spring }) }) local hardcodedCommands = require("hardcodedCommand") local CommandManager = {} CommandManager.contentType = ProjectManager.makeRegularContentType("Commands", "lua") local Command = {} CommandManager.baseClass = Command local methodSignatures = { New = "New(self)", Run = "Run(self, unitIds, parameters)", Reset = "Reset(self)" } local orderIssueingCommand = {} -- a reference used as a key in unit roles function Command:loadMethods(...) --Logger.log("script-load", "Loading method ", methodName, " into ", scriptName) local path, parameters = ProjectManager.findFile(CommandManager.contentType, ...) if(not path)then return nil, parameters end local name = parameters.qualifiedName if(not parameters.exists)then return nil, "Command " .. name .. " does not exist" end local project = parameters.project if(not self.project)then self.project = project end local scriptStr = VFS.LoadFile(path) local scriptChunk = assert(loadstring(scriptStr, name)) local environment environment = commandEnvironment:Create({ project = project }, { loadMethods = function(...) self:loadMethods(...) environment.New = self.New environment.Reset = self.Reset environment.Run = self.Run end }) setfenv(scriptChunk, environment) scriptChunk() self.getInfo = environment.getInfo if not environment.New then Logger.log("script-load", "Warning - scriptName: ", scriptName, ", Method ", methodSignatures.New, " missing (note that this might be intentional)") self.New = function() end else self.New = environment.New end if not environment.Reset then Logger.log("script-load", "Warning - scriptName: ", scriptName, ", Method ", methodSignatures.Reset, " missing (note that this might be intentional)") self.Reset = function() end else self.Reset = environment.Reset end if not environment.Run then Logger.error("script-load", "scriptName: ", scriptName, ", Method ", methodSignatures.Run, " missing") self.Run = function() return Results.FAILURE end else local run = environment.Run -- a very big hack -- the correct solution would be to already know the group at the time of compilation... but that is not the logic here self.Run = function(self, unitIDs, ...) local env = commandEnvironment:Create({ group = unitIDs, project = project, }) environment.Sensors = env.Sensors environment.global = env.global environment.bb = env.bb return run(self, unitIDs, ...) end end end function Command:Extend(scriptName) local hardcoded = hardcodedCommands[scriptName] if(hardcoded)then Logger.log("script-load", "Hardcoded command '", scriptName, "' detected.") return hardcoded end Logger.log("script-load", "Loading command from file " .. scriptName) Logger.log("script-load", "scriptName: ", scriptName) local new_class = { } local class_mt = { __index = new_class } function new_class:BaseNew() local newinst = {} setmetatable( newinst, class_mt ) newinst.unitsAssigned = {} newinst.activeCommands = {} -- map(unitID, setOfCmdTags) newinst.idleUnits = {} newinst.scriptName = scriptName -- for debugging purposes local info = self.getInfo() newinst.onNoUnits = info.onNoUnits or Results.SUCCESS local outputParameters = {} if(info.parameterDefs)then for _, def in ipairs(info.parameterDefs) do if(def.output)then outputParameters[def.name] = true end end end newinst.outputParameters = outputParameters success,res = pcall(newinst.New, newinst) if not success then Logger.error("command", "Error in script ", scriptName, ", method " .. methodSignatures.New, ": ", res) end return newinst end new_class._G = new_class setmetatable( new_class, { __index = self }) new_class:loadMethods(scriptName) return new_class end function Command:BaseRun(unitIDs, parameters) if unitIDs.length == 0 and self.onNoUnits ~= Results.RUNNING then Logger.log("command", "No units assigned.") return self.onNoUnits end self.unitsAssigned = unitIDs currentlyExecutingCommand = self local success,res,retVal = pcall(self.Run, self, unitIDs, parameters) if success then if (res == Results.SUCCESS or res == Results.FAILURE) then self:BaseReset() elseif(res ~= Results.RUNNING)then Logger.error("command", "Invalid result of a command. Expected SUCCESS, FAILURE or RUNNING, got: ", dump(res)) return Results.FAILURE end return res, retVal else Logger.error("command", "Error in script ", self.scriptName, ", method ", methodSignatures.Run, ": ", res) return Results.FAILURE end end function Command:BaseReset() Logger.log("command", self.scriptName, " Reset()") local unitIDs = self.unitsAssigned if(unitIDs.length)then for i = 1, unitIDs.length do unitID = unitIDs[i] if(unitToOrderIssueingCommandMap[unitID] == self)then unitToOrderIssueingCommandMap[unitID] = nil -- hack to clear the unit's command queue (adding order without "shift" clears the queue) Spring.GiveOrderToUnit(unitID, CMD.STOP, {},{}) end end end self.unitsAssigned = {} self.idleUnits = {} currentlyExecutingCommand = self local success,res = pcall(self.Reset, self) if not success then Logger.error("command", "Error in script ", self.scriptName, ", method ", methodSignatures.Reset, ": ", res) end end -- TODO not working function Command:GetActiveCommands(unitID) active = self.activeCommands[unitID] if not active then active = {} self.activeCommands[unitID] = active end return active end -- TODO cmdTag is always nil function Command:AddActiveCommand(unitID, cmdID, cmdTag) if cmdID == CMD.STOP then return end active = self:GetActiveCommands(unitID) active.cmdTag = true Logger.log("command", "AddActiveCommand - Unit: ", unitID, " newCmd: ", dump(cmdTag), " QueueLen: ", #active) self.idleUnits[unitID] = false end -- TODO cmdTag is always nil function Command:CommandDone(unitID, cmdID, cmdTag) active = self:GetActiveCommands(unitID) active.cmdTag = nil Logger.log("command", "CommandDone - Unit: ", unitID, " doneCmd: ", dump(cmdTag), " QueueLen: ", #active) end function Command:SetUnitIdle(unitID) Logger.log("command", "SetUnitIdle - Unit: ", unitID) self.idleUnits[unitID] = true end function Command:UnitIdle(unitID) Logger.log("command", "UnitIdle - Unit: ", unitID, " Idle: ", self.idleUnits[unitID]) return self.idleUnits[unitID] end function CommandManager.getAvailableCommandScripts() local commandList = ProjectManager.listAll(CommandManager.contentType) local paramsDefs = {} local tooltips = {} local nameList = {} for _,data in ipairs(commandList)do nameList[#nameList] = data.qualifiedName end for _,data in ipairs(commandList)do Logger.log("script-load", "Loading definition from file: ", data.path) local code = VFS.LoadFile(data.path) .. "; return getInfo()" local script = assert(loadstring(code, data.qualifiedName)) setfenv(script, commandEnvironment:Create()) local success, info = pcall(script) if success then Logger.log("script-load", "Script: ", data.qualifiedName, ", Definitions loaded: ", info.parameterDefs) paramsDefs[data.qualifiedName] = info.parameterDefs or {} tooltips[data.qualifiedName] = info.tooltip or "" else error("script-load".. "Script ".. data.qualifiedName .. " is missing the getInfo() function or it contains an error: ".. info) end end for k, hardcoded in pairs(hardcodedCommands) do paramsDefs[k] = hardcoded.parameterDefs or {} tooltips[k] = hardcoded.tooltip or "" end return paramsDefs, tooltips end return CommandManager
mit
Fenix-XI/Fenix
scripts/globals/items/burdock_root.lua
18
1176
----------------------------------------- -- ID: 5651 -- Item: Burdock Root -- Food Effect: 5Min, All Races ----------------------------------------- -- Agility 2 -- Vitality -4 ----------------------------------------- require("scripts/globals/status"); ----------------------------------------- -- OnItemCheck ----------------------------------------- function onItemCheck(target) result = 0 if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then result = 246; end return result; end; ----------------------------------------- -- OnItemUse ----------------------------------------- function onItemUse(target) target:addStatusEffect(EFFECT_FOOD,0,0,300,5651); end; ----------------------------------- -- onEffectGain Action ----------------------------------- function onEffectGain(target,effect) target:addMod(MOD_AGI, 2); target:addMod(MOD_VIT, -4); end; ----------------------------------------- -- onEffectLose Action ----------------------------------------- function onEffectLose(target,effect) target:delMod(MOD_AGI, 2); target:delMod(MOD_VIT, -4); end;
gpl-3.0
DarkstarProject/darkstar
scripts/globals/items/behemoth_steak.lua
11
1728
----------------------------------------- -- ID: 6464 -- Item: behemoth_steak -- Food Effect: 180Min, All Races ----------------------------------------- -- HP +40 -- STR +7 -- DEX +7 -- INT -3 -- Attack +23% (cap 160) -- Ranged Attack +23% (cap 160) -- Triple Attack +1% -- Lizard Killer +4 -- hHP +4 ----------------------------------------- require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- function onItemCheck(target) local result = 0 if target:hasStatusEffect(dsp.effect.FOOD) or target:hasStatusEffect(dsp.effect.FIELD_SUPPORT_FOOD) then result = dsp.msg.basic.IS_FULL end return result end function onItemUse(target) target:addStatusEffect(dsp.effect.FOOD,0,0,10800,6464) end function onEffectGain(target,effect) target:addMod(dsp.mod.HP, 40) target:addMod(dsp.mod.STR, 7) target:addMod(dsp.mod.DEX, 7) target:addMod(dsp.mod.INT, -3) target:addMod(dsp.mod.FOOD_ATTP, 23) target:addMod(dsp.mod.FOOD_ATT_CAP, 160) target:addMod(dsp.mod.FOOD_RATTP, 23) target:addMod(dsp.mod.FOOD_RATT_CAP, 160) target:addMod(dsp.mod.TRIPLE_ATTACK, 1) target:addMod(dsp.mod.LIZARD_KILLER, 4) target:addMod(dsp.mod.HPHEAL, 4) end function onEffectLose(target, effect) target:delMod(dsp.mod.HP, 40) target:delMod(dsp.mod.STR, 7) target:delMod(dsp.mod.DEX, 7) target:delMod(dsp.mod.INT, -3) target:delMod(dsp.mod.FOOD_ATTP, 23) target:delMod(dsp.mod.FOOD_ATT_CAP, 160) target:delMod(dsp.mod.FOOD_RATTP, 23) target:delMod(dsp.mod.FOOD_RATT_CAP, 160) target:delMod(dsp.mod.TRIPLE_ATTACK, 1) target:delMod(dsp.mod.LIZARD_KILLER, 4) target:delMod(dsp.mod.HPHEAL, 4) end
gpl-3.0
DarkstarProject/darkstar
scripts/zones/The_Garden_of_RuHmet/bcnms/when_angels_fall.lua
9
1414
----------------------------------- -- Area: The_Garden_of_RuHmet -- Name: When Angels Fall ----------------------------------- require("scripts/globals/battlefield") require("scripts/globals/missions") ----------------------------------- function onBattlefieldTick(battlefield, tick) dsp.battlefield.onBattlefieldTick(battlefield, tick) end function onBattlefieldRegister(player, battlefield) end function onBattlefieldEnter(player, battlefield) end function onBattlefieldLeave(player, battlefield, leavecode) if leavecode == dsp.battlefield.leaveCode.WON then local name, clearTime, partySize = battlefield:getRecord() local arg8 = (player:getCurrentMission(COP) ~= dsp.mission.id.cop.WHEN_ANGELS_FALL or player:getCharVar("PromathiaStatus") ~= 4) and 1 or 0 player:startEvent(32001, battlefield:getArea(), clearTime, partySize, battlefield:getTimeInside(), 0, battlefield:getLocalVar("[cs]bit"), arg8) elseif leavecode == dsp.battlefield.leaveCode.LOST then player:startEvent(32002) end end function onEventUpdate(player, csid, option) end function onEventFinish(player, csid, option) if csid== 32001 then if player:getCurrentMission(COP) == dsp.mission.id.cop.WHEN_ANGELS_FALL and player:getCharVar("PromathiaStatus") == 4 then player:setCharVar("PromathiaStatus", 5) end player:setPos(420, 0, 445, 192) end end
gpl-3.0
asdofindia/prosody-modules
mod_carbons/mod_carbons.lua
32
5142
-- XEP-0280: Message Carbons implementation for Prosody -- Copyright (C) 2011 Kim Alvefur -- -- This file is MIT/X11 licensed. local st = require "util.stanza"; local jid_bare = require "util.jid".bare; local xmlns_carbons = "urn:xmpp:carbons:2"; local xmlns_carbons_old = "urn:xmpp:carbons:1"; local xmlns_carbons_really_old = "urn:xmpp:carbons:0"; local xmlns_forward = "urn:xmpp:forward:0"; local full_sessions, bare_sessions = full_sessions, bare_sessions; local function toggle_carbons(event) local origin, stanza = event.origin, event.stanza; local state = stanza.tags[1].attr.mode or stanza.tags[1].name; module:log("debug", "%s %sd carbons", origin.full_jid, state); origin.want_carbons = state == "enable" and stanza.tags[1].attr.xmlns; return origin.send(st.reply(stanza)); end module:hook("iq-set/self/"..xmlns_carbons..":disable", toggle_carbons); module:hook("iq-set/self/"..xmlns_carbons..":enable", toggle_carbons); -- COMPAT module:hook("iq-set/self/"..xmlns_carbons_old..":disable", toggle_carbons); module:hook("iq-set/self/"..xmlns_carbons_old..":enable", toggle_carbons); module:hook("iq-set/self/"..xmlns_carbons_really_old..":carbons", toggle_carbons); local function message_handler(event, c2s) local origin, stanza = event.origin, event.stanza; local orig_type = stanza.attr.type; local orig_from = stanza.attr.from; local orig_to = stanza.attr.to; if not (orig_type == nil or orig_type == "normal" or orig_type == "chat") then return -- No carbons for messages of type error or headline end -- Stanza sent by a local client local bare_jid = jid_bare(orig_from); local target_session = origin; local top_priority = false; local user_sessions = bare_sessions[bare_jid]; -- Stanza about to be delivered to a local client if not c2s then bare_jid = jid_bare(orig_to); target_session = full_sessions[orig_to]; user_sessions = bare_sessions[bare_jid]; if not target_session and user_sessions then -- The top resources will already receive this message per normal routing rules, -- so we are going to skip them in order to avoid sending duplicated messages. local top_resources = user_sessions.top_resources; top_priority = top_resources and top_resources[1].priority end end if not user_sessions then module:log("debug", "Skip carbons for offline user"); return -- No use in sending carbons to an offline user end if stanza:get_child("private", xmlns_carbons) then if not c2s then stanza:maptags(function(tag) if not ( tag.attr.xmlns == xmlns_carbons and tag.name == "private" ) then return tag; end end); end module:log("debug", "Message tagged private, ignoring"); return elseif stanza:get_child("no-copy", "urn:xmpp:hints") then module:log("debug", "Message has no-copy hint, ignoring"); return elseif stanza:get_child("x", "http://jabber.org/protocol/muc#user") then module:log("debug", "MUC PM, ignoring"); return end -- Create the carbon copy and wrap it as per the Stanza Forwarding XEP local copy = st.clone(stanza); copy.attr.xmlns = "jabber:client"; local carbon = st.message{ from = bare_jid, type = orig_type, } :tag(c2s and "sent" or "received", { xmlns = xmlns_carbons }) :tag("forwarded", { xmlns = xmlns_forward }) :add_child(copy):reset(); -- COMPAT local carbon_old = st.message{ from = bare_jid, type = orig_type, } :tag(c2s and "sent" or "received", { xmlns = xmlns_carbons_old }):up() :tag("forwarded", { xmlns = xmlns_forward }) :add_child(copy):reset(); -- COMPAT local carbon_really_old = st.clone(stanza) :tag(c2s and "sent" or "received", { xmlns = xmlns_carbons_really_old }):up() user_sessions = user_sessions and user_sessions.sessions; for _, session in pairs(user_sessions) do -- Carbons are sent to resources that have enabled it if session.want_carbons -- but not the resource that sent the message, or the one that it's directed to and session ~= target_session -- and isn't among the top resources that would receive the message per standard routing rules and (c2s or session.priority ~= top_priority) -- don't send v0 carbons (or copies) for c2s and (not c2s or session.want_carbons ~= xmlns_carbons_really_old) then carbon.attr.to = session.full_jid; module:log("debug", "Sending carbon to %s", session.full_jid); local carbon = session.want_carbons == xmlns_carbons_old and carbon_old -- COMPAT or session.want_carbons == xmlns_carbons_really_old and carbon_really_old -- COMPAT or carbon; session.send(carbon); end end end local function c2s_message_handler(event) return message_handler(event, true) end -- Stanzas sent by local clients module:hook("pre-message/host", c2s_message_handler, 1); module:hook("pre-message/bare", c2s_message_handler, 1); module:hook("pre-message/full", c2s_message_handler, 1); -- Stanzas to local clients module:hook("message/bare", message_handler, 1); module:hook("message/full", message_handler, 1); module:add_feature(xmlns_carbons); module:add_feature(xmlns_carbons_old); if module:get_option_boolean("carbons_v0") then module:add_feature(xmlns_carbons_really_old); end
mit
DarkstarProject/darkstar
scripts/zones/Windurst_Waters/npcs/Ohbiru-Dohbiru.lua
9
10499
----------------------------------- -- Area: Windurst Waters -- NPC: Ohbiru-Dohbiru -- Involved in quest: Food For Thought, Say It with Flowers -- Starts and finishes quest: Toraimarai Turmoil ----------------------------------- require("scripts/globals/quests"); require("scripts/globals/titles"); require("scripts/globals/common"); require("scripts/globals/settings"); require("scripts/globals/keyitems"); local ID = require("scripts/zones/Windurst_Waters/IDs"); function onTrade(player,npc,trade) local turmoil = player:getQuestStatus(WINDURST,dsp.quest.id.windurst.TORAIMARAI_TURMOIL); local count = trade:getItemCount(); if (player:getQuestStatus(WINDURST,dsp.quest.id.windurst.WATER_WAY_TO_GO) == QUEST_ACCEPTED) then if (trade:hasItemQty(4351,1) and count == 1) then player:startEvent(355,900); end elseif (player:getQuestStatus(WINDURST,dsp.quest.id.windurst.FOOD_FOR_THOUGHT) == QUEST_ACCEPTED) then local OhbiruFood = player:getCharVar("Ohbiru_Food_var"); if (trade:hasItemQty(4493,1) == true and trade:hasItemQty(4408,1) == true and trade:hasItemQty(624,1) == true and count == 3) then if (OhbiruFood < 2) then -- Traded all 3 items & Didn't ask for order if (math.random(1,2) == 1) then player:startEvent(325,440); else player:startEvent(326); end elseif (OhbiruFood == 2) then -- Traded all 3 items after receiving order player:startEvent(322,440); end end elseif (turmoil == QUEST_ACCEPTED) then if (count == 3 and trade:getGil() == 0 and trade:hasItemQty(906,3) == true) then --Check that all 3 items have been traded player:startEvent(791); else player:startEvent(786,4500,267,906); -- Reminder of needed items end elseif (turmoil == QUEST_COMPLETED) then if (count == 3 and trade:getGil() == 0 and trade:hasItemQty(906,3) == true) then --Check that all 3 items have been traded player:startEvent(791); else player:startEvent(795,4500,0,906); -- Reminder of needed items for repeated quest end end end; function onTrigger(player,npc) -- Check for Missions first (priority?) -- If the player has started the mission or not local pfame = player:getFameLevel(WINDURST); local turmoil = player:getQuestStatus(WINDURST,dsp.quest.id.windurst.TORAIMARAI_TURMOIL); local FoodForThought = player:getQuestStatus(WINDURST,dsp.quest.id.windurst.FOOD_FOR_THOUGHT); local needToZone = player:needToZone(); local OhbiruFood = player:getCharVar("Ohbiru_Food_var"); -- Variable to track progress of Ohbiru-Dohbiru in Food for Thought local waterWayToGo = player:getQuestStatus(WINDURST,dsp.quest.id.windurst.WATER_WAY_TO_GO); local overnightDelivery = player:getQuestStatus(WINDURST,dsp.quest.id.windurst.OVERNIGHT_DELIVERY); local SayFlowers = player:getQuestStatus(WINDURST,dsp.quest.id.windurst.SAY_IT_WITH_FLOWERS); local FlowerProgress = player:getCharVar("FLOWER_PROGRESS"); local blueRibbonBlues = player:getQuestStatus(WINDURST,dsp.quest.id.windurst.BLUE_RIBBON_BLUES) if (player:getCurrentMission(COP) == dsp.mission.id.cop.THE_ROAD_FORKS and player:getCharVar("MEMORIES_OF_A_MAIDEN_Status")==2) then player:startEvent(872); elseif (player:getCurrentMission(WINDURST) == dsp.mission.id.windurst.THE_PRICE_OF_PEACE) then if (player:getCharVar("ohbiru_dohbiru_talk") == 1) then player:startEvent(143); else player:startEvent(144); end elseif ((SayFlowers == QUEST_ACCEPTED or SayFlowers == QUEST_COMPLETED) and FlowerProgress == 1) then if (needToZone) then player:startEvent(518); elseif (player:getCharVar("FLOWER_PROGRESS") == 2) then player:startEvent(517,0,0,0,0,950); else player:startEvent(516,0,0,0,0,950); end elseif (waterWayToGo == QUEST_COMPLETED and needToZone) then player:startEvent(356,0,4351); elseif (waterWayToGo == QUEST_ACCEPTED) then if (player:hasItem(504) == false and player:hasItem(4351) == false) then player:startEvent(354); else player:startEvent(353); end elseif (waterWayToGo == QUEST_AVAILABLE and overnightDelivery == QUEST_COMPLETED and pfame >= 3) then player:startEvent(352,0,4351); elseif (FoodForThought == QUEST_AVAILABLE and OhbiruFood == 0) then player:startEvent(308); -- Hungry; mentions the experiment. First step in quest for this NPC. player:setCharVar("Ohbiru_Food_var",1); elseif (FoodForThought == QUEST_AVAILABLE and OhbiruFood == 1) then player:startEvent(309); -- Hungry. The NPC complains of being hungry before the quest is active. elseif (FoodForThought == QUEST_ACCEPTED and OhbiruFood < 2) then player:startEvent(316,0,4493,624,4408); -- Gives Order player:setCharVar("Ohbiru_Food_var",2); elseif (FoodForThought == QUEST_ACCEPTED and OhbiruFood == 2) then player:startEvent(317,0,4493,624,4408); -- Repeats Order elseif (FoodForThought == QUEST_ACCEPTED and OhbiruFood == 3) then player:startEvent(324); -- Reminds player to check on friends if he has been given his food. elseif (FoodForThought == QUEST_COMPLETED and needToZone == true) then player:startEvent(344); -- Post Food for Thought Dialogue elseif (overnightDelivery == QUEST_COMPLETED and pfame < 6) then player:startEvent(351); -- Post Overnight Delivery Dialogue -- -- Begin Toraimarai Turmoil Section -- elseif blueRibbonBlues == QUEST_COMPLETED and turmoil == QUEST_AVAILABLE and pfame >= 6 and needToZone == false then player:startEvent(785,4500,267,906); elseif (turmoil == QUEST_ACCEPTED) then player:startEvent(786,4500,267,906); -- Reminder of needed items elseif (turmoil == QUEST_COMPLETED) then player:startEvent(795,4500,0,906); -- Allows player to initiate repeat of Toraimarai Turmoil else player:startEvent(344); end end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) local tabre = { [0] = { itemid = 948, gil = 300 }, -- Carnation [1] = { itemid = 941, gil = 200 }, -- Red Rose [2] = { itemid = 949, gil = 250 }, -- Rain Lily [3] = { itemid = 956, gil = 150 }, -- Lilac [4] = { itemid = 957, gil = 200 }, -- Amaryllis [5] = { itemid = 958, gil = 100 } -- Marguerite } -- Check Missions first (priority?) local turmoil = player:getQuestStatus(WINDURST,dsp.quest.id.windurst.TORAIMARAI_TURMOIL); if (csid == 143) then player:setCharVar("ohbiru_dohbiru_talk",2); elseif (csid == 322 or csid == 325 or csid == 326) then player:tradeComplete(); player:addGil(GIL_RATE*440); if (player:getCharVar("Kerutoto_Food_var") == 2 and player:getCharVar("Kenapa_Food_var") == 4) then -- If this is the last NPC to be fed player:completeQuest(WINDURST,dsp.quest.id.windurst.FOOD_FOR_THOUGHT); player:addFame(WINDURST,100); player:addTitle(dsp.title.FAST_FOOD_DELIVERER); player:needToZone(true); player:setCharVar("Kerutoto_Food_var",0); -- ------------------------------------------ player:setCharVar("Kenapa_Food_var",0); -- Erase all the variables used in this quest player:setCharVar("Ohbiru_Food_var",0); -- ------------------------------------------ else -- If this is NOT the last NPC given food, flag this NPC as completed. player:setCharVar("Ohbiru_Food_var",3); end elseif (csid == 785 and option == 1) then -- Adds Toraimarai turmoil player:addQuest(WINDURST,dsp.quest.id.windurst.TORAIMARAI_TURMOIL); player:messageSpecial(ID.text.KEYITEM_OBTAINED,dsp.ki.RHINOSTERY_CERTIFICATE); player:addKeyItem(dsp.ki.RHINOSTERY_CERTIFICATE); -- Rhinostery Certificate elseif (csid == 791 and turmoil == QUEST_ACCEPTED) then -- Completes Toraimarai turmoil - first time player:addGil(GIL_RATE*4500); player:messageSpecial(ID.text.GIL_OBTAINED,GIL_RATE*4500); player:completeQuest(WINDURST,dsp.quest.id.windurst.TORAIMARAI_TURMOIL); player:addFame(WINDURST,100); player:addTitle(dsp.title.CERTIFIED_RHINOSTERY_VENTURER); player:tradeComplete(); elseif (csid == 791 and turmoil == 2) then -- Completes Toraimarai turmoil - repeats player:addGil(GIL_RATE*4500); player:messageSpecial(ID.text.GIL_OBTAINED,GIL_RATE*4500); player:addFame(WINDURST,50); player:tradeComplete(); elseif (csid == 352 and option == 0 or csid == 354) then if (player:getFreeSlotsCount() >= 1) then if (player:getQuestStatus(WINDURST,dsp.quest.id.windurst.WATER_WAY_TO_GO) == QUEST_AVAILABLE) then player:addQuest(WINDURST,dsp.quest.id.windurst.WATER_WAY_TO_GO); end player:addItem(504); player:messageSpecial(ID.text.ITEM_OBTAINED,504); else player:messageSpecial(ID.text.ITEM_CANNOT_BE_OBTAINED,504); end elseif (csid == 355) then player:addGil(GIL_RATE*900); player:completeQuest(WINDURST,dsp.quest.id.windurst.WATER_WAY_TO_GO); player:addFame(WINDURST,40); player:tradeComplete(); player:needToZone(true); elseif (csid == 872) then player:setCharVar("MEMORIES_OF_A_MAIDEN_Status",3); elseif (csid == 516) then if (option < 7) then local choice = tabre[option]; if (choice and player:getGil() >= choice.gil) then if (player:getFreeSlotsCount() > 0) then player:addItem(choice.itemid) player:messageSpecial(ID.text.ITEM_OBTAINED,choice.itemid); player:delGil(choice.gil); player:needToZone(true); else player:messageSpecial(ID.text.ITEM_CANNOT_BE_OBTAINED,choice.itemid); end else player:messageSpecial(ID.text.NOT_HAVE_ENOUGH_GIL); end elseif (option == 7) then player:setCharVar("FLOWER_PROGRESS",2); end end end;
gpl-3.0
erics1989/lurk
generate_map.lua
1
4892
local generate_aux = require("generate_aux") local function generate_map_cave(prev, name, n) generate_aux.init(name, n) for _, space in ipairs(_state.map.spaces) do local terrain = game.data_init("terrain_stone") game.terrain_enter(terrain, space) end local area = generate_aux.get_blobs( function (space) return game.rand1(100) <= 60 end, 1 ) for _, space in ipairs(area) do local terrain = game.data_init("terrain_dot") game.terrain_enter(terrain, space) end local area = generate_aux.get_blobs( function (space) return game.rand1(100) <= 40 end, 4 ) for _, space in ipairs(area) do local terrain = game.data_init("terrain_water") game.terrain_enter(terrain, space) end local area = generate_aux.get_blobs( function (space) return game.rand1(100) <= 50 end, 1 ) for _, space in ipairs(area) do if space.terrain.id == "terrain_dot" then local terrain = game.data_init("terrain_foliage") game.terrain_enter(terrain, space) end end local area = generate_aux.get_blobs( function (space) return game.rand1(100) <= 50 end, 1 ) for _, space in ipairs(area) do if space.terrain.id == "terrain_foliage" then local terrain = game.data_init("terrain_dense_foliage") game.terrain_enter(terrain, space) end end local area = generate_aux.get_blobs( function (space) return game.rand1(100) <= 50 end, 1 ) for _, space in ipairs(area) do if space.terrain.id == "terrain_foliage" then local terrain = game.data_init("terrain_tree") game.terrain_enter(terrain, space) end end -- post-processing local vf = function (space) return game.data(space.terrain).stand and not game.data(space.terrain).water and space.terrain.id ~= "terrain_chasm" end local conn1 = generate_aux.get_connections1(vf) for _, space in ipairs(conn1) do if not vf(space) then local terrain = game.data_init("terrain_dot") game.terrain_enter(terrain, space) end end local conn2 = generate_aux.get_connections2(vf) for _, space in ipairs(conn2) do if not vf(space) then local terrain = game.data_init("terrain_dot") game.terrain_enter(terrain, space) end end -- place stairs local upstairs, dnstairs = generate_aux.get_distant_spaces(vf) -- place upstairs if _state.map.n == 1 then local terrain = game.data_init("terrain_stairs_up") terrain.door = { name = _state.map.name, n = 0 } game.terrain_enter(terrain, upstairs) else local up = { name = prev.name, n = prev.n } local terrain = game.data_init("terrain_stairs_up") terrain.door = up game.terrain_enter(terrain, upstairs) end -- place dnstairs if _state.map.n == 4 then local object = game.data_init("object_orb") game.object_enter(object, dnstairs) else local dn = { name = _state.map.name, n = _state.map.n + 1 } local terrain = game.data_init("terrain_stairs_dn") terrain.door = dn game.terrain_enter(terrain, dnstairs) end -- place encounters local encounters = _database.branch_zero[n].encounters for i = 1, _database.branch_zero[n].encounter_count do local str = encounters[game.rand1(#encounters)] local encounter = _database[str] local spaces = List.filter(_state.map.spaces, encounter.valid) if spaces[1] then local space = spaces[game.rand1(#spaces)] encounter.init(space) end end local encounter = _database["encounter_person_pirahna"] local spaces = List.filter( _state.map.spaces, function (space) return encounter.valid(space) and game.rand1() < 0.1 end ) for _, space in ipairs(spaces) do encounter.init(space) end -- place treasures local treasures = _database.branch_zero[n].treasures for i = 1, 4 do local str = treasures[game.rand1(#treasures)] local spaces = List.filter( _state.map.spaces, function (space) return game.data(space.terrain).stand and not game.data(space.terrain).water and not space.terrain.door and not space.object end ) local space = spaces[game.rand1(#spaces)] game.object_enter(game.data_init(str), space) end end local function generate_map(prev, name, n) generate_map_cave(prev, name, n) end return generate_map
gpl-3.0
Fenix-XI/Fenix
scripts/zones/Yhoator_Jungle/npcs/Field_Manual.lua
29
1052
----------------------------------- -- Field Manual -- Area: Yhoator Jungle ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/fieldsofvalor"); ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) startFov(FOV_EVENT_YHOATOR,player); end; ----------------------------------- -- onTrade Action ----------------------------------- function onTrade(player,npc,trade) end; ----------------------------------- -- onEventSelection ----------------------------------- function onEventUpdate(player,csid,menuchoice) updateFov(player,csid,menuchoice,129,130,131,132,133); end; ----------------------------------- -- onEventFinish Action ----------------------------------- function onEventFinish(player,csid,option) finishFov(player,csid,option,129,130,131,132,133,FOV_MSG_YHOATOR); end;
gpl-3.0
Fenix-XI/Fenix
scripts/zones/Mamook/npcs/Logging_Point.lua
13
1044
----------------------------------- -- Area: Mamook -- NPC: Logging Point ----------------------------------- package.loaded["scripts/zones/Mamook/TextIDs"] = nil; ------------------------------------- require("scripts/globals/logging"); require("scripts/zones/Mamook/TextIDs"); ----------------------------------- -- onTrade ----------------------------------- function onTrade(player,npc,trade) startLogging(player,player:getZoneID(),npc,trade,0x00D7); end; ----------------------------------- -- onTrigger ----------------------------------- function onTrigger(player,npc) player:messageSpecial(LOGGING_IS_POSSIBLE_HERE,1021); end; ----------------------------------- -- onEventUpdate ----------------------------------- function onEventUpdate(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; ----------------------------------- -- onEventFinish ----------------------------------- function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); end;
gpl-3.0
8devices/carambola2-luci
libs/json/luasrc/json.lua
50
13333
--[[ LuCI - Lua Configuration Interface Copyright 2008 Steven Barth <steven@midlink.org> Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 $Id$ Decoder: Info: null will be decoded to luci.json.null if first parameter of Decoder() is true Example: decoder = luci.json.Decoder() luci.ltn12.pump.all(luci.ltn12.source.string("decodableJSON"), decoder:sink()) luci.util.dumptable(decoder:get()) Known issues: does not support unicode conversion \uXXYY with XX != 00 will be ignored Encoder: Info: Accepts numbers, strings, nil, booleans as they are Accepts luci.json.null as replacement for nil Accepts full associative and full numerically indexed tables Mixed tables will loose their associative values during conversion Iterator functions will be encoded as an array of their return values Non-iterator functions will probably corrupt the encoder Example: encoder = luci.json.Encoder(encodableData) luci.ltn12.pump.all(encoder:source(), luci.ltn12.sink.file(io.open("someFile", w))) ]]-- local nixio = require "nixio" local util = require "luci.util" local table = require "table" local string = require "string" local coroutine = require "coroutine" local assert = assert local tonumber = tonumber local tostring = tostring local error = error local type = type local pairs = pairs local ipairs = ipairs local next = next local pcall = pcall local band = nixio.bit.band local bor = nixio.bit.bor local rshift = nixio.bit.rshift local char = string.char local getmetatable = getmetatable --- LuCI JSON-Library -- @cstyle instance module "luci.json" --- Directly decode a JSON string -- @param json JSON-String -- @return Lua object function decode(json, ...) local a = ActiveDecoder(function() return nil end, ...) a.chunk = json local s, obj = pcall(a.get, a) return s and obj or nil end --- Direcly encode a Lua object into a JSON string. -- @param obj Lua Object -- @return JSON string function encode(obj, ...) local out = {} local e = Encoder(obj, 1, ...):source() local chnk, err repeat chnk, err = e() out[#out+1] = chnk until not chnk return not err and table.concat(out) or nil end --- Null replacement function -- @return null function null() return null end --- Create a new JSON-Encoder. -- @class function -- @name Encoder -- @param data Lua-Object to be encoded. -- @param buffersize Blocksize of returned data source. -- @param fastescape Use non-standard escaping (don't escape control chars) -- @return JSON-Encoder Encoder = util.class() function Encoder.__init__(self, data, buffersize, fastescape) self.data = data self.buffersize = buffersize or 512 self.buffer = "" self.fastescape = fastescape getmetatable(self).__call = Encoder.source end --- Create an LTN12 source providing the encoded JSON-Data. -- @return LTN12 source function Encoder.source(self) local source = coroutine.create(self.dispatch) return function() local res, data = coroutine.resume(source, self, self.data, true) if res then return data else return nil, data end end end function Encoder.dispatch(self, data, start) local parser = self.parsers[type(data)] parser(self, data) if start then if #self.buffer > 0 then coroutine.yield(self.buffer) end coroutine.yield() end end function Encoder.put(self, chunk) if self.buffersize < 2 then coroutine.yield(chunk) else if #self.buffer + #chunk > self.buffersize then local written = 0 local fbuffer = self.buffersize - #self.buffer coroutine.yield(self.buffer .. chunk:sub(written + 1, fbuffer)) written = fbuffer while #chunk - written > self.buffersize do fbuffer = written + self.buffersize coroutine.yield(chunk:sub(written + 1, fbuffer)) written = fbuffer end self.buffer = chunk:sub(written + 1) else self.buffer = self.buffer .. chunk end end end function Encoder.parse_nil(self) self:put("null") end function Encoder.parse_bool(self, obj) self:put(obj and "true" or "false") end function Encoder.parse_number(self, obj) self:put(tostring(obj)) end function Encoder.parse_string(self, obj) if self.fastescape then self:put('"' .. obj:gsub('\\', '\\\\'):gsub('"', '\\"') .. '"') else self:put('"' .. obj:gsub('[%c\\"]', function(char) return '\\u00%02x' % char:byte() end ) .. '"') end end function Encoder.parse_iter(self, obj) if obj == null then return self:put("null") end if type(obj) == "table" and (#obj == 0 and next(obj)) then self:put("{") local first = true for key, entry in pairs(obj) do first = first or self:put(",") first = first and false self:parse_string(tostring(key)) self:put(":") self:dispatch(entry) end self:put("}") else self:put("[") local first = true if type(obj) == "table" then for i=1, #obj do first = first or self:put(",") first = first and nil self:dispatch(obj[i]) end else for entry in obj do first = first or self:put(",") first = first and nil self:dispatch(entry) end end self:put("]") end end Encoder.parsers = { ['nil'] = Encoder.parse_nil, ['table'] = Encoder.parse_iter, ['number'] = Encoder.parse_number, ['string'] = Encoder.parse_string, ['boolean'] = Encoder.parse_bool, ['function'] = Encoder.parse_iter } --- Create a new JSON-Decoder. -- @class function -- @name Decoder -- @param customnull Use luci.json.null instead of nil for decoding null -- @return JSON-Decoder Decoder = util.class() function Decoder.__init__(self, customnull) self.cnull = customnull getmetatable(self).__call = Decoder.sink end --- Create an LTN12 sink from the decoder object which accepts the JSON-Data. -- @return LTN12 sink function Decoder.sink(self) local sink = coroutine.create(self.dispatch) return function(...) return coroutine.resume(sink, self, ...) end end --- Get the decoded data packets after the rawdata has been sent to the sink. -- @return Decoded data function Decoder.get(self) return self.data end function Decoder.dispatch(self, chunk, src_err, strict) local robject, object local oset = false while chunk do while chunk and #chunk < 1 do chunk = self:fetch() end assert(not strict or chunk, "Unexpected EOS") if not chunk then break end local char = chunk:sub(1, 1) local parser = self.parsers[char] or (char:match("%s") and self.parse_space) or (char:match("[0-9-]") and self.parse_number) or error("Unexpected char '%s'" % char) chunk, robject = parser(self, chunk) if parser ~= self.parse_space then assert(not oset, "Scope violation: Too many objects") object = robject oset = true if strict then return chunk, object end end end assert(not src_err, src_err) assert(oset, "Unexpected EOS") self.data = object end function Decoder.fetch(self) local tself, chunk, src_err = coroutine.yield() assert(chunk or not src_err, src_err) return chunk end function Decoder.fetch_atleast(self, chunk, bytes) while #chunk < bytes do local nchunk = self:fetch() assert(nchunk, "Unexpected EOS") chunk = chunk .. nchunk end return chunk end function Decoder.fetch_until(self, chunk, pattern) local start = chunk:find(pattern) while not start do local nchunk = self:fetch() assert(nchunk, "Unexpected EOS") chunk = chunk .. nchunk start = chunk:find(pattern) end return chunk, start end function Decoder.parse_space(self, chunk) local start = chunk:find("[^%s]") while not start do chunk = self:fetch() if not chunk then return nil end start = chunk:find("[^%s]") end return chunk:sub(start) end function Decoder.parse_literal(self, chunk, literal, value) chunk = self:fetch_atleast(chunk, #literal) assert(chunk:sub(1, #literal) == literal, "Invalid character sequence") return chunk:sub(#literal + 1), value end function Decoder.parse_null(self, chunk) return self:parse_literal(chunk, "null", self.cnull and null) end function Decoder.parse_true(self, chunk) return self:parse_literal(chunk, "true", true) end function Decoder.parse_false(self, chunk) return self:parse_literal(chunk, "false", false) end function Decoder.parse_number(self, chunk) local chunk, start = self:fetch_until(chunk, "[^0-9eE.+-]") local number = tonumber(chunk:sub(1, start - 1)) assert(number, "Invalid number specification") return chunk:sub(start), number end function Decoder.parse_string(self, chunk) local str = "" local object = nil assert(chunk:sub(1, 1) == '"', 'Expected "') chunk = chunk:sub(2) while true do local spos = chunk:find('[\\"]') if spos then str = str .. chunk:sub(1, spos - 1) local char = chunk:sub(spos, spos) if char == '"' then -- String end chunk = chunk:sub(spos + 1) break elseif char == "\\" then -- Escape sequence chunk, object = self:parse_escape(chunk:sub(spos)) str = str .. object end else str = str .. chunk chunk = self:fetch() assert(chunk, "Unexpected EOS while parsing a string") end end return chunk, str end function Decoder.utf8_encode(self, s1, s2) local n = s1 * 256 + s2 if n >= 0 and n <= 0x7F then return char(n) elseif n >= 0 and n <= 0x7FF then return char( bor(band(rshift(n, 6), 0x1F), 0xC0), bor(band(n, 0x3F), 0x80) ) elseif n >= 0 and n <= 0xFFFF then return char( bor(band(rshift(n, 12), 0x0F), 0xE0), bor(band(rshift(n, 6), 0x3F), 0x80), bor(band(n, 0x3F), 0x80) ) elseif n >= 0 and n <= 0x10FFFF then return char( bor(band(rshift(n, 18), 0x07), 0xF0), bor(band(rshift(n, 12), 0x3F), 0x80), bor(band(rshift(n, 6), 0x3F), 0x80), bor(band(n, 0x3F), 0x80) ) else return "?" end end function Decoder.parse_escape(self, chunk) local str = "" chunk = self:fetch_atleast(chunk:sub(2), 1) local char = chunk:sub(1, 1) chunk = chunk:sub(2) if char == '"' then return chunk, '"' elseif char == "\\" then return chunk, "\\" elseif char == "u" then chunk = self:fetch_atleast(chunk, 4) local s1, s2 = chunk:sub(1, 2), chunk:sub(3, 4) s1, s2 = tonumber(s1, 16), tonumber(s2, 16) assert(s1 and s2, "Invalid Unicode character") return chunk:sub(5), self:utf8_encode(s1, s2) elseif char == "/" then return chunk, "/" elseif char == "b" then return chunk, "\b" elseif char == "f" then return chunk, "\f" elseif char == "n" then return chunk, "\n" elseif char == "r" then return chunk, "\r" elseif char == "t" then return chunk, "\t" else error("Unexpected escaping sequence '\\%s'" % char) end end function Decoder.parse_array(self, chunk) chunk = chunk:sub(2) local array = {} local nextp = 1 local chunk, object = self:parse_delimiter(chunk, "%]") if object then return chunk, array end repeat chunk, object = self:dispatch(chunk, nil, true) table.insert(array, nextp, object) nextp = nextp + 1 chunk, object = self:parse_delimiter(chunk, ",%]") assert(object, "Delimiter expected") until object == "]" return chunk, array end function Decoder.parse_object(self, chunk) chunk = chunk:sub(2) local array = {} local name local chunk, object = self:parse_delimiter(chunk, "}") if object then return chunk, array end repeat chunk = self:parse_space(chunk) assert(chunk, "Unexpected EOS") chunk, name = self:parse_string(chunk) chunk, object = self:parse_delimiter(chunk, ":") assert(object, "Separator expected") chunk, object = self:dispatch(chunk, nil, true) array[name] = object chunk, object = self:parse_delimiter(chunk, ",}") assert(object, "Delimiter expected") until object == "}" return chunk, array end function Decoder.parse_delimiter(self, chunk, delimiter) while true do chunk = self:fetch_atleast(chunk, 1) local char = chunk:sub(1, 1) if char:match("%s") then chunk = self:parse_space(chunk) assert(chunk, "Unexpected EOS") elseif char:match("[%s]" % delimiter) then return chunk:sub(2), char else return chunk, nil end end end Decoder.parsers = { ['"'] = Decoder.parse_string, ['t'] = Decoder.parse_true, ['f'] = Decoder.parse_false, ['n'] = Decoder.parse_null, ['['] = Decoder.parse_array, ['{'] = Decoder.parse_object } --- Create a new Active JSON-Decoder. -- @class function -- @name ActiveDecoder -- @param customnull Use luci.json.null instead of nil for decoding null -- @return Active JSON-Decoder ActiveDecoder = util.class(Decoder) function ActiveDecoder.__init__(self, source, customnull) Decoder.__init__(self, customnull) self.source = source self.chunk = nil getmetatable(self).__call = self.get end --- Fetches one JSON-object from given source -- @return Decoded object function ActiveDecoder.get(self) local chunk, src_err, object if not self.chunk then chunk, src_err = self.source() else chunk = self.chunk end self.chunk, object = self:dispatch(chunk, src_err, true) return object end function ActiveDecoder.fetch(self) local chunk, src_err = self.source() assert(chunk or not src_err, src_err) return chunk end
apache-2.0
DarkstarProject/darkstar
scripts/globals/items/serving_of_red_curry.lua
11
1910
----------------------------------------- -- ID: 4298 -- Item: serving_of_red_curry -- Food Effect: 3 hours, All Races ----------------------------------------- -- HP +25 -- Strength +7 -- Agility +1 -- Intelligence -2 -- HP recovered while healing +2 -- MP recovered while healing +1 -- Attack +23% (Cap: 150@652 Base Attack) -- Ranged Attack +23% (Cap: 150@652 Base Ranged Attack) -- Demon Killer +4 -- Resist Sleep +3 ----------------------------------------- require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- function onItemCheck(target) local result = 0 if target:hasStatusEffect(dsp.effect.FOOD) or target:hasStatusEffect(dsp.effect.FIELD_SUPPORT_FOOD) then result = dsp.msg.basic.IS_FULL end return result end function onItemUse(target) target:addStatusEffect(dsp.effect.FOOD,0,0,10800,4298) end function onEffectGain(target, effect) target:addMod(dsp.mod.HP, 25) target:addMod(dsp.mod.STR, 7) target:addMod(dsp.mod.AGI, 1) target:addMod(dsp.mod.INT, -2) target:addMod(dsp.mod.HPHEAL, 2) target:addMod(dsp.mod.MPHEAL, 1) target:addMod(dsp.mod.FOOD_ATTP, 23) target:addMod(dsp.mod.FOOD_ATT_CAP, 150) target:addMod(dsp.mod.FOOD_RATTP, 23) target:addMod(dsp.mod.FOOD_RATT_CAP, 150) target:addMod(dsp.mod.DEMON_KILLER, 4) target:addMod(dsp.mod.SLEEPRES, 3) end function onEffectLose(target, effect) target:delMod(dsp.mod.HP, 25) target:delMod(dsp.mod.STR, 7) target:delMod(dsp.mod.AGI, 1) target:delMod(dsp.mod.INT, -2) target:delMod(dsp.mod.HPHEAL, 2) target:delMod(dsp.mod.MPHEAL, 1) target:delMod(dsp.mod.FOOD_ATTP, 23) target:delMod(dsp.mod.FOOD_ATT_CAP, 150) target:delMod(dsp.mod.FOOD_RATTP, 23) target:delMod(dsp.mod.FOOD_RATT_CAP, 150) target:delMod(dsp.mod.DEMON_KILLER, 4) target:delMod(dsp.mod.SLEEPRES, 3) end
gpl-3.0
Fenix-XI/Fenix
scripts/globals/abilities/devotion.lua
44
1670
----------------------------------- -- Ability: Devotion -- Sacrifices HP to grant a party member the same amount in MP. -- Obtained: White Mage Level 75 -- Recast Time: 0:10:00 -- Duration: Instant -- Target: Party member, cannot target self. ----------------------------------- require("scripts/globals/status"); require("scripts/globals/utils"); ----------------------------------- -- onAbilityCheck ----------------------------------- function onAbilityCheck(player,target,ability) if (player:getID() == target:getID()) then return MSGBASIC_CANNOT_PERFORM_TARG,0; elseif (player:getHP() < 4) then -- Fails if HP < 4 return MSGBASIC_UNABLE_TO_USE_JA,0; else return 0,0; end end; ----------------------------------- -- onUseAbility ----------------------------------- function onUseAbility(player,target,ability) -- Plus 5 percent mp recovers per extra devotion merit local meritBonus = player:getMerit(MERIT_DEVOTION) - 5; -- printf("Devotion Merit Bonus: %d", meritBonus); local mpPercent = (25 + meritBonus) / 100; -- printf("Devotion MP Percent: %f", mpPercent); local damageHP = math.floor(player:getHP() * 0.25); -- printf("Devotion HP Damage: %d", damageHP); -- If stoneskin is present, it should absorb damage... damageHP = utils.stoneskin(player, damageHP); -- printf("Devotion HP Damage (after Stoneskin): %d", damageHP); local healMP = player:getHP() * mpPercent; healMP = utils.clamp(healMP, 0,target:getMaxMP() - target:getMP()); -- printf("Devotion MP Healed: %d", healMP); player:delHP(damageHP); target:addMP(healMP); return healMP; end;
gpl-3.0
LazyShpee/discord-egobot
libs/db.lua
1
1725
local ts = require("./libs/tablesave") local fs = require("fs") local function save(self, name) if type(self._tables[name]) ~= 'table' then return end local path = self._dir..'/db_'..name..'.lua' ts.save(self._tables[name], path) end local function loadAll(self) local stat = fs.statSync(self._dir) if stat and stat.type ~= "directory" then error("Could not open directory "..self._dir) end if not stat then fs.mkdirSync(self._dir) end for i, filename in ipairs(fs.readdirSync(self._dir)) do if filename:find('^db_[a-zA-Z0-9]+%.lua$') then local name = filename:match('^db_([a-zA-Z0-9]+)%.lua$') self._tables[name] = ts.load(self._dir..'/'..filename) end end end local function saveAll(self) for k, v in pairs(self._tables) do self:save(k) end end local function exists(self, name) return type(self._tables[name]) == 'table' end return function(dir) local index = { _dir = dir, _tables = {}, save = save, saveAll = saveAll, loadAll = loadAll, exists = exists } local db = setmetatable({}, { __index = function(s, k) if type(index[k]) ~= 'nil' then return index[k] end if type(index._tables[k]) ~= 'nil' then return index._tables[k] end end, __newindex = function(s, k, v) if type(index[k]) ~= 'nil' then error("Reserved keyword") end if not k:find("^[a-zA-Z0-9]+$") then error("Only alphanumerical name are supported") end if type(v) ~= 'table' and type(v) ~= 'nil' then error("Tables can only be tables") end index._tables[k] = v if type(v) == 'nil' then fs.unlinkSync(index._dir..'/db_'..k..'.lua') end end }) db:loadAll() return db end
mit
DarkstarProject/darkstar
scripts/globals/abilities/dark_shot.lua
12
2856
----------------------------------- -- Ability: Dark Shot -- Consumes a Dark Card to enhance dark-based debuffs. Additional effect: Dark-based Dispel -- Bio Effect: Attack Down Effect +5% and DoT + 3 ----------------------------------- require("scripts/globals/magic") require("scripts/globals/status") ----------------------------------- function onAbilityCheck(player, target, ability) --ranged weapon/ammo: You do not have an appropriate ranged weapon equipped. --no card: <name> cannot perform that action. if player:getWeaponSkillType(dsp.slot.RANGED) ~= dsp.skill.MARKSMANSHIP or player:getWeaponSkillType(dsp.slot.AMMO) ~= dsp.skill.MARKSMANSHIP then return 216, 0 end if player:hasItem(2183, 0) or player:hasItem(2974, 0) then return 0, 0 else return 71, 0 end end function onUseAbility(player, target, ability) local duration = 60 local bonusAcc = player:getStat(dsp.mod.AGI) / 2 + player:getMerit(dsp.merit.QUICK_DRAW_ACCURACY) + player:getMod(dsp.mod.QUICK_DRAW_MACC) local resist = applyResistanceAbility(player, target, dsp.magic.ele.DARK, dsp.skill.NONE, bonusAcc) if resist < 0.25 then ability:setMsg(dsp.msg.basic.JA_MISS_2) -- resist message return 0 end duration = duration * resist local effects = {} local bio = target:getStatusEffect(dsp.effect.BIO) if bio ~= nil then table.insert(effects, bio) end local blind = target:getStatusEffect(dsp.effect.BLINDNESS) if blind ~= nil then table.insert(effects, blind) end local threnody = target:getStatusEffect(dsp.effect.THRENODY) if threnody ~= nil and threnody:getSubPower() == dsp.mod.LIGHTRES then table.insert(effects, threnody) end if #effects > 0 then local effect = effects[math.random(#effects)] local duration = effect:getDuration() local startTime = effect:getStartTime() local tick = effect:getTick() local power = effect:getPower() local subpower = effect:getSubPower() local tier = effect:getTier() local effectId = effect:getType() local subId = effect:getSubType() power = power * 1.5 subpower = subpower * 1.5 target:delStatusEffectSilent(effectId) target:addStatusEffect(effectId, power, tick, duration, subId, subpower, tier) local newEffect = target:getStatusEffect(effectId) newEffect:setStartTime(startTime) end ability:setMsg(dsp.msg.basic.JA_REMOVE_EFFECT_2) local dispelledEffect = target:dispelStatusEffect() if dispelledEffect == dsp.effect.NONE then -- no effect ability:setMsg(dsp.msg.basic.JA_NO_EFFECT_2) end local del = player:delItem(2183, 1) or player:delItem(2974, 1) target:updateClaim(player) return dispelledEffect end
gpl-3.0
DarkstarProject/darkstar
scripts/zones/Wajaom_Woodlands/mobs/Hydra.lua
9
1251
----------------------------------- -- Area: Wajaom Woodlands -- Mob: Hydra -- !pos -282 -24 -1 51 ----------------------------------- require("scripts/globals/titles"); ----------------------------------- function onMobFight(mob, target) local battletime = mob:getBattleTime(); local headgrow = mob:getLocalVar("headgrow"); local broken = mob:AnimationSub(); if (headgrow < battletime and broken > 0) then mob:AnimationSub(broken - 1); mob:setLocalVar("headgrow", battletime + 300); end end; function onCriticalHit(mob) local rand = math.random(); local battletime = mob:getBattleTime(); local headgrow = mob:getLocalVar("headgrow"); local headbreak = mob:getLocalVar("headbreak"); local broken = mob:AnimationSub(); if (rand <= 0.15 and battletime >= headbreak and broken < 2) then mob:AnimationSub(broken + 1); mob:setLocalVar("headgrow", battletime + math.random(120, 240)) mob:setLocalVar("headbreak", battletime + 300); end end; function onMobDeath(mob, player, isKiller) player:addTitle(dsp.title.HYDRA_HEADHUNTER); end; function onMobDespawn(mob) mob:setRespawnTime(math.random(48, 72) * 3600) -- 48 to 72 hours, in 1 hour windows end
gpl-3.0
LuaDist/lunit
lunit-tests.lua
9
34836
--[[-------------------------------------------------------------------------- This file is part of lunit 0.5. For Details about lunit look at: http://www.mroth.net/lunit/ Author: Michael Roth <mroth@nessie.de> Copyright (c) 2004, 2006-2009 Michael Roth <mroth@nessie.de> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --]]-------------------------------------------------------------------------- require "lunit" local a_number = 123 local a_string = "A string" local a_table = { } local a_function = function() end local a_thread = coroutine.create(function() end) local pcall = pcall local error = error local pairs = pairs local ipairs = ipairs local module = module module( "lunit-tests.interface", lunit.testcase ) function test() local funcnames = { "main", "run", "runtest", "testcase", "testcases", "tests", "setupname", "teardownname", "loadrunner", "setrunner", "loadonly", "assert", "assert_true", "assert_false", "assert_equal", "assert_not_equal", "assert_match", "assert_not_match", "assert_nil", "assert_not_nil", "assert_boolean", "assert_not_boolean", "assert_number", "assert_not_number", "assert_string", "assert_not_string", "assert_table", "assert_not_table", "assert_function", "assert_not_function", "assert_thread", "assert_not_thread", "assert_userdata", "assert_not_userdata", "assert_pass", "assert_error", "assert_error_match", "fail", "clearstats", "is_nil", "is_boolean", "is_number", "is_string", "is_table", "is_function", "is_thread", "is_userdata" } for _, funcname in ipairs(funcnames) do assert_function( lunit[funcname], "Public function missing: "..funcname ) end assert_table( lunit.stats, "Statistic table missing" ) do local map = {} for _, name in ipairs(funcnames) do map[name] = true end for _, name in ipairs{"lunit", "_PACKAGE", "_M", "_NAME", "stats"} do map[name] = true end for name, _ in pairs(lunit) do assert( map[name], "Invalid public variable: lunit."..name ) end end end -- We must assume that errors thrown by test functions are detected. We use -- the stdlib error() function to signal errors instead of fail(). module( "lunit-tests.basics", lunit.testcase ) function test_fail() local ok, errmsg ok, errmsg = pcall(function() fail() end) if ok then error("fail() doesn't fail!") end ok, errmsg = pcall(function() fail("A message") end) if ok then error("fail(\"A message\") doesn't fail!") end end function test_assert_error() local ok, errmsg ok, errmsg = pcall(function() assert_error(function() error("Error!") end) end) if not ok then error("assert_error( <error> ) doesn't work!") end ok, errmsg = pcall(function() assert_error("A message", function() error("Error") end) end) if not ok then error("assert_error(\"A message\", <error>) doesn't work!") end ok, errmsg = pcall(function() assert_error(function() end) end) if ok then error("assert_error( <no error> ) doesn't fail!") end ok, errmsg = pcall(function() assert_error("A Message", function() end) end) if ok then error("assert_error(\"A message\", <no error>) doesn't fail!") end end function test_assert_pass() local ok, errmsg ok, errmsg = pcall(function() assert_pass(function() error("Error!") end) end) if ok then error("assert_pass( <error> ) doesn't fail!") end ok, errmsg = pcall(function() assert_pass("A message", function() error("Error") end) end) if ok then error("assert_pass(\"A message\", <error>) doesn't fail!") end ok, errmsg = pcall(function() assert_pass(function() end) end) if not ok then error("assert_pass( <no error> ) doesn't work!") end ok, errmsg = pcall(function() assert_pass("A Message", function() end) end) if not ok then error("assert_pass(\"A message\", <no error>) doesn't work!") end end function test_assert_true() assert_pass("assert_true(true) doesn't work!", function() assert_true(true) end) assert_pass("assert_true(true, \"A message\" doesn't work!", function() assert_true(true, "A Message") end) assert_error("assert_true(false) doesn't fail!", function() assert_true(false) end) assert_error("assert_true(false, \"A message\" doesn't fail!", function() assert_true(false, "A Message") end) end function test_assert_false() assert_pass("assert_false(false) doesn't work!", function() assert_false(false) end) assert_pass("assert_false(false, \"A message\" doesn't work!", function() assert_false(false, "A Message") end) assert_error("assert_false(true) doesn't fail!", function() assert_false(true) end) assert_error("assert_false(true, \"A message\" doesn't fail!", function() assert_false(true, "A Message") end) end function test_assert() assert_pass("assert(true) doesn't work!", function() assert(true) end) assert_pass("assert(12345) doesn't work!", function() assert(12345) end) assert_pass("assert(\"A string\") doesn't work!", function() assert("A string") end) assert_pass("assert( {} ) doesn't work!", function() assert( {} ) end) assert_error("assert_(false) doesn't fail!", function() assert(false) end) assert_error("assert_(nil) doesn't fail!", function() assert(nil) end) end function test_assert_equal() assert_pass("assert_equal(\"A String\", \"A String\") doesn't work!", function() local a_string = assert_equal("A String", "A String") assert_true("A String" == a_string) end) assert_pass("assert_equal(\"A String\", \"A String\", \"A message\") doesn't work!", function() local a_string = assert_equal("A String", "A String", "A message") assert_true("A String" == a_string) end) assert_pass("assert_equal(12345, 12345) doesn't work!", function() local a_number = assert_equal(12345, 12345) assert_true(12345 == a_number) end) assert_pass("assert_equal(12345, 12345, \"A message\") doesn't work!", function() local a_number = assert_equal(12345, 12345, "A message") assert_true(12345 == a_number) end) assert_pass("assert_equal(nil, nil) doesn't work!", function() local a_nil = assert_equal(nil, nil) assert_true(nil == a_nil) end) assert_pass("assert_equal(12345, 12345, \"A message\") doesn't work!", function() local a_nil = assert_equal(nil, nil, "A message") assert_true(nil == a_nil) end) assert_pass("assert_equal(false, false) doesn't work!", function() local a_false = assert_equal(false, false) assert_true(false == a_false) end) assert_pass("assert_equal(false, false, \"A message\") doesn't work!", function() local a_false = assert_equal(false, false, "A message") assert_true(false == a_false) end) assert_pass("assert_equal(true, true) doesn't work!", function() local a_true = assert_equal(true, true) assert_true(true == a_true) end) assert_pass("assert_equal(true, true, \"A message\") doesn't work!", function() local a_true = assert_equal(true, true, "A message") assert_true(true == a_true) end) assert_error("assert_equal(\"A String\", \"Another String\") doesn't fail!", function() assert_equal("A String", "Another String") end) assert_error("assert_equal(\"A String\", \"Another String\", \"A message\") doesn't fail!", function() assert_equal("A String", "Another String", "A message") end) assert_error("assert_equal(123, 456) doesn't fail!", function() assert_equal(123, 456) end) assert_error("assert_equal(123, 456) \"A message\") doesn't fail!", function() assert_equal(123, 456, "A message") end) assert_error("assert_equal(true, false) doesn't fail!", function() assert_equal(true, false) end) assert_error("assert_equal(true, false) \"A message\") doesn't fail!", function() assert_equal(true, false, "A message") end) assert_error("assert_equal(true, nil) doesn't fail!", function() assert_equal(true, nil) end) assert_error("assert_equal(true, nil) \"A message\") doesn't fail!", function() assert_equal(true, nil, "A message") end) assert_error("assert_equal(false, true) doesn't fail!", function() assert_equal(false, true) end) assert_error("assert_equal(false, true, \"A message\") doesn't fail!", function() assert_equal(false, true, "A message") end) assert_error("assert_equal(false, nil) doesn't fail!", function() assert_equal(false, nil) end) assert_error("assert_equal(false, nil) \"A message\") doesn't fail!", function() assert_equal(false, nil, "A message") end) assert_error("assert_equal(nil, true) doesn't fail!", function() assert_equal(nil, true) end) assert_error("assert_equal(nil, true) \"A message\") doesn't fail!", function() assert_equal(nil, true, "A message") end) assert_error("assert_equal(nil, false) doesn't fail!", function() assert_equal(nil, false) end) assert_error("assert_equal(nil, false) \"A message\") doesn't fail!", function() assert_equal(nil, false, "A message") end) end function test_assert_not_equal() assert_pass("assert_not_equal(\"A String\", \"Another String\") doesn't work!", function() local a_string = assert_not_equal("A String", "Another String") assert_true("Another String" == a_string) end) assert_pass("assert_not_equal(\"A String\", \"Another String\", \"A message\") doesn't work!", function() local a_string = assert_not_equal("A String", "Another String", "A message") assert_true("Another String" == a_string) end) assert_pass("assert_not_equal(123, 456) doesn't work!", function() local a_number = assert_not_equal(123, 456) assert_true(456 == a_number) end) assert_pass("assert_not_equal(123, 456, \"A message\") doesn't work!", function() local a_number = assert_not_equal(123, 456, "A message") assert_true(456 == a_number) end) assert_pass("assert_not_equal(true, false) doesn't work!", function() local a_false = assert_not_equal(true, false) assert_true(false == a_false) end) assert_pass("assert_not_equal(true, false) \"A message\") doesn't work!", function() local a_false = assert_not_equal(true, false, "A message") assert_true(false == a_false) end) assert_pass("assert_not_equal(true, nil) doesn't work!", function() local a_nil = assert_not_equal(true, nil) assert_true(nil == a_nil) end) assert_pass("assert_not_equal(true, nil) \"A message\") doesn't work!", function() local a_nil = assert_not_equal(true, nil, "A message") assert_true(nil == a_nil) end) assert_pass("assert_not_equal(false, true) doesn't work!", function() local a_true = assert_not_equal(false, true) assert_true(true == a_true) end) assert_pass("assert_not_equal(false, true, \"A message\") doesn't work!", function() local a_true = assert_not_equal(false, true, "A message") assert_true(true == a_true) end) assert_pass("assert_not_equal(false, nil) doesn't work!", function() local a_nil = assert_not_equal(false, nil) assert_true(nil == a_nil) end) assert_pass("assert_not_equal(false, nil) \"A message\") doesn't work!", function() local a_nil = assert_not_equal(false, nil, "A message") assert_true(nil == a_nil) end) assert_pass("assert_not_equal(nil, true) doesn't work!", function() local a_true = assert_not_equal(nil, true) assert_true(true == a_true) end) assert_pass("assert_not_equal(nil, true) \"A message\") doesn't work!", function() local a_true = assert_not_equal(nil, true, "A message") assert_true(true == a_true) end) assert_pass("assert_not_equal(nil, false) doesn't work!", function() local a_false = assert_not_equal(nil, false) assert_true(false == a_false) end) assert_pass("assert_not_equal(nil, false) \"A message\") doesn't work!", function() local a_false = assert_not_equal(nil, false, "A message") assert_true(false == a_false) end) assert_error("assert_not_equal(\"A String\", \"A String\") doesn't work!", function() assert_not_equal("A String", "A String") end) assert_error("assert_not_equal(\"A String\", \"A String\", \"A message\") doesn't fail!", function() assert_not_equal("A String", "A String", "A message") end) assert_error("assert_not_equal(12345, 12345) doesn't fail!", function() assert_not_equal(12345, 12345) end) assert_error("assert_not_equal(12345, 12345, \"A message\") doesn't fail!", function() assert_not_equal(12345, 12345, "A message") end) assert_error("assert_not_equal(nil, nil) doesn't fail!", function() assert_not_equal(nil, nil) end) assert_error("assert_not_equal(nil, nil, \"A message\") doesn't fail!", function() assert_not_equal(nil, nil, "A message") end) assert_error("assert_not_equal(false, false) doesn't fail!", function() assert_not_equal(false, false) end) assert_error("assert_not_equal(false, false, \"A message\") doesn't fail!", function() assert_not_equal(false, false, "A message") end) assert_error("assert_not_equal(true, true) doesn't fail!", function() assert_not_equal(true, true) end) assert_error("assert_not_equal(true, true, \"A message\") doesn't fail!", function() assert_not_equal(true, true, "A message") end) end module( "lunit-tests.is_xyz", lunit.testcase ) function test_is_nil() assert_true( is_nil(nil) ) assert_false( is_nil(true) ) assert_false( is_nil(false) ) assert_false( is_nil(a_number) ) assert_false( is_nil(a_string) ) assert_false( is_nil(a_table) ) assert_false( is_nil(a_function) ) assert_false( is_nil(a_thread) ) end function test_is_boolean() assert_true( is_boolean(false) ) assert_true( is_boolean(true) ) assert_false( is_boolean(nil) ) assert_false( is_boolean(a_number) ) assert_false( is_boolean(a_string) ) assert_false( is_boolean(a_table) ) assert_false( is_boolean(a_function) ) assert_false( is_boolean(a_thread) ) end function test_is_number() assert_true( is_number(a_number) ) assert_false( is_number(nil) ) assert_false( is_number(true) ) assert_false( is_number(false) ) assert_false( is_number(a_string) ) assert_false( is_number(a_table) ) assert_false( is_number(a_function) ) assert_false( is_number(a_thread) ) end function test_is_string() assert_true( is_string(a_string) ) assert_false( is_string(nil) ) assert_false( is_string(true) ) assert_false( is_string(false) ) assert_false( is_string(a_number) ) assert_false( is_string(a_table) ) assert_false( is_string(a_function) ) assert_false( is_string(a_thread) ) end function test_is_table() assert_true( is_table(a_table) ) assert_false( is_table(nil) ) assert_false( is_table(true) ) assert_false( is_table(false) ) assert_false( is_table(a_number) ) assert_false( is_table(a_string) ) assert_false( is_table(a_function) ) assert_false( is_table(a_thread) ) end function test_is_function() assert_true( is_function(a_function) ) assert_false( is_function(nil) ) assert_false( is_function(true) ) assert_false( is_function(false) ) assert_false( is_function(a_number) ) assert_false( is_function(a_string) ) assert_false( is_function(a_table) ) assert_false( is_function(a_thread) ) end function test_is_thread() assert_true( is_thread(a_thread) ) assert_false( is_thread(nil) ) assert_false( is_thread(true) ) assert_false( is_thread(false) ) assert_false( is_thread(a_number) ) assert_false( is_thread(a_string) ) assert_false( is_thread(a_table) ) assert_false( is_thread(a_function) ) end module( "lunit-tests.assert_not_xyz", lunit.testcase ) function test_assert_not_nil() assert_not_nil( true ) assert_not_nil( false ) assert_not_nil( a_number ) assert_not_nil( a_string ) assert_not_nil( a_table ) assert_not_nil( a_function ) assert_not_nil( a_thread ) assert_not_nil( true, "A message") assert_not_nil( false, "A message") assert_not_nil( a_number, "A message") assert_not_nil( a_string, "A message") assert_not_nil( a_table, "A message") assert_not_nil( a_function, "A message") assert_not_nil( a_thread, "A message") assert_error(function() assert_not_nil(nil) end) assert_error(function() assert_not_nil(nil, "A message") end) end function test_assert_not_boolean() assert_not_boolean( nil ) assert_not_boolean( a_number ) assert_not_boolean( a_string ) assert_not_boolean( a_table ) assert_not_boolean( a_function ) assert_not_boolean( a_thread ) assert_not_boolean( nil, "A message") assert_not_boolean( a_number, "A message") assert_not_boolean( a_string, "A message") assert_not_boolean( a_table, "A message") assert_not_boolean( a_function, "A message") assert_not_boolean( a_thread, "A message") assert_error(function() assert_not_boolean(true) end) assert_error(function() assert_not_boolean(true, "A message") end) assert_error(function() assert_not_boolean(false) end) assert_error(function() assert_not_boolean(false, "A message") end) end function test_assert_not_number() assert_not_number( nil ) assert_not_number( true ) assert_not_number( false ) assert_not_number( a_string ) assert_not_number( a_table ) assert_not_number( a_function ) assert_not_number( a_thread ) assert_not_number( nil, "A message") assert_not_number( true, "A message") assert_not_number( false, "A message") assert_not_number( a_string, "A message") assert_not_number( a_table, "A message") assert_not_number( a_function, "A message") assert_not_number( a_thread, "A message") assert_error(function() assert_not_number(a_number) end) assert_error(function() assert_not_number(a_number, "A message") end) end function test_assert_not_string() assert_not_string( nil ) assert_not_string( true ) assert_not_string( false ) assert_not_string( a_number ) assert_not_string( a_table ) assert_not_string( a_function ) assert_not_string( a_thread ) assert_not_string( nil, "A message") assert_not_string( true, "A message") assert_not_string( false, "A message") assert_not_string( a_number, "A message") assert_not_string( a_table, "A message") assert_not_string( a_function, "A message") assert_not_string( a_thread, "A message") assert_error(function() assert_not_string(a_string) end) assert_error(function() assert_not_string(a_string, "A message") end) end function test_assert_not_table() assert_not_table( nil ) assert_not_table( true ) assert_not_table( false ) assert_not_table( a_number ) assert_not_table( a_string ) assert_not_table( a_function ) assert_not_table( a_thread ) assert_not_table( nil, "A message") assert_not_table( true, "A message") assert_not_table( false, "A message") assert_not_table( a_number, "A message") assert_not_table( a_string, "A message") assert_not_table( a_function, "A message") assert_not_table( a_thread, "A message") assert_error(function() assert_not_table(a_table) end) assert_error(function() assert_not_table(a_table, "A message") end) end function test_assert_not_function() assert_not_function( nil ) assert_not_function( true ) assert_not_function( false ) assert_not_function( a_number ) assert_not_function( a_string ) assert_not_function( a_table ) assert_not_function( a_thread ) assert_not_function( nil, "A message") assert_not_function( true, "A message") assert_not_function( false, "A message") assert_not_function( a_number, "A message") assert_not_function( a_string, "A message") assert_not_function( a_table, "A message") assert_not_function( a_thread, "A message") assert_error(function() assert_not_function(a_function) end) assert_error(function() assert_not_function(a_function, "A message") end) end function test_assert_not_thread() assert_not_thread( nil ) assert_not_thread( true ) assert_not_thread( false ) assert_not_thread( a_number ) assert_not_thread( a_string ) assert_not_thread( a_table ) assert_not_thread( a_function ) assert_not_thread( nil, "A message") assert_not_thread( true, "A message") assert_not_thread( false, "A message") assert_not_thread( a_number, "A message") assert_not_thread( a_string, "A message") assert_not_thread( a_table, "A message") assert_not_thread( a_function, "A message") assert_error(function() assert_not_thread(a_thread) end) assert_error(function() assert_not_thread(a_thread, "A message") end) end module( "lunit-tests.assert_xyz", lunit.testcase ) function test_assert_nil() assert_nil( nil ) assert_nil( nil, "A message" ) assert_error( function() assert_nil( true ) end) assert_error( function() assert_nil( false ) end) assert_error( function() assert_nil( a_number ) end) assert_error( function() assert_nil( a_string ) end) assert_error( function() assert_nil( a_table ) end) assert_error( function() assert_nil( a_function ) end) assert_error( function() assert_nil( a_thread ) end) assert_error( function() assert_nil( true, "A message" ) end) assert_error( function() assert_nil( false, "A message" ) end) assert_error( function() assert_nil( a_number, "A message" ) end) assert_error( function() assert_nil( a_string, "A message" ) end) assert_error( function() assert_nil( a_table, "A message" ) end) assert_error( function() assert_nil( a_function, "A message" ) end) assert_error( function() assert_nil( a_thread, "A message" ) end) end function test_assert_boolean() assert_boolean( true ) assert_boolean( false ) assert_boolean( true, "A message" ) assert_boolean( false, "A message" ) assert_error( function() assert_boolean( nil ) end) assert_error( function() assert_boolean( a_number ) end) assert_error( function() assert_boolean( a_string ) end) assert_error( function() assert_boolean( a_table ) end) assert_error( function() assert_boolean( a_function ) end) assert_error( function() assert_boolean( a_thread ) end) assert_error( function() assert_boolean( nil, "A message" ) end) assert_error( function() assert_boolean( a_number, "A message" ) end) assert_error( function() assert_boolean( a_string, "A message" ) end) assert_error( function() assert_boolean( a_table, "A message" ) end) assert_error( function() assert_boolean( a_function, "A message" ) end) assert_error( function() assert_boolean( a_thread, "A message" ) end) end function test_assert_number() assert_number( a_number ) assert_number( a_number, "A message" ) assert_error( function() assert_number( nil ) end) assert_error( function() assert_number( true ) end) assert_error( function() assert_number( false ) end) assert_error( function() assert_number( a_string ) end) assert_error( function() assert_number( a_table ) end) assert_error( function() assert_number( a_function ) end) assert_error( function() assert_number( a_thread ) end) assert_error( function() assert_number( nil, "A message" ) end) assert_error( function() assert_number( true, "A message" ) end) assert_error( function() assert_number( false, "A message" ) end) assert_error( function() assert_number( a_string, "A message" ) end) assert_error( function() assert_number( a_table, "A message" ) end) assert_error( function() assert_number( a_function, "A message" ) end) assert_error( function() assert_number( a_thread, "A message" ) end) end function test_assert_string() assert_string( a_string ) assert_string( a_string, "A message" ) assert_error( function() assert_string( nil ) end) assert_error( function() assert_string( true ) end) assert_error( function() assert_string( false ) end) assert_error( function() assert_string( a_number ) end) assert_error( function() assert_string( a_table ) end) assert_error( function() assert_string( a_function ) end) assert_error( function() assert_string( a_thread ) end) assert_error( function() assert_string( nil, "A message" ) end) assert_error( function() assert_string( true, "A message" ) end) assert_error( function() assert_string( false, "A message" ) end) assert_error( function() assert_string( a_number, "A message" ) end) assert_error( function() assert_string( a_table, "A message" ) end) assert_error( function() assert_string( a_function, "A message" ) end) assert_error( function() assert_string( a_thread, "A message" ) end) end function test_assert_table() assert_table( a_table ) assert_table( a_table, "A message" ) assert_error( function() assert_table( nil ) end) assert_error( function() assert_table( true ) end) assert_error( function() assert_table( false ) end) assert_error( function() assert_table( a_number ) end) assert_error( function() assert_table( a_string ) end) assert_error( function() assert_table( a_function ) end) assert_error( function() assert_table( a_thread ) end) assert_error( function() assert_table( nil, "A message" ) end) assert_error( function() assert_table( true, "A message" ) end) assert_error( function() assert_table( false, "A message" ) end) assert_error( function() assert_table( a_number, "A message" ) end) assert_error( function() assert_table( a_string, "A message" ) end) assert_error( function() assert_table( a_function, "A message" ) end) assert_error( function() assert_table( a_thread, "A message" ) end) end function test_assert_function() assert_function( a_function ) assert_function( a_function, "A message" ) assert_error( function() assert_function( nil ) end) assert_error( function() assert_function( true ) end) assert_error( function() assert_function( false ) end) assert_error( function() assert_function( a_number ) end) assert_error( function() assert_function( a_string ) end) assert_error( function() assert_function( a_table ) end) assert_error( function() assert_function( a_thread ) end) assert_error( function() assert_function( nil, "A message" ) end) assert_error( function() assert_function( true, "A message" ) end) assert_error( function() assert_function( false, "A message" ) end) assert_error( function() assert_function( a_number, "A message" ) end) assert_error( function() assert_function( a_string, "A message" ) end) assert_error( function() assert_function( a_table, "A message" ) end) assert_error( function() assert_function( a_thread, "A message" ) end) end function test_assert_thread() assert_thread( a_thread ) assert_thread( a_thread, "A message" ) assert_error( function() assert_thread( nil ) end) assert_error( function() assert_thread( true ) end) assert_error( function() assert_thread( false ) end) assert_error( function() assert_thread( a_number ) end) assert_error( function() assert_thread( a_string ) end) assert_error( function() assert_thread( a_table ) end) assert_error( function() assert_thread( a_function ) end) assert_error( function() assert_thread( nil, "A message" ) end) assert_error( function() assert_thread( true, "A message" ) end) assert_error( function() assert_thread( false, "A message" ) end) assert_error( function() assert_thread( a_number, "A message" ) end) assert_error( function() assert_thread( a_string, "A message" ) end) assert_error( function() assert_thread( a_table, "A message" ) end) assert_error( function() assert_thread( a_function, "A message" ) end) end module( "lunit-tests.match", lunit.testcase ) function test_assert_match() assert_pass("assert_match(\"^Hello\", \"Hello World\") doesn't work!", function() local a_string = assert_match("^Hello", "Hello World") assert_equal("Hello World", a_string) end) assert_pass("assert_match(\"^Hello\", \"Hello World\", \"A Message\") doesn't work!", function() local a_string = assert_match("^Hello", "Hello World", "A message") assert_equal("Hello World", a_string) end) assert_pass("assert_match(\"World$\", \"Hello World\") doesn't work!", function() local a_string = assert_match("World$", "Hello World") assert_equal("Hello World", a_string) end) assert_pass("assert_match(\"World$\", \"Hello World\", \"A Message\") doesn't work!", function() local a_string = assert_match("World$", "Hello World", "A message") assert_equal("Hello World", a_string) end) assert_error("assert_match(\"Hello$\", \"Hello World\") doesn't fail!", function() assert_match("Hello$", "Hello World") end) assert_error("assert_match(\"Hello$\", \"Hello World\", \"A Message\") doesn't fail!", function() assert_match("Hello$", "Hello World", "A message") end) assert_error("assert_match(\"^World\", \"Hello World\") doesn't fail!", function() assert_match("^World", "Hello World") end) assert_error("assert_match(\"^World\", \"Hello World\", \"A Message\") doesn't fail!", function() assert_match("^World", "Hello World", "A message") end) assert_error("assert_match(nil, \"Hello World\") doesn't fail!", function() assert_match(nil, "Hello World") end) assert_error("assert_match(nil, \"Hello World\", \"A Message\") doesn't fail!", function() assert_match(nil, "Hello World", "A message") end) assert_error("assert_match(\"^World\", nil) doesn't fail!", function() assert_match("^World", nil) end) assert_error("assert_match(\"^World\", nil, \"A Message\") doesn't fail!", function() assert_match("^World", nil, "A message") end) end function test_assert_not_match() assert_pass("assert_not_match(\"Hello$\", \"Hello World\") doesn't work!", function() local a_string = assert_not_match("Hello$", "Hello World") assert_equal("Hello World", a_string) end) assert_pass("assert_not_match(\"Hello$\", \"Hello World\", \"A Message\") doesn't work!", function() local a_string = assert_not_match("Hello$", "Hello World", "A message") assert_equal("Hello World", a_string) end) assert_pass("assert_not_match(\"^World\", \"Hello World\") doesn't work!", function() local a_string = assert_not_match("^World", "Hello World") assert_equal("Hello World", a_string) end) assert_pass("assert_not_match(\"^World\", \"Hello World\", \"A Message\") doesn't work!", function() local a_string = assert_not_match("^World", "Hello World", "A message") assert_equal("Hello World", a_string) end) assert_error("assert_not_match(\"^Hello\", \"Hello World\") doesn't fail!", function() assert_not_match("^Hello", "Hello World") end) assert_error("assert_not_match(\"^Hello\", \"Hello World\", \"A Message\") doesn't fail!", function() assert_not_match("^Hello", "Hello World", "A message") end) assert_error("assert_not_match(\"World$\", \"Hello World\") doesn't fail!", function() assert_not_match("World$", "Hello World") end) assert_error("assert_not_match(\"World$\", \"Hello World\", \"A Message\") doesn't fail!", function() assert_not_match("World$", "Hello World", "A message") end) assert_error("assert_not_match(nil, \"Hello World\") doesn't fail!", function() assert_not_match(nil, "Hello World") end) assert_error("assert_not_match(nil, \"Hello World\", \"A Message\") doesn't fail!", function() assert_not_match(nil, "Hello World", "A message") end) assert_error("assert_not_match(\"^World\", nil) doesn't fail!", function() assert_not_match("^World", nil) end) assert_error("assert_not_match(\"^World\", nil, \"A Message\") doesn't fail!", function() assert_not_match("^World", nil, "A message") end) end function test_assert_error_match() local ok, errobj, usrmsg local function errfunc() error("My Error!") end local errpattern = "Error!$" local wrongpattern = "^_foobar_$" local function goodfunc() -- NOP end ok = pcall(function() assert_error_match(errpattern, errfunc) end) assert_true(ok, "assert_error_match( <pattern>, <error> )") ok = pcall(function() assert_error_match("A message", errpattern, errfunc) end) assert_true(ok, "assert_error_match(\"A message\", <pattern>, <error>)") usrmsg = "assert_error_match( <wrong pattern>, <error> )" ok, errobj = pcall(function() assert_error_match(wrongpattern, errfunc) end) assert_false(ok, usrmsg) assert_table(errobj, usrmsg) assert_match("expected error '.+: My Error!' to match pattern '"..wrongpattern.."' but doesn't$", errobj.msg, usrmsg) usrmsg = "assert_error_match(\"A message\", <wrong pattern>, <error>)" ok, errobj = pcall(function() assert_error_match("A message", wrongpattern, errfunc) end) assert_false(ok, usrmsg) assert_table(errobj, usrmsg) assert_match("expected error '.+: My Error!' to match pattern '"..wrongpattern.."' but doesn't$", errobj.msg, usrmsg) usrmsg = "assert_error_match( <pattern>, <no error> )" ok, errobj = pcall(function() assert_error_match(errpattern, goodfunc) end) assert_false(ok, usrmsg) assert_table(errobj, usrmsg) assert_match("error expected but no error occurred$", errobj.msg, usrmsg) usrmsg = "assert_error_match(\"A message\", <pattern>, <no error>)" ok, errobj = pcall(function() assert_error_match("A Message", errpattern, goodfunc) end) assert_false(ok, usrmsg) assert_table(errobj, usrmsg) assert_match("error expected but no error occurred$", errobj.msg, usrmsg) end module( "lunit-tests.setup-teardown", lunit.testcase ) local setup_called = 0 local teardown_called = 0 local helper_called = 0 function setup() setup_called = setup_called + 1 end function Teardown() teardown_called = teardown_called + 1 end local function helper() helper_called = helper_called + 1 assert(setup_called == helper_called, "setup() not called") assert(teardown_called == helper_called - 1, "teardown() not called") end function test1() helper() end function test2() helper() end function test3() helper() end
mit
SkzKatsushiro/OpenRA
mods/cnc/maps/nod02a/nod02a.lua
15
7806
NodUnits = { "bggy", "e1", "e1", "e1", "e1", "e1", "bggy", "e1", "e1", "e1", "bggy" } NodBaseBuildings = { "hand", "fact", "nuke" } DfndActorTriggerActivator = { Refinery, Barracks, Powerplant, Yard } Atk3ActorTriggerActivator = { Guard1, Guard2, Guard3, Guard4, Guard5, Guard6, Guard7 } Atk1CellTriggerActivator = { CPos.New(45,37), CPos.New(44,37), CPos.New(45,36), CPos.New(44,36), CPos.New(45,35), CPos.New(44,35), CPos.New(45,34), CPos.New(44,34) } Atk4CellTriggerActivator = { CPos.New(50,47), CPos.New(49,47), CPos.New(48,47), CPos.New(47,47), CPos.New(46,47), CPos.New(45,47), CPos.New(44,47), CPos.New(43,47), CPos.New(42,47), CPos.New(41,47), CPos.New(40,47), CPos.New(39,47), CPos.New(38,47), CPos.New(37,47), CPos.New(50,46), CPos.New(49,46), CPos.New(48,46), CPos.New(47,46), CPos.New(46,46), CPos.New(45,46), CPos.New(44,46), CPos.New(43,46), CPos.New(42,46), CPos.New(41,46), CPos.New(40,46), CPos.New(39,46), CPos.New(38,46) } Atk2TriggerFunctionTime = DateTime.Seconds(40) Atk5TriggerFunctionTime = DateTime.Minutes(1) + DateTime.Seconds(15) Atk6TriggerFunctionTime = DateTime.Minutes(1) + DateTime.Seconds(20) Atk7TriggerFunctionTime = DateTime.Seconds(50) Pat1TriggerFunctionTime = DateTime.Seconds(30) Atk1Waypoints = { waypoint2, waypoint4, waypoint5, waypoint6 } Atk2Waypoints = { waypoint2, waypoint5, waypoint7, waypoint6 } Atk3Waypoints = { waypoint2, waypoint4, waypoint5, waypoint9 } Atk4Waypoints = { waypoint0, waypoint8, waypoint9 } Pat1Waypoints = { waypoint0, waypoint1, waypoint2, waypoint3 } UnitToRebuild = 'e1' GDIStartUnits = 0 getActors = function(owner, units) local maxUnits = 0 local actors = { } for type, count in pairs(units) do local globalActors = Map.ActorsInBox(Map.TopLeft, Map.BottomRight, function(actor) return actor.Owner == owner and actor.Type == type and not actor.IsDead end) if #globalActors < count then maxUnits = #globalActors else maxUnits = count end for i = 1, maxUnits, 1 do actors[#actors + 1] = globalActors[i] end end return actors end InsertNodUnits = function() Media.PlaySpeechNotification(player, "Reinforce") Reinforcements.Reinforce(player, NodUnits, { UnitsEntry.Location, UnitsRally.Location }, 15) Reinforcements.Reinforce(player, { "mcv" }, { McvEntry.Location, McvRally.Location }) end OnAnyDamaged = function(actors, func) Utils.Do(actors, function(actor) Trigger.OnDamaged(actor, func) end) end CheckForBase = function(player) local buildings = 0 Utils.Do(NodBaseBuildings, function(name) if #player.GetActorsByType(name) > 0 then buildings = buildings + 1 end end) return buildings == #NodBaseBuildings end DfndTriggerFunction = function() local list = enemy.GetGroundAttackers() Utils.Do(list, function(unit) IdleHunt(unit) end) end Atk2TriggerFunction = function() local MyActors = getActors(enemy, { ['e1'] = 3 }) Utils.Do(MyActors, function(actor) Atk2Movement(actor) end) end Atk3TriggerFunction = function() if not Atk3TriggerSwitch then Atk3TriggerSwitch = true MyActors = getActors(enemy, { ['e1'] = 4 }) Utils.Do(MyActors, function(actor) Atk3Movement(actor) end) end end Atk5TriggerFunction = function() local MyActors = getActors(enemy, { ['e1'] = 3 }) Utils.Do(MyActors, function(actor) Atk2Movement(actor) end) end Atk6TriggerFunction = function() local MyActors = getActors(enemy, { ['e1'] = 4 }) Utils.Do(MyActors, function(actor) Atk3Movement(actor) end) end Atk7TriggerFunction = function() local MyActors = getActors(enemy, { ['e1'] = 3 }) Utils.Do(MyActors, function(actor) Atk4Movement(actor) end) end Pat1TriggerFunction = function() local MyActors = getActors(enemy, { ['e1'] = 3 }) Utils.Do(MyActors, function(actor) Pat1Movement(actor) end) end Atk1Movement = function(unit) Utils.Do(Atk1Waypoints, function(waypoint) unit.AttackMove(waypoint.Location) end) IdleHunt(unit) end Atk2Movement = function(unit) Utils.Do(Atk2Waypoints, function(waypoint) unit.AttackMove(waypoint.Location) end) IdleHunt(unit) end Atk3Movement = function(unit) Utils.Do(Atk3Waypoints, function(waypoint) unit.AttackMove(waypoint.Location) end) IdleHunt(unit) end Atk4Movement = function(unit) Utils.Do(Atk4Waypoints, function(waypoint) unit.AttackMove(waypoint.Location) end) IdleHunt(unit) end Pat1Movement = function(unit) Utils.Do(Pat1Waypoints, function(waypoint) unit.Move(waypoint.Location) end) IdleHunt(unit) end WorldLoaded = function() player = Player.GetPlayer("Nod") enemy = Player.GetPlayer("GDI") Trigger.OnObjectiveAdded(player, function(p, id) Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective") end) Trigger.OnObjectiveCompleted(player, function(p, id) Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed") end) Trigger.OnObjectiveFailed(player, function(p, id) Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed") end) Trigger.OnPlayerWon(player, function() Media.PlaySpeechNotification(player, "Win") end) Trigger.OnPlayerLost(player, function() Media.PlaySpeechNotification(player, "Lose") end) NodObjective1 = player.AddPrimaryObjective("Build a base.") NodObjective2 = player.AddPrimaryObjective("Destroy the GDI base.") GDIObjective = enemy.AddPrimaryObjective("Kill all enemies.") OnAnyDamaged(Atk3ActorTriggerActivator, Atk3TriggerFunction) Trigger.OnAllRemovedFromWorld(DfndActorTriggerActivator, DfndTriggerFunction) Trigger.AfterDelay(Atk2TriggerFunctionTime, Atk2TriggerFunction) Trigger.AfterDelay(Atk5TriggerFunctionTime, Atk5TriggerFunction) Trigger.AfterDelay(Atk6TriggerFunctionTime, Atk6TriggerFunction) Trigger.AfterDelay(Atk7TriggerFunctionTime, Atk7TriggerFunction) Trigger.AfterDelay(Pat1TriggerFunctionTime, Pat1TriggerFunction) Trigger.OnEnteredFootprint(Atk1CellTriggerActivator, function(a, id) if a.Owner == player then MyActors = getActors(enemy, { ['e1'] = 5 }) Utils.Do(MyActors, function(actor) Atk1Movement(actor) end) Trigger.RemoveFootprintTrigger(id) end end) Trigger.OnEnteredFootprint(Atk4CellTriggerActivator, function(a, id) if a.Owner == player then MyActors = getActors(enemy, { ['e1'] = 3 } ) Utils.Do(MyActors, function(actor) Atk2Movement(actor) end) Trigger.RemoveFootprintTrigger(id) end end) Trigger.AfterDelay(0, getStartUnits) InsertNodUnits() end Tick = function() if enemy.HasNoRequiredUnits() then player.MarkCompletedObjective(NodObjective2) end if player.HasNoRequiredUnits() then if DateTime.GameTime > 2 then enemy.MarkCompletedObjective(GDIObjective) end end if DateTime.GameTime % DateTime.Seconds(1) == 0 and not player.IsObjectiveCompleted(NodObjective1) and CheckForBase(player) then player.MarkCompletedObjective(NodObjective1) end if DateTime.GameTime % DateTime.Seconds(3) == 0 and Barracks.IsInWorld and Barracks.Owner == enemy then checkProduction(enemy) end end checkProduction = function(player) local Units = Map.ActorsInBox(Map.TopLeft, Map.BottomRight, function(actor) return actor.Owner == player and actor.Type == UnitToRebuild end) if #Units < GDIStartUnits then local unitsToProduce = GDIStartUnits - #Units if Barracks.IsInWorld and unitsToProduce > 0 then local UnitsType = { } for i = 1, unitsToProduce, 1 do UnitsType[i] = UnitToRebuild end Barracks.Build(UnitsType) end end end getStartUnits = function() local Units = Map.ActorsInBox(Map.TopLeft, Map.BottomRight, function(actor) return actor.Owner == enemy end) Utils.Do(Units, function(unit) if unit.Type == UnitToRebuild then GDIStartUnits = GDIStartUnits + 1 end end) end IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
gpl-3.0